All parallel jobs become terminated if error occurs only in one of them
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I use “parfor” to run a function for different input values in parallel on 24 cores. Some input values may be out of the acceptable range for the function and MATLAB generates an error message and terminates the job.
The problem is that all other jobs are also terminated although their input values are OK. How can I prevent this behavior of MATLAB?
(I cannot predict in advance what values are problematic since the function is quite complicated and calls many other functions while it is running.)
0 Commenti
Risposta accettata
OCDER
il 8 Set 2017
Try placing a try-catch statement around where the error occurs. Note that try-catch can slow down performance, but I guess it's better than stopping all jobs.
parfor j = 1:NumberOfJobs
try
%Do the unpredictable function here
catch
end
end
Più risposte (0)
Vedere anche
Categorie
Scopri di più su MATLAB Parallel Server in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!