r

  • About: free software environment for statistical computing and graphics
  • Category: Data Analysis
  • URL: http://www.r-project.org
  • Interactive executable: R
module (bold = default) build dependencies
r/3.3.2 jdk/1.8.0_111 intel/mkl-2017
r/3.3.3/b1
r/3.4.1/b1

To run a script file (say it is called test.R) in batch mode, type or put in your sbatch script:

R --no-save < test.R

Here is simple example for the Rmpi package.

tmp.R:

library(Rmpi)
rank <- mpi.comm.rank(comm = 0)
size <- mpi.comm.size(comm = 0)
hostname <- mpi.get.processor.name()
cat(sprintf("Hello from process %3d of %3d on %s\n", rank, size, hostname))
mpi.finalize()

tmp.sbatch:

#!/bin/bash
#SBATCH --partition=debug --time=00:01:00 --output=tmp.out.txt
#SBATCH --ntasks=4
module load r/3.1.0/b2 openmpi/1.6.5/b1
mpirun -n 4 Rscript tmp.R

also see slides from the CIRC summer school workshop on R.

also see Using Software.