Knowledge Center         Contents    Previous  Next    
Platform Computing Corp.

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.

DESCRIPTION

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.

SYNOPSIS

#include <lsf/lsf.h> 
char **ls_placeofhosts(char *resreq, int *num, int options, 
    char *fromhost, char **hostlist, int listsize) 

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 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 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

listsize gives the number of host or cluster names in hostlist.

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_placereq()

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