User information

Use lsb.users to:

  • Configure user groups, hierarchical fairshare for users and user groups, and job slot limits for users and user groups.

  • Configure account mappings in a MultiCluster environment.

LSBLIB provides the function lsb_userinfo() for getting information on LSF user and user groups.

struct userInfoEnt *lsb_userinfo(users, numUsers) 
    char **users;            User names 
    int  *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 group 
    float procJobLimit;       Max number of started jobs on each processor 
    int   maxJobs;            Max number of started or running jobs allowed 
    int   numStartJobs;       Number of started jobs of the user/group 
    int   numJobs;            Number of jobs the user/group submitted 
    int   numPEND;            Number of pending jobs of the user/group 
    int   numRUN;             Number of running jobs of the user/group 
    int   numSSUSP;           Number of system-suspended jobs 
    int   numUSUSP;           Number of user-suspended jobs 
    int   numRESERVE;         Number of job slots reserved for pending jobs 
}; 

lsb_userinfo() gets:

  • The maximum number of job slots that a user can use simultaneously on any host

  • The maximum number of job slots that a user can use simultaneously in the whole local LSF cluster

  • The current number of job slots used by running and suspended jobs

  • The current 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.