ls_placeofhosts
Returns the most suitable host() for the task() from a set of candidate hosts with regards to current load conditions and the task's resource requirements.ls_placeofhosts 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_placeofhosts is successful, an array of host names is returned and *num is set to reflect the number of returned hosts. Otherwise, ls_placeofhosts returns NULL and sets lserrno to indicate the error.
The routine returns a pointer to a dynamically allocated array of strings which can be freed in subsequent calls.
#include <lsf/lsf.h>
char **ls_placeofhosts(char *resreq, int *num, int options, char *fromhost, char **hostlist, int listsize)
Data Structures:
- Parameters:
*resreq 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 IBM 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 *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 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 options_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. **hostlist Specifies a list of candidate hosts from which ls_placeofhosts can choose suitable hosts. listsize The number of host entry in hostlist. Define Statements:
- none
Errors:
- Returns:
- char **:An array of host names is returned.
Function was successful.NULL
Function failed.Equivalent line commands:
- If the function fails, lserrno is set to indicate the error.
Files:
- none
- none
- See also:
- ls_placereq
Date Modified: 16 Jul 2014
Terms of Use
Copyright © 1994-2014 International Business Machines Corp.
US Government Users Restricted Rights - Use, duplication or disclosure
restricted by GSA ADP Schedule Contract with IBM Corp.