LSF batch job ID

LSF APIs supports 64-bit batch job ID. The LSF batch job ID will store in a 64-bit integer. It consists of two parts:

  • Base ID

  • Array index

The base ID is stored in the lower 32 bits. The array index is shared in the top 32 bits. The top 32 bits are only used when the underlying job is an array job.

LSBLIB provides the following C macros (defined in lsbatch.h) for manipulating job IDs:

LSB_JOBID(base_ID, array_index)   Yield an LSF batch job ID
LSB_ARRAY_IDX(job_ID)             Yield array index part of the job ID
LSB_ARRAY_JOBID(job_ID)           Yield the base ID part of the job ID

The function calls used to get job information are:

  • int lsb_openjobinfo(job_ID, jobName, user, queue, host, options);

  • struct jobInfoEnt *lsb_readjobinfo(more);

  • void lsb_closejobinfo(void);

These functions are used to open a job information connection with mbatchd, read job records, and then close the job information connection.