Error calling serialize R function
This is most likely due to running out of memory (see my blog post for details). Here's an example how you can cause this error:
> a <- matrix(1, ncol=10^4*2.1, nrow=10^4)> cl <- makeCluster(8, type = "FORK")> parSapply(cl, 1:8, function(x) {+ b <- a + 1+ mean(b)+ })Error in unserialize(node$con) : error reading from connection
I got a similar error Error in unserialize(node$con) : error reading from connection
I found out it was a missing argument in a call to a C function trough .Call()
Maybe it can be of help!
I struggled with this problem for quite a while and was able to fix it by moving all my required packages into the arguments within the foreach loop by using .packages=c("ex1","ex2")
. Previously I had just used require("ex1")
inside the loop and this seems to have been the root cause of my errors.
Overall, I would just make sure you're moving everything possible into the foreach arguments to avoid these types of errors.