[R] rgenoud and snow

michele caseposta mic.cipi at gmail.com
Thu Jan 31 17:59:49 CET 2013


Hello everyone.
I am trying to use rgenoud in a parallel environment.
While making some tests, I noticed that rgenoud seems not to be using the cluster created by makeCluster, doing all the computation in the main node.

Following is the example:

ncores <- 5
cl <- makeCluster(rep('localhost', ncores), type='SOCK')

evalFunc3 <- function(x){
  r <- rnorm(1000000)
  print(Sys.getpid())
  return(x[1]/2-x[2]^3+0.5)
}

genResSeq <- genoud(evalFunc3, nvars=2, max=T, pop.size=ncores, cluster = cl)

stopCluster(cl)

Is this the expected behavior? I would have guessed each node to be busy with the evaluation of the function for each individual, but it does not seem to be the case.


More information about the R-help mailing list