October 24 2013
This is a guide for installing
Rmpi on Mac OSX.
Open-mpi is open source mpi library such allows scalable and parallel processing. To install
open-mpi, you will need to install Homebrew first. Then install
brew install gfortran brew install open-mpi
You will need a C complier. For OSX 10.9, see Configuring complier for R 3.0.1 on OSX 10.9 Mavericks. For previous OS, the default llvm-gcc complier should work fine most of the time.
Final step, either open R in terminal or R GUI, and run
This should install
library(Rmpi) mpi.spawn.Rslaves() mpi.iparReplicate(100, mean(rnorm(1000000))) mpi.close.Rslaves()
Note: If you compile your own R, or install R via Homebrew or macport, it is more likely that Rmpi will fail to detect number of cores via
mpi.universe.size(). In this case, you may need to specify the number of salves.
library(Rmpi) mpi.spawn.Rslaves(nslaves=3) mpi.iparReplicate(100, mean(rnorm(1000000))) mpi.close.Rslaves()