Some LSLIB functions require a resource requirement parameter. This parameter is passed to the master LIM for host selection. It is important to understand how LSF handles default resource requirements. See Administering Platform LSF for further information about resource requirements.
It is desirable for LSF to automatically assume default values for some key requirements if they are not specified by the user.
The default resource requirements depend on the specific application context. For example, the lsload command assumes ‘type==any order[r15s:pg]’ as the default resource requirements, while lsrun assumes ‘type==local order[r15s:pg]’ as the default resource requirements. This is because the user usually expects lsload to show the load on all hosts. With lsrun, a task using run on the same host type as the local host, causes the task to be run on the correct host type.
LSLIB provides the flexibility for the application programmer to set the default behavior.
LSF default resource requirements contain two parts, a type requirement and an order requirement. A type requirement ensures that the correct type of host is selected. Use an order requirement to order the selected hosts according to some reasonable criteria.
LSF appends a type requirement to the resource requirement string supplied by an application in the following situations:
The default type requirement can be either ‘type==any’ or ‘type==$fromtype’ depending on whether or not the flag DFT_FROMTYPE is set in the options parameter of the function call. DFT_FROMTYPE is defined in lsf.h.
If DFT_FROMTYPE is set in the options parameter, the default type requirement is ‘type==$fromtype’. If DFT_FROMTYPE is not set, then the default type requirement is ‘type==any’.
The value of fromtype depends on the function call. If the function has a fromhost parameter, then fromtype is the host type of the fromhost. fromhost is the host that submits the task. Otherwise, fromtype is local.
LSF also appends an order requirement, order[r15s:pg], to the resource requirement string if an order requirement is not already specified.
The table below lists some examples of how LSF appends the default resource requirements.