Reputation: 115
I am using foreach
+ %dopar%
to achieve parallelism over multiple cores. I know some of the tasks will face exceptions. When an exception occurs:
I tried finding resources on this, but couldn't find any. Looks like I'm using the wrong keywords. If you have any resources, please direct me to them.
Upvotes: 1
Views: 237
Reputation: 673
There is a parameter in foreach
called .errorhandling
, it could have the values of stop
(default), remove
or pass
. their behaviour is like this:
stop
: The function will be stopped.remove
: The result of this specific task will not be returned.pass
: The error object will be included with the results.So addressing your specific question, if you have many task running in parallel and one of the task in one worker raised an exception, then it stop the process and will pass to the next task "scheduled" (that is because of the default value stop
). The other task will continue as normal in parallel.
Please see this answer that explains better how are handled the errors in foreach
and %dopar%
.
I hope this will clarify a little your problem.
Upvotes: 3