Debian Codegraph @

doc/man/man1/nodeset.1

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