Documentation:Job Arrays

Job arrays can be useful when running high throughput calculations (for example parameter sweeps). They help you control jobs by group and they're lighter than single jobs for the scheduler.

This documentation is valid for

A basic example
File: hello.sh

echo Hello from array job $1
 * 1) !/bin/bash

File: hello.job

echo The Job ID is $PBS_JOBID echo The Job Array Index is $PBS_ARRAY_INDEX cd $PBS_O_WORKDIR [ -e out_$PBS_ARRAY_INDEX.txt ] || ./hello.sh $PBS_ARRAY_INDEX > out_$PBS_ARRAY_INDEX.txt
 * 1) !/bin/bash
 * 1) PBS -l select=1:ncpus=1:mpiprocs=1
 * 2) PBS -l walltime=00:05:00
 * 3) PBS -N Array
 * 4) PBS -J 1-9
 * 5) PBS -r y

run qsub hello.job

Interacting with Job Arrays

 * To display the array, use qstat. If you want the details for each job, use qstat -t
 * To delete the array, use qdel JOBID[], for example qdel qdel 67276[]. To delete one job in the array, use qdel JOBID[ARRAY_INDEX], for example qdel 67276[3]

Explanations
The PBS option -J X-Y[:Z] indicates you're submitting a job array with index starting at X, ending at Y, incremented by Z. The array index is stored in the $PBS_ARRAY_INDEX</tt> that you can pass as an argument to your programs (or use tail and head to read a file with parameters).

The line #PBS -r y</tt> specifies that the jobs in the array are rerunnable (Bellatrix defaults to non-rerunnable). If you don't put this line, you'll get an error.