LSBLIB provides the function lsb_userinfo() for getting information on LSF user and user groups.
struct userInfoEnt *lsb_userinfo(users, numUsers)char **users; User namesint *numUsers; Number of user names
To get information about all users, set *numUsers = 0; *numUsers is updated to the actual number of users when lsb_userinfo() returns. To get information on the invoker, set users = NULL and *numUsers = 1.
The function returns an array of userInfoEnt structure containing user information. The structure is defined in lsbatch.h as followed:
struct userInfoEnt {char *user; Name of the user or user groupfloat procJobLimit; Max number of started jobs on each processorint maxJobs; Max number of started or running jobs allowedint numStartJobs; Number of started jobs of the user/groupint numJobs; Number of jobs the user/group submittedint numPEND; Number of pending jobs of the user/groupint numRUN; Number of running jobs of the user/groupint numSSUSP; Number of system-suspended jobsint numUSUSP; Number of user-suspended jobsint numRESERVE; Number of job slots reserved for pending jobs};
The maximum number of job slots are defined in the lsb.users LSF configuration file. The reserved user name default, also defined in lsb.users, matches users not already listed in lsb.users who have no jobs started in the system.
On success, returns an array of userInfoEnt structures and sets *numUsers to the number of userInfoEnt structures returned. The next call writes over the returned array.
On failure, lsb_userinfo() returns NULL and sets lsberrno to indicate the error. If lsberrno is LSBE_BAD_USER, (*users)[*numUsers] is not a user known to the LSF system. Otherwise, if *numUsers is less than its original value, *numUsers is the actual number of users found.