Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

An example of how to install Rmpi using the module openmpi/gcc/64/4.1.10.74 can be found below. Note that, the package snow has to be installed as well.

Code Block
languager
module load r/4.2.12
module load openmpi/4.1.4
R
.libPaths("~/rlibs") # assuming you are installing your 
                     # packages at the ~/rlibs folder
install.packages("Rmpi", lib = "~/rlibs", repo = "https://cloud.r-project.org/",
                 configure.args = "--with-mpi=/gpfs/sharedfs1/admin/hpc2.0/apps/openmpi/4.1.4/")
install.packages("snow", lib = "~/rlibs", repo = "https://cloud.r-project.org/")

...

Code Block
#!/bin/bash
#SBATCH -p general
#SBATCH -n 30

source /etc/profile.d/modules.sh
module purge
module load r/4.2.12 openmpi/4.1.4

# If MPI tells you that forking is bad uncomment the line below 
# export OMPI_MCA_mpi_warn_on_fork=0

Rscript mpi.R

...