Knowledge Center Contents Previous Next |
ls_load()
Returns all load indices.
DESCRIPTION
This routine returns the dynamic load information of qualified hosts.
ls_load() returns all load indices. The result of this call is an array of hostLoad data structures as defined in <lsf/lsf.h>. The status component of the hostLoad structure is an array of integers. The high order 16 bits of the first integer are used to mark the operation status of the host. Possible states defined in <lsf/lsf.h> are as follows:
LIM_UNAVAIL
The host Load Information Manager (LIM) is unavailable (e.g. the host is down or there is no LIM ). If LIM is unavailable the other information in the hostLoad structure is meaningless.
LIM_BUSY
The host is busy (overloaded).
LIM_LOCKEDU
The host's LIM is locked by the root, LSF administrator or a user.
LIM_LOCKEDW
The host's LIM is locked by its run windows.
LIM_RESDOWN
The host's Remote Execution Server (RES) is not available.
LIM_UNLICENSED
The host has no software license.
The low order 16 bits of the first integer are reserved. The other integer() of the status array is used to indicate the load status of the host. If any of these bits is set, then the host is considered to be busy (overloaded). Each bit (starting from bit 0) in integer() represents one load index that caused the host to be busy. If bit i is set then the load index corresponding to li[i] caused the host to be busy. An integer can be used to for 32 load indices. If number of load indices on the host, both built-in and user defined, are more than 32, more than one integer will be used.
Programmers can use macros to test the status of a host. The most commonly used macros include:
LS_ISUNAVAIL(status) LS_ISBUSY(status) LS_ISBUSYON(status, index) LS_ISLOCKEDU(status) LS_ISLOCKEDW(status) LS_ISLOCKED(status) LS_ISRESDOWN(status) LS_ISUNLICENSED(status) LS_ISOK(status)In the hostLoad data structure, the li vector contains load information on various resources on a host. The elements of the load vector are determined by the namelist parameter.
SYNOPSIS
#include <lsf/lsf.h> struct hostLoad *ls_load(char *resreq, int *numhosts, int options, char *fromhost) struct hostLoad { char hostName[MAXHOSTNAMELEN]; int *status; float *li; };PARAMETERS
*resreq
resreq is a character string describing resource requirements. Only the load vectors of the hosts satisfying the requirements will be returned. If resreq is NULL, the load vectors of all hosts will be returned.
*numhosts
numhosts is the address of an integer which initially contains the number of hosts requested. If *numhosts is 0, request information on as many hosts as satisfy resreq. If numhosts is NULL, requests load information on one (1) host. If numhosts is not NULL, then *numhosts will contain the number of hostLoad records returned on success.
options
options is constructed from the bitwise inclusive OR of zero or more of the following flags, as defined in <lsf/lsf.h>.
EXACT
Exactly *numhosts hosts are desired. If EXACT is set, either exactly *numhosts hosts are returned, or the call returns an error. If EXACT is not set, then up to *numhosts hosts are returned. If *numhosts is zero, then the EXACT flag is ignored and as many hosts in the load sharing system as are eligible (that is, those that satisfy the resource requirements) are returned.
OK_ONLY
Return only those hosts that are currently in the `ok' state. If OK_ONLY is set, those hosts that are busy, locked, or unavail are not returned. If OK_ONLY is not set, then some or all of the hosts whose status are not `ok' may also be returned, depending on the value of *numhosts and whether the EXACT flag is set.
NORMALIZE
Normalize CPU load indices. If NORMALIZE is set, then the CPU run queue length load indices r15s, r1m, and r15m of each host returned are normalized. See Administering Platform LSF for the concept of normalized queue length. Default is to return the raw queue length. The options EFFECTIVE and NORMALIZE are mutually exclusive.
EFFECTIVE
If EFFECTIVE is set, then the CPU run queue length load indices of each host returned are effective load. See Administering Platform LSF for the concept of effective queue length. Default is to return the raw queue length. The options EFFECTIVE and NORMALIZE are mutually exclusive.
IGNORE_RES
Ignore the status of RES when determining the hosts that are considered to be `ok'. If IGNORE_RES is specified, then hosts with RES not running are also considered to be `ok' during host selection.
DFT_FROMTYPE
Return hosts with the same type as the fromhost which satisfy the resource requirements. By default all host types are considered.
*fromhost
fromhost is the name of the host from which a task might be transferred. This parameter affects the host selection in such a way as to give preference to fromhost if the load on other hosts is not much better. If fromhost is NULL, the local host is assumed.
RETURN VALUES
character:
character:NULL
Depends on which parameter is returned with NULL.
ERRORS
Systems that conform to the Single UNIX specification are not required to detect error conditions for this function. - Error handling
SEE ALSO
Related APIs
ls_loadinfo()
ls_loadofhosts()
Equivalent line command
none
Files
$LSF_CONFDIR/lsf.shared
$LSF_CONFDIR/lsf.cluster.cluster_name
Platform Computing Inc.
www.platform.com |
Knowledge Center Contents Previous Next |