SGE to Slurm Very Quick Reference
Commands
| SGE | Slurm | Description |
|---|---|---|
| qsub script_file | sbatch script_file | Submit a job from script_file |
| qdel 123 | scancel 123 | Cancel job 123 |
| qstat | squeue | List user's pending and running jobs |
| qhost -q | sinfo sinfo -s | Cluster status with partition (queue) list With '-s' a summarised partition list, which is shorter and simpler to interpret. |
Job Specification
| SGE | Slurm | Description |
|---|---|---|
| #$ | #SBATCH | Scheduler directive |
| -q queue_name | -p queue_name | Queue to 'queue_name' |
| -pe 64 | -n 64 | Processor count of 64 |
| -l h_rt=[ss] | -t [minutes] or -t [days-hh:mm:ss] | Max wall run time |
| -o file_name | -o file_name | STDOUT output file |
| -e file_name | -e file_name | STDERR output file |
| -J job_name | --job-name=job_name | Job name |
| -l exclusive | --exclusive | Exclusive node usage for this job - i.e. no other jobs on same nodes |
| -l mem_free=128M or -l mem_free=1G | --mem-per-cpu=128M or --mem-per-cpu=1G | Memory requirement |
| Set by parallel environment config | --tasks-per-node=16 | Processes per node |
| -P proj_code | --account=proj_code | Project account to charge job to |
| -t "[array_spec]" | --array=array_spec | Job array declaration |
Job Environment Variables
| SGE | Slurm | Description |
|---|---|---|
| $JOBID | $SLURM_JOBID | Job ID |
| $SGE_O_WORKDIR | $SLURM_SUBMIT_DIR | Submit directory |
| $JOBID | $SLURM_ARRAY_JOB_ID | Job Array Parent |
| $SGE_TASK_ID | $SLURM_ARRAY_TASK_ID | Job Array Index |
| $SGE_O_HOST | $SLURM_SUBMIT_HOST | Submission Host |
| cat $PE_HOSTLIST (this is a file) | $SLURM_JOB_NODELIST | Allocated compute nodes |
| $NSLOTS | $SLURM_NTASKS (mpirun can automatically pick this up from Slurm, it does not need to be specified) | Number of processors allocated |
| $QUEUE | $SLURM_JOB_PARTITION | Queue |
Much more detail available in the Slurm documentation.