Submit the job

Nothing left to do but submit the job to the cluster with qsub:

qsub -V -t 0-3 $HOME/tutorial/JobArray/JobArray.qsub.sh

There is a few things to note about the -t argument. This argument specifies that we the job should be run as a job array. In addition to that it also specifies the array ids that our instabces will get. When we run the command above we'll get instances 0, 1, 2, 3 respectively. We could also specify those as a comma delimited list. The following command does the same thing as the previous one:

qsub -V -t 0,1,2,3 $HOME/tutorial/JobArray/JobArray.qsub.sh

We could also make up our own non-sequential ids:

qsub -V -t 111,211,311,411 $HOME/tutorial/JobArray/JobArray.qsub.sh

Anyhow, if our jobs ran successfully, we should be able to see the results in the output files. In our case:

~/ $ cat *.o*
Started: 2012-10-16 21:01:12 Finished: 2012-10-16 21:01:22 Host: iln28 User: akrevl
My arguments:
['myarg1-0', 'myarg2-0', 'myarg3-0']
Started: 2012-10-16 21:01:12 Finished: 2012-10-16 21:01:22 Host: iln28 User: akrevl
My arguments:
['myarg1-1', 'myarg2-1', 'myarg3-1']
Started: 2012-10-16 21:01:12 Finished: 2012-10-16 21:01:22 Host: iln28 User: akrevl
My arguments:
['myarg1-2', 'myarg2-2', 'myarg3-2']
Started: 2012-10-16 21:01:13 Finished: 2012-10-16 21:01:23 Host: iln28 User: akrevl
My arguments:
['myarg1-3', 'myarg2-3', 'myarg3-3']

So we successfully ran four instances of our script with 4 different sets of arguments. Of course this is only one way of doing things... but it seems to work...