PBS Jub submission how-to
Using MPIRUN
    For most (simple) jobs, you will be able to run by modifying your mpirun call slightly.  All that is required is that you add the '-pbs' switch to your commandline. Also for clarity it is recommended that you remove -machinefile and -nolocal parameters. So, for example, if your old mpirun call looked like:

/usr/local/mpi/bin/mpirun -np 2 -machinefile mymachines -nolocal $HOME/a.out

Then your new mpirun call will look like:

/usr/local/mpi/bin/mpirun -pbs -np 2 $HOME/a.out
 

Note: Some scripts may actually invoke older mpirun arguments, for instance: machinefile and nolocal. Such arguments will be ignored under PBS.

Example:
/usr/local/mpi/bin/mpirun -pbs -np 2 -machinefile mymachines -nolocal $HOME/a.out

will be equivalent to the earlier commandline, because under PBS 'nolocal' is automatic and the 'machinefile' is provided by PBS.

Additional Parameters: You can also use the -nodetype parameter to ask PBS for specific computer type. So for example if I wanted to make sure my job ran on Vega nodes I would issue a command like:

/usr/local/mpi/bin/mpirun -pbs -np 2  -nodetype vega $HOME/a.out

You can also request star nodes. By default, you will get whatever nodes are available (possibly a combination of both types). Please note that if you request a lot of processors and a particular node type, your job may sit idle in the queue waiting for more nodes to become available.

Serial Jobs

    To submit a serial job through PBS can be done in one of two ways:
1. (recommended)
    Use mpirun to submit your job through the batch system.
    Example of how to do this (assuming a.out is your program):
       /usr/local/mpi/bin/mpirun -pbs -np 1 a.out

If you submit this way, Mpirun will launch the job in the current working directory on the computational node.
 

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).
Example:
        #PBS ...
        #PBS ...
        a.out
        #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.

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.