select

select synopsis

select(expression)
select(expressionoperatorexpression)
select((expressionoperatorexpression)operatorexpression)

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.

resource_nameoperatorvalue
resource_name

The following resources can be used as selection criteria.

Static resources

Static resources are built-in resources that represent host information that does not change over time, such as the maximum RAM available to user processes or the number of processors in a machine. Most static resources are determined at start-up time, or when hardware configuration changes are detected.

Static resources can be used to select appropriate hosts based on binary architecture, relative CPU speed, and system configuration.

Note:

The resources ncpus, maxmem, maxswp, and maxtmp are not static on UNIX hosts that support dynamic hardware reconfiguration.

Index

Measures

Units

Determined by

type

host type

string

configuration

model

host model

string

configuration

hname

host name

string

configuration

cpuf

CPU factor

relative

configuration

server

host can run remote jobs

Boolean

configuration

rexpri

execution priority

nice(2) argument

configuration

ncpus

number of processors

processors

LIM

ndiks

number of local disks

disks

LIM

maxmem

maximum RAM

MB

LIM

maxswp

maximum swap space

MB

LIM

maxtmp

maximum space in /tmp

MB

LIM

CPU factor (cpuf)

The CPU factor is the speed of the host’s CPU relative to other hosts in the cluster. If one processor is twice the speed of another, its CPU factor should be twice as large. CPU factors are defined by the cluster administrator. For multiprocessor hosts, the CPU factor is the speed of a single processor.

Server

The server static resource is Boolean. It has the following values:

  • 1 if the host is configured to run jobs from other hosts.

  • 0 if the host is a client for submitting jobs to other hosts.

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

Negative of a

!

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.

Example: Simple selection expression using static resources

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

Example: 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)