Job Arrays

Using an array provides the option of submitting multiple jobs in a specific order.

Each job in an array is assigned its own job ID and is treated as an individual job. The syntax is: nc run -array <n>

To submit an array, use option -array N in nc run. The value of N is between 1 and the value specified by the maxJobArray configuration parameter. maxJobArray is normally set to 1000.

For example:
% nc run -array 100 sleep 10

The job specification may contain the symbolic element @INDEX@ in either the command line, the environment, or the directory specification. The @INDEX@ element is substituted when the job array is created. Use @INDEX@ in the command line of the job array or in its environment.

Examples

% nc run -array 100 -e "BASE" sleep @INDEX@
nc run -array 100 -e "BASE+D(MYINDEX=@INDEX@)" sleep 10

VOV_JOBINDEX

When you submit a job array, such as:

nc run -array 5 myJob.sh

The VOV_JOBINDEX environment variable will be set in the execution environment of each job in the array. In the above example, the first job created will have a VOV_JOBINDEX value of 1, the second job will have 2, and so on, with the last job having a value of 5.

Note: This variable is for consumption only and is not intended to be set by the user at any time.