[Rcpp-devel] RInside and MPI master slave model proper usage

Dirk Eddelbuettel edd at debian.org
Sat Jan 19 23:14:50 CET 2013


On 19 January 2013 at 16:29, Nicholas Pezolano wrote:
| Hi I'm using Rinside with MPI and testing out a simple master slave model.
| 
| heres a basic example of what i'm trying to do.
| http://www.lam-mpi.org/tutorials/one-step/ezstart.php
| 
| The function  do_work(unit_of_work_t work){ .....   gets run across all the
|  N nodes until the M units of work are done. 
|     I am calling many R functions from C++, as well as loading R libraries,
|  in the do_work function.
| 
| Is there a way to load R once on each of the slaves and have the do_work
| function have access to RInside for every iteration of the master-slave model?
| 
| Do I have to run           RInside R(argc, argv);      for every-time
| the function do_work is called by the master?
| 
| Is there a way to free the R instance or is this handled automatically? or is
| there a better approach?

Do you know that there is a working example, contributed in the early days by
Jianping Hua?

All this assumes that you are a tad familiar with basic MPI. The model used
here uses straight MPI from C (or C++), and each (worker/slave) node just
happens to do its work with R.

There are other models, notably Rmpi and you are not forced to use RInside in
order to deploy MPI with R.  If you have basic questions, r-sig-hpc may be a
better place.

Dirk



-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  


More information about the Rcpp-devel mailing list