Categories
R

Rmpi on fedora 11/12

From January 2010 a couple of new options was included in Rmpi. These are –with-Rmpi-include, –with-Rmpi-libpath, and –with-Rmpi-type. Installation (finally) seems to be working well with OpenMPI. Compilation against mpich2 works fine, but making clusters does not.

On x64 systems use:

R CMD INSTALL Rmpi_0.5-8.tar.gz –configure-args=”–with-Rmpi-include=/usr/include/openmpi-x86_64 –with-Rmpi-libpath=/usr/lib64/openmpi/lib –with-Rmpi-type=OPENMPI”

In addition edit ~/.bashrc and add the following lines:

LD_LIBRARY_PATH=/usr/lib64:/usr/lib64/mpich2/lib:/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

Test with:

require(Rmpi)
require(snow)
cl <- makeCluster(2)
mpiTest <- seq(1, 20, by = 5)
parLapply(cl, mpiTest, runif)

[[1]]
[1] 0.1664325

[[2]]
[1] 0.2460850 0.6571958 0.6900965 0.6776356 0.4609656 0.8634224

[[3]]
[1] 0.32242634 0.57560057 0.58737793 0.47889866 0.78592260 0.83085694
[7] 0.02747334 0.12454139 0.88403084 0.91591933 0.72832798

[[4]]
[1] 0.6322360 0.5101366 0.8536310 0.8594838 0.1397010 0.8471578 0.6202280
[8] 0.5812721 0.7616779 0.8595870 0.2623519 0.9126362 0.9918862 0.1061388
[15] 0.9311254 0.7099221