lsb_readjobinfo() takes one argument:
Either this parameter or the return value from the lsb_openjobinfo() can be used to keep track of the number of job records that can be returned from the connection. This parameter is updated each time lsb_readjobinfo() is called.
The jobInfoEnt structure returned by lsb_readjobinfo() is defined in lsbatch.h as:
struct jobInfoEnt {LS_LONG_INT jobId; job IDchar *user; submission userint status; job status/* possible values for the status field */#define JOB_STAT_PEND 0x01 job is pending#define JOB_STAT_PSUSP 0x02 job is held#define JOB_STAT_RUN 0x04 job is running#define JOB_STAT_SSUSP 0x08 job is suspended by LSF batch system#define JOB_STAT_USUSP 0x10 job is suspended by user#define JOB_STAT_EXIT 0x20 job exited#define JOB_STAT_DONE 0x40 job is completed successfully#define JOB_STAT_PDONE 0x80 post job process done successfully#define JOB_STAT_PERROR 0x100 post job process error#define JOB_STAT_WAIT 0x200 chunk job waiting its execution turn#define JOB_STAT_UNKWN 0x1000 unknown statusint *reasonTb; pending or suspending reasonsint numReasons; length of reasonTb vectorint reasons; reserved for future useint subreasons; reserved for future useint jobPid; process Id of the jobtime_t submitTime; time when the job is submittedtime_t reserveTime; time when job slots are reservedtime_t startTime; time when job is actually startedtime_t predictedStartTime; job's predicted start timetime_t endTime; time when the job finishestime_t lastEvent; last time eventtime_t nextEvent; next time eventint duration; duration time (minutes)float cpuTime; CPU time consumed by the jobint umask; file mode creation mask for the jobchar *cwd; current working directory where job issubmittedchar *subHomeDir; submitting user’s home directorychar *fromHost; host from which the job is submittedchar **exHosts; host(s) on which the job executesint numExHosts; number of execution hostsfloat cpuFactor; CPU factor of the first execution hostint nIdx; number of load indices in the loadSched andloadStop vectorfloat *loadSched; stop scheduling new jobs if this threshold isexceededfloat *loadStop; stop jobs if this threshold is exceededstruct submit submit; job submission parametersint exitStatus; exit statusint execUid; user ID under which the job is runningchar *execHome; home directory of the user denoted byexecUidchar *execCwd; current working directory where job isrunningchar *execUsername; user name corresponds to execUidtime_t jRusageUpdateTime; last time job's resource usage is updatedstruct jRusage runRusage; last updated job's resource usageint jType; job type/* Possible values for the jType field */#define JGRP_NODE_JOB 1 this structure stores a normal batch job#define JGRP_NODE_GROUP 2 this structure stores a job group#define JGRP_NODE_ARRAY 3 this structure stores a job arraychar *parentGroup; for job group usechar *jName; if jType is JGRP_NODE_GROUP, then it isjob group name. Otherwise, it is the job'snameint counter[NUM_JGRP_COUNTERS];/* index into the counter array, only used for job array */#define JGRP_COUNT_NJOBS 0 total jobs in the array#define JGRP_COUNT_PEND 1 number of pending jobs in the array#define JGRP_COUNT_NPSUSP 2 number of held jobs in the array#define JGRP_COUNT_NRUN 3 number of running jobs in the array#define JGRP_COUNT_NSSUSP 4 number of jobs suspended by thesystem in the array#define JGRP_COUNT_NUSUSP 5 number of jobs suspended by theuser in the array#define JGRP_COUNT_NEXIT 6 number of exited jobs in the array#define JGRP_COUNT_NDONE 7 number of successfully completed jobsint counter[NUM_JGRP_COUNTERS];u_short port; service port of the jobint jobPriority; job dynamic priorityint numExternalMsg; number of external messages in the jobstruct jobExternalMsgReply **externalMsg;int clusterId;char *detailReason; Detail reason fieldfloat idleFactor;int exceptMask; Job exception maskchar *additionalInfo; Arbitrary job information stringcurrently used by rms_rid and rms_allocint exitInfo; Termination reasonint warningTimePeriod; Warning time in seconds, -1 ifunspecifiedchar *warningAction; Warning action, SIGNAL | CHKPNT |command, NULL if unspecifiedchar *chargedSAAP; SAAP charged for jobchar *execRusage; The rusage satisfied at job runtimetime_t rsvInActive; Time when AR was expired or deletedint numLicense; Number of licenses reported from LSchar **licenseNames; LS license namesfloat aps; Absolute priority valuefloat adminAps; Static aps value set by adminint runTime; Job's real runtimeint reserveCnt; Number of resource types reserved by this jobstruct reserveItem *items; Detail reservation information foreach kind of resourcefloat adminFactorVal; Admin factor valueint resizeMin; Pending resize min. 0, if no resize pendingint resizeMax; Pending resize max. 0, if no resize pendingtime_t resizeReqTime; Time when pending request was issuedint jStartNumExHosts; Number of hosts when job startschar **jStartExHosts; Host list when job startstime_t lastResizeTime; Last time job allocation changed};
jobInfoEnt can store a job array as well as a non-array batch job, depending on the value of jType field, which can be either JGRP_NODE_JOB or JGRP_NODE_ARRAY.