Guillaume,

please read ?multicore -- especially the section "Warning".

Cheers,
Simon


On Jan 15, 2010, at 9:42 , Guillaume Chapron wrote:

Hello,

I have this test function:

onerun <- function(j) {
        
        p <- numeric(10)     
        for (i in 1:9) {        
                p[i+1] <- j + p[i]   
        }       
        return(p)

}

Then I can call:

lapply(1:100, onerun)

I would like to multi-thread this, so I do:

library(multicore)
mclapply(1:100, onerun)

and it works.

But when I increase the size of the computations, i.e.

mclapply(1:10000, onerun)

it crashes with this error message:

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.

What do I do wrong? I have a dual core MBP.

Thanks!

Guillaume

_______________________________________________
R-SIG-Mac mailing list
R-SIG-Mac@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-mac



_______________________________________________
R-SIG-Mac mailing list
R-SIG-Mac@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to