Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note
This part below is out-dated

Table of Contents

Running R from SLURM

R is compiled with Intel Compilers and MKL.

The SLURM script calling an R script should look like this:

Code Block
languagebash
#!/bin/bash -l

#SBATCH --nodes 1 
#SBATCH --ntasks 1 
#SBATCH --cpus-per-task 1
#SBATCH --mem 60000
#SBATCH --time 00:05:00
 
echo STARTING AT `date`

module purge 
module load intel intel-mkl
module load r
srun R CMD BATCH ./rscript.R
 
echo FINISHED at `date`

...where rscript.sh is executable (chmod +x rscript.sh) and begins with the line

Code Block
languagebash
#!/usr/bin/env Rscript

Installing packages within R

To allow proper compilation with Intel compilers, create the ~/.R/Makevars file with the following content:

Code Block
languagebash
CC=icc
CXX=icpc
FC=ifort
F77=ifort

Packages requiring libcurl

Libcurl is available via the curl module. Just load it before running R with

Code Block
languagebash
module load curl

Installing SparkR

You will first need to load the following modules

Code Block
languagebash
module load intel intel-mkl
module load r curl spark

Then, you can launch R and do the following

Code Block
languagebash
install.packages("devtools")
devtools::install_github('apache/spark@v2.0.2', subdir='R/pkg')



...