I’m trying to parallelize (using snow::parLapply) some code that depends on a package (ie, a package other than snow). Objects referenced in the function called by parLapply must be explicitly passed to the cluster using clusterExport. Is there any way to pass an entire package to the cluster rather than having to explicitly name every function (including a package’s internal functions called by user functions!) in clusterExport?
I’m trying to parallelize (using snow::parLapply ) some code that depends on a package
Share
Install the package on all nodes, and have your code call
library(thePackageYouUse)on all nodes via one the available commands, egg something likeI think the
parallelpackage which comes with recent R releases has examples — see for example here fromhelp(clusterApply)where thebootpackage is loaded everywhere: