Skip to main content

Crosswalk between PBS and Slurm submission scripts - Knowledgebase / Research Systems - SOMTech (Technology Services) - VCU School of Medicine

Crosswalk between PBS and Slurm submission scripts

Authors list

Equivalent commands in PBS and Slurm

Purpose

PBS

Slurm

Submit a job

qsub jobscript

sbatch jobscript

Delete a job

qdel job_id

scancel job_id

Delete all jobs belonging to user

qdel `qselect -u user`

scancel -u user

Job status

qstat -u user

squeue -u user

Show all jobs

qstat -a

squeue

Equivalent Environment Variables in PBS and Slurm

Purpose

PBS

Slurm

Job ID

$PBS_JOBID

$SLURM_JOBID

Submit directory

$PBS_O_WORKDIR

$SLURM_SUBMIT_DIR

Allocated node list

$PBS_NODEFILE

$SLURM_JOB_NODELIST

Job array index

$PBS_ARRAY_INDEX

$SLURM_ARRAY_TASK_ID

Number of cores/processes

 

$SLURM_CPUS_PER_TASK

Equivalent Job Specifications in PBS and Slurm

Purpose

PBS

Slurm

Set a wallclock limit

qsub -l nodes=1,walltime=HH:MM:SS

sbatch -t [min] OR -t [days-hh:mm:ss]

Standard output file

qsub -o filename

sbatch -o filename

 

 

1. PBS -o filename

1. SBATCH --output filename



 

1. SBATCH -o filename

 

 

Standard errror file

qsub -e filename

sbatch -e filename

 

 

1. PBS -e filename

1. SBATCH --error filename

 

2. SBATCH -e filename

 

 

Combine stdout/stderr

qsub -j oe

This is the default.

 

1. PBS -j oe

 

Location of out/err files

qsub -k oe

not needed. By default, slurm will write stdout/stderr files to the directory from which the job is submitted.

 

1. PBS -k oe

 

Export environment to allocated node

qsub -V

sbatch --export=all (default)

Export a single variable

qsub -v np=12

sbatch --export=np

Email notifications

qsub -m be

END|FAIL|ALL

 

 

1. PBS -m be

1. SBATCH --mail-type=ALL

 

 

Job name

qsub -N jobname -l nodes=1 jobscript

sbatch --job-name=name jobscript

 

 

1. PBS -N JobName

1. SBATCH --job-name=JobName

 

 

Job restart

n]

sbatch --requeue OR --no-requeue


Helpful Unhelpful