All parallel jobs become terminated if error occurs only in one of them
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
OCDER
2017-9-8
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Parallel Server 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!