Passing job array index as an argument in drmaa-python

331 Views Asked by At

I am using a lsf-drmaa implementation and interfacing through drmaa-python. I usually pass in the environment variable, $LSB_JOBINDEX, into my run.sh script as an argument. Through drmaa-python, I created JobTemplate jt and would like to pass it through as an argument. I have tried using PARAMETRIC_INDEX, but this command does not work for me: jt.args = [str(drmaa.JobTemplate.PARAMETRIC_INDEX)].

I receive the following error:

W #29c0 [  1227.22]  * '$drmaa_incr_ph$' can not be expanded in '$drmaa_incr_ph$'; removing from string

Where am I going wrong and/or how can I pass in the index using another method? Thanks--

1

There are 1 best solutions below

0
laylaylom On

You should be able to reference (within your run script) the value of PARAMETRIC_INDEX via the environment variable $SGE_TASK_ID. qmaster takes care of expanding/populating the $SGE_TASK_ID with each array index value in your script when it submits the corresponding job.