Sun MPI 4.0 User's Guide: With CRE

Specifying Resource Attributes

Table 3-3 lists predefined attributes you can include in an RRS. Your system administrator may also have defined attributes specific to your Sun HPC cluster. You can see what settings these administrator-defined attributes have with the mpinfo command.

Table 3-3 Standard RRS Attributes

Attribute 

Meaning 

cpu_idle

Percent of time that the CPU is idle. 

cpu_iowait 

Percent of time that the CPU spends waiting for I/O. 

cpu_kernel 

Percent of time that the CPU spends in the kernel. 

cpu_scale 

Performance rating of the CPU. 

cpu_swap 

Percent of time that the CPU spends waiting for swap. 

cpu_type 

CPU architecture. 

cpu_user 

Percent of time that the CPU spends running user's program. 

load1 

Node's load average for the past minute. 

load5 

Node's load average for the past 5 minutes. 

load15 

Node's load average for the past 15 minutes. 

manufacturer 

Hardware manufacturer. 

mem_free 

Nodes's available memory, in Mbytes. 

mem_total 

Node's total physical memory, in Mbytes. 

name 

Node's hostname. 

os_max_proc 

Maximum number of processes allowed on the node, including cluster daemons. 

os_arch_kernel 

Node's kernel architecture. 

os_name 

Operating system's name. 

os_release 

Operating system's release number. 

os_release_maj 

The major number of the operating system's release number. 

os_release_min 

The minor number of the operating system's release number. 

os_version 

Operating system's version. 

serial_number 

Node's serial number. 

swap_free 

Node's available swap space, in Mbytes. 

swap_total 

Node's total swap space, in Mbytes. 

The CRE recognizes two types of attributes, value and boolean.

Value-Based Attributes

Value attributes can take a literal value or a numeric value. Or, depending on the operator used, they may take no value.

% mprun -R "name = hpc-demo" a.out
% mprun -R "load5 < 4" a.out

specifies that you only want nodes whose individual load averages over the previous 5 minutes were less than 4.

% mprun -R "mem_total>>" a.out

specifies that you prefer nodes with the largest physical memory available.

Table 3-4 identifies the operators that can be used in RRS expressions.

Table 3-4 Operators Valid for Use in RRS

Operator 

Meaning 

Select all nodes where the value of the specified attribute is less than the specified value. 

<= 

Select all nodes where the value of the specified attribute is less than or equal to the specified value. 

Select all nodes where the value of the specified attribute is equal to the specified value. 

>= 

Select all nodes where the value of the specified attribute is greater than or equal to the specified value. 

Select all nodes where the value of the specified attribute is greater than the specified value. 

!= 

Attribute must not be equal to the specified value. (Precede with a backslash in the C shell.) 

<< 

Select the node(s) that have the lowest value for this attribute. 

>> 

Select the node(s) that have the highest value for this attribute. 

The operators have the following precedence, from strongest to weakest:

unary -
*, /
+, binary -
=, !=, >=, <=, >, <, <<, >>
!
&, |
?

If you use the << or >> operator, the CRE does not provide load balancing. In the previous example, the CRE would choose the node with the most free swap space, regardless of its load. If you use << or >> more than once, only the last use has any effect--it overrides the previous uses. For example,

% mprun -R "mem_free>> swap_free>>" a.out

initially selects the nodes that have the most free memory, but then selects nodes that have the largest amount of available swap space. The second selection may yield a different set of nodes than were selected initially.

You can also use arithmetic expressions for numeric attributes anywhere. For example,

% mprun -R "load1 / load5 < 2" a.out

specifies that the ratio between the one-minute load average and the five-minute load average must be less than 2. In other words, the load average on the node must not be growing too fast.

You can use standard arithmetic operators as well as the C ?: conditional operator.


Note -

Because some shell programs interpret characters used in RRS arguments, you may need to protect your RRS entries from undesired interpretation by your shell program. For example, if you use csh, write "-R \!private" instead of "-R !private".


Boolean Attributes

Boolean attributes are either true or false. If you want the attribute to be true, simply list the attribute in the RRS. For example, if your system administrator has defined an attribute called ionode, you can request a node with that attribute:

% mprun -R "ionode" a.out

If you want the attribute to be false (that is, you do not want a resource with that attribute), precede the attribute's name with !. (Precede this with a backslash in the C shell; the backslash is an escape character to prevent the shell from interpreting the exclamation point as a "history" escape.) For example,

% mprun -R "\!ionode" a.out

For example,

% mprun -R "mem_free > 256" a.out

specifies that the node must have over 256 megabytes of available RAM.

% mprun -R "swap_free >>" a.out

specifies that the node picked must have the highest available swap space.