Skip to content

Commit 74604c5

Browse files
committed
doc: add documentation for --pick option
Part of #311. Change-Id: I8cf97e0b48593f723af1396dd64f7a1a0c51dc7b
1 parent 85180f1 commit 74604c5

File tree

6 files changed

+42
-11
lines changed

6 files changed

+42
-11
lines changed

doc/man/man1/clush.1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" Man page generated from reStructuredText.
22
.
3-
.TH CLUSH 1 "2016-02-28" "1.7.1" "ClusterShell User Manual"
3+
.TH CLUSH 1 "2016-06-16" "1.7.2" "ClusterShell User Manual"
44
.SH NAME
55
clush \- execute shell commands on a cluster
66
.
@@ -190,6 +190,9 @@ path to a file containing a list of single hosts, node sets or node groups, sepa
190190
.TP
191191
.BI \-\-topology\fB= FILE
192192
topology configuration file to use for tree mode
193+
.TP
194+
.BI \-\-pick\fB= N
195+
pick N node(s) at random in nodeset
193196
.UNINDENT
194197
.TP
195198
.B Output behaviour:

doc/man/man1/nodeset.1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" Man page generated from reStructuredText.
22
.
3-
.TH NODESET 1 "2016-02-28" "1.7.1" "ClusterShell User Manual"
3+
.TH NODESET 1 "2016-06-16" "1.7.2" "ClusterShell User Manual"
44
.SH NAME
55
nodeset \- compute advanced nodeset operations
66
.
@@ -137,6 +137,9 @@ split result into contiguous subsets (ie. for nodeset, subsets will contain node
137137
.TP
138138
.BI \-\-axis\fB= RANGESET
139139
for nD nodesets, fold along provided axis only. Axis are indexed from 1 to n and can be specified here either using the rangeset syntax, eg. \(aq1\(aq, \(aq1\-2\(aq, \(aq1,3\(aq, or by a single negative number meaning that the indice is counted from the end. Because some nodesets may have several different dimensions, axis indices are silently truncated to fall in the allowed range.
140+
.TP
141+
.BI \-\-pick\fB= N
142+
pick N node(s) at random in nodeset
140143
.UNINDENT
141144
.UNINDENT
142145
.UNINDENT

doc/sphinx/tools/clush.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,25 @@ For example::
7777
Selecting all nodes
7878
"""""""""""""""""""
7979

80-
Finally, a special option ``-a`` (without argument) can be used to select
81-
**all** nodes, in the sense of ClusterShell node groups (see
80+
The special option ``-a`` (without argument) can be used to select **all**
81+
nodes, in the sense of ClusterShell node groups (see
8282
:ref:`node groups configuration <groups-config>` for more details on special
8383
**all** external shell command upcall). If not properly configured, the
8484
``-a`` option may lead to a runtime error like::
8585

8686
clush: External error: Not enough working external calls (all, or map +
8787
list) defined to get all node
8888

89+
Picking node(s) at random
90+
"""""""""""""""""""""""""
91+
92+
Use ``--pick`` with a maximum number of nodes you wish to pick randomly from
93+
the targeted node set. *clush* will then run only on selected node(s). The
94+
following example will run a script on a single random node picked from the
95+
``@compute`` group::
96+
97+
$ clush -w @compute --pick=1 ./nonreg-single-client-fs-io.sh
98+
8999
Host files
90100
""""""""""
91101

doc/sphinx/tools/nodeset.rst

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,10 @@ patterns" (inherited from :class:`.NodeSet` extended pattern feature, see
422422
Special operations
423423
^^^^^^^^^^^^^^^^^^
424424

425-
Three special operations are currently available: node set slicing, splitting
426-
on a predefined node count and splitting non-contiguous subsets. There are all
427-
explained below.
425+
A few special operations are currently available: node set slicing, splitting
426+
on a predefined node count, splitting non-contiguous subsets, choosing fold
427+
axis (for multidimensional node sets) and picking N nodes randomly. They are
428+
all explained below.
428429

429430
Slicing
430431
"""""""
@@ -567,6 +568,18 @@ useful to fold along the last axis whatever number of dimensions used::
567568
comp-1-[1-36],comp-2-[1-36],login-[1-2]
568569

569570

571+
Picking N node(s) at random
572+
"""""""""""""""""""""""""""
573+
574+
Use ``--pick`` with a maximum number of nodes you wish to pick randomly from
575+
the resulting node set (or from the resulting range set with ``-R``)::
576+
577+
$ nodeset --pick=1 -f node11 node12 node13
578+
node12
579+
$ nodeset --pick=2 -f node11 node12 node13
580+
node[11,13]
581+
582+
570583
.. _nodeset-groups:
571584

572585
Node groups

doc/txt/clush.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ execute shell commands on a cluster
77
-----------------------------------
88

99
:Author: Stephane Thiell <[email protected]>
10-
:Date: 2016-02-28
10+
:Date: 2016-06-16
1111
:Copyright: CeCILL-C V1
12-
:Version: 1.7.1
12+
:Version: 1.7.2
1313
:Manual section: 1
1414
:Manual group: ClusterShell User Manual
1515

@@ -144,6 +144,7 @@ Selecting target nodes:
144144
--hostfile=FILE, --machinefile=FILE
145145
path to a file containing a list of single hosts, node sets or node groups, separated by spaces and lines (may be specified multiple times, one per file)
146146
--topology=FILE topology configuration file to use for tree mode
147+
--pick=N pick N node(s) at random in nodeset
147148

148149
Output behaviour:
149150
-q, --quiet be quiet, print essential output only

doc/txt/nodeset.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ compute advanced nodeset operations
77
-----------------------------------
88

99
:Author: Stephane Thiell <[email protected]>
10-
:Date: 2016-02-28
10+
:Date: 2016-06-16
1111
:Copyright: CeCILL-C V1
12-
:Version: 1.7.1
12+
:Version: 1.7.2
1313
:Manual section: 1
1414
:Manual group: ClusterShell User Manual
1515

@@ -75,6 +75,7 @@ OPTIONS
7575
--split=MAXSPLIT split result into a number of subsets
7676
--contiguous split result into contiguous subsets (ie. for nodeset, subsets will contain nodes with same pattern name and a contiguous range of indexes, like foobar[1-100]; for rangeset, subsets with consists in contiguous index ranges)"""
7777
--axis=RANGESET for nD nodesets, fold along provided axis only. Axis are indexed from 1 to n and can be specified here either using the rangeset syntax, eg. '1', '1-2', '1,3', or by a single negative number meaning that the indice is counted from the end. Because some nodesets may have several different dimensions, axis indices are silently truncated to fall in the allowed range.
78+
--pick=N pick N node(s) at random in nodeset
7879

7980

8081
For a short explanation of these options, see ``-h, --help``.

0 commit comments

Comments
 (0)