Hi All,
I am simply trying to use nimble to speed up a custom function. I created a nimble function that compiles successfully and is much faster that just using R code. When I try use the compiled function with the parallel package, I receive an error: Error in checkForRemoteErrors(val) : 4 nodes produced
errors; first error: NULL value passed as symbol address
I created a simpler example with a test function that generates the same error and I hope someone can help me see what I am missing here. I'm running R 4.4.1 on Windows 10.
Thanks
Chris
library(nimble)
library(parallel)
myPower <- nimbleFunction(
run = function(x = double(0, default = 1), power=double(0, default=2)) {
returnType(double(0))
return(x^power)
})
myPowerc <- compileNimble(myPower)
cl <- makeCluster(getOption("cl.cores", 4))
res <- parLapply(cl,split(1:100,1:100),myPowerc,power=2)
stopCluster(cl)