Submission of OAR jobs array

Here is test.oar the following OAR script :

#!/bin/bash
#OAR -n TEST_ARRAY
#OAR -l nodes=1,walltime=48:00:00
#OAR -p nbcores=16 AND visu = 'NO'
#OAR -O test_array.%jobid%.log
#OAR -E test_array.%jobid%.log

ulimit -s unlimited

echo "$1"
hostname

exit $?

We want to launch 5 times this script, we can use OAR jobs array

Via command :

oarsub --array 5  -S "./test.oar toto"

OAR will launch 5 times the test.oar script with option "toto"

[user@cicada2 OAR]$ oarsub --array 5  -S "./test.oar toto"
[ADMISSION RULE] Modify resource description with type constraints
OAR_JOB_ID=12716
OAR_JOB_ID=12717
OAR_JOB_ID=12718
OAR_JOB_ID=12719
OAR_JOB_ID=12720
OAR_ARRAY_ID=12716
[user@cicada2 OAR]$ oarstat
Job id     Name           User           Submission Date     S Queue
---------- -------------- -------------- ------------------- - ----------
12716      TEST_ARRAY     user           2013-05-06 14:17:48 L default   
12717      TEST_ARRAY     user           2013-05-06 14:17:48 L default   
12718      TEST_ARRAY     user           2013-05-06 14:17:48 L default   
12719      TEST_ARRAY     user           2013-05-06 14:17:48 L default   
12720      TEST_ARRAY     user           2013-05-06 14:17:48 L default

Some OAR variables are available :

  • OAR_ARRAY_ID : it's the unique identifier of jobs array in OAR universe
  • OAR_JOB_ID : it's the unique identifier of a job in the job array

We can too launch 5 times test.oar with differents options

Via command :

oarsub -S ./test.oar --array-param-file param_file

We can launch test.oar with different options described in "param_file" file

[user@cicada2 OAR]$ more param_file
tutu
toto
"super turlututu"

The lines beginning by # are considered as comments, if you want space, you must put some " ".

[user@cicada2 OAR]$ oarsub -S ./test.oar --array-param-file param_file
[ADMISSION RULE] Modify resource description with type constraints
OAR_JOB_ID=12724
OAR_JOB_ID=12725
OAR_JOB_ID=12726
OAR_ARRAY_ID=12724
[user@cicada2 OAR]$ oarstat
Job id     Name           User           Submission Date     S Queue
---------- -------------- -------------- ------------------- - ----------
12724      TEST_ARRAY     user           2013-05-06 14:23:47 L default   
12725      TEST_ARRAY     user           2013-05-06 14:23:47 L default   
12726      TEST_ARRAY     user           2013-05-06 14:23:47 L default

The "param_file" file have only 3 inputs, test.oar script will be launched only 3 times, we will obtain :

[user@cicada2 OAR]$ more *.log
::::::::::::::
test_array.12724.log
::::::::::::::
tutu
node001
::::::::::::::
test_array.12725.log
::::::::::::::
toto
node004
::::::::::::::
test_array.12726.log
::::::::::::::
super turlututu
node005

 

Address

Université de Nice Sophia-Antipolis
D.S.I.
28 Avenue de Valrose
B.P. 2135
06103 NICE Cedex 02