R OpenMP ExampleΒΆ

r_openmp.slrm:

#!/bin/bash
#SBATCH -p batch
#SBATCH -t 00:15:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem=2G
#SBATCH -o r_openmp.out

module load R
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
time srun Rscript --default-packages=methods,utils,stats R-benchmark-25.R

The benchmark script is available here (more information about it is available here page).