Array JobsΒΆ

Array jobs are useful when you want to submit and manage a large number of similar jobs, especially when the same script needs to be run with different arguments, or different input files.

An array job is a job that is composed of several tasks, all of which behave like independent jobs. The same script is then used multiple times with different arguments. The argument is given by an index number that corresponds to the task number and is exported via the SGE_TASK_ID environment variable.

An array job submission is executed using the -t option with the following syntax:

% qsub -t min[-max[:interval]]


The min, max, and range arguments are available by the SGE_TASK_FIRST, SGE_TASK_LAST and SGE_TASK_STEPSIZE environment variables. Note that these variables do not necessarily indicate the execution order.