@Data-SEO wrote:
What is OpenMPI ?
MPI : Message Passing Interface is a specification for an API for passing messages between different computers.
Programming with MPI
* Difficult because of Rmpi package defines about 110 R functions
* Needs a parallel programming system to do the actual work in parallelThe doMPI package acts as an adaptor to the Rmpi package, which in turn is an R interface to an implementation of MPI
* Very easy to install Open MPI, and Rmpi on Debian / Ubuntu
* You can test with one computerInstall OpenMPI on RedHat
$ sudo yum install openmpi openmpi-devel openmpi-libs
$ sudo ldconfig /usr/lib64/openmpi/lib/
$ export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}/usr/lib64/openmpi/lib/“
$ R
install.packages("Rmpi",
configure.args =
c("--with-Rmpi-include=/usr/include/openmpi-x86_64/",
"--with-Rmpi-libpath=/usr/lib64/openmpi/lib/",
"--with-Rmpi-type=OPENMPI"))install.packages (“doMPI“)
Test OpenMPI
library(Rmpi)
library(doMPI)
nslaves <- 4
cl <-startMPIcluster(nslaves)4 slaves are spawned successfully. 0 failed.
registerDoMPI(cl)
result <-foreach(i = 1:20) %dopar% { out <-mean(rnorm(1e+07))}
closeCluster(cl)
Posts: 1
Participants: 1