Altair Grid Engine
Altair Grid Engine (GE) is a workload management and job scheduling system. It is a further development by Univa of Sun Grid Engine (SGE). SGE was developed by Sun Microsystems before 2011, and was at one time open source. Univa Grid Engine (UGE) was a proprietary fork of it. After Univa was acquired by Altair, UGE engine is now called Altair Grid Engine (GE).
GE has both a graphical interface and command line tools for submitting, monitoring, modifying and deleting jobs.
GE uses job scripts to submit and execute jobs. Various settings can be put in the job script, such as number of processors, resource usage and application-specific variables.
The steps for running a job through GE are to:
-
Create a job script
-
Select the directives to use
-
Add the scripts and applications and runtime parameters
-
Submit it to the workload management system
6.1 Writing A Job Script
A binary cannot be submitted directly to GE—a job script is needed for that. A job script can contain various settings and variables to go with the application. A job script format looks like:
6.1.1 Directives
It is possible to specify options (‘directives’) to GE by using “#$” in the script. The difference in the meaning of lines that start with the “#” character in the job script file should be noted:
6.1.2 GE Environment Variables
Available environment variables for GE can be seen in the man page for qsub. Some of these are called pseudo environment variables:
There are also about 30 environment variables begining with the prefix SGE_.
6.1.3 Job Script Options
Options can be set in the job script file using this line format for each option:
Available options and their descriptions can be seen with the output of qsub -help:
More detail on these options and their use is found in the man page for qsub.
6.1.4 The Executable Line
In a job script, the executable line is launched with the job launcher command after the directives lines have been dealt with, and after any other shell commands have been carried out to set up the execution environment.
6.1.4.1 Using mpirun In The Executable Line
The mpirun job-launcher command is used for executables compiled with MPI libraries. Executables that have not been compiled with MPI libraries, or which are launched without any specified number of nodes, run on a single free node chosen by the workload manager.
The executable line to run a program myprog that has been compiled with MPI libraries is run by placing the job-launcher command mpirun before it as follows:
6.1.5 Job Script Examples
Some job script examples are given in this section. Each job script can use a number of variables and directives.
6.1.5.1 Single Node Example Script
An example script for GE:
6.1.5.2 Parallel Example Script
For parallel jobs the -pe (parallel environment) option must be assigned to the script. Depending on the interconnect, there may be a choice between a number of parallel environments such as MPICH (Ethernet) or MVAPICH2 (InfiniBand).
The number of available slots can be set by the administrator to an arbitrary value. However, it is typically set so that it matches the number of cores in the cluster, for efficiency reasons. More slots can be set than cores, but most administrators prefer not to do that.
In a job script, the user can request slots from the available slots. Requesting multiple slots therefore typically means requesting multiple cores. In the case of an environment that is not set up as a parallel environment, the request for slots is done with the -np option. For jobs that run in a parallel environment, the -pe option is used. Mixed jobs, running in both non-MPI and parallel environments are also possible if the administrator has allowed it in the complex attribute slots settings.
Whether the request is granted is decided by the workload manager policy set by the administrator. If the request exceeds the number of available slots, then the request is not granted.
If the administrator has configured the cluster to use cloud computing with Auto Scale (cm-scale) (Chapter 8 of the Administrator Manual), then the total number of slots available to a cluster changes over time automatically, as nodes are started up and stopped dynamically.
6.2 Submitting A Job
The GE module uge must be loaded first so that UGE commands can be accessed:
With GE a job can be submitted with qsub. The qsub command has the following syntax:
After completion (either successful or not), output is put in the user’s current directory, appended with the job number which is assigned by GE to the job nmae.
For example, for a jobscript with the job option #$ -N myapp, the job name is set to myapp. When the job completes, then by default there is an error and there is an output file. The names they take are of the form:
If the -j y job script option is set, then the error file is combined with the output file into a single .o <job ID> file.
6.2.1 Submitting To A Specific Queue
Some clusters have specific queues for jobs which run are configured to house a certain type of job: long and short duration jobs, high resource jobs, or a queue for a specific type of node.
To see which queues are available on the cluster the qstat command can be used:
The job is then submitted, for example to the long.q queue:
6.2.2 Queue Assignment Required For Auto Scale (cm-scale)
If cm-scale is used with GE, then jobs must be assigned to a queue by default, or cm-scale ignores the job. If the cluster administrator has not configured GE to assign a queue to jobs by default, then the user can assign a queue to the job with the -q option in order to have cm-scale consider the job.
6.3 Monitoring A Job
The job status can be viewed with qstat. In this example the sleeper.sh script has been submitted. Using qstat without options will only display a list of jobs, with no queue status options:
More details are visible when using the -f (for full) option. Some of the details that can be seen are:
-
The queue-type
qtype, which can take a state of Batch (B), Interactive (I), or Parallel (P). -
The
resv/used/totcolumn is the count of reserved/used/total free slots in the queue. -
The
statescolumn is the state of the queue.
The man page for qstat gives details on the job states and the queue states.
By default the qstat command shows only jobs belonging to the current user, i.e. the command is executed with the option -u $user. To see jobs from other users too, the following format is used:
6.4 Deleting A Job
A job can be deleted in GE with the following command
The job-id is the number assigned by GE when the job is submitted using qsub. Only jobs belonging to the logged-in user can be deleted. Using qdel will delete a user’s job regardless of whether the job is running or in the queue.