@@ -367,8 +367,10 @@ is not doable. But if the call return zero, for instance, for a non-existing
367367group, the user will not receive any error when trying to resolve such unknown
368368group. The desired behavior is up to the system administrator.
369369
370- Slurm bindings (example)
371- """"""""""""""""""""""""
370+ .. _group-slurm-bindings :
371+
372+ Slurm group bindings
373+ """"""""""""""""""""
372374
373375Enable Slurm node group bindings by renaming the example configuration file
374376usually installed as ``/etc/clustershell/groups.conf.d/slurm.conf.example `` to
@@ -445,15 +447,15 @@ allocated for jobs belonging to the username::
445447
446448 [slurmuser,su]
447449 map: squeue -h -u $GROUP -o "%N" -t R
448- list: squeue -h -o "%i " -t R
450+ list: squeue -h -o "%u " -t R
449451 reverse: squeue -h -w $NODE -o "%i"
450452 cache_time: 60
451453
452454Example of use with :ref: `clush <clush-tool >` to execute a command on all nodes
453455with running jobs of username::
454456
455457 $ clush -bw@su:username 'df -Ph /scratch'
456- $ clush -bw@su:username 'du -s /scratch/username'
458+ $ clush -bw@su:username 'du -s /scratch/username'
457459
458460:ref: `cache_time <group-external-caching >` is also set to 60 seconds instead
459461of the default (3600s) to avoid caching results in memory for too long, because
@@ -467,6 +469,50 @@ You can then easily find nodes associated with a Slurm job ID::
467469 $ nodeset -f @sj:686518
468470 cluster-[0003,0005,0010,0012,0015,0017,0021,0055]
469471
472+ .. _group-xcat-bindings :
473+
474+ xCAT group bindings
475+ """""""""""""""""""
476+
477+ Enable xCAT node group bindings by renaming the example configuration file
478+ usually installed as ``/etc/clustershell/groups.conf.d/xcat.conf.example `` to
479+ ``xcat.conf ``. A single group source is defined in this file and is detailed
480+ below.
481+
482+ .. warning :: xCAT installs its own `nodeset`_ command which
483+ usually takes precedence over ClusterShell's :ref: `nodeset-tool ` command.
484+ In that case, simply use :ref: `cluset <cluset-tool >` instead.
485+
486+ While examples below are based on the :ref: `cluset-tool ` tool, all Python
487+ tools using ClusterShell and the :class: `.NodeSet ` class will automatically
488+ benefit from these additional node groups.
489+
490+ .. highlight :: ini
491+
492+ The section **xcat ** defines a group source based on xCAT static node groups::
493+
494+ [xcat]
495+
496+ # list the nodes in the specified node group
497+ map: lsdef -s -t node $GROUP | cut -d' ' -f1
498+
499+ # list all the nodes defined in the xCAT tables
500+ all: lsdef -s -t node | cut -d' ' -f1
501+
502+ # list all groups
503+ list: lsdef -t group | cut -d' ' -f1
504+
505+ .. highlight :: console
506+
507+ Example of use with :ref: `cluset-tool `::
508+
509+ $ lsdef -s -t node dtn
510+ sh-dtn01 (node)
511+ sh-dtn02 (node)
512+
513+ $ cluset -s xcat -f @dtn
514+ sh-dtn[01-02]
515+
470516.. highlight :: text
471517
472518.. _defaults-config :
@@ -493,5 +539,40 @@ following files is found, in priority order::
493539 $HOME/.config/clustershell/defaults.conf (only if $XDG_CONFIG_HOME is not defined)
494540 $HOME/.local/etc/clustershell/defaults.conf
495541
542+ Use case: rsh
543+ ^^^^^^^^^^^^^^
544+
545+ If your cluster uses a rsh variant like ``mrsh `` or ``krsh ``, you may want to
546+ change it in the library defaults.
547+
548+ An example file is usually available in
549+ ``/usr/share/doc/clustershell-*/examples/defaults.conf-rsh `` and could be
550+ copied to ``/etc/clustershell/defaults.conf `` or to an alternate path
551+ described above. Basically, the change consists in defining an alternate
552+ distant worker by Python module name as follow::
553+
554+ [task.default]
555+ distant_workername: Rsh
556+
557+
558+ .. _defaults-config-slurm :
559+
560+ Use case: Slurm
561+ ^^^^^^^^^^^^^^^
562+
563+ If your cluster naming scheme has multiple dimensions, as in ``node-93-02 ``, we
564+ recommend that you disengage some nD folding when using Slurm, which is
565+ currently unable to detect some multidimensional node indexes when not
566+ explicitly enclosed with square brackets.
567+
568+ To do so, define ``fold_axis `` to -1 in the :ref: `defaults-config ` so that nD
569+ folding is only computed on the last axis (seems to work best with Slurm)::
570+
571+ [nodeset]
572+ fold_axis: -1
573+
574+ That way, node sets computed by ClusterShell tools can be passed to Slurm
575+ without error.
496576
497577.. _ConfigParser : http://docs.python.org/library/configparser.html
578+ .. _nodeset : https://xcat-docs.readthedocs.io/en/stable/guides/admin-guides/references/man8/nodeset.8.html
0 commit comments