Hey folks,

Is there any way to exit an mclapply early on error?

For example, in the following mclapply loop, I have to wait for all the 
processes to finish before the error is returned. 

```
mclapply(X = 1:12, FUN = function(x) {Sys.sleep(0.1); if(x == 4) stop()}, 
mc.cores = 4, mc.preschedule = F)
```

When there are many calculations in FUN, it takes a long time before the error 
is returned. It would be nice if there were an option to exit (all child 
processes) early on error. Is there any way to do this?

Thanks,
Giovanni Righi

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to