Computational Cluster Programs

Commonly-Used SGE Commands

Use the qsub Command to Submit a Job

The qsub command is used to submit jobs to SGE. The syntax of the qsub command is:

qsub [-cwd] [-v SOME_VAR] [-o path] [-e path] script
Where:
-cwd
Directs SGE to run the job in the same directory from which you submitted it. Alternatively, you can specify this flag in the SGE command file for the job. Displays the status of those queues which you can access.

-v SOME_VAR
Passes the environment variable SOME_VAR to the job. Alternatively, you can specify this flag in the SGE command file for the job.

-o path
Redirects the stdout from the SGE script. The default is your home directory. Specify /dev/null to disgard it. Alternatively, you can specify this flag in the SGE command file for the job.

-e path
Redirects the stderr from the SGE script. The default is your home directory. Specify /dev/null to disgard it. Alternatively, you can specify this flag in the SGE command file for the job.

script
Either the SGE command file or the script that starts up your job.

For example, if you saved a job command file with the name "myjob.cmd", you could submit it to SGE by entering:

qsub myjob.cmd

SGE will respond to you with something like:

your job 345 has been submitted
where 345 is the job number assigned by SGE for your job. ATS support for SGE access groups does not allow qsub to accept redirected input (stdin) in some cases.

Use the qstat Command to Determine the Status of a Job

The qstat command displays information about the SGE queues and the jobs in the queues, both running or waiting to run. The syntax of the qstat command is:

qstat [-f] [-j job_number] [-U yourLoginId] [-u yourLoginId]
where:
qstat alone with no arguments
Displays a list of all running and waiting jobs.

-f
Displays summary information on each queue as well as the queued job list.

-j job_number
Displays the status of the job whose number is job_number.

-U yourLoginId
Displays the status of those queues which you can access.

-u yourLoginId
Displays the statis information for only your jobs.

Use the qhost Command to Display Node Information

The qhost command displays information about compute nodes: their architectures, number of processors, load, etc. The syntax of the qhost command is:

qhost [-j] [-q]
where:
qhost alone with no arguments
Displays a table of information about the compute nodes.

-j
Adds information about the specific jobs that are running on each compute node.

-q
Shows the queues each compute node accepts.

Use the qdel Command to Cancel a Job

The qdel is used to cancel a job, either while it is waiting to execute or while it is running.

qdel job_number

If a running job does not get cancelled right away, enter:

qdel -f job_number

to force it to be cancelled.

Additional SGE Commands

Enter:

man command
For information on any of these additional SGE commands:
qhold
Places a hold on a queued job to prevent it from running.

qrls
Releases a held job.

qmon
An X-Windows interface to SGE.