PBS Shell Commands
A popular open-source resource manager, TORQUE is used at thousands of research sites globally. With the commands available through TORQUE you can allocate resources, schedule and manage execution, monitor and view the status of your jobs.
Some of TORQUE's commands are used at the shell command line, others are embedded in the shell script that runs your program. Here are the commonly used shell commands.
Frequently Used Shell Commands
|qsub||submit a pbs job||qsub [script]||$ qsub job.pbs|
|qstat||show status of pbs batch jobs||qstat [job_id]||$ qstat 44|
|qdel||delete pbs batch job||qdel [job_id]||$ qdel 44|
|qhold||hold pbs batch jobs||qhold [job_id]||$ qhold 44|
|qrls||release hold on pbs batch jobs||qrls [job_id]||$ qrls 44|
Shell Commands to Check Queue and Job Status
|qstat -q||list all queues|
|qstat -a||list all jobs|
|qstat -au userid
||list jobs for userid|
|qstat -r||list running jobs|
|qstat -f job_id||list full information about job_id|
|qstat -Qf queue||list full information about queue|
|qstat -B||list summary status of the job server|
|pbsnodes||list status of all compute nodes|
For complete documentation on the commands listed here, refer to the online man page: type man command at the shell prompt.
#PBS in your Job Script
The best way to control execution of your job is through the use of #PBS commands embedded in the job script. The job script is any shell script you normally run to execute your programs. The #PBS commands appear to be comments to the shell but when your script is submitted to the PBS job scheduler (via the qsub command), they can alter job attributes and select scheduler options.
|Basic #PBS commands|
|#PBS -N myjob||Set the job name|
|#PBS -m ae||Mail status when the job completes|
|#PBS -l nodes=4||Allocate specified number of nodes|
|#PBS -l walltime=1:00:00||Inform the PBS scheduler of the expected runtime|
Download a PBS Template Script
Download an example script that includes descriptive comments: Example PBS Job Script