How to configure and use MPI on Windows with R

I downloaded the R script from the Internet, which states that it must be running in the MPI environment. Now I know almost nothing about MPI, except that it is used for parallel computing, and it is rather difficult to find a simple tutorial on how to configure and use it.

Can someone give me a simple, step-by-step instruction on what I need to install to run it, how should I do it, and how can I run a script?

Thanks in advance.

Edit, here is what I tried:

  • I installed Microsoft MPI
  • I installed and downloaded the RMpi package in R

Specific problems:

> # number of available slots is passed via environment variable
> slots <- as.integer(Sys.getenv("NSLOTS"))

gives NA_integer_.

, (, Sys.getenv( "NSLOTS" ) )

> slots <- as.integer(4)
> cl <- snow::makeMPIcluster(slots)

mpi.comm.spawn(slave = mpitask, slavearg = args, nslaves = count,: MPI, : MPI_COMM_SPAWN (CMD = "C:/PROGRA~1/R/R-31~1.0/bin/Rscript.exe", argv = 0x0000000009A12CA8, maxprocs = 4, MPI_INFO_NULL, = 0, MPI_COMM_SELF, intercomm = 0x000000000A2FF8B0, errors = 0x00000000100E3C70) failed

, MPI .

+4
1

,...

> require(parallel) 
> nCores <- 8  # manually for non-cluster machines
> cl <- makeCluster(nCores) # by default this uses the PSOCK mechanism as in the SNOW package
-1

All Articles