Torque Keywords

The following keywords may be specified as qsub command line options, or as directives (preceded by #PBS) embedded in a batch script.


Required Torque Options/Directives
Option Default Description
-l nodes=Nodes 1 node Number of nodes assigned to the job.
-l ppn=ProcessPerNode 1 process per node Number of processes per node Note: ppn must be less than or equal to the maximum available cores on the target compute node.
-l partition=O O Compute resorces allocated to the job, could be "O" for regular On-demand resources and "S" for cost-saving Spot-based resources
-l walltime=DD:HH:MM:SS 00:00:05:00 Maximum wallclock time for job
-N job_name Name of job script Name of job; up to 15 printable, non-whitespace characters
Useful Torque Options/Directives
Option Default Description
-q queue_name batch Name of submit queue
-A repo Default repo Charge job to repo
-e filename <job_name>.e<job_id> Write stderr to filename
-o filename <job_name>.o<job_id> Write stdout to filename
-j [oe | eo] Do not merge Merge (join) stdout and stderr. If oe, merge as output file; ie eo, merge as error file
-m [a | b | e | n] a Email notification: a=send mail if job aborted by system b=send mail when job begins e=send mail when job ends n=never send email Options a, b, e may be combined
-M email_address None User email address

Torque Environment Variables

The batch system defines many environment variables, which are available for use in batch scripts. The following tables list some of the more useful variables. Users must not redefine the value of any of these variables!


Variable Name Meaning
PBS_O_LOGNAME Login name of user who executed qsub.
PBS_O_HOME Home directory of submitting user.
PBS_O_WORKDIR Directory in which qsub command was executed. Note that batch jobs begin execution in $PBS_O_HOME; many batch scripts execute "cd $PBS_O_WORKDIR" as first executable statement.
PBS_O_HOST Hostname of system on which qsub was executed. This is typically a Carver login node.
PBS_JOBID Unique identifier for this job; important for tracking job status.
PBS_ENVIRONMENT Set to "PBS_BATCH" for scripts submitted as batch jobs; "PBS_INTERACTIVE" for interactive batch jobs ("qsub -I ...").
PBS_O_QUEUE Name of submit queue.
PBS_QUEUE Name of execution queue.
PBS_O_JOBNAME Name of this job.
PBS_NODEFILE Name of file conta ining list of nodes assigned to this job.
PBS_NUM_NODES Number of nodes assigned to this job.
PBS_NUM_PPN Value of "ppn" (processes per node) for this job.

Standard Output and Error

While your job is running, standard output (stdout) and standard error (stderr) are written to temporary "spool" files (for example: 123456-cluster.OU and 123456-cluster.ER) in the submit directory. If you merge stderr/stdout via the "#PBS -j eo" or "#PBS -j oe" option, then only one such spool file will appear.

These files will be updated in real-time while the job is running, allowing you to use them for job monitoring. It is important that you do not modify, remove or rename these spool files while the job is still running!

After your batch job completes, the above files will be renamed to the corresponding stdout/stderr files (for example: my_job.o123456 and my_job .e123456).

  1. PBS/Torque
  2. A tutorial on running batch jobs using PBS