Job Control

Quick Start Example

(Note: the file names used in this example (myprogram, my_input_file, my_output_file, myjob.qsub) are all EXAMPLES. You can name your files whatever you want.)

Let's say you have a program named myprogram and that you would normally run it on your own computer with the command:

% ./myprogram < my_input_fileĀ  > my_output_file

To run this on wesley do the following:

I. Create a job script file that contains the following two lines. Name it anything you like (We'll call it myjob.qsub in this example).

cd $PBS_O_WORKDIR
./myprogram < my_input_file > my_output_file

Place myjob.qsub in the same directory that contains myprogram and my_input_file.

II. Submit the job to the queue with the qsub command. The minimum arguments for qsub are the time limit and the name of the job script. For example,

% qsub -l walltime=2:30:00 myjob.qsub

In this example we specified a time limit of 2 hours and 30 minutes. If the job runs longer it will automatically be killed. (This feature is to prevent programs that might end up in infinite loops from wasting computer time).

After the qsub command is executed, the job will enter the queue and then run as soon as there is an available compute node. You can examine the queue any time using either the qstat or showq commands (both are useful since they describe the queue in slightly different ways).

When the job completes, besides any normal output files from the program, you will find two additional files that end with .oJOBID and .eJOBID. These are the standard output and error output that you would normally see on your screen.

Note that it is safe to log out of wesley immediately after you submit the job with qsub. The job will remain in the queue and run normally even if you are no longer logged in.

Commands to Manage your Jobs

Submitting jobs

qsub
sqjobs

Viewing job and queue status

userjobs
qstat
showq
freenode [-c][-a]

Deleting/terminating jobs

qdel
sqkill