Submitting an R job is very similar to submitting a serial job shown on Submitting Jobs.
You will notice that the example is very similar to to the serial example. The important line is the
module load command. That tells Tusker to load the R framework into the environment so jobs may use it.
Multicore (parallel) R submission
Submitting a multicore R job to SLURM is very similar to Submitting an OpenMP Job, since both are running multicore jobs on a single node. Below is an example:
The above example will submit a single job which can use up to 16 cores.
Be sure to use limits in your R code so you only use 16 cores, or your performance will suffer. For example, when using the parallel package function mclapply:
Multinode R submission with Rmpi
Submitting a multinode MPI R job to SLURM is very similar to Submitting an MPI Job, since both are running multicore jobs on a multiple nodes. Below is an example of running Rmpi on Crane on 2 nodes and 32 cores:
When you run Rmpi job on Crane, please use the line export OMPI_MCA_mtl=^psm in your submit script. On the other hand, if you run Rmpi job on Tusker, you do not need to add this line. This is because of the different Infiniband cards Tusker and Crane use. Regardless of how may cores your job uses, the Rmpi package should always be run with mpirun -n 1 because it spawns additional processes dynamically.
Please find below an example of Rmpi R script provided by The University of Chicago Research Computing Center:
Users are allowed to install R packages into their own home directories. Instructions are provided by OSU.