Rmpi
Overview
Rmpi: An interface (wrapper) to MPI. It also provides interactive R manager and worker environment.
Using
This usage relates to using this library on Beartooth.
We currently only have version 0.7.1 available.
Note: Loading this module will also load in r/4.2.2
Meaning you have an environment with r/4.2.2
and the Rmpi
library.
You do NOT need to load r/4.2.2
as a module separately.
Multicore
This R library is designed to run across multiple nodes, and multiple tasks on a node.
ONLY using the Rmpi library
If you are only using the Rmpi
library, and no other related parallel libraries such as snow
, then to allow the use of Rmpi on the cluster you first need to copy the following file into your home folder. (If you already have a .Rprofile
file in your home, you'll need to update it.)
[]$ cp /apps/u/spack/gcc/12.2.0/r-rmpi/0.7-1-3eiutsq/rlib/R/library/Rmpi/Rprofile ~/.Rprofile
To then use the module, you’ll need to load the following modules:
module load gcc/12.2.0 openmpi/4.1.4 r-rmpi/0.7-1-ompi
Example
This example was based on an example here:
Using the Rmpi library with Snow
To start:
This assumes you have installed the snow library yourself into your home.
You know the location for this library: For example:
~/R/x86_64-pc-linux-gnu-library/4.2/snow/
You have NOT copied the
.Rprofile
file into your home folder. If you have, then running this example will appear that the test has stalled and will eventually just time out.
This example is based on a script and discussion here.