PBS Environment Variables

PBS sets multiple environment variables at submission time. The following PBS variables are commonly used in batch scripts:

PBS_O_WORKDIR PBS sets the environment variable PBS_O_WORKDIR to the directory from which the batch job was submitted.
PBS_NODEFILE Contains a list of the nodes assigned to the job. If multiple CPUs on a node have been assigned, the node will be listed in the file more than once. By default, mpirun assigns tasks to nodes in the order they are listed in this file.
PBS_JOBID The full jobID assigned to this job. Often used to uniquely name output files for this job, for example: mpirun -np 16 ./a.out >output.${PBS_JOBID}.