- Introduction31621240
- Example of a Job Script
- How to Consolidate Small Jobs into Fewer Larger Jobs Using Job Arrays
- Rules for Submitting Job Arrays that use Parallel Environments (like MPI)
Anchor | ||||
---|---|---|---|---|
|
...
The syntax for the -t
flag is -t n[-m[:s]]
, namely:
-t 1-20 | run 20 tasks, with task IDs ranging from1 to 20 |
-t 10-30 | run 21 tasks, with task IDs ranging from 10 to 30 |
-t 50-140:10 | run 10 tasks, with task IDs ranging from 50 to 140 by step of 10 (50, 60, ..., 140) |
-t 20 | run one task, with task ID 20 |
Each instantiation of the job will have access to the following four environment variables:
SGE_TASK_ID | unique ID for the specific task |
SGE_TASK_FIRST | ID of the first task, as specified with qsub |
SGE_TASK_LAST | ID of the last task, as specified with qsub |
SGE_TASK_STEPSIZE | task ID step size, as specified with qsub |
You can also limit the number of concurrent tasks with the -tc
flag, for example:
...
The following job script with embedded directives must be broken into two files:
one job script with embedded directives | is replaced by two files, a qsub_XXX.sou and a XXX.sh | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
no spaces after the '\' | ||||||||||||||
this can be any type of executable script, the line "source /etc/profile.d/modules.sh" is bash/sh specific tho. |
Before submitting the job array, make sure the script is executable:
...