Dear R users,
I tried to use the built in parallelization in RevolutionR 2.10.0 on my Mac OSX,
with i5 processor (so 4 cores). Nothing happens when I use %dopar% for
parallelization in RevolutionR 2.10.0, and using 2.12.1 I just get errors:
library(doMC)
registerDoMC()
getDoParWorkers()
x <- iris[which(iris[,5] != "setosa"), c(1,5)]
trials <- 1000
# %do% works fine
ptime <- system.time({
r <- foreach(icount(trials), .combine=cbind) %do% {
ind <- sample(100, 100, replace=TRUE)
result1 <- glm(x[ind,2]~x[ind,1], family=binomial(logit))
coefficients(result1)
}
})[3]
> ptime
elapsed
8.54
# %dopar% does not work
ptime <- system.time({
r <- foreach(icount(trials), .combine=cbind) %dopar% {
ind <- sample(100, 100, replace=TRUE)
result1 <- glm(x[ind,2]~x[ind,1], family=binomial(logit))
coefficients(result1)
}
})[3]
> ptime
elapsed
11.978
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.
Any ideas?
Thanks! Scott
[[alternative HTML version deleted]]