File: cluset.1

package info (click to toggle)
clustershell 1.9.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,228 kB
  • sloc: python: 20,978; makefile: 149
file content (492 lines) | stat: -rw-r--r-- 12,312 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "CLUSET" "1" "2025-01-23" "1.9.3" "ClusterShell User Manual"
.SH NAME
cluset \- compute advanced cluster node set operations
.SH SYNOPSIS
.INDENT 0.0
.INDENT 3.5
\fBcluset\fP [OPTIONS] [COMMAND] [nodeset1 [OPERATION] nodeset2|...]
.UNINDENT
.UNINDENT
.SH DESCRIPTION
.sp
Note: \fBcluset\fP and \fBnodeset\fP are the same command.
.sp
\fBcluset\fP is an utility command provided with the ClusterShell library which
implements some features of ClusterShell\(aqs NodeSet and RangeSet Python classes.
It provides easy manipulation of 1D or nD\-indexed cluster nodes and node
groups.
.sp
Also, \fBcluset\fP is automatically bound to the library node group resolution
mechanism. Thus, it is especially useful to enhance cluster aware
administration shell scripts.
.SH OPTIONS
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.TP
.B  \-\-version
show program\(aqs version number and exit
.TP
.B  \-h\fP,\fB  \-\-help
show this help message and exit
.TP
.BI \-s \ GROUPSOURCE\fR,\fB \ \-\-groupsource\fB= GROUPSOURCE
optional \fBgroups.conf\fP(5) group source to use
.TP
.BI \-\-groupsconf\fB= FILE
use alternate config file for groups.conf(5)
.UNINDENT
.INDENT 0.0
.TP
.B Commands:
.INDENT 7.0
.TP
.B  \-c\fP,\fB  \-\-count
show number of nodes in nodeset(s)
.TP
.B  \-e\fP,\fB  \-\-expand
expand nodeset(s) to separate nodes (see also \-S \fISEPARATOR\fP)
.TP
.B  \-f\fP,\fB  \-\-fold
fold nodeset(s) (or separate nodes) into one nodeset
.TP
.B  \-l\fP,\fB  \-\-list
list node groups, list node groups and nodes (\fB\-ll\fP) or list node groups, nodes and node count (\fB\-lll\fP). When no argument is specified at all, this command will list all node group names found in selected group source (see also \-s \fIGROUPSOURCE\fP). If any nodesets are specified as argument, this command will find node groups these nodes belongs to (individually). Optionally for each group, the fraction of these nodes being member of the group may be displayed (with \fB\-ll\fP), and also member count/total group node count (with \fB\-lll\fP). If a single hyphen\-minus (\-) is given as a nodeset, it will be read from standard input.
.TP
.B  \-L\fP,\fB  \-\-list\-all
list node groups from all group sources (\fB\-LL\fP shows nodes and \fB\-LLL\fP adds node count). Like \fB\-l\fP, if any nodesets are specified as argument, this command will find node groups these nodes belongs to (individually).
.TP
.B  \-r\fP,\fB  \-\-regroup
fold nodes using node groups (see \-s \fIGROUPSOURCE\fP)
.TP
.B  \-\-groupsources
list all active group sources (see \fBgroups.conf\fP(5))
.UNINDENT
.TP
.B Operations:
.INDENT 7.0
.TP
.BI \-x \ SUB_NODES\fR,\fB \ \-\-exclude\fB= SUB_NODES
exclude specified set
.TP
.BI \-i \ AND_NODES\fR,\fB \ \-\-intersection\fB= AND_NODES
calculate sets intersection
.TP
.BI \-X \ XOR_NODES\fR,\fB \ \-\-xor\fB= XOR_NODES
calculate symmetric difference between sets
.UNINDENT
.TP
.B Options:
.INDENT 7.0
.TP
.B  \-a\fP,\fB  \-\-all
call external node groups support to display all nodes
.TP
.BI \-\-autostep\fB= AUTOSTEP
enable a\-b/step style syntax when folding nodesets, value is min node count threshold (integer \(aq4\(aq, percentage \(aq50%\(aq or \(aqauto\(aq). If not specified, auto step is disabled (best for compatibility with other cluster tools. Example: autostep=4, \(dqnode2 node4 node6\(dq folds in node[2,4,6] but autostep=3, \(dqnode2 node4 node6\(dq folds in node[2\-6/2].
.TP
.B  \-d\fP,\fB  \-\-debug
output more messages for debugging purpose
.TP
.B  \-q\fP,\fB  \-\-quiet
be quiet, print essential output only
.TP
.B  \-R\fP,\fB  \-\-rangeset
switch to RangeSet instead of NodeSet. Useful when
working on numerical cluster ranges, eg. 1,5,18\-31
.TP
.B  \-G\fP,\fB  \-\-groupbase
hide group source prefix (always \fI@groupname\fP)
.TP
.BI \-S \ SEPARATOR\fR,\fB \ \-\-separator\fB= SEPARATOR
separator string to use when expanding nodesets
(default: \(aq \(aq)
.TP
.BI \-O \ FORMAT\fR,\fB \ \-\-output\-format\fB= FORMAT
output format (default: \(aq%s\(aq)
.TP
.BI \-I \ SLICE_RANGESET\fR,\fB \ \-\-slice\fB= SLICE_RANGESET
return sliced off result; examples of SLICE_RANGESET are \(dq0\(dq for simple index selection, or \(dq1\-9/2,16\(dq for complex rangeset selection
.TP
.BI \-\-split\fB= MAXSPLIT
split result into a number of subsets
.TP
.B  \-\-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)\(dq\(dq\(dq
.TP
.BI \-\-axis\fB= 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. \(aq1\(aq, \(aq1\-2\(aq, \(aq1,3\(aq, or by a single negative number meaning that the indices is counted from the end. Because some nodesets may have several different dimensions, axis indices are silently truncated to fall in the allowed range.
.TP
.BI \-\-pick\fB= N
pick N node(s) at random in nodeset
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
For a short explanation of these options, see \fB\-h, \-\-help\fP\&.
.sp
If a single hyphen\-minus (\-) is given as a nodeset, it will be read from
standard input.
.SH EXTENDED PATTERNS
.sp
The \fBcluset\fP command benefits from ClusterShell NodeSet basic
arithmetic addition. This feature extends recognized string patterns by
supporting operators matching all Operations seen previously. String
patterns are read from left to right, by proceeding any character
operators accordingly.
.INDENT 0.0
.TP
.B Supported character operators
.INDENT 7.0
.TP
.B \fB,\fP
indicates that the \fIunion\fP of both left and right nodeset should be
computed before continuing
.TP
.B \fB!\fP
indicates the \fIdifference\fP operation
.TP
.B \fB&\fP
indicates the \fIintersection\fP operation
.TP
.B \fB^\fP
indicates the \fIsymmetric difference\fP (XOR) operation
.UNINDENT
.sp
Care should be taken to escape these characters as needed when the shell
does not interpret them literally.
.TP
.B Examples of use of extended patterns
.INDENT 7.0
.TP
.B $ cluset \-f node[0\-7],node[8\-10]
.UNINDENT
.nf
node[0\-10]
.fi
.sp
.INDENT 7.0
.TP
.B $ cluset \-f node[0\-10]!node[8\-10]
.UNINDENT
.nf
node[0\-7]
.fi
.sp
.INDENT 7.0
.TP
.B $ cluset \-f node[0\-10]&node[5\-13]
.UNINDENT
.nf
node[5\-10]
.fi
.sp
.INDENT 7.0
.TP
.B $ cluset \-f node[0\-10]^node[5\-13]
.UNINDENT
.nf
node[0\-4,11\-13]
.fi
.sp
.TP
.B Example of advanced usage
.INDENT 7.0
.TP
.B $ cluset \-f @gpu^@slurm:bigmem!@chassis[1\-9/2]
.UNINDENT
.sp
This computes a folded nodeset containing nodes found in group @gpu and @slurm:bigmem, but not in both, minus the nodes found in odd chassis groups from 1 to 9.
.TP
.B \(dqAll nodes\(dq extension
The \fB@*\fP and \fB@SOURCE:*\fP special notations may be used in extended patterns to represent all nodes (in SOURCE) according to the \fIall\fP external shell command (see \fBgroups.conf\fP(5)) and are equivalent to:
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.TP
.B $ cluset [\-s SOURCE] \-a \-f
.UNINDENT
.UNINDENT
.UNINDENT
.TP
.B Group names in expressions
The \fB@@SOURCE\fP notation may be used to access all group names from the specified SOURCE (or from the default group source when just \fB@@\fP is used) in node set expressions; this works with either file\-based group sources or with external group sources that have the \fIlist\fP upcall defined (see \fBgroups.conf\fP(5)):
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.TP
.B $ cluset \-f @@rack
.UNINDENT
.nf
J[1\-3]
.fi
.sp
.UNINDENT
.UNINDENT
.UNINDENT
.SH NODE WILDCARDS
.sp
Any wildcard mask found is matched against all nodes from the group source (see \fBgroups.conf\fP(5) and the \fB\-a/\-\-all\fP option above).
\fB*\fP means match zero or more characters of any type; \fB?\fP means match exactly one character of any type.
This can be especially useful for server farms, or when cluster node names differ.
.INDENT 0.0
.TP
.B Say that your group configuration is set to return the following “all nodes”:
.INDENT 7.0
.TP
.B $ cluset \-f \-a
.UNINDENT
.nf
bckserv[1\-2],dbserv[1\-4],wwwserv[1\-9]
.fi
.sp
.TP
.B Then, you can use wildcards to select particular nodes, as shown below:
.INDENT 7.0
.TP
.B $ cluset \-f \(aqwww*\(aq
.UNINDENT
.nf
wwwserv[1\-9]
.fi
.sp
.INDENT 7.0
.TP
.B $ cluset \-f \(aqwww*[1\-4]\(aq
.UNINDENT
.nf
wwwserv[1\-4]
.fi
.sp
.INDENT 7.0
.TP
.B $ cluset \-f \(aq*serv1\(aq
.UNINDENT
.nf
bckserv1,dbserv1,wwwserv1
.fi
.sp
.UNINDENT
.sp
Wildcard masks are resolved prior to extended patterns, but each mask is evaluated as a whole node set operand.
In the example below, we select all nodes matching \fB*serv*\fP before removing all nodes matching \fBwww*\fP:
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.TP
.B $ cluset  \-f \(aq*serv*!www*\(aq
.UNINDENT
.nf
bckserv[1\-2],dbserv[1\-4]
.fi
.sp
.UNINDENT
.UNINDENT
.SH EXIT STATUS
.sp
An exit status of zero indicates success of the \fBcluset\fP command. A non\-zero
exit status indicates failure.
.SH EXAMPLES
.INDENT 0.0
.TP
.B Getting the node count
.INDENT 7.0
.TP
.B $ cluset \-c node[0\-7,32\-159]
.UNINDENT
.nf
136
.fi
.sp
.INDENT 7.0
.TP
.B $ cluset \-c node[0\-7,32\-159] node[160\-163]
.UNINDENT
.nf
140
.fi
.sp
.INDENT 7.0
.TP
.B $ cluset \-c dc[1\-2]n[100\-199]
.UNINDENT
.nf
200
.fi
.sp
.INDENT 7.0
.TP
.B $ cluset \-c @login
.UNINDENT
.nf
4
.fi
.sp
.TP
.B Folding nodesets
.INDENT 7.0
.TP
.B $ cluset \-f node[0\-7,32\-159] node[160\-163]
.UNINDENT
.nf
node[0\-7,32\-163]
.fi
.sp
.INDENT 7.0
.TP
.B $ echo node3 node6 node1 node2 node7 node5 | cluset \-f
.UNINDENT
.nf
node[1\-3,5\-7]
.fi
.sp
.INDENT 7.0
.TP
.B $ cluset \-f dc1n2 dc2n2 dc1n1 dc2n1
.UNINDENT
.nf
dc[1\-2]n[1\-2]
.fi
.sp
.INDENT 7.0
.TP
.B $ cluset \-\-axis=1 \-f dc1n2 dc2n2 dc1n1 dc2n1
.UNINDENT
.nf
dc[1\-2]n1,dc[1\-2]n2
.fi
.sp
.TP
.B Expanding nodesets
.INDENT 7.0
.TP
.B $ cluset \-e node[160\-163]
.UNINDENT
.nf
node160 node161 node162 node163
.fi
.sp
.INDENT 7.0
.TP
.B $ echo \(aqdc[1\-2]n[2\-6/2]\(aq | cluset \-e
.UNINDENT
.nf
dc1n2 dc1n4 dc1n6 dc2n2 dc2n4 dc2n6
.fi
.sp
.TP
.B Excluding nodes from nodeset
.INDENT 7.0
.TP
.B $ cluset \-f node[32\-159] \-x node33
.UNINDENT
.nf
node[32,34\-159]
.fi
.sp
.TP
.B Computing nodesets intersection
.INDENT 7.0
.TP
.B $ cluset \-f node[32\-159] \-i node[0\-7,20\-21,32,156\-159]
.UNINDENT
.nf
node[32,156\-159]
.fi
.sp
.TP
.B Computing nodesets symmetric difference (xor)
.INDENT 7.0
.TP
.B $ cluset \-f node[33\-159] \-\-xor node[32\-33,156\-159]
.UNINDENT
.nf
node[32,34\-155]
.fi
.sp
.TP
.B Splitting nodes into several nodesets (expanding results)
.INDENT 7.0
.TP
.B $ cluset \-\-split=3 \-e node[1\-9]
.UNINDENT
.nf
node1 node2 node3
node4 node5 node6
node7 node8 node9
.fi
.sp
.TP
.B Splitting non\-contiguous nodesets (folding results)
.INDENT 7.0
.TP
.B $ cluset \-\-contiguous \-f node2 node3 node4 node8 node9
.UNINDENT
.nf
node[2\-4]
node[8\-9]
.fi
.sp
.INDENT 7.0
.TP
.B $ cluset \-\-contiguous \-f dc[1,3]n[1\-2,4\-5]
.UNINDENT
.nf
dc1n[1\-2]
dc1n[4\-5]
dc3n[1\-2]
dc3n[4\-5]
.fi
.sp
.UNINDENT
.SH HISTORY
.sp
\fBcluset\fP was added in 1.7.3 to avoid a conflict with xCAT\(aqs \fBnodeset\fP
command and also to conform with ClusterShell\(aqs \(dqclu*\(dq command nomenclature.
.SH SEE ALSO
.sp
\fBclubak\fP(1), \fBclush\fP(1), \fBnodeset\fP(1), \fBgroups.conf\fP(5).
.sp
 <http://clustershell.readthedocs.org/> 
.SH BUG REPORTS
.INDENT 0.0
.TP
.B Use the following URL to submit a bug report or feedback:
 <https://github.com/cea\-hpc/clustershell/issues> 
.UNINDENT
.SH AUTHOR
Stephane Thiell <sthiell@stanford.edu>
.SH COPYRIGHT
GNU Lesser General Public License version 2.1 or later (LGPLv2.1+)
.\" Generated by docutils manpage writer.
.