bpstat

Name

bpstat -- Show cluster node status and cluster process mapping.

Synopsis

bpstat [-h, --help] [-V, --version] [-U, --update]
[-c, --compact] [-l, --long] [-a, --address]
[-s, --status] [-n, --number] [-t, --total]
[-N, --sort-number] [-S, --sort-status] [-O, --keep-order]
[-R, --sort-reverse]
[-A hostname] [-p] [-P [nodes]] [[nodes... | allup]...]

Description

This utility displays the BProc status of cluster nodes, and processes running on those nodes. Node information includes the node's IP address, state, user ownership, group ownership, and running node user processes.

Options

The following options are available to the bpstat program.

-h, --help

Print the command usage message and exit. If -h is the first option, all other options will be ignored. If -h is not the first option, the other options will be parsed up to the -h option, and those options will be processed.

-V, --version

Print the command version number and exit. If -V is the first option, all other options will be ignored. If -V is not the first option, the other options will be parsed up to the -V option, and those options will be processed.

-U, --update

Continuously update the status; otherwise, print status once and exit.

-c, --compact

Print compacted listing of nodes (default).

-l, --long

Print long list of node status. This includes IP address, status, mode, user and group information.

-a, --address

Prints the IP address of the indicated node.

-s, --status

Prints the state for the indicated node. The BProc states are "down", "boot", "error", "unavailable", "up", "reboot", "halt", and "pwroff".

-n, --number

Prints the node numbers that are being used and/or are available for the nodes in the cluster.

-t, --total

Prints the total number of nodes configured for the cluster. The number is calculated from the cluster configuration in the /etc/beowulf/config file. Note that this is the potential size of the cluster, not the current number of available nodes or the count of machines assigned node numbers.

-R, --sort-reverse

Prints the node list in reverse sorted order.

-N, --sort-number

Prints the node list sorted by node number.

-S, --sort-status

Prints the node list sorted by node status.

-O, --keep-order

Prints the nodes in the order returned by the system (no sorting is done).

-A hostname

Prints the node number that corresponds to the specified hostname or IP address.

-p

Prints a list of processes (by PID) that are currently running on the specified node.

-P [nodes]

Postprocesses the output from the ps command, prepending the node number that BProc-controlled processes are running on. This is typically used as ps -aux | bpstat -P. Processes not controlled by the BProc system will not have a number appended. If nodes is supplied, then the ps output is filtered to show only the specified node(s). Node(s) can be identified by names, numbers, or a list of numbers.

[nodes... | allup]

Optionally, specify the nodes for which information is to be displayed. Nodes can be specified individually, in a list, or as ranges. Alternatively, allup specifies all nodes that are in an up state.

Examples

Print the number of available nodes:

[user@cluster user] $ bpstat --total allup
  9

Generate a list of all usable nodes:

[user@cluster user] $ bpstat --number allup
  0 1 2 4 5 10 16 17 20
[user@cluster user] $ bpstat --number allup | awk '{ print "."$1 }'
  .0 .1 .2 .4 .5 .10 .16 .17 .20

Print status for all nodes:

[user@cluster user] $ bpstat
 Node(s)                        Status       Mode       User       Group
  8,11,22-31                     down         ---------- root       root
  3,6-7,9,12-15,18-19,21         error        ---x------ root       root
  0-2,4-5,10,16-17,20            up           ---x--x--x root       root

Print the PIDs and associated node number of currently running processes:

[user@cluster user] $ bpstat -p
 PID	Node
  7503	0
  8262	1

Print status for specific nodes:

[user@cluster user] $ bpstat 0-2,3,8
 Node(s)                        Status       Mode       User       Group
  8                              down         ---------- root       root
  3                              error        ---x------ root       root
  0-2                            up           ---x--x--x root       root

Augment ps aux for node numbers:

[user@cluster user] $ ps aux | bpstat -P
NODE    USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
        root         1  0.0  0.0  4756  552 ?        S    10:58   0:02 init [5]
        root         2  0.0  0.0     0    0 ?        S    10:58   0:00 [migration/0]
  (etc.)

Filter ps aux for nodes n1 and n2:

[user@cluster user] $ ps aux | bpstat -P n1,n2
NODE    USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
1       root      1328  0.0  0.0  6864  692 ?        Ss   12:45   0:00 [portmap]
2       root     32397  0.0  0.0  6864  692 ?        Ss   12:45   0:00 [portmap]

See Also

beomap(1), bproc_nodestatus(3), bproc_nodeaddr(3), bproc_nodeinfo(3), bproc_pidnode(3)