[R] How to put inlined C code on a worker node?
mikeumo at gmail.com
Thu Nov 13 16:59:51 CET 2014
I am using inline C functions within foreach %dopar% loop. On SMP (doParallel, doMP) it works but on MPI-based clusters (doMPI) it does’t. The reason, I think, is because the object code produced using the inline package, essentially an .so file, does not get copied onto the worker nodes when they are spawned using startMPIcluster().
Does anyone have any ideas on how I can send the object code to the workers and re-link it to the inline functions, or some other way? I know that I can define the inline functions within the foreach loop but it is very limiting and does not look pretty when you have a lot of functions to define. So, is there I way that follows a good programming style?
I would prefer to do it from within the R script and use the “spawning” mode to paralellize.
Thank you for your time,
More information about the R-help