Skip to content

Example Slurm array job script that runs an R script

License

Notifications You must be signed in to change notification settings

BristolRSE/R_array_job_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

R_array_job_example

Example Slurm array job script that runs an R script

To use R on a HPC machine, you will typically first need to load an R environment module, e.g. on University of Bristol Advanced Computing Research Centre's BluePebble facility

$ module load lang/r

The example array job script submit_R_array.sh is written for the Slurm job scheduler and can be submitted to run on a HPC machine using

$ sbatch submit_R_array.sh

This example uses the commandArgs() function from base R to read the array job index provided as a command line argument in submit_R_array.sh. R packages which support more sophisticated access and manipulation of command line arguments are available, e.g. optparse.

NOTE
On University of Bristol HPC facilities, a HPC account project code must be provided at the command line, i.e.

$ sbatch --account=<project code> submit_R_array.sh

where <project code> is replaced with your University of Bristol HPC project code.

This can alternatively be added to the job script itself, by adding a #SBATCH directive line, i.e.

#SBATCH --account=<project code>

About

Example Slurm array job script that runs an R script

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published