Instructions to install and run Rmpi under Microsoft MPI

(Tested on Windows 7 Pro 64bit)

Note: Instructions to run Rmpi under MPICH2 are given here. However, duo to discontinuation of MPICH2, Rmpi (version 0.6-3 or older) cannot be guarantied to work properly.

Steps:

  1.   Install Microsoft MPI  for Windows. The software name is called "Microsoft MPI Redistributable Package".

It can be found from https://msdn.microsoft.com/en-us/library/windows/desktop/bb524831(v=vs.85).aspx.
Install MSMpiSetup.exe to get MPI running environment. The default location is in C:\Program Files\Microsoft MPI. You can install Rmpi windows binary from within Rstudio. However, if you want to compile Rmpi yourselves, you have to install SDK msmpisdk.msi at the default location: C:/Program Files (x86)/Microsoft SDKs/MPI


2.    Install Rmpi through Rstudio or compile it yourselves with Rtools. If you compile Rmpi yourselves and Microsoft MPI is not installed in the default location C:/Program Files (x86)/Microsoft SDKs/MPI, please set up MPI_HOME environment variable before compiling.


  1. Since MPI_Comm_spawn is not implemented in Microsoft MPI, mpi.spawn.Rslaves is disabled. To use Rmpi, you must run R and Rmpi through DOS terminal.
    • Copy Rmpi's Rprofile to your working directory as .Rprofile.
    • Launch Rmpi on a 8-core PC, run (1 master and 8 slaves for total 9 R sessions)
      mpiexec  -n 9 "C:\Program Files\R\R-3.0.3\bin\x64\Rterm.exe" --no-save -q
    • Check if Rmpi is running properly,
           mpi.setup.rngstream(iseed=123)
           mpi.parReplicate
      (80, mean(rnorm(1000000)))
    • To close all R slaves, run
           mpi.close.Rslaves()
    • To quit R and Rmpi
           mpi.quit()


(last update 05/31/2016)