Submit Scripts

Submit scripts are simply bash scripts that tell the SLURM scheduler what your job requires in order to run efficiently. The #SBATCH lines are not comments as they are commonly in bash scripts. #SBATCH is interpreted by sbatch to allocate and set various parameters. If you put a space after the '#' symbol, it will become a comment as expected.


A job needs to be submitted to the queue - but there are a few different queues that we call "partitions." Partitions are groups of nodes that are separated by resource configurations intended for different types of usage. Submit to the debug partition for very short jobs and for general testing.

Partition Name Number of Nodes Time Limit Cores Threads Memory
debug* 1 2 hours 24 48 (2 threads per core) 128 GB
short 3 2 days 24 48 (2 threads per core) 128 GB
long 9 5 days 24 48 (2 threads per core) 128 GB

* default partition. If no partition is specified, your job will be submitted to the 'debug' partition

Submit a basic R job

Example of

#SBATCH --mail-type=ALL # send us an email about all events
#SBATCH --mail-user=[username]
# SBATCH this is a comment
#SBATCH -J job_name # give the job a name
#SBATCH -t 240:00:00 # run this simulation for 5 days (HOURS:MINUTES:SECONDS)
#SBATCH -p long # send this job to the long partition since we want it to run more than 4 days
#SBATCH --mem-per-cpu=500M
# Load R version 3.4.3
module load R/R-3.4.3
# Run our R program myjob.R which resides in /workspace/[username]/
R CMD BATCH --no-save myjob.R myjob.out

A job is submitted using the sbatch command.

[user@lunchbox] (44)$ sbatch

See the Tutorials and Examples section for more specific scenarios such as multi-threaded, multi-core, MPI, job arrays, setting variables, etc.