Last updated
Last updated
A batch job runs a program or series of programs without manual intervention. This is useful when launching complex or time-consuming jobs. Unlike interactive qlogin sessions batch jobs continue to run even if you log out. All of their output is written to a file (or files) instead of to the screen.
You do not need to specify which compute nodes to run the job. The qstat
command will automatically choose an available compute node or nodes. If no suitable nodes are available, your job will be put into a wait state and will launch as soon as compute nodes are available.
Batch jobs are defined in a _job submission script _and launched via the qsub
command.
The file /share/apps/examples/template.qsub (included below) as a starting point for creating your own job scripts
All jobs are assigned a job ID and can be monitored with the qstat
command which lists all of your running and scheduled jobs. Here is an example of user jsmith monitoring a job.
The output of the qstat
command shows a list of your jobs and what state they’re in. In this case there is only one job (job 5842) running and it is in the qw
or "queued, waiting" state. The qstat
command will show an 'r' for jobs that are running, and an 'e' for jobs in an error state.
To see a listing of all running and scheduled jobs for all users type
Once a job completes, it is no longer listed in the qstat
output.
To cancel a running or waiting job use the qdel command and pass it the job id of the job you’d like to terminate. You can only cancel jobs for which you are the owner. Here’s an example:
The directory /share/apps/examples contains example batch jobs.
You can view the output file elephant.png by copying it to your computer and opening it.