As recommended in other posts I wrote my own package in R to parallelize functions I wrote with Rcpp. I can load the package and everything works, but when I'm using optimParallel, I get the message:
Error in checkForRemoteErrors(val) : 3 nodes produced errors; first error: object '_EffES_profileLLcpp' not found
Here is what I'm doing:
library(optimParallel)
library(EffES) # EffES is my own package
cl <- makeCluster(detectCores()-1)
clusterEvalQ(cl, library(EffES))
clusterEvalQ(cl, library(optimParallel))
setDefaultCluster(cl = cl)
w.es <- optimParallel(par=rep(0.001,3), profileLLcpp, y=y.test, x=x.test, lower = rep(0.001,3), method = "L-BFGS-B")$par
Error in checkForRemoteErrors(val) :
3 nodes produced errors; first error: object '_EffES_profileLLcpp' not found
What am I doing wrong?