Interacting with Compute Nodes#

The primary tool for interacting with ICE ClusterWare ™ nodes from the command line is cw-nodectl. This tool is how an administrator would add a node, set or check configuration details of a node, see the basic node hardware, see basic status, cause a node to join or leave attribute groups, reboot or powerdown a node, or execute commands on the node.

Nodes are named by default in the form of nX, where X is a numeric zero-based index. More complicated clusters may benefit from more flexible naming schemes. See Node Names and Pools for details.

Sometimes the easiest way to target sets of similarly named nodes is to use the name and range operators with the cw-nodectl command. In this case, use the ‘-i’ argument followed by a range specifier. For example:

  • View detailed information for nodes 10, 11, 12, … up to and including 30:

    cw-nodectl -in[10-30] ls -L
    
  • View detailed information for all GPU nodes:

    cw-nodectl -igpu* ls -L
    
  • View detailed information for nodes 0 through 100 plus GPU nodes 1, 3, and 5:

    cw-nodectl -in[0-100],gpu[1,3,5] ls -L
    

While using a range specifier can efficiently target groups of contiguous nodes, it assumes that node numbering is the most meaningful identifier, which may not always be the case. Instead, you can use other operators (listed below) or a node selector string (see Node Selectors).

Range Operators#

Range Operator

Description

n[0-5]

All nodes n0, n1, …, through n5 (inclusive of the end points)

n[1,5,6]

The three nodes in the comma-separated list: n1, n5, and n6

n[0-5,9,10]

Nodes n0 through n5 plus n9 and n10

n[0-100] with <LogicalTest>

Returns only those nodes in the original set where the LogicalTest evaluates to True

n[0-100] in n[0-9]

Returns the intersection of the two sets, in this case n0 through n9

n[0-50] and n[51-100]

Returns the union of the two sets, in this case n0 through n100

n*

Any node that matches “n” followed by any number of any character

n0?

Any node that matches “n0” followed by exactly one other character

Logical Operators#

Logical Operator

Description

a == b

Equality

a != b

Inequality

a > b

Greater than

a < b

Less than

a >= b

Greater than or equal to

a <= b

Less than or equal to

a and b a && b

Logical and

a or b a || b

Logical or

not a ! a

Logical negation

attributes[foo]

Returns true if field "foo" exists in attributes and is "true". This includes the boolean value True as well as non-zero numbers and non-empty strings.

in “MyGroup”

Returns true for any node in the named Attribute Group (MyGroup)

exists attributes[foo]

Check if field "foo" exists in the attribute table

“a” in a[foo]

Check if the string "a" exists inside the string (a[foo]). This will fail for int or float values.

Tip

Parentheses can be used to order multiple tests or just for readability. For example:

( foo in attributes ) or c

In this case, the "(foo in attributes)" test is done first, then or'd with c.

Data Multipliers and Type Coercion#

Several data multipliers are available to help convert bytes to KB, MB, etc. This can be especially helpful in storage calculations where using bytes may be tedious.

KB = 1,000

KiB = 1024

MB = 1,000,000

MiB = 1024*1024

GB = 1,000,000,000

GiB = 1024*1024*1024

TB = 1,000,000,000,000

TiB = 1024*1024*1024*1024

These multipliers can be used in any comparison operation:

cw-nodectl –selector “hardware[ram_total] > 128GiB” ls

When necessary, both operands are coerced to be the same type, with float taking precedence over int, which takes precedence over strings:

  1. If either operand is a float, then both are interpreted as floats. Integers are trivially promoted to floats, but strings must be of the form +/-1.23e+/-4 or the parser will throw an error.

  2. If either operand is an int, then both are interpreted as ints. Strings must be of the form 1234 (no period or exponent, even if the number is actually an integer).

  3. Strings are compared lexicographically.