Skip to content

Instantly share code, notes, and snippets.

@willprice
Last active March 22, 2024 05:34
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willprice/6569d1123fb30a57a54b3ff1595df1a2 to your computer and use it in GitHub Desktop.
Save willprice/6569d1123fb30a57a54b3ff1595df1a2 to your computer and use it in GitHub Desktop.
PBS pro cheat sheet

PBS Pro command cheat sheet

List nodes and their features

$ pbsnodes

Run an interactive job on a node with 4 RTX 2080 GPUs, 8 CPUs, 90GB of RAM, for 2 hours

$  qsub -l ngpus=4 -l ncpus=8 -l mem=90G -l gputype=RTX2080 -l walltime=02:00:00   -I

Alternatively this can be compressed into

$ qsub -l ngpus=4:ncpus=8:mem=90G:gputype=RTX2080:walltime=02:00:00 -I

The -I flag indicates the interactive aspect of the job.


Cancel a job

$ qdel -p <job-id>

List information on queues

$ qstat

List current jobs owned by $USER

$ qstat -u $USER

Mail notifications can be enabled through the -m toggle which takes one of the following options:

  • n - No mail will be sent.
  • a - Mail is sent when the job is aborted by the batch system.
  • b - Mail is sent when the job begins execution.
  • e - Mail is sent when the job terminates.
  • j - Mail is sent also for subjobs of an array job. Option "j" must be combined with "a", "b", or "e".

The mail user is specified via -M <email-address>. Alternatively setting $PBS_O_MAIL to <email-address> and omitting the flag has the same effect.


Jobs can be given names through -N <name>.


If you want to export variables from the current environment to the job, pass the -V flag which passes all current environment variables to the job's environment.


If you want to run one job after another, you can use the depend additional attribute, e.g.

$ qsub -W depend=afterok:<first-job-id> -l ncpus=8:ngpus=4:mem=90G:walltime=02:00:00 job-script.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment