joeblow
joeblow

Reputation: 13

Submitting LSF job array using different arguments for each element of the array

I'm trying to avoid submitting separate jobs. I have so far have this at the start of my script:

#!/bin/bash
#BSUB -P account 
#BSUB -q queue
#BSUB -W 48:00
#BSUB -n 2
#BSUB -R rusage[mem=40000]
#BSUB -J jobname[1-22]
#BSUB -a 000-176:1
#BSUB -eo jobname.%I.%a.err
#BSUB -oo jobname.%I.%a.out

And then submit the job as follows:

bsub < myscript.sh

I have also tried the -i option as well but that doesn't work either.

One more issue is that the ranges of input arguments are different for the different elements of the array. So for jobname[1] input arguments will range from 000-176 but for jobname[22] input arguments will range from 000-067.

Is there a way to do this without manually submitting the job 22 times or more?

Upvotes: 0

Views: 1081

Answers (1)

Squirrel
Squirrel

Reputation: 2282

Use the $LSB_JOBINDEX environment variable inside your script, which is set to the index number of the particular array element at execution time.

Upvotes: 2

Related Questions