|
Article ID: 464
Last updated: 04 Dec, 2025
A job array is a collection of jobs that differ from each other by only a single index parameter. Creating a job array provides an easy way to group related jobs together. For example, if you have a parameter study that requires you to run your application five times, each with a different input parameter, you can use a job array instead of creating five separate PBS scripts and submitting them separately. Creating a Job ArrayTo create a job array, use a single PBS script and use the -J option to specify a range for the index parameter, either on the qsub command line or within your PBS script. For example, if you submit the following script, a job array with five sub-jobs will be created:
Submitting the script to PBS will return a PBS_ARRAY_ID. For example:
Each sub-job in this job array will have a PBS_JOBID that includes both the PBS_ARRAY_ID and a unique PBS_ARRAY_INDEX value within the brackets. For example:
When you develop your script, note the following:
Checking StatusThe status of the sub-jobs is not displayed by default. For example, the following qstat options shows the job array as a single job:
In the example above, the "B" status applies only to job arrays. This status indicates that at least one sub-job has left the "Q" (queued) state and is running or has run, but not all sub-jobs have run. To check the status of the sub-jobs, use either the -Jt option or the -t option with an array specified. For example:
Deleting a Job Array or Sub-JobTo delete a job array or a sub-job, use the qdel command and specify the array or sub-job. For example:
More InformationFor more information about job arrays, see Chapter 8 of the PBS Professional User's Guide (PDF - 3MB). |