parfeval - Struct contents reference from a non-struct array object
이전 댓글 표시
I changed one of my programs from serial computation to parallel computation. In serial everything works fine; in parallel also most times. When I execute my program I get the following error:
Error using parallel.FevalFuture/fetchOutputs (line 139)
One or more futures resulted in an error.
Error in test_method_time_determination (line 132)
result_show{idx} = fetchOutputs(result(idx));
Caused by:
Error using pi_processing_pi (line 10)
Struct contents reference from a non-struct array object.
The strange thing is, that I get the error message just sometimes. I can run exactly the same program like ten times and once it fails and not necessarily at the same point.
I think, the problem is that the function which is processed in parallel sometimes delivers an empty result cell. My function call looks like that:
while go
result(cnt) = parfeval(@pi_processing_pi,1,ref, target, roi, analysis.intMet, analysis.subMet, sizeX, sizeY, ns_x, ns_y, analysis.ns);
//some changes in the input arguments
if something break;
end
I get the results via:
result_show = cell(1,imax);
for idx=1:imax
result_show{idx} = fetchOutputs(result(idx));
%some processing
end
The pi_processing_pi function evaluates the differences between two images and returns a Matrix. The functions are quite complex with several sub-functions. I don't think that it makes much sense to add all the functions. Moreover, the functions usually work and just from time to time a function evaluation fails (for a case which worked several times before). Does anybody have an idea why this problem occurs. I am using Matlab 2016b btw. But I have the same problem with 2017a.
댓글 수: 1
Andreas Thoma
2018년 2월 9일
편집: Andreas Thoma
2018년 2월 9일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!