Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

exporting function from R package to cluster (parallel processing)

I am trying to use parLapply again (now successfully used it in this context) but this time the function to parallelize contains some functions from the mc2d package (ie. deprt, ppert). I installed and loaded the package, before the parallel part of the code.

I successfully exported my variables to the cluster using cluster export,

clusterExport(C1, "variable")
...

However I tried to export the functions dpert and ppert using

clusterEvalQ(C1,dpert)

and I get the error

object C1 not found

how does it not find C1? is there another way to export R-packages functions to the cluster for parallel processing?

like image 416
Neodyme Avatar asked Jun 19 '14 09:06

Neodyme


1 Answers

Use clusterExport for functions as well...

clusterExport(Cl,c('dpert','variable'))
like image 191
Ankur Chakravarthy Avatar answered Oct 06 '22 07:10

Ankur Chakravarthy