Host partition in fairshare scheduling

To configure host partition fairshare, define a host partition in lsb.hosts. lsb_hostpartinfo() to gets the information on defined host partitions.

struct hostPartInfoEnt *lsb_hostpartinfo (hostParts,                                          numHostParts) 
    char **hostParts;         Host partition names 
    int  *numHostParts;       Number of host partition names

To get information on all host partitions, set hostParts to NULL; *numHostParts is the actual number of host partitions when this lsb_hostpartinfo() returns.

The next call reuses the storage for the array of hostPartInfoEnt structures.

lsb_hostpartinfo() returns a struct hostPartInfoEnt describing the host partitions:

struct hostPartInfoEnt { 
    char hostPart[MAX_LSB_NAME_LEN]; Name of the host partition 
    char *hostList;                 Names of hosts in the partition 
    int  numUsers;                  Number of users sharing the partition 
    struct hostPartUserInfo *users; Description of user in the partition 
};

The string variable hostList contains the names of the host in the partition and each of the names has a foward slash character (/) appended. (See lsb_groupinfo(3).)

The struct hostPartUserInfo holds information on a specific user in the host partition.

struct hostPartUserInfo { 
    char user[MAX_LSB_NAME_LEN]; User Name  
    int   shares;                Number of shares assigned to the user 
    float priority;              Priority of user to use the host partition 
    int   numStartJobs;          Number of started jobs on host partition 
    float histCpuTime;           Normalized CPU time of finished jobs 
    int   numReserveJobs;        Number of reserved job slots for pending 
                                 jobs 
    int   runTime;               Time unfinished jobs spend in RUN state  
}; 

For priority, the bigger values represent higher priorities. Jobs belonging to the user or user group with the highest priority are considered first for dispatch when resources in the host partition are being contended for. In general, a user or user group with more shares, fewer numStartJobs and less histCpuTime has higher priority.

On success, returns an array of hostPartInfoEnt structures which hold information on the host partitions, and sets *numHostParts to the number of hostPartInfoEnt structures.

On failure, lsb_hostpartinfo() returns NULL and sets lsberrno to indicate the error. If lsberrno is LSBE_BAD_HPART, (*hostParts)[*numHostParts] is not a host partition known to the LSF system. Otherwise, if *numHostParts is less than its original value, *numHostParts is the actual number of host partitions found.