IBM Support

Accessing LSF batch job ID and array ID within job environment



Accessing LSF batch job ID and array ID within job environment

Resolving The Problem

How can I determine an LSF batch job's Job ID or Array ID within that job's execution environment?

LSF makes the following job ID or array ID related environment variables available to LSF jobs:
LSB_JOBID: LSF assigned job ID

LSB_BATCH_JID: Array job ID. Includes job ID and array index number

LSB_JOBINDEX: Job array index

For example, a 4-element array job is submitted as follows:
$ bsub -J "job[1-4]" my_job
Job <13234> is submitted to default queue .

The third element job from this array will have access to the following environment variables and corresponding values:




[{"Product":{"code":"SSWRJV","label":"IBM Spectrum LSF"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"--","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSWRJV","label":"IBM Spectrum LSF"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":null,"Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
23 June 2018