How to submit a job to SLURM

This article explains how to submit a batch job to the new scheduler SLURM. It covers:

  • What is a batch job?
  • Job submission methods
  • Important job submission options
  • Job array submission
  • Job dependencies submission
  • Recursive job submission

What is a batch job?

A batch job is controlled by a script written by the user who submits the job to the batch system SLURM. The batch system then selects the resources for the job and decides when to run the job.  Note: the term "job" is used throughout this documentation to mean a "batch job".

Submitting a SLURM job script

A job is submitted to the batch system SLURM from the following CentOS7 Sci machines:

sci4.jasmin.ac.uk
sci5.jasmin.ac.uk

The  SLURM job submission command is:

$ sbatch myjobscript

The job script is a Bash script of user's application and includes a list of SLURM directives, prefixed with `#SBATCH` as shown in this example:

#!/bin/bash 
#SBATCH -p short-serial 
#SBATCH -o %J.out 
#SBATCH -e %J.err
#SBATCH -t 2 

# executable 
sleep 1m

For job specification of resources please refer to Table 2 of the help article LSF to SLURM quick reference

Still need help? Contact Us Contact Us