PBS Job submission how-to

Submitting Jobs

Submitting a job through PBS can be accomplished in one of two ways:

1. Manually allocate nodes for an interactive session (recommended)
Use the following command to allocate nodes: qsub -I -l nodes=:ppn=2

note: node_number=1 and ppn=1 for serial job.

2. Use a qsub script.
To do this you will need to first write a script for your program. If you have cleanup routines or run this program often it may be worthwhile to do it this way. All scripts should contain some "PBS Directives". Any line in the script beginning with '#PBS' and placed before the first command in the script will be interpreted as directives. After the first command in your script all directives will be ignored (there is no preprocessing of directives).
#PBS ...
#PBS ...
#PBS ... <-- this directive will be ignored.

Some common directives are -N (Name to queue the job under) and -l nodes=(#). You can find out more about these and other directives you have at your disposal by perusing 'man qsub'. Here is a sample qsub script:

#PBS -N MyJobName
#PBS -l nodes=1:ppn=1
a.out <myInput >myOutput

Once you have the script file, you submit it to PBS using the qsub command:

qsub myscript

Important: Keep in mind that PBS will start the script from your home directory, so if the file is located elsewhere you will either need to (a) use 'cd' inside your script to get to the proper directory or (b) use the fully qualified pathname of the executable.

Other PBS Utilities

qstat Check the status of your jobs in the queue. Possible states are "Q"ueued, "H"eld, "R"unning, "E"xiting. If you have no jobs in the queue, there will be no output.

qstat -f job.id : Specifies that a full status display be  written to standard out.  
qstat -n	: In  addition  to  the  basic  information, nodes allocated to a job are listed.  
check man pbs for more command line options

qdel Delete a job from the queue.

qhold Put a job on hold.

qalter Change the requirements of a job.

qsig Send a signal to your job (applies to running jobs only)

See man pages for more details. If you start from 'man qsub' You will find references to the rest of the pages.