| 1 |
.. _clubak-tool: |
| 2 |
|
| 3 |
clubak |
| 4 |
------ |
| 5 |
|
| 6 |
.. highlight:: console |
| 7 |
|
| 8 |
Overview |
| 9 |
^^^^^^^^ |
| 10 |
|
| 11 |
*clubak* is another utility provided with the ClusterShell library that tries to |
| 12 |
gather and sort such dsh-like output:: |
| 13 |
|
| 14 |
node17: MD5 (cstest.py) = 62e23bcf2e11143d4875c9826ef6183f |
| 15 |
node14: MD5 (cstest.py) = 62e23bcf2e11143d4875c9826ef6183f |
| 16 |
node16: MD5 (cstest.py) = e88f238673933b08d2b36904e3a207df |
| 17 |
node15: MD5 (cstest.py) = 62e23bcf2e11143d4875c9826ef6183f |
| 18 |
|
| 19 |
If *file* content is made of such output, you get the following result:: |
| 20 |
|
| 21 |
$ clubak -b < file |
| 22 |
--------------- |
| 23 |
node[14-15,17] (3) |
| 24 |
--------------- |
| 25 |
MD5 (cstest.py) = 62e23bcf2e11143d4875c9826ef6183f |
| 26 |
--------------- |
| 27 |
node16 |
| 28 |
--------------- |
| 29 |
MD5 (cstest.py) = e88f238673933b08d2b36904e3a207df |
| 30 |
|
| 31 |
Or with ``-L`` display option to disable header block:: |
| 32 |
|
| 33 |
$ clubak -bL < file |
| 34 |
node[14-15,17]: MD5 (cstest.py) = 62e23bcf2e11143d4875c9826ef6183f |
| 35 |
node16: MD5 (cstest.py) = e88f238673933b08d2b36904e3a207df |
| 36 |
|
| 37 |
Indeed, *clubak* formats text from standard input containing lines of the form |
| 38 |
*node: output*. It is fully backward compatible with *dshbak(1)* available |
| 39 |
with *pdsh* but provides additional features. For instance, *clubak* always |
| 40 |
displays its results sorted by node/nodeset. |
| 41 |
|
| 42 |
You do NOT need to execute *clubak* when using *clush* as all output |
| 43 |
formatting features are already included in *clush* (see *clush -b / -B / -L* |
| 44 |
examples, :ref:`clush-oneshot`). There are several advantages of having |
| 45 |
*clubak* features included in *clush*: for example, it is possible, with |
| 46 |
*clush*, to still get partial results when interrupted during command |
| 47 |
execution (e.g. with *Control-C*), something not possible by just piping |
| 48 |
commands together. |
| 49 |
|
| 50 |
Most *clubak* options are the same as *clush*. For instance, to try to resolve |
| 51 |
node groups in results, use ``-r, --regroup``:: |
| 52 |
|
| 53 |
$ clubak -br < file |
| 54 |
|
| 55 |
Likewise, the ``--axis`` option folds the displayed node set along selected |
| 56 |
*nD* axes only, as described in :ref:`clush-axis`. |
| 57 |
|
| 58 |
By default, *clubak* interprets each key (the field before the separator on |
| 59 |
input lines) as a node set. Use ``--interpret-keys=never`` to keep keys as |
| 60 |
plain strings instead, for example to gather lines by arbitrary, non-node |
| 61 |
keys, or ``--interpret-keys=always`` to require that every key is a valid node |
| 62 |
set. In ``auto`` mode (the default), *clubak* interprets keys as node sets, |
| 63 |
but silently switches to treating all keys as plain strings if any key |
| 64 |
cannot be parsed. |
| 65 |
|
| 66 |
Like *clush*, *clubak* uses the :mod:`ClusterShell.MsgTree` module of the ClusterShell |
| 67 |
library. |
| 68 |
|
| 69 |
Tree trace mode (-T) |
| 70 |
^^^^^^^^^^^^^^^^^^^^ |
| 71 |
|
| 72 |
A special option ``-T, --tree``, only available with *clubak*, can switch on |
| 73 |
:class:`.MsgTree` trace mode (all keys/nodes are kept for each message element |
| 74 |
of the tree, thus allowing special output display). This mode has been first |
| 75 |
added to replace *padb* [#]_ in some cases to display a whole cluster job |
| 76 |
digested backtrace. |
| 77 |
|
| 78 |
For example:: |
| 79 |
|
| 80 |
$ cat trace_test |
| 81 |
node3: first_func() |
| 82 |
node1: first_func() |
| 83 |
node2: first_func() |
| 84 |
node5: first_func() |
| 85 |
node1: second_func() |
| 86 |
node4: first_func() |
| 87 |
node3: bis_second_func() |
| 88 |
node2: second_func() |
| 89 |
node5: second_func() |
| 90 |
node4: bis_second_func() |
| 91 |
|
| 92 |
$ cat trace_test | clubak -TL |
| 93 |
node[1-5]: |
| 94 |
first_func() |
| 95 |
node[1-2,5]: |
| 96 |
second_func() |
| 97 |
node[3-4]: |
| 98 |
bis_second_func() |
| 99 |
|
| 100 |
|
| 101 |
.. [#] *padb*, a parallel application debugger |
| 102 |
|