[R-SIG-Mac] Strange error message with mclapply

Guillaume Chapron carnivorescience at gmail.com
Fri Jan 15 15:42:19 CET 2010


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



More information about the R-SIG-Mac mailing list