Tuesday, December 21, 2010

Starting R to run Rmpi jobs

I always forget the proper command to start R to run Rmpi jobs. Here it is:

mpirun -np 1 --hostfile [name of hosts file] R --no-save

The thing that always throws me is that I use -np 2 or whatever number of processors. I forget that you need to start one instance of R and then from within that one instance you can access however many processors you have in your hosts file.

Note: You get the same thing by using "orterun" rather than "mpirun" in the above command, but I like mpirun because it is obvious what it is doing.