Instructions to install and run Rmpi under Windows 

(only Windows XP pro is tested):

 

If you mainly use Rmpi to run on a standalone dual-cores or quad-cores PC, then running Rmpi under DeinoMPI is the simplest and best way for you. Corresponding instructions are here. The following instructions are for Rmpi under MPICH2. 

  1. Install MPICH2 for Windows. Find the latest version at http://www-unix.mcs.anl.gov/mpi/mpich2  Version 1.0.6 or later is recommended. 

    Before installing MPICH2, you need Microsoft .Net 1.1 at .NET Framework Version 1.1 Redistributable Package and Visual C++ 2005 SP1 Redistributable Package (x86).

    Install MPICH2 on each node and make sure the window service smpd is running properly with a pass phrase, not a user password. Please use the same pass phrase on each node.

    MPICH2 comes with the following windows programs:
    wmpiconfig --- set/modify/delete MPICH2 configuration settings
    wmpiexec --- window wrapper to the command mpiexec.exe. Very handy to pass information to mpiexec.
    wmpiregister --- register user name and password on master node. This must be done before doing anything else.

    On master node, use wmpiconfig to scan hosts or click "Get Settings" for a host. Those hosts with green color are set correctly. You can add those workable hosts in "hosts", like "localhost node2 node3". If master R is not involved with any computation other than communications, set "hosts" to "localhost:2 node2 node3" so that the first R slave is on localhost, the second one on node2, and so on. By the same token, if node2 is a dual CPU node, set "hosts" to "localhost:2 node2:2 node3". 

    Launch wmpiexec and click "more options". Add "-localroot" in "extra mpiexec options". Specify a working directory. In "Application", locate  Rgui.exe. Click "Execute" will lanuch one Rgui. Alternatively, create a shortcut with command
     "C:\Program Files\MPICH2\bin\mpiexec.exe" -n 1 -localroot -noprompt "C:\Program Files\R\R-2.5.1\bin\Rgui.exe". 
    (copy from "Show command"). 

    Notice that Windows has its own way mapping network drives. It is hard for slaves to use network drives under spawning. To let slaves use network drives, please follow instructions in 3.


  2. If you plan to run Rmpi on one PC only (probably a dual-core or quad-core PC), use wmpiconfig to set "localonly" to "yes". For a dual-core CPU PC, set "hosts" to "localhost:3" (one master and two slaves). If you do not change "localonly" to "yes", you need to click "more options" in wmpiexec and add "-localroot" in "extra mpiexec options".

    Use wmpiexec's "Application" to locate Rgui.exe and click "Execute" to launch one Rgui

    Note: If Rterm is used, no need to change setting in "localonly". Just check "run in an separate window" in wmpiexec and add "--no-save" or "--save" after "Rterm.exe" in Application.

    After loading Rmpi, use mpi.spawn.Rslaves() to spawn R slaves. If Rmpi works well on a single PC but hangs with remote nodes, it is mostly like caused the block of firewalls on remote nodes. Turn off firewalls to debug and make firewall exceptions for Rgui and Rterm.


  3. Instead of lauching one Rgui and spawning R slaves, one can use Rprofile from Rmpi to launch multiple Rs. There are two ways: use .Rprofile at a working dir or set R_PROFILE env at command line.
    1. Copy Rprofile in Rmpi directory into a  working directory as .Rprofile. Assume that .Rprofile is in \\winsrv\wdir. Try at DOS command

      H:\>"C:\Program Files\MPICH2\bin\mpiexec.exe" -wdir Z:\ -map Z:\\winsrv\wdir -n 3 "C:\Program Files\R\R-2.5.1\bin\Rterm.exe" --no-save -q

      to launch one R master and two R slaves. Where R slaves are running is determined by "hosts" setting. Notice that the drive Z: is mapped by smpd on fly and it will be removed after exit.
    2. To launch multiple Rs without using .Rprofile, try at DOS command

      H:\>"C:\Program Files\MPICH2\bin\mpiexec.exe" -wdir Z:\ -map Z:\\winsrv\wdir -n 3 "C:\Program Files\R\R-2.5.1\bin\Rterm.exe" --no-save -q R_PROFILE="C:\Program Files\R\R-2.5.1\library\Rmpi\Rprofile"

      You can also use wmpiexec to pass all information to mpiexec. Check "run in an separate window" if you use Rterm and add "-localroot" in "extra mpiexec options" if you use Rgui. Click "Save Job" to save all settings and click "Load Job" to load previous saved settings.
      "reset" button in wmpiexec will load setting from "hosts". If you want to add more hosts, you can add them in "hosts" in wmpiexec like "localhost node2 node3". Choose a proper "Number of processes" before clicking "Execute".

  4. Final note. Since Windows XP uses c:\windows\temp as system temp dir as default, slave Rs will use it to create R_TempDir. Make sure it must be writable for users. To force remote R to use other temp directory, say Z:/temp,  add TMP=Z:/temp at Rterm or Rgui command line or in "environment variables" (separate multiple envs by space). Somehow wmpiexec does not like an env with spaces in "environment variables". So putting R_PROFILE="C:\Program Files\R\R-2.5.1\library\Rmpi\Rprofile" in "environment variables" will fail but R_PROFILE=C:/Progra~1/R/R-2.5.1/library/Rmpi/Rprofile will be OK.

    (last update 01/21/2010 )