PBS to SLURM transition

University of Southern California already compiled an excellent list of cheatsheets and resources for converting PBS terminology to Slurm.

You can read it here: https://hpcc.usc.edu/support/documentation/pbs-to-slurm/

A short version of it, strictly pertaining to GHPC is below.

Key differences

Job runs from where you submitted the job and not the user's home directory...

Commands

PBS commandSlurm commandMeaning
qsub job-script.shsbatch job-script.shsubmit job-script.sh to the queue
qsub -Isrun -N1 --pty bashGet an interactive shell on a cluster node
mystmyststatus of my jobs in all queues
navstnavstStatus of all jobs in NAV queue
qstat -f sj all details about a job
N/AsajStatus of all my jobs
N/AsajtStatus of all my jobs in last 24 hours
qdel scancel cancel a job
pbsnodes -aghpcinfoStatus of all nodes in entire cluster

Environment variables

PBSSlurmMeaning
$PBS_JOBID$SLURM_JOB_IDjob id for use within scripts
$PBS_O_WORKDIR$SLURM_SUBMIT_DIRDirectory where the job was submitted from
$PBS_O_HOST$SLURM_SUBMIT_HOSTHostname where job was submitted from

Automate conversion of job scripts from PBS to Slurm

An easy way to swap these environment variables in your current job scripts? You can use sed.

sed -i -e 's/$PBS_JOBID/$SLURM_JOB_ID/g' -e 's/$PBS_O_WORKDIR/$SLURM_SUBMIT_DIR/g' <jobscriptfilename.sh>