Skip to content

Slurm Quick Reference

UGE to SLURM conversions

User Commands UGE SLURM
Job submission qsub [script_file] sbatch [script_file]
Job deletion qdel [job_id] scancel [job_id]
Job status by job id qstat [-j job_id] squeue [job_id]
Job status by user qstat [-u user_name] squeue [-u user_name]
Job hold qhold [job_id] scontrol hold [job_id]
Job release qrls [job_id] scontrol release [job_id]
List nodes nodestatus/qhost sinfo -N OR scontrol show nodes

Environment variables

Environment variable UGE SLURM
Job ID $JOB_ID $SLURM_JOB_ID
Submit directory $SGE_O_WORKDIR $SLURM_SUBMIT_DIR
Submit host $SGE_O_HOST $SLURM_SUBMIT_HOST
Node list $PE_HOSTFILE $SLURM_JOB_NODELIST
Job Array Index $SGE_TASK_ID $SLURM_ARRAY_TASK_ID
Job ID $JOB_ID $SLURM_JOB_ID
Number of cores $NSLOTS $SLURM_NTASKS

Job Specification

Option UGE SLURM
Script directive #$ #SBATCH
queue/partition -q [queue/partition] -p [queue/partition]
Request number of nodes N/A -N [min[-max]]
Request number of cores -pe smp [count] -n [count] OR --ntasks=[count]
Wall clock limit -l h_rt=[seconds] -t [min] OR -t [days-hh:mm:ss]
Standard output file -o [file_name] -o [file_name]
Standard error file -e [file_name] -e [file_name]
Combine stdout/stderr -j yes (use -o without -e)
Event notification -m abe --mail-type=[events]
Send notification email -M [address] --mail-user=[address]
Job name -N [name] --job-name=[name]
Restart job -r [yes|no] --requeue OR --no-requeue (NOTE: configurable default)
Set working directory -cwd OR -wd [directory] --workdir=[dir_name] (defaults to current directory if workdir option not used)
Use entire node -l exclusive --exclusive --mem=0
Memory per core -l hvmem=[memory per core][K|M|G] --mem-per-cpu= [mem][M|G|T]
Memory per node N/A --mem=[mem per node][M|G|T] (also counted as mem per job for non-parallel jobs)
Charge to an account n/a --account=[account]
Tasks per node N/A --tasks-per-node=[count] --cpus-per-task=[count] (only use with hybrid mpi/openmpi jobs)
Job dependency -hold_jid [job_id job_name]
Specify a node -l h=[node] -w [nodes] OR --nodelist=[nodes] AND/OR --exclude=[nodes] (comma separated list)
Job arrays -t [array_spec] --array=[array_spec]
Generic Resources (GPU etc) -l [resource]=[value] --gres=[resource_spec]
Begin Time -a [YYMMDDhhmm] --begin=YYYY-MM-DD[THH:MM[:SS]]