LSF Version 7.3 - Administering Platform LSF

Passing Arguments on the Command Line
492 Administering Platform LSF
Redirect standard input
1 Use the -i option of bsub and the %I variable when your executable reads from
standard input.
To use %I, all the input files must be named consistently with a variable part
that corresponds to the indices of the job array. For example:
input.1, input.2, input.3, ..., input.N
For example, the following command submits a job array of 1000 jobs whose
input files are named
input.1, input.2, input.3, ..., input.1000 and located
in the current working directory:
bsub -J "myArray[1-1000]" -i "input.%I" myJob
Redirect standard output and error
1 Use the -o option of bsub and the %I and %J variables when your executable
writes to standard output and error.
a To create an output file that corresponds to each job submitted from a job
array, specify %I as part of the output file name.
For example, the following command submits a job array of 1000 jobs
whose output files are put in CWD and named
output.1, output.2,
output.3, ..., output.1000:
bsub -J "myArray[1-1000]" -o "output.%I" myJob
b To create output files that include the job array job ID as part of the file
name specify %J.
For example, the following command submits a job array of 1000 jobs
whose output files are put in CWD and named
output.123.1,
output.123.2, output.123.3, ..., output.123.1000. The job ID of the
job array is 123.
bsub -J "myArray[1-1000]" -o "output.%J.%I" myJob
Passing Arguments on the Command Line
The environment variable LSB_JOBINDEX is used as a substitution string to
support passing job array indices on the command line. When the job is dispatched,
LSF sets LSB_JOBINDEX in the execution environment to the job array index of
the current job. LSB_JOBINDEX is set for all jobs. For non-array jobs,
LSB_JOBINDEX is set to zero (0).
To use LSB_JOBINDEX, all the input files must be named consistently and with a
variable part that corresponds to the indices of the job array. For example:
input.1, input.2, input.3, ..., input.N
You must escape LSB_JOBINDEX with a backslash, \, to prevent the shell
interpreting
bsub from expanding the variable. For example, the following
command submits a job array of 1000 jobs whose input files are named
input.1,