So this bit of code:
library(plyr)
library(doMC)
registerDoMC(cores=2)
x=1:100
llply(x, some_function, .parallel=TRUE)
fails with an error like so:
__THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__ ()
the error disappears when I run R from terminal. So it's something about the GUI that breaks it. Unfortunately, I share this code with collaborators and so I can't ask them to run it from the terminal. This forum post says It looks as if this problem w/ the doMC backend was coming from my having been sourcing the "/Applications/R.app/Contents/Resources/GUI- tools.R" but I am not intentionally doing that in R.app. Is there any way to turn off this conflicting behavior?
My Mac specs: Also running R GUI 2.13.1. OSX 10.7.1, doMC Version 1.2.3 with 64bit R.app. Also have a MB Pro 2.53 with Intel Core 2 Duo
Ask on R-SIG-Mac if you want real answers ;). This has nothing to do with the GUI tools, it has to do with the Cocoa running event loop in the children - see ?multicore for the warning about GUIs. You may want to update to more recent multicore which disables the event loop in the GUI (if possible). Also avoid any Quartz graphics calls in the code you run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With