Skip to Main Content

The University of Tennessee

Newton header banner

Frequently Used Tools:



Home » Documentation » Using the Grid Engine » Job Definition Files

Job definition files

When submitting a job execution request, it is strongly advised that all options be provided within a job definition file (in these examples the file will be called "job.sge"). This file will contain the command you wish to execute and any Grid Engine resource request options that you need. In the following file, we will request the "medium*" queue with a job name of "Test" in which to execute the command "uname -a":

#$ -N Test
#$ -q medium*
#$ -cwd
uname -a

All Grid Engine options are preceded by the string "#$ ", and all other lines in the file are executed by the shell (the default shell is /bin/csh).

The "-N" option sets the name of the job. This name is used to create the output log files for the job. We recommend using a capital letter for the job name is order to distinguish these log files from the other files in your working directory. This makes it easier to delete the log files later.

The "-q" option requests the queue in which the job should run. See Cluster Queues for more information.

The "-cwd" option instructs the Grid Engine to execute your jobs from the directory in which you submit the job (using qsub). This is recommended because it eliminates the need to "cd" to the correct sub-directory for job execution, and it ensures that you log files will be located in the same directory as your job-definition file.

Submit the job using the qsub command:

[username@newton ~]$ qsub job.sge
Your job 1697 ("test") has been submitted

A second way to specify Grid Engine options is to place them on the command line when you execute "qsub" E.g.:

[username@newton ~]$ qsub -q medium\* job.sge
Your job 1698 ("test") has been submitted

Command line options will override corresponding options within the job definition file. For a full listing of Grid Engine options, execute man qsub.

Back to Using The Grid Engine