Knowledge Center Contents Previous Next |
ls_placereq()
Returns the most suitable host() for the task() with regards to current load conditions and the task's resource requirements.
DESCRIPTION
ls_placereq() sends a task placement request to the LIM. The LIM returns a set of most suitable host() for the task(), taking into account the current load conditions and the task's resource requirements. Hostnames may be duplicated for hosts that have sufficient resources to accept multiple tasks (for example, multiprocessors).
If ls_placereq() is successful, an array of host names is returned and *num is set to reflect the number of returned hosts. Otherwise, NULL is returned and lserrno is set to indicate the error.
The routine returns a pointer to a dynamically allocated array of strings which can be freed in subsequent calls.
SYNOPSIS
#include <lsf/lsf.h> char **ls_placereq(char *resreq, int *num, int options, char *fromhost)PARAMETERS
*resreq
The input parameter resreq is a resource requirement expression that characterizes the resource needs of a single task. You can retrieve this parameter by calling ls_eligible() or the application can supply its own. See Administering Platform LSF for more information about resource requirement expressions. The names used for resource requirements are defined by the LSF administrator in the configuration file LSF_CONFDIR/lsf.shared. You can obtain the available resource names by calling ls_info() or running the LSF utility program lsinfo(). If resreq is NULL, then the default is assumed, which is to require a host of the same type as the local host with low 1-minute average CPU queue length and paging rate.
*num
The input parameter *num is the number of hosts requested. If *num is zero, then all eligible hosts are requested. If *num is NULL, then a single host is requested.
options
The input parameter options is constructed from the bitwise inclusive OR of zero or more of the flags that are defined in <lsf/lsf.h>. These flags are documented in ls_load().
*fromhost
fromhost is the host from which the task originates when LIM makes the placement decision. Preference is given to fromhost over remote hosts that do not have significantly lighter loads or greater resources. This preference avoids unnecessary task transfer and reduces overhead. If fromhost is NULL, then the local host is assumed.
RETURN VALUES
character:Array
An array of host names is returned.
character:NULL
Function failed.
ERRORS
If the function fails, lserrno is set to indicate the error.
SEE ALSO
Related APIs
ls_placeofhosts()
ls_loadadj()
ls_eligible()
ls_info() - Returns a pointer to an lsInfo structure.
ls_load()
Equivalent line command
none
Files
none
Platform Computing Inc.
www.platform.com |
Knowledge Center Contents Previous Next |