Skip to main content »

Trinity College Dublin

Slurm Resource Manger

Basic Slurm Commands

sinfo show available queues and nodes
squeue / smap show jobs in the queue
sbatchsubmit a script
sallocsubmit an interactive request
scanceldelete a job

See here for more examples of slurm commands, and here for comparisons of Torque/PBS/Maui commands to their slurm equivalents.

Slurm Submission Scripts

The following is a typical Slurm submission script.

#!/bin/sh
#SBATCH -n 16           # 16 cores
#SBATCH -t 1-03:00:00   # 1 day and 3 hours
#SBATCH -p compute      # partition name
#SBATCH -J my_job_name  # sensible name for the job

# [optional] specify a project name - it will use your default
# (i.e. your most recent project) if you leave this blank
#SBATCH -U HPC_12_12345 # optional project name

# load up the correct modules, if required
. /etc/profile.d/modules.sh
module load default-gcc-openmpi-apps-libs-recommended

# launch the code
mpirun ./cpi.x

How to submit a job

To submit this, run the following command:

sbatch myscript.sh

Note that this is for OpenMPI compiled applications, for other MPI implementations you may need to adjust the mpirun line. See here for more details.

Warning: do not execute the script

The job submission script file is written to look like a bash shell script. However, you do NOT submit the job to the queue by executing the script.

In particular, the following is INCORRECT:

# this is the INCORRECT way to submit a job
./myscript.sh  # wrong! this will not submit the job!

The correct way is noted above (sbatch myscript.sh).

Missing Libraries/Module Issues

If your script fails because it is unable to find libraries then you will have to configure the environment modules - see here for more.

More on Slurm

For more details on SLURM, please see http://slurm.schedmd.com/.


Last updated 10 Mar 2015Contact TCHPC: info | support.