-R res_req

Selects the most appropriate resource for a particular purpose.

Synopsis

-R "select(select_string)"
-R "select(select_string) order(order_string)"

Description

A resource requirement string describes the criteria for defining a set of resources.

The entire resource requirement string cannot contain more than 512 characters.

If the characters "-" or "." form a part of the host or resource name, enclose the name using single quotation marks (for example, when a full host name is used, such as 'gr4e01.domain.name.com').

Examples of proper quotation mark usage include the following:

egosh resource list -R "select(’host1.domain.name.com’)"

egosh resource list -R "select(’host1-1’)"

egosh resource list -R "select(’host1-1’ ||’host1-2’)"

Important:
If the command is issued in whole from the shell console or the requirement has white space, enclose the requirement in double quotation marks. For example:
egosh resource list -R "select(mem>100)"

If the command is issued from the egosh console, quotation marks are optional. For example:

egosh> resource list -R select(mem>100)

Options

select(select_string)

Specifies the criteria for selecting the resources. The selection string filters out the resources that do not meet the criteria, resulting in a list of one or more eligible resources.

The parentheses must be typed as shown.

order(order_string)

Specifies the sort order for selecting the best resource from the list of eligible resources. The most appropriate resource is listed first, the least is listed last.

The parentheses must be typed as shown.

select

The selection string excludes unsuitable resources by specifying the characteristics a resource must have to match a resource requirement.

select synopsis

select(expression)select(expression operator expression)select((expression operator expression) operator expression)

select description

The selection string is a logical expression used to select one or more resources to match one or more criteria. Any resource that satisfies the criteria is selected.

The selection string is used in many ways to select resources.

  • To define resource groups in EGO

  • By Platform Symphony application profiles to define the resources to run SOA workload

  • To define resource requirements for both jobs and queues in Platform LSF

The resource selection string uses values for host_name, model, type, and/or resources as selection string expressions. These can be seen in the output of

egosh resource view
. When entering a resource requirement string in EGO, omit the operator and use only the value. For example:

Incorrect syntax: select(type==linux86)

Correct syntax: select(linux86)

Other examples of correct syntax:
select(linux86 && maxmem > 500)
select(maxmem > 2046 && LINUX86) => ib06b09
select(maxmem > 2046 && mg) => ib06b09
select(NTX86) =>host1

When you input a string, ensure that you use valid characters. This requirements applies to all resource requirement strings. Valid characters include the following: a-z A-Z 0-9 * / ! ( ) . | \ ^ & $ # @ ~ % `

select expression synopsis

resource_name operator value
resource_name

Specifies the name of the resource to use as selection criteria.

You can specify a static resource or a load index, depending on the purpose of the selection string.

operator
The following operators can be used in selection strings. If you are using the selection string in an XML format, you must use the applicable escape characters in the XML Equivalence column. The operators are listed in order of decreasing precedence:

Operator

XML Equivalent

Syntax

Meaning

!

n/a

!a

Logical NOT: 1 if a==0, 0 otherwise

*

n/a

a*b

Multiply a and b

/

n/a

a / b

Divide a by b

+

n/a

a+b

Add a and b

-

n/a

a-b

Subtract b from a

>

>

a > b

1 if a is greater than b, 0 otherwise

<

&lt;

a < b

1 if a is less than b, 0 otherwise

>=

&gt;=

a >= b

1 if a is greater than or equal to b, 0 otherwise

<=

&lt;=

a <= b

1 if a is less than or equal to b, 0 otherwise

==

n/a

a == b

1 if a is equal to b, 0 otherwise

!=

n/a

a != b

1 if a is not equal to b, 0 otherwise

&&

&amp;&amp;

a && b

Logical AND: 1 if both a and b are non-zero, 0 otherwise

||

n/a

a || b

Logical OR: 1 if either a or b is non-zero, 0 otherwise


value

Specifies the value to be used as criteria for selecting a resource. Value can be numerical, such as when referring to available memory or swap space, or it can be textual, such as when referring to a specific type of host.

Simple selection expression using static resources

The following example selects resources with total memory greater than 500MB:
select(maxmem > 500)

Compound selection expression using static resources

The following example selects resources with total memory greater than 500MB and total swap space greater than or equal to 300MB:
select(maxmem > 500 && maxswp >=300)

Compound selection expression with precedence for dynamic load indices

The following example selects resources with available memory greater than 500MB and available swap space greater than or equal to 300MB, or at least 1000MB temporary disk space:
select((mem > 500 && swp >=300) || tmp >= 1000) 

order

Sorts the selected resources into an order of preference according to the values of the resources.

order synopsis

order(expression)

order description

The order string acts on the results of a selection string, sorting the selected resources to identify the most favorable resources, and eliminate the least desirable resources.

Resources are sorted into ascending order based on a load index or the result of an arithmetical expression.

The result orders the resources from smallest to largest.

order expression synopsis

order(load_index)
order(arithmetic_expression)
load_index

Specify the load index to use as the criteria for sorting resources.

Specify any built-in or external load index.

arithmetic _expression

Specify an arithmetic expression that expresses the desired outcome.

You can create an expression using load indices, operators, and numbers.

Use the following operators:

+

add

subtract

*

multiply

/

divide

Order resources based on CPU utilization

The following example orders the selected resources based on their CPU utilization, ordering least utilized hosts first:
order(ut)

Order resources based on available swap space

The following example orders the selected resources based on their available swap space, but sorts by descending order, ordering hosts with the greatest amount of available swap space first:
order(0-swp)