[R-sig-hpc] undesired forking from either doMC, foreach or multicore
braunm at mit.edu
Thu Jan 6 23:04:53 CET 2011
I've been using foreach and plyr with the DoMC backend for a few months now, and I regularly get the following error:
The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.
This message will appear once for every active thread. Unfortunately, I have not been able to replicate it on demand, so I cannot prepare a useful test case. The way I deal with this is to exit R, find all the remaining existing R jobs, and kill them, one by one, by job number. But this is rather tedious.
I see that this is problem is mentioned in the DoMC into vignette, but I am wondering if there is a simple command, from within R, that will "clean up" any remaining multicore-spawned R jobs that might have been called, before I call some more. I don't think I've ever had this problem on the first foreach/plyr loop in a session, but sometimes I do on the second. Or maybe not. A useful alternative to an R command to clean up the jobs would be something to run from the bash shell.
I am running on Mac OSX 10.6, on a 12-core 2010-vintage Mac Pro. SessionInfo() is
R version 2.12.0 (2010-10-15)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
attached base packages:
 stats graphics grDevices datasets utils methods base
other attached packages:
 plyr_1.4 doMC_1.2.1 multicore_0.1-3 foreach_1.3.0 codetools_0.2-2 iterators_1.0.3
Thanks for your help.
Homer A. Burnell (1928) Career Development Professor,
and Assistant Professor of Management Science (Marketing Group)
MIT Sloan School of Management
100 Main St.., E62-535
Cambridge, MA 02139
braunm at mit.edu
More information about the R-sig-hpc