I intermittently get the following error when using Rscript
to call mclapply
from the command-line:
Error in sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE)) :
write error, closing pipe to the master
If I run the exact same code in R Studio or from an interactive R session, I don't get the error. This error pops up in a variety of contexts from very large jobs where each worker has to return a very large object to small jobs. I've also tried turning prescheduling
off but it still throws the error. Sometimes it will go away if I reduce the number of threads in the mc.cores
argument. I am using Microsoft R Open on Ubuntu 18.04.1. It also popped up on Ubuntu 16.04. One thing I haven't tried is running the code in standard R instead of MRO.
Here's my Rscript -e 'sessionInfo()'
:
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.1 LTS
Matrix products: default
BLAS: /opt/microsoft/ropen/3.5.1/lib64/R/lib/libRblas.so
LAPACK: /opt/microsoft/ropen/3.5.1/lib64/R/lib/libRlapack.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RevoUtils_11.0.1 RevoUtilsMath_11.0.0
loaded via a namespace (and not attached):
[1] compiler_3.5.1
Any ideas? Has anyone else encountered something like this? I apologize for not having a reproducible example but the data/code where I've encountered the error so far is impractically large to share, and I have not been able to reproduce the error in other contexts. It seems to just occur randomly.