PBS Directives Summary

PBS directives may appear as header lines in a batch script or as options on the qsub command line. They specify the resource requirements of your job and various other attributes. Many of the directives are discussed in more detail elsewhere in this document. The online manual page for qsub (man qsub) describes many of them.

PBS header lines must come before any executable lines in your script. Their syntax is:

#PBS [option]

where option is one of the options in the table below. For example, to request 4 nodes with 12 processors per node:

#PBS -l nodes=4:ppn=12

The syntax for including an option on the qsub command line is:

qsub [option]

For example, the following line submits the script myscript.job but adds the -l nodes directive:

qsub -l nodes=4:ppn=12 myscript.job

Notes: The “-l” flag is an “el” (for ”limit”), not a “one”. There are no spaces around the “=” and “:” signs.

Option Desctiption Example
-l walltime=hh:mm:ss Requests the amount of time needed for the job. Default is one hour. #PBS -l walltime=10:00:00
-l nodes=n:ppn=p Requests number of nodes and processors per node. The range of ppn values depends on the hardware you are running on.  Default is one processor on one node.

#PBS -l nodes=2:ppn=12

#PBS -l nodes=3:ppn=8

-l nodes=n:ppn=p:gpus=g Requests number of gpus per node in addition to the node and ppn requests. This syntax applies to Oakley only.

#PBS -l nodes=1:ppn=12:gpus=2

-l nodes=n:ppn=12:gpus=2:vis Requests a visualization job on Oakley. The batch system will start an X server with access to the GPUs. #PBS -l nodes=1:ppn=12:gpus=2:vis
-l nodes=n:ppn=8:gpu Requests a gpu node. Must request ppn=8. This syntax applies to Glenn only. #PBS -l nodes=1:ppn=8:gpu
-l nodes=n:ppn=p:feature Requests a node with a particular feature. #PBS -l nodes=1:ppn=8:newdual
-l mem=amount Request the total amount of memory needed across all nodes. Default units are bytes; can also be expressed in megabytes (mem=4000MB) or gigabytes (mem=4GB). #PBS -l mem=24000MB
-l software=package[+N] Request use of N licenses for package. If omitted, N=1. Only required for jobs using specific software packages with limited numbers of licenses; see software documentation for details. #PBS -l software=abaqus+5
-N jobname Sets the job name, which appears in status listings and is used as the prefix in the job’s output and error log files. The job name must not contain spaces. #PBS -N Test_job2
-j oe By default, PBS returns two log files, one for the standard output stream (stdout), the other for the standard error stream (stderr). This option joins both into a single log file. #PBS -j oe

-m [a][b][e]

-m n

Use any combination of the letters a, b, and e; do not include the brackets. Requests a status email when the job begins (b), ends (e), or aborts (a). The n option requests no email, but you'll still get email if the job aborts.

#PBS -m abe    for lots of email

#PBS -m n       for minimal email

-o filename Renames the output log file. #PBS -o test.out
-I Requests an interactive batch job. qsub -I
-X Enables X11 forwarding. Useful primarily in interactive batch jobs. qsub -I -X
-l file=amount Request nodes with temporary file space of amount specified. This should be used only when requesting special nodes on Glenn. #PBS -l file=1000gb
-S /bin/shell Sets the Linux shell to be used used in executing your batch script. You should normally leave this out; it defaults to your normal login shell. The most common shells are /bin/csh, /bin/bash, /bin/ksh, /bin/tcsh. #PBS -S /bin/bash
-a [YYYY][MM][DD]hhmm Delay executing batch job until a particular date and time. Hours and minutes are required; year, month and day are optional. No spaces are allowed in the numeric string.

#PBS -a 1700

(Run the job after 5pm.)

-W depend=afterany:jobid This job may be scheduled for execution only after job jobid has terminated. #PBS -W depend=afterany:123456