parfeval - Struct contents reference from a non-struct array object
Afficher commentaires plus anciens
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 commentaire
Andreas Thoma
le 9 Fév 2018
Modifié(e) : Andreas Thoma
le 9 Fév 2018
Réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!