Portable Batch System (PBS)

When doing massive computations, a user has two problems: which machine to run his giant job on, and how to coordinate with other competing users. The Portable Batch System (PBS) is a POSIX-compliant suite of commands intended to manage large jobs running on multiple compute servers.

At present, PBS is active on these machines:
Sixpac Holly
Queue name sixpac@sixpac holly@holly
Number of Hosts 6 10 (48 planned)
CPU 933 MHz P-3 1.0 GHz P-3
Memory (each) 512 Mb 2 Gb
Disc (each) 45 Gb 37 Gb

How to Set Up a PBS Job

To run a job on one of these machines, first prepare a shell script which invokes whatever commands you want, including your self-written program. Click here for a simple PBS job script which you can copy. In the script, lines beginning with ``#PBS'' add to the command line switches of qsub (see below) which you use to submit your job (but switches actually on the command line are believed whatever the script says). Most of the useful switches are demonstrated here; you don't have to specify all of them.

And here is another script illustrating how to set up a local directory, so your job can write scratch files on the local machine, and then remove them. That is much faster than sending them over Ethernet to some other machine, like your home directory server, and filling up your disc quota.

Then just do qsub filename and the job's identifier will be reported back to you. When the job finishes, stdout and stderr of the job will be written to files, named after the job ID, in the current directory when qsub was executed (or to files specified with the -o or -e switches).

(About the CPU limit: the job monitor checks from time to time whether the job has gone over, and kills it if so. Hence the actual time received by the job could be slightly more than the specified limit.)

You may optionally specify a limit on memory by (for example) ``#PBS -l mem=500mb''. However, each cluster has a default equal to the whole physical memory of the (smallest) member host, and there is no benefit to requesting less memory except if your code has a bug which you are trying to diagnose by using a memory limit. If you request more than the size of the smallest node, your job will be run only on a machine that has that much memory. If you request more than the largest node, the job will be ``rejected by all destinations''. It is a bad idea to force a machine to run a job larger than its physical memory, because swap space isn't much larger, and the I/O to access the swap space is very slow.

Disc Scratch Space

You may write files in your home directory or its subdirectories, but if you have large files you may run yourself out of disc quota, and also, massive data flows via NFS are slow. If you read and write a lot of data, it is better to do that on the local machine. A large scratch space, most of the disc as indicated in the above table, has been allocated on each machine for job temporary files. Files will be deleted automatically 5 days after the last writing, but please delete files as soon as you are done with them, either in the job script or after visualization and summarization is finished.

The temporary space is called /scr (on Ficus it is /hugetmp). To avoid entanglement with other users, it's best if you create your own directory in there, e.g. /scr/jimc. This sample script illustrates how to do it.

PBS Commands

Here is a short description of the various administrative commands for PBS available to users, generally with the more useful ones first. For complete details, see the man page, e.g. do man qsub. Here are some common switches and command line arguments:

-q queue@server
You may need to specify the queue, or else you get a non-useful default.
job.server
The job ID is given to you when you submit the job using qsub, and is also reported by qstat. You only need to give the 1-component name of the server, e.g. ``325.bud''.

When the description mentions jobs, you need to give the job IDs on the command line; generally multiple jobs can be affected at once.

qsub
Submit a PBS job, filename as the command line argument. It prints the job ID. See the sample job above for potential command line switches, but it's easier to put them in the job script as shown.
qstat
Prints a summary of queue and job status. Give a job ID for only that job, or qstat -a queue@server (not using -q) for all jobs in the queue.
qdel
Delete jobs.
qsig
Sends a user-specified signal to jobs; default is "kill".
xpbs
GUI to exec the various "q" commands. You can submit from xpbs also, with a GUI to adjust parameters. Click on rows to select or deselect them. Iconify (shrink) panels by clicking on the dot icon.
xpbsmon
GUI monitor of PBS node status; similar to pbsnodes but nicer. For more info per node, de-iconify by clicking on the square icon; for the summary, iconify by clicking on the dot.
qselect
Finds jobs matching criteria and writes their IDs. Probably the most useful command line arguments are -q queue@server -u user.
pbsdsh
Uses ``Task Management API'' for distributed tasks.
pbsnodes
Lists the status of all (-a) or selected nodes. Specify the server with -s.
qalter
Retroactively change job attributes settable by qsub
qhold
Hold a job (temporarily block execution; see qrls)
qmgr
Management interface. Give the server hostname. For ordinary users the interface is readonly.
qmsg
Append a text message to a job's stderr.
qrerun
Kills the jobs but re-queues them for execution.
qrls
Release a held job (see qhold)

These commands are present in /usr/local/pbs/bin but are generally not useful to ordinary users.

chk_tree
Audit PBS spool directory for world writable files etc.
hostn
Given IP address, prints the hostname and all aliases.
nqs2pbs
Converts nqs scripts to pbs; we don't use nqs.
pbs_tclsh
Includes intrinsic functions as for tcl scheduler.
pbs_wish
Includes intrinsic functions as for tcl scheduler.

These commands are present in /usr/local/pbs/bin but are available only to managers.

printjob
Prints data about a job by opening an actual file somewhere, likely the job queue file. Managers only?
qdisable
Disable a queue (managers only).
qenable
Inverse of qdisable
qmove
Take a job out of one queue and put it in another. Probably for managers only; in any case, we have only one queue.
qrun
Force the server to run a job (managers only).
qorder
Change the order of jobs in a queue. Probably for managers only, and useless for us since we have only one queue.
qstart
Start a queue (managers only).
qstop
Stop a queue (managers only).
qterm
Shut down a server (managers only).
tracejob
Print a log file summary of selected info. Managers only?