> This page is for version 11 (default).
> For other versions, use one of these documentation indexes:
> - 11 (default): https://docs.nvidia.com/base-command-manager/product-manuals/11/llms.txt
> - 10: https://docs.nvidia.com/base-command-manager/product-manuals/10/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/base-command-manager/product-manuals/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/base-command-manager/product-manuals/_mcp/server.

# Workload Management

For clusters that have many users and a significant load, a workload manager (WLM) system allows a more efficient use of resources to be enforced for all users than if there were no such system in place. This is because without resource management, there is a tendency for each individual user to over-exploit common resources.

When a WLM is used, the end user can submit a job to it. This can be done interactively, but it is typically done as a non-interactive batch job.

The WLM assigns resources to the job, and checks the current availability as well as checking its estimates of the future availability of the cluster resources that the job is asking for. The WLM then schedules and executes the job based on the assignment criteria that the administrator has set for the WLM system. After the job has finished executing, the job output is delivered back to the user.

Among the hardware resources that can be used for a job are GPUs. Installing CUDA software to enable the use of GPUs is described in [section 9 of the *Installation Manual*](/installation/nvidiagpus). Configuring GPU settings for BCM is described in section [3.17.2](/admin/configuring#3172-configuring-gpu-settings) of the *Administrator Manual*. Configuring GPU settings for an individual WLM is described in the section on getting that particular WLM up and running.

The details of job submission from a user’s perspective are covered in the *User Manual*.

Sections [7.1](#71-workload-managers-choices)–[7.5](#75-configuring-and-running-individual-workload-managers) cover the installation procedure to get a WLM up and running.

Sections [7.6](#76-using-base-view-with-workload-management) –[7.7](#77-using-cmsh-with-workload-management) describe how Base View and `cmsh` are used to view and handle jobs, queues and node drainage.

Section [7.8](#78-examples-of-workload-management-assignment) shows examples of WLM assignments handled by BCM.

Section [7.9](#79-power-saving-with-cm-scale) describes the power saving features of WLMs.

Section [7.10](#710-cgroups) describes cgroups, a resources limiter, mostly in the context of WLMs.

Section [7.11](#711-custom-node-parameters) describes WLM customizations for settings other than the common settings covered by BCM.

## 7.1  Workload Managers Choices

Some WLM packages are installed by default, others require registration from the distributor before installation.

During cluster installation, a WLM can be chosen ([figure 3.9 of the *Installation Manual*](/installation/installing#fig-workload)) for setting up. The choices are:

* **Slurm**: Available as version 25.05 or 25.11. Slurm is a free (GPL) job scheduler, with commercial support.

* **LSF v10.1**: IBM Spectrum LSF (Load Sharing Facility) version 10.1, is a further development of what used to be IBM Platform LSF.

* **None**: For clusters that need no HPC job-scheduling.

The WLMs in the preceding list can also be chosen and set up later using the `cm-wlm-setup` tool (section [7.3](#73-installation-of-workload-managers)).

After installation, if there are no major changes in the WLM for updated versions of the workload managers, then

* WLMs that are packaged with BCM (Slurm) can have their packages updated using standard package update commands (`yum update` and similar). The installation and configuration of the WLM from the updated packages is carried out as described later on in this chapter.

* WLMs such as LSF that are installed by picking up software from the vendor can be updated by following vendor guidelines.

## 7.2  Forcing Jobs To Run In A Workload Management System

Another preliminary step is to consider forcing users to run jobs only within the WLM system. Having jobs run via a WLM is normally a best practice.

For convenience, BCM defaults to allowing users to log in via `ssh` to a node, using the authorized keys files stored in each users directory in `/home` (section [2.3.2](/admin/clustermanagement#232-logins-using-ssh)). This allows users to run their processes without restriction, that is, outside the WLM system. For clusters with a significant load this policy results in a sub-optimal use of resources, since such unplanned-for jobs disturb any already-running jobs.

Disallowing user logins to nodes, so that users have to run their jobs through the WLM system, means that jobs are then distributed to the nodes only according to the planning of the WLM. If planning is based on sensible assignment criteria, then resources use is optimized—which is the entire aim of a WLM in the first place.

### 7.2.1  Disallowing User Logins To Regular Nodes Via `cmsh`

The `usernodelogin` setting of `cmsh` restricts direct user logins from outside the WLM, and is thus one way of preventing the user from using node resources in an unaccountable manner. The `usernodelogin` setting is applicable to node categories only, rather than to individual nodes.

In `cmsh` the attribute of `usernodelogin` is set from within `category` mode:

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% category use default
[basecm11->category[default]]% set usernodelogin onlywhenjob
[basecm11->category*[default*]]% commit
```

The attributes for `usernodelogin` are:

* `always` (the default): This allows all users to `ssh` directly into a node at any time.

* `never`: This allows no user other than root to directly `ssh` into the node.

* `onlywhenjob`: This allows the user to `ssh` directly into the node when a job is running on it. It typically also prevents other users from doing a direct `ssh` into the same node during the job run, since typically the WLM is set up so that only one job runs per node. However, an `ssh` session that is already running is not automatically terminated after the job is done.

  * Some cluster administrators may wish to allow some special user accounts to override the `onlywhenjob` setting, for example for diagnostic purposes. Before giving the details of how to override the setting, some background explanation is probably useful:

    The `onlywhenjob` setting works with the PAM system, and adds the following line to `/etc/pam.d/sshd` on the regular nodes:

    ```bash
        account          required       pam_bright.so
    ```

    Nodes with the `onlywhenjob` restriction can be configured to allow a particular set of users to access them, despite the restriction, by allowing them with the PAM system, as follows: Within the software image \<*node image*> used by the node, that is under `/cm/images/` \<*node image*>, the administrator can add the set of user accounts to the file `etc/security/pam_bright.d/pam_allow.conf`. This file is installed in the software image with a chroot installation (section [9.4](/admin/softwareimagemanagement#94-managing-a-package-in-a-software-image-and-running-it-on-nodes)) of the `cm-libpam` package.

    Groups of users can be allowed using the file `etc/security/pam_bright.d/pam_allow_group.conf`.

    Other adjustments to PAM configuration, such as the number of attempted logins and the associated wait time per login, can be carried by editing the `/etc/security/pam_bright.d/cm-check-alloc.conf` file.

    The image can then be updated to allow the users, by running the `imageupdate` command in `cmsh` (section [5.6.2](/admin/provisioning#562-updating-running-nodes-with-cmsh-using-imageupdate)), or by clicking the `Update node` option in Base View (section [5.6.3](/admin/provisioning#563-updating-running-nodes-with-base-view-using-the-update-node-option)).

### 7.2.2  Disallowing User Logins To Regular Nodes Via Base View

In Base View, user node login access is set via a category setting, for example for the `default` category via the navigation path in figure [7.1](#fig-base-view-workloadmanagement-user-node-login): <code>Grouping > Categories\[default] > > Settings > User node login</code>

![Disallowing user logins to nodes via Base View](/base-command-manager/product-manuals/_fern-img/45e7b91a70ff02b4b916dd0bb32757b837f4a5d4610a3c704a481e44e122df5d.webp)

*Figure 7.1: Disallowing user logins to nodes via Base View*

### 7.2.3  Disallowing Other User Processes Outside Of Workload Manager User Processes

Besides disabling user logins, administrators may choose to disable interactive jobs in the WLM as an additional measure to prevent users from starting jobs on other nodes.

Administrators may also choose to set up scripts that run after job execution. Such scripts can terminate user processes outside the WLM, as part of a policy, or for general administrative hygiene. These are `Epilog` scripts and are part of the WLM.

The WLM documentation has more on configuring these options.

### 7.2.4  High Availability By Workload Managers

NVIDIA Base Command Manager uses the existing built-in high availability (HA) functionalities of workload managers as much as possible. A double server HA configuration with the existing built-in HA functionality can be carried out using the `cm-wlm-setup` utility (section [7.3](#73-installation-of-workload-managers)), or using the Base View HA wizard (section [7.4.1](#741-enabling-and-disabling-a-wlm-with-base-view)). The built-in functionality makes use of the primary WLM server and secondary WLM server, which are placed on separate nodes.

The HA configuration aspect (section [15.1.3](/admin/ha#1513-services-in-bcm-ha-setups)) in this case means that a WLM server role is assigned to both the WLM primary and the WLM secondary nodes. These primary WLM and secondary WLM servers can then:

* both be on head nodes,

* both be on regular (compute) nodes

It is not possible to configure a mixed setup—that is with one head node and one regular node—for the WLM servers on an HA setup.

In a non-HA cluster, the WLM `primaryserver` value is set to the head node by default.

**Example**

```bash
[head->wlm[slurm]]% get primaryserver
head
```

This is because NVIDIA Base Command Manager always configures the primary WLM server on the primary cluster head node.

If both the head nodes are configured with the WLM server roles, then the WLM `primaryserver` value is set to the primary cluster head node. This is because NVIDIA Base Command Manager always configures the primary WLM server on the primary cluster head node, and the backup WLM server on the secondary head node.

**Example**

```bash
[head1->wlm[slurm]]% get primaryserver
head1
[head1->wlm[slurm]]% exit
root@head1:~# ssh head2 "cmha makeactive"
...
...[logging into the newly active head node, and checking where the primary server is:]...
[head2->wlm[slurm]]% get primaryserver
head1
```

If the parameter `primaryserver` is unset in `wlm` mode, and the Slurm server role is assigned to the head nodes, then the `slurmctld` service is always started on both head nodes. During a failover, the Slurm configuration is regenerated and both `slurmctld` services are restarted. The primary `slurmctld` is always on the active head node.

If two regular nodes are configured with the WLM server roles instead, then in the cluster entity configuration the `primaryserver` parameter is set to one of the compute nodes.

The cluster primary head node and the WLM primary server should not be confused. In particular, the active cluster head node and active workload manager server are not necessarily the same for the case of the Slurm or LSF workload managers. For these, if the passive cluster head node becomes an active cluster head node without a crash, then this does not trigger a passive WLM server on the newly active head node to also become an active WLM server. Thus, the WLM server can be active on a passive head node, and vice versa, because the WLM primary server is independent of the cluster primary head node.

#### 7.2.4.1  Slurm High Availability, `scontrol takeover` And `slurmstartpolicy`

This section considers some Slurm high availability issues on running `scontrol takeover` with BCM integration.

**Logical steps during the Slurm takeover between head nodes:** Slurm high availability normally waits a short while with moving its control activity over to a passive head node that has just been made active. After a short delay, the Slurm failover algorithm is followed so that the Slurm controller (`slurmctld`) takes over operations on the newly active head node.

Slurm can speed up takeover by running `scontrol takeover` from the Bash shell on the node with the secondary `slurmctld`. Running `scontrol takeover` stops the primary `slurmctld` and triggers the Slurm failover algorithm.

This can be useful if the administrator wants to carry out maintenance on the usually active head node. Carrying out the takeover lets the Slurm service remain available, and stops the Slurm primary controller following the newly active head node.

The logic on how this works in BCM is:

1. The production state starts with

   * an active primary

   * a passive secondary

   * the primary head node set up as the primary Slurm controller

2. the administrator runs `cmha makeactive` on the secondary passive. This causes the following to happen:

* `scontrol takeover` is run by CMDaemon on the secondary passive

* CMDaemon goes into the passive state on the primary node, and `slurmctld` on the primary node stops

* CMDaemon goes into the active state on the secondary node, and `slurmctld` on the secondary node starts

3. there is no interruption in Slurm services, because with `scontrol takeover` CMDaemon has forced the backup `slurmctld` to take over

4. the administrator can now carry out maintenance on the primary (now passive) head node

5. once maintenance has been completed, the administrator can optionally reboot the primary (passive) head node, and then make it active again with `cmha makeactive` to get back to the original production state

The problem with the preceding logic is that by default BCM automatically restarts a stopped `slurmctld` that it notices. This means that the results of `scontrol takeover` in steps 2 and 3 are unknown if carried out manually. That is, it is not practical to run the `scontrol takeover` command directly from Bash because it is possible to unintentionally configure the primary and backup `slurmctld` with an incorrect status.

To deal with this problem cleanly, CMDaemon provides the `slurmctldstartpolicy` parameter, described next.

**The `slurmctldstartpolicy` parameter and Slurm takeover behavior:** The `slurmctldstartpolicy` parameter can take the following values to decide the `slurmctld` behavior during `scontrol takeover`:

* `TAKEOVER`: The default value on an HA cluster.

* `ALWAYS`: The default value on a non-HA cluster.

* `ACTIVEONLY`: Useful only if `/cm/shared` is not mounted on both head nodes at the same time. For example, as in DAS (Direct Attached Storage), which should never be used anyway for shared storage in a production system.

1. If within NVIDIA Base Command Manager, in the `SlurmServerRole`, the `slurmctldstartpolicy` parameter is set to `TAKEOVER`, then disabling the automatic restart of the `slurmctld` service is unnecessary:

   ```bash
   [root@basecm11 ~]# cmsh
   [basecm11-]% configurationoverlay
   [basecm11-]>configurationoverlay]% use slurm-server
   [basecm11->configurationoverlay[slurm-server]]% roles
   [basecm11->configurationoverlay[slurm-server]->roles]% use slurmserver
   [basecm11->configurationoverlay[slurm-server]->roles[slurmserver]]% set slurmctldstartpolicy TAKEOVER
   [basecm11->configurationoverlay*[slurm-server*]->roles*[slurmserver*]]% commit
   ```

   The setting value can be cleared with:

   ```bash
   [basecm11->configurationoverlay[slurm-server]->roles[slurmserver]]% set slurmctldstartpolicy ALWAYS
   [basecm11->configurationoverlay*[slurm-server*]->roles*[slurmserver*]]% commit
   ```

2. If `cm-wlm-setup` installs Slurm on an HA cluster, then the `slurmctldstartpolicy` parameter can be set in one of the TUI screens during the session. Before HA is configured, the parameter has a default value of `ALWAYS`. After HA is configured it has a default value of `TAKEOVER`. The default value of `TAKEOVER` causes `prefailoverscript` in the `failover` submode (section [15.4.6](/admin/ha#1546-high-availability-parameters)) to take the value `/cm/local/apps/cmd/scripts/slurm.takeover.sh`

3. If `cm-wlm-setup` installs Slurm on a non-HA cluster, then the `prefailoverscript` parameter must be set within the `failover` submode of `partition` mode:

   ```bash
   [basecm11->partition[base]->failover]% set prefailoverscript /cm/local/apps/cmd/scripts/slurm.takeover.sh
   [basecm11->partition*[base*]->failover*]% commit
   ```

   This ensures that the active head node is taken over by Slurm during a change of the active head node.

The takeover is temporary. If the head node which has the Slurm primary `slurmctld` on it is restarted, or if the service itself is restarted manually, then the primary `slurmctld` takes back its role, as per Slurm documentation.

For a Slurm cluster with a single `slurmctld`, where the Slurm server role is assigned to a single compute node or the BCM cluster has only one head node, the parameter `slurmctldstartpolicy` should be set to `ALWAYS`, which is the default.

Table [7.2.4.1](#7241-slurm-high-availability-scontrol-takeover-and-slurmstartpolicy) shows what `slurmctld` does when the `slurmctldstartpolicy` parameter is set to `TAKEOVER` and when in `SlurmWlmCluster` the parameter `primaryserver` is set. The detailed behavior per head node depends on whether the head nodes are active or primary:

<table>
  <colgroup>
    <col />

    <col />

    <col />

    <col />

    <col />
  </colgroup>

  <thead>
    <tr>
      <th>
        **Node pair**
      </th>

      <th>
        **Is `slurmctldstartpolicy` TAKEOVER?**
      </th>

      <th>
        **Active node?**
      </th>

      <th>
        **Slurm primary node?**
      </th>

      <th>
        **`slurmctld` starts?**
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        Head001
      </td>

      <td>
        `no`
      </td>

      <td>
        \*
      </td>

      <td>
        \*
      </td>

      <td>
        yes
      </td>
    </tr>

    <tr>
      <td>
        Head002
      </td>

      <td>
        `no`
      </td>

      <td>
        \*
      </td>

      <td>
        \*
      </td>

      <td>
        yes
      </td>
    </tr>

    <tr>
      <td colspan="5" />
    </tr>

    <tr>
      <td>
        Head001
      </td>

      <td>
        `yes`
      </td>

      <td>
        yes
      </td>

      <td>
        yes
      </td>

      <td>
        yes
      </td>
    </tr>

    <tr>
      <td>
        Head002
      </td>

      <td>
        `yes`
      </td>

      <td>
        no
      </td>

      <td>
        no
      </td>

      <td>
        yes
      </td>
    </tr>

    <tr>
      <td colspan="5" />
    </tr>

    <tr>
      <td>
        Head001
      </td>

      <td>
        `yes`
      </td>

      <td>
        yes
      </td>

      <td>
        no
      </td>

      <td>
        yes
      </td>
    </tr>

    <tr>
      <td>
        Head002
      </td>

      <td>
        `yes`
      </td>

      <td>
        no
      </td>

      <td>
        yes
      </td>

      <td>
        no
      </td>
    </tr>

    <tr>
      <td colspan="5" />
    </tr>

    <tr>
      <td>
        Head001
      </td>

      <td>
        `yes`
      </td>

      <td>
        no
      </td>

      <td>
        yes
      </td>

      <td>
        no
      </td>
    </tr>

    <tr>
      <td>
        Head002
      </td>

      <td>
        `yes`
      </td>

      <td>
        yes
      </td>

      <td>
        no
      </td>

      <td>
        yes
      </td>
    </tr>

    <tr>
      <td colspan="5" />
    </tr>

    <tr>
      <td>
        Head001
      </td>

      <td>
        `yes`
      </td>

      <td>
        no
      </td>

      <td>
        no
      </td>

      <td>
        yes
      </td>
    </tr>

    <tr>
      <td>
        Head002
      </td>

      <td>
        `yes`
      </td>

      <td>
        yes
      </td>

      <td>
        yes
      </td>

      <td>
        yes
      </td>
    </tr>
  </tbody>
</table>

\*    any value of `yes` or `no`

\


Table [7.2.4.1](#7241-slurm-high-availability-scontrol-takeover-and-slurmstartpolicy) `slurmctldstartpolicy` parameter and `slurmctld`

**Slurm controller high availability on compute nodes:** If the Slurm server role is assigned to two compute nodes, the TAKEOVER policy is configured automatically only when both nodes belong to a failover group. In this configuration, `slurmctld` does not start on the primary node while the secondary node is active.

## 7.3  Installation Of Workload Managers

Normally the administrator selects a WLM to be used during BCM installation ([figure 3.9 of the *Installation Manual*](/installation/installing#fig-workload)). A WLM may however also be added and configured after BCM has been installed, by using `cm-wlm-setup`, which is part of the `cm-setup` package, or by using the Base View WLM wizard.

With most other objects, BCM front ends—`cmsh` and Base View—can be used to create a new object from scratch, or can clone a new object from another existing object. However, the front ends cannot do this for a WLM object. An attempt to create or clone a new WLM object using `cmsh` or Base View is prohibited by the front ends, because there are many pitfalls possible in configuration.

A new WLM object, and WLM instance, can therefore only be installed via `cm-wlm-setup`, the Base View WLM wizard, or by selecting a WLM during the initial BCM installation.

### 7.3.1  Running `cm-wlm-setup` In CLI Mode

The recommended way to run the `cm-wlm-setup` utility is without options or arguments, in which case a TUI dialog starts up. A TUI session run with `cm-wlm-setup` is covered in section [7.3.2](#732-running-cm-wlm-setup-as-a-tui).

However, the `cm-wlm-setup` utility can alternatively be used in a non-GUI, command-line, mode, with options and arguments. The utility has the following usage:

```bash
[root@basecm11 ~]# cm-wlm-setup -h
usage: Workload manager setup cm-wlm-setup [-c <config_file>]
                                           [--setup | --disable]
                                           [--wlm <name>]
                                           [--server-nodes SERVER_NODES]
                                           [--server-primary SERVER_PRIMARY]
                                           [--server-overlay-name SERVER_OVERLAY_NAME]
                                           [--server-overlay-priority SERVER_OVERLAY_PRIORITY]
                                           [--client-categories CLIENT_CATEGORIES]
                                           [--client-nodes CLIENT_NODES]
                                           [--client-overlay-name CLIENT_OVERLAY_NAME]
                                           [--client-overlay-priority CLIENT_OVERLAY_PRIORITY]
                                           [--client-slots <slots>]
                                           [--submit-categories SUBMIT_CATEGORIES]
                                           [--submit-nodes SUBMIT_NODES]
                                           [--submit-overlay-name SUBMIT_OVERLAY_NAME]
                                           [--submit-overlay-priority SUBMIT_OVERLAY_PRIORITY]
                                           [--wlm-cluster-name WLM_CLUSTER_NAME]
                                           [--reboot] [--reset-cgroups]
                                           [--yes-i-really-mean-it]
                                           [--archives-location <path>]
                                           [--license <license>] [--purge]
                                           [--accounting-overlay-name ACCOUNTING_OVERLAY_NAME]
                                           [--accounting-overlay-priority ACCOUNTING_OVERLAY_PRIORITY]
                                           [--with-pyxis]
                                           [--add-pyxis]
                                           [--reinstall-pyxis]
                                           [--remove-pyxis]
                                           [--pyxis-data-directory <path>]
                                           [--nvidia-gpus NVIDIA_GPUS] [-v]
                                           [--no-distro-checks] [--json]
                                           [--output-remote-execution-runner]
                                           [--on-error-action {debug,remotedebug,undo,abort}]
                                           [--skip-packages]
                                           [--min-reboot-timeout <reboot_timeout_seconds>]
                                           [--allow-running-from-secondary]
                                           [--dev] [-h]
```

The help output from running `cm-wlm-setup -h` continues on beyond the preceding text output, and presents more options.

These options can be grouped as follows:

#### 7.3.1.1  Optional Arguments

* `--setup`: Helps set up a server, enable roles, and create the default queues/partitions

* `--disable`: Disable WLM services

* `-h, --help`: Displays the help screen

#### 7.3.1.2  Common Arguments

* `-c` \<*YAML configuration file*>: Loads a runtime configuration for plugins, from a YAML configuration file.

#### 7.3.1.3  Options For Installing Or Managing A WLM

* `--wlm` \<*WLM name*>: Specifies which WLM is to be set up. Choices for \<*WLM name*> are:

  * `slurm`

  * `lsf`

* `--wlm-cluster-name` \<*WLM cluster name*>: Specifies the name for the new WLM cluster that is to be set up.

* `--reboot`: Reboot after install

#### 7.3.1.4  Server Role Settings

* `--server-nodes` \<*server nodes*>: Sets the server roles of the WLM to the value set for \<*server nodes*>, which is a comma-separated list of nodes. Default value: `HEAD`, which is a reserved name for the head node.

* `--server-primary` \<*primary server*>: Sets the hostname used for the primary server to \<*primary server*>. Default name: `HEAD`.

* `--server-overlay-name` \<*server overlay name*>: Sets the server role configuration overlay name to \<*server overlay name*>. Default name: \<*WLM name*>`-server`, where \<*WLM name*> is the name specified in the `--wlm` option.

* `--server-overlay-priority` \<*server overlay priority*>: Sets the server role configuration overlay priority to \<*server overlay priority*>. Default value: `500`.

#### 7.3.1.5  Client Role Settings

* `--client-categories` \<*client categories*>: Sets the client roles of the WLM to the value set for \<*client categories nodes*>, which is a comma-separated list of node categories. Default value: `default`.

* `--client-nodes` \<*client nodes*>: Sets the client roles of the WLM to the value set for \<*client nodes*>, which is a comma-separated list of nodes. No value set by default.

* `--client-overlay-name` \<*client overlay name*>: Sets the client role configuration overlay name to \<*client overlay name*>. Default name: \<*WLM name*>`-client`, where \<*WLM name*> is the name specified in the `--wlm` option.

* `--client-overlay-priority` \<*client overlay priority*>: Sets the client role configuration overlay priority to \<*client overlay priority*>. Default value: `500`.

* `--client-slots` \<*slots*>: Sets the number of slots on the client to \<*slots*>.

#### 7.3.1.6  Submit Role Settings

* `--submit-categories` \<*submit categories*>: Sets the submit roles of the WLM to the value set for \<*submit categories nodes*>, which is a comma-separated list of node categories that are submit nodes. Default value: `default`.

* `--submit-nodes` \<*submit nodes*>: Sets the submit roles of the WLM to the value set for \<*submit nodes*>, which is a comma-separated list of submit nodes. No value set by default.

* `--submit-overlay-name` \<*submit overlay name*>: Sets the submit role configuration overlay name to \<*submit overlay name*>. Default name: \<*WLM name*>`-submit`, where \<*WLM name*> is the name specified in the `--wlm` option.

* `--submit-overlay-priority` \<*submit overlay priority*>: Sets the submit role configuration overlay priority to \<*submit overlay priority*>. Default value: `500`.

#### 7.3.1.7  Disable Options

* `--reset-cgroups`: Disable joining cgroup controllers with systemd setting JoinControllers

* `--yes-i-really-mean-it`: Required for additional safety

#### 7.3.1.8  Workload Manager Specific Options

* `--archives-location` \<*path*>: Set the directory path for the archive files, only for LSF. This parameter is mandatory for LSF installation.

* `--license` \<*path*>: Set the path to the LSF license.

* `--purge`: Remove the directories on disable, for LSF.

#### 7.3.1.9  Slurm Accounting Role Settings

* `--accounting-overlay-name` \<*accounting overlay name*>: Sets the accounting role configuration overlay

* `--accounting-overlay-priority` \<*accounting overlay priority*>: Sets the accounting role configuration overlay priority to \<*accounting overlay priority*>. Default value: `500`.

#### 7.3.1.10  Slurm Pyxis Settings

* `--add-pyxis`: Add Pyxis to an existing cluster

* `--reinstall-pyxis`: Reinstall or upgrade Pyxis on all the clusters using it

* `--remove-pyxis`: Remove Pyxis from an existing cluster

* `--with-pyxis`: Enable Pyxis

* `--pyxis-data-directory` \<*path*>: Sets directory where images will be stored

#### 7.3.1.11  Slurm GPU Settings

* `--nvidia-gpus` \<*NVIDIA GPUs specification*>: Sets the NVIDIA GPUs that will be used in the configuration, specifying type and number of GPUs. For example: `--nvidia-gpus=A100:4`

* `--gpu-client-nodes` \<*NVIDIA GPU client nodes*>: Sets a comma-separated list of nodes assigned to the GPU overlay.

* `--gpu-client-categories` \<*NVIDIA GPU client categories*>: Sets a comma-separated list of node categories assigned to the GPU overlay.

#### 7.3.1.12  Advanced Options

* ` -v, --verbose`: This displays a more verbose output. It can be helpful in troubleshooting.

* ` --no-distro-checks`: Disables distribution checks based on ds.json.

* ` --json`: Use json formatting for logs printed to STDOUT.

* ` --output-remote-execution-runner`: Format output for CMDaemon.

* ` --on-error-action {debug,remotedebug,undo,abort}`: Upon encountering a critical error, instead of asking the user for choice, the setup will do the selected action.

* ` --skip-packages`: Skip the stages which install packages. Requires packages to be already installed.

* ` --min-reboot-timeout` \<*timeout*>: How long to wait for nodes to finish reboot, in seconds. Minimum value: `300`. Default value: `300`.

* ` --allow-running-from-secondary`: Allow the wizard to be run from the secondary when it is the active head node.

* ` --dev`: Enables additional command line arguments for developers.

### 7.3.2  Running `cm-wlm-setup` As A TUI

Running `cm-wlm-setup` with no options and with no arguments brings up a TUI screen (figure [7.2](#fig-cm-wlm-setup-ncurses-initial-screen)).

![cm-wlm-setup TUI initial screen](/base-command-manager/product-manuals/_fern-img/e4f4aa1bbee9c46b4ee005138410a16911d3aea1553e995d26f4d671312ac337.webp)

*Figure 7.2: cm-wlm-setup TUI initial screen*

#### 7.3.2.1  Express Installation

The `Setup (Express)` menu option allows the administrator to select the workload manager in the next screen (figure [7.3](#fig-cm-wlm-setup-ncurses-wlm-selection-screen)), and to install it with a minimal number of configuration steps. If it has already been installed, but disabled using `cm-wlm-setup`, then it can also be re-enabled, instead of installed from scratch.

![cm-wlm-setup TUI WLM selection screen](/base-command-manager/product-manuals/_fern-img/68a66d3bd1e4ad221cb883e4eb788a6bd90431543adada1dd83834764095c954.webp)

*Figure 7.3: cm-wlm-setup TUI WLM selection screen*

#### 7.3.2.2  Step-by-step Installation

If the `Setup (Step By Step)` menu option is chosen instead of the express option, then this also allows the administrator to select the workload manager in figure [7.3](#fig-cm-wlm-setup-ncurses-wlm-selection-screen). But after selection, there are a number of extra configuration steps that can be carried out which are not available in the express configuration. Guidance is given for these extra steps, and sensible default values are already filled in for many options.

One part of the step-by-step session involves assigning the WLM client role to the compute nodes of the cluster. Only the non-GPU compute nodes should be assigned the (standard, non-GPU) WLM client role. The GPU compute nodes are assigned a *GPU* WLM client role in the section of the TUI wizard that deals with GPU configuration.

The WLM client role is assigned to the entire category—the `default` category— of non-head nodes by default (figure [7.4](#fig-urwid-cm-wlm-setup-slurm-config-client-role-category)):

![Slurm with cm-wlm-setup: WLM Client role category configuration screen](/base-command-manager/product-manuals/_fern-files/nvidia-bcm-manuals.docs.buildwithfern.com/8a340d793af816a485872adcf7337ab46334311bb8f22f0d3e71f88f17f75080/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/tmp/tmp-465-wPoXzKKBLZez/latextofern/fern/assets/figures/urwid-cm-wlm-setup-slurm-config-client-role-category.png)

*Figure 7.4: Slurm with cm-wlm-setup: WLM Client role category configuration screen*

The WLM client role can be assigned to selected nodes only by setting the `default` category checkbox to blank, and then selecting the non-GPU nodes in the following screen. For example, as illustrated in figure [7.4](#fig-urwid-cm-wlm-setup-slurm-config-client-role-category), where the standard, non-GPU nodes are `node002` and `node003`:

![Slurm with cm-wlm-setup: WLM client role node configuration screen](/base-command-manager/product-manuals/_fern-files/nvidia-bcm-manuals.docs.buildwithfern.com/31c97665e8b333a41a8244dbdb402b9fc7256a1dfc910022b521ab856c963ec4/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/tmp/tmp-465-wPoXzKKBLZez/latextofern/fern/assets/figures/urwid-cm-wlm-setup-slurm-config-client-role-node.png)

*Figure 7.5: Slurm with cm-wlm-setup: WLM client role node configuration screen*

#### 7.3.2.3  GPU Configuration Screens

The GPU configuration screens are extra steps available during a `Setup (Step By Step)` session. The GPU configuration steps are discussed summarily in the quickstart section for GPUs, [here](/installation/quickstart#14-quickstart-for-gpus).

The GPU configuration steps are covered in this section in more detail:

After configuring the WLM server, WLM submission and WLM client roles for the nodes of the cluster, a screen that asks if GPU resources should be configured is displayed (figure [1.1](/installation/quickstart#14-quickstart-for-gpus)):

![Slurm With cm-wlm-setup: GPU Configuration Entry Screen](/base-command-manager/product-manuals/_fern-files/nvidia-bcm-manuals.docs.buildwithfern.com/14f9a9e8d9b36c585cf9303202bd6af07ba01b2d8ca30e1c06592757a5689694/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/tmp/tmp-465-wPoXzKKBLZez/latextofern/fern/assets/9161a888e3f9ec5cd1868d95b48349a533310e18.png)

*Figure 1.1: Slurm With cm-wlm-setup: GPU Configuration Entry Screen*

Following through brings up a GPU device settings configuration screen (figure [1.2](/installation/quickstart#14-quickstart-for-gpus)):

![Slurm With cm-wlm-setup: GPU Device Settings Configuration Screen](/base-command-manager/product-manuals/_fern-files/nvidia-bcm-manuals.docs.buildwithfern.com/248688fbf2a774b9582174bfdb061bc5aa3181c03e0f0f331a9f321ea2963519/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/tmp/tmp-465-wPoXzKKBLZez/latextofern/fern/assets/057db6460ebe19f3029a378fa6969d000fa36809.png)

*Figure 1.2: Slurm With cm-wlm-setup: GPU Device Settings Configuration Screen*

The help text option in the screen gives hints based on the descriptions at [https://slurm.schedmd.com/gres.conf.html](https://slurm.schedmd.com/gres.conf.html), and also as seen in Slurm’s `man gres.conf.5`.

Figure [1.2](/installation/quickstart#14-quickstart-for-gpus) shows 2 physical GPUs on the node being configured. The type is an arbitrary string for the GPU, and each CPU core is allocated an alias GPU device.

The next screen (figure [1.3](/installation/quickstart#14-quickstart-for-gpus)) allows the NVIDIA CUDA MPS (Multi-Process Service) to be configured:

![Configuring An NVIDIA GPU For Slurm With cm-wlm-setup: MPS Settings Configuration Screen](/base-command-manager/product-manuals/_fern-files/nvidia-bcm-manuals.docs.buildwithfern.com/519d02a407f3f7e75a75900228954a4bd25f2cef0dd2230568793b3b4891b6d0/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/_dot_dot_/tmp/tmp-465-wPoXzKKBLZez/latextofern/fern/assets/bef636ced1f614d880c0ed2d72e2fe81a55a2ebb.png)

*Figure 1.3: Configuring An NVIDIA GPU For Slurm With cm-wlm-setup: MPS Settings Configuration Screen*

The help text for this screen gives hints on how the fields can be filled in. The number of GPU cores (figure [1.3](/installation/quickstart#14-quickstart-for-gpus)) for a GPU device can be set.

Further screens allow:

* the configuration overlay (section [2.1.6](/admin/clustermanagement#216-configuration-overlay)) name to be set for the GPU WLM clients. By default the name is set to `slurm-client-gpu`.

* a GPU WLM client role to be assigned to a category, if, for example, all the GPU nodes have been given their own category.

* the GPU WLM client role to be assigned to individual nodes instead of to a category.

* a configuration overlay priority to be set for a GPU WLM client role. By default, this has a value of `450`.

* automatic GPU detection, with the following options:

  * `BCM autodetects GPUs`

  * `Slurm autodetects NVIDIA GPU details`

  * `Slurm autodetects AMD GPU details`

  * `Slurm autodetects Intel GPU details`

  * `Slurm autodetects AWS Trainium/Inferentia devices`

  * `Manual GPU configuration in cm-wlm-setup`

  * `Skip GPU configuration`

#### 7.3.2.4  Slurm Accounting Database Configuration

In the step-by-step configuration for the Slurm WLM, after the server and client parameters have been set, the Slurm accounting database configuration can be set.

This requires setting:

* one or two accounting nodes

* a primary accounting node

All nodes must be reachable from `slurmctld`.

The accounting nodes can be set with the `Select accounting nodes` screen (figure [7.9](#fig-cm-wlm-setup-slurm-select-accounting-nodes)):

![cm-wlm-setup selection of accounting nodes](/base-command-manager/product-manuals/_fern-img/0346d19ba9c46bda3bde006a25f0ff370b32d35d01481bfe5c8111890b5143ca.webp)

*Figure 7.9: cm-wlm-setup selection of accounting nodes*

Head nodes and compute nodes cannot be mixed for the accounting nodes. If two accounting nodes are set, then the `slurmdbd` high availability configuration is automatically set up.

The primary accounting node—that is, the node that is `AccountingStorageHost` in `slurm.conf`—can then be set in the `Select the primary accounting server node` screen (figure [7.10](#fig-cm-wlm-setup-slurm-select-primary-accounting-node)):

![cm-wlm-setup selection of primary accounting node](/base-command-manager/product-manuals/_fern-img/db1f7529263bfc5240392ab5121bbb2f576b28948920418dd2d7773a968f6e0d.webp)

*Figure 7.10: cm-wlm-setup selection of primary accounting node*

The other accounting node is automatically set to be `AccountingStorageBackupHost`.

The type of node on which the `slurmdbd` database runs can then be set (figure [7.11](#fig-cm-wlm-setup-slurm-select-slurmdbd-nodes)):

![cm-wlm-setup selection of the type of node on which the Slurm accounting database runs](/base-command-manager/product-manuals/_fern-img/32a1fab830477d5b62a1bc269eb1defcd1ab4ca53ea061b712ac3e56c3cbd2db.webp)

*Figure 7.11: cm-wlm-setup selection of the type of node on which the Slurm accounting database runs*

Only two of the three options are offered at a time. Which options are offered is determined by the accounting node selection made on the preceding screen. The accounting nodes are either all head nodes or all compute nodes. A mixed selection is rejected.

* If `Use accounting node` is selected, then the database is stored on the primary accounting node. This option is offered when the accounting nodes are head nodes

* If `Select cluster node` is selected, then the next screen allows the selection of the BCM MySQL overlay which is used to manage the database (figure [7.12](#fig-cm-wlm-setup-slurm-mysql-overlay)). This option is offered when the accounting nodes are compute nodes, that is, when `slurmdbd` is offloaded from the head nodes. Whether the head nodes are configured for high availability makes no difference. If no MySQL configuration overlay is found, then the selection is rejected, and MySQL must first be installed with `cm-mysql-setup`. If the MySQL installation is running on more than one node (section [14.12](/admin/administration#1412-the-cm-mysql-setup-utility)), then `mysql-router` is automatically installed on all accounting nodes.

![cm-wlm-setup Selection of host(s) for where the Slurm accounting database used by slurmdbd is stored](/base-command-manager/product-manuals/_fern-img/d8e024e32f6cde26d290522c0303725416f61c04359203965d60eab6493c0033.webp)

*Figure 7.12: cm-wlm-setup Selection of host(s) for where the Slurm accounting database used by slurmdbd is stored*

* If `Select external node` is selected, then a non-BCM hostname is asked for, and the cluster administrator is responsible for the installation and configuration of the DBMS. This option is always offered

Modifying the settings after installation is discussed [here](#slurm-accounting-database-configuration).

#### 7.3.2.5  Disabling An Installation

The `Disable` option in figure [7.2](#fig-cm-wlm-setup-ncurses-initial-screen) allows the administrator to disable an existing instance.

#### 7.3.2.6  Summary Screen

The screen that appears after the configuration steps are completed, is the `Summary` screen (figure [7.13](#fig-cm-wlm-setup-ncurses-final-summary-screen)). This screen allows the configuration to be viewed, saved, or saved and deployed.

![cm-wlm-setup TUI summary screen](/base-command-manager/product-manuals/_fern-img/17dc0975ffff9fa0ce464000a36eab4e5296d95479d33eae43900a30aabd2eb1.webp)

*Figure 7.13: cm-wlm-setup TUI summary screen*

In the final summary screen, as with other scripts that come with the `cm-setup` package, the configuration setting can be one of the following kinds:

* `minimal config`: For this minimal kind of configuration setting, the configuration consists only of the settings that differ from the default application configuration. The remaining default application configuration settings are not included in the configuration.

* `config`: For this non-minimal kind of configuration setting, the configuration consists of the minimal configuration settings (the ones changed by BCM), as well as the remaining default configuration settings (the ones provided with the application). That is to say: the remaining default configuration application settings are included in the configuration. The default application configuration settings may change as the upstream packages change.

If deployment is carried out, then several screens of output are displayed. After the deployment is completed, the log file can be viewed at `/var/log/cm-wlm-setup.log`.

### 7.3.3  Installation And Configuration Of Enroot And Pyxis With Slurm To Run Containerized Jobs

#### 7.3.3.1  What Is Enroot?

As the [README file for Enroot](https://github.com/NVIDIA/enroot/blob/master/README.md) says, Enroot is an open source tool to turn container images into unprivileged sandboxes. Enroot can be thought of as an enhanced unprivileged chroot. It uses user and mount namespaces, as well as other modern kernel features, in order to create such sandboxes. It uses the same underlying technologies as containers, but removes much of the isolation that they inherently provide, while preserving filesystem separation. Further details on Enroot can be found at [https://github.com/NVIDIA/enroot](https://github.com/NVIDIA/enroot).

Enroot can be used with different workload managers, but for now only Slurm has been tightly integrated.

#### 7.3.3.2  What Is Pyxis?

Pyxis ([https://github.com/NVIDIA/pyxis](https://github.com/NVIDIA/pyxis)) is a SPANK plugin for Slurm. SPANK (Slurm Plug-in architecture for Node and job (K)control, `man spank.8`) is a generic interface for job launch code control in Slurm. The Pyxis plugin requires the Enroot utility, and allows the user’s jobs to be executed seamlessly over Enroot in unprivileged containers. The plugin enables the Slurm submission utilities to provide container-related command line options.

#### 7.3.3.3  Enroot And Pyxis Packages

BCM provides two Enroot package flavors: *standard* and *hardened*. The standard binaries are compiled as follows:

* Open file descriptors are inherited

* Spectre variant 2 (IBPB/STIBP) mitigations are disabled

* Spectre variant 4 (SSBD) mitigations are disabled

[As a rule of thumb: the hardened flavor is slightly more secure but suffers a larger overhead.](https://github.com/NVIDIA/enroot/blob/master/doc/installation.md)

* The standard packages are already installed by default with BCM, and are:

  * `enroot`: provides the main utility and helper files.

  * `enroot+caps`: a nearly empty package which runs a post-installation script to grant extra capabilities to unprivileged users. This allows them to import and convert container images.

  * `pyxis-sources`: installs a tarball with the Pyxis plugin source files. The tarball is used by `cm-wlm-setup` to compile the Pyxis plugin on a cluster. The version of the package (section [9.1](/admin/softwareimagemanagement#91-nvidia-base-command-manager-packages-their-naming-convention-and-version)), found using `yum info pyxis-sources` or `apt-cache show pyxis-sources`, implies the Pyxis source version that is provided. For example: `pyxis-sources-0.20.0-[...].rpm` provides the Pyxis source for version 0.20.0.

* The hardened packages that can be installed from the BCM repositories to replace the standard `enroot` and `enroot+caps` are:

  * `enroot-hardened`: provides hardened main utility and helper files.

  * `enroot-hardened+caps`: Provides extra capabilities to unprivileged users so that they can import and convert containers themselves.

The package `pyxis-sources` installs the tarball at `/cm/local/apps/slurm/var/pyxis/pyxis-sources.tar.gz`. If the administrator needs a version of Pyxis other than the one provided by the package, then the archive can be replaced with a source tarball of the same name.

#### 7.3.3.4  How Are Enroot And Pyxis Set Up In BCM?

Pyxis and Enroot can be set up or removed by the administrator by choosing the appropriate options when Slurm is set up. In order to choose the appropriate options, `cm-wlm-setup` can be run in step-by-step mode ([here](#7322-step-by-step-installation)). Alternatively, Pyxis-related command line options can be specified for the `cm-wlm-setup` arguments `--add-pyxis` and `--reinstall-pyxis`.

The step-by-step mode eventually presents a screen where the Pyxis setup can be enabled using a plugin:

![cm-wlm-setup Pyxis setup screen](/base-command-manager/product-manuals/_fern-img/6311a12d72eab2043a7886e70d03819f3b930e13aa4f03338b26a3e1e18f26eb.webp)

*Figure 7.14: cm-wlm-setup Pyxis setup screen*

The Pyxis screen is available for RHEL8-based systems and Ubuntu 20 and beyond. Older systems are not supported.

If the plugin is enabled in the Pyxis setup screen, then `cm-wlm-setup` installs the `enroot` and `enroot+caps` packages from [https://github.com/NVIDIA/enroot/releases](https://github.com/NVIDIA/enroot/releases) into the software images where the Slurm client role is to be assigned. The `cm-wlm-setup` uitility also installs them directly on the head node if the head node was selected to run jobs. Pyxis sources are downloaded from GitHub, compiled with the installed Slurm, and installed in the appropriate Slurm directory.

If the administrator enables the Pyxis plugin, then a new screen with Enroot settings is shown:

![cm-wlm-setup Enroot settings screen](/base-command-manager/product-manuals/_fern-img/efb8e3821935fc06c022259ff936d02f716b3b1f8dc3c2b7ee68650bb372ee44.webp)

*Figure 7.15: cm-wlm-setup Enroot settings screen*

The Enroot settings have reasonable default values. The administrator can change these:

* `Share raw images among users and nodes`: If enabled, then the raw container image is shared among users and nodes, and the administrator must ensure that the cache directory is shared among all the compute nodes. Enabling the option disables the creation of a UID subdirectory by the Enroot prolog script.

  The following points about implementing Enroot cache sharing should be considered by the administrator:

  * Enabling the checkbox for the option normally changes the default value of the Enroot cache directory, as defined in the TUI in the `Cache directory` field, to `${XDG_CACHE_HOME}/enroot`. This field is normally evaluated by the Enroot installation to the home directory of the user:

    `~/.cache/enroot`

    when a job is executed.

    The default value can also be changed in the TUI to any shared directory. If the specified directory does not exist, then `cm-wlm-setup` creates it with Unix directory permissions set to [`chmod 00777`, which allows all users to share container images in the cache with each other on all the nodes. The extra `0` prefix is a non-POSIX-compliant GNU/Linux extension that clears the SUID and SGID bits so that users do not get elevated privileges simply through sharing the images](https://www.gnu.org/software/coreutils/manual/html_node/Directory-Setuid-and-Setgid.html).

  * Restrictions can be placed on the ability of regular users to share images and to create files in the cache, by setting more restrictive permissions for the directory manually, after the `cm-wlm-setup` run.

    For example, the permissions can be set to 00770, while the ownership group of the directory is changed to a group with all the Pyxis users in it. In this case, only the users within the Pyxis users group can create the image layers in the cache.

  * An alternative to cache sharing of images among users and nodes is to save Squashfs images in a shared directory, outside the cache. Then the users can specify a full path to a shared Squashfs image on the cluster in the `srun/sbatch` command line. In this case there is no need to share the cache among the nodes, as the Squashfs images are not copied over to cache before execution.

  Only the administrator should have access to updating the image.

* `Share unpacked container images among nodes`: Enables sharing of unpacked container images (image filesystems) among nodes. A user job can modify the filesystem, so it is not recommended to share this directory among users.

  Enabling the option disables removal of the Enroot data directory, if the container name is specified. This allows a user to keep the container filesystem between jobs run by the user. It is up to the user or the administrator to clean up the data directory if the option is enabled.

  If the data directory is shared among nodes, then it is up to a user to ensure that the container filesystem is unpacked at least once before real jobs start. Otherwise, a race condition is possible when the images are extracted simultaneously on several nodes.

* `Cache directory`: Path to the cache directory where raw container image layers are stored.

  If the directory is not shared, then the Slurm prolog script creates a subdirectory with a name that is the job user ID, while epilog cleans up that subdirectory. If the directory is shared, then neither prolog nor epilog touches the directory.

* `Data directory`: Directory where the container filesystems (unpackaged images) are stored. If the directory is shared, then the epilog script checks if the container name is specified for the job, and skips removal of the container subdirectory.

* `Runtime directory`: A working directory with temporary files created by Enroot.

When Pyxis is set up, `cm-wlm-setup` also prepares the following configuration files for the compute nodes:

* `/etc/enroot/enroot.conf`: This is a symlink to `/cm/shared/apps/slurm/etc/enroot.conf`. The configuration file provides reasonable default settings that allows Enroot to be used by many users. Important settings in the file are:

  * `ENROOT_RUNTIME_PATH`: working directory for enroot, created per user. Default value: `/run/enroot/runtime/$(id -u)`

  * `ENROOT_CACHE_PATH`: directory where container layers are stored. Default value: `/run/enroot/cache/$(id -u)`

  * `ENROOT_DATA_PATH`: directory where the filesystems of running containers are stored. Default value: `/run/enroot/data/$(id -u)`

  * `ENROOT_SQUASH_OPTIONS`: options passed to `mksquashfs` to produce container images. Default value: `-noI -noD -noF -noX -no-duplicates`

  * `ENROOT_MOUNT_HOME`: mount the current user’s home directory by default. Default value: `yes`.

  The administrator can change the symlink, or replace the file with a customized `enroot.conf`, if other values are preferred.

* `/etc/sysctl.d/80-enroot.conf`: symlink to `/cm/shared/apps/slurm/etc/enroot-sysctl.conf`. The file tunes `sysctl` parameters for Enroot.

* `/cm/local/apps/slurm/var/prologs/50-prolog-enroot.sh`: symlink to `/cm/shared/apps/slurm/prologs/prolog-enroot.sh`. This is the `slurmd` prolog that creates appropriate directories, with appropriate user permissions, that are used by Enroot.

* `/cm/local/apps/slurm/var/epilogs/50-epilog-enroot.sh`: symlink to `/cm/shared/apps/slurm/epilogs/epilog-enroot.sh`. Cleans the user directories used by Enroot.

When `cm-wlm-setup` finishes its Pyxis configuration run, then there is no need for the nodes to be rebooted. The plugin works immediately.

The new Slurm submission command option names start with either `--container` or `--no-container`. The full list of options can be displayed with the `--help` option. For example:

**Example**

```bash
[user@basecm11 ~]$ srun --help | grep container
      --container             Path to OCI container bundle
      --container-image=[USER@][REGISTRY#]IMAGE[:TAG]|PATH
                              [pyxis] the image to use for the container
      --container-mounts=SRC:DST[:FLAGS][,SRC:DST...]
                              [pyxis] bind mount[s] inside the container. Mount
      --container-workdir=PATH
                              [pyxis] working directory inside the container
      --container-name=NAME   [pyxis] name to use for saving and loading the
                              container on the host. Unnamed containers are
                              containers are not. If a container with this name
                              already exists, the existing container is used and
      --container-save=PATH   [pyxis] Save the container state to a squashfs
      --container-mount-home  [pyxis] bind mount the user's home directory.
      --no-container-mount-home
      --container-remap-root  [pyxis] ask to be remapped to root inside the
                              container. Does not grant elevated system
      --no-container-remap-root
                              [pyxis] do not remap to root inside the container
      --container-entrypoint  [pyxis] execute the entrypoint from the container
      --no-container-entrypoint
                              container image
      --container-writable    [pyxis] make the container filesystem writable
      --container-readonly    [pyxis] make the container filesystem read-only
```

**Simple installation validation:**

The simplest way to validate the Pyxis/Enroot setup after Slurm setup is to try out an `srun` command:

**Example**

```bash
[user@basecm11 ~]$ module load slurm
[user@basecm11 ~]$ srun --container-image=ubuntu grep PRETTY /etc/os-release
pyxis: importing docker image: ubuntu
PRETTY_NAME="Ubuntu 24.04.2 LTS"
```

**A more thorough installation validation:** In order to perform a more thorough test of Pyxis/Enroot, an NCCL-based test can be used. NCCL is the NVIDIA Collective Communications Library ([https://docs.nvidia.com/deeplearning/nccl](https://docs.nvidia.com/deeplearning/nccl)), which is a library of multi-GPU collective communication primitives. The test can be found at [https://github.com/NVIDIA/nccl-tests](https://github.com/NVIDIA/nccl-tests). A prebuilt container image, with the NCCL test already installed, can be started as shown in the example that follows.

It should be noted that running a multi-tenant cluster with all the export flags enabled as in the example may compromise security. It is therefore not recommended as a standard configuration.

**Example**

```bash
[user@basecm11 ~]$ module load slurm
[user@basecm11 ~]$ srun --export="NCCL_DEBUG=INFO,NCCL_IB_DISABLE=1,PMIX_MCA_gds=hash" -N 2 \
--ntasks-per-node=1 --gpus-per-task=1 --mpi=pmix --container-image=deepops/mpi-nccl-test \
/nccl_tests/build/all_reduce_perf -b 1M -e 4G -f 2 -g 1

pyxis: imported docker image: deepops/mpi-nccl-test
pyxis: imported docker image: deepops/mpi-nccl-test
# nThread 1 nGpus 1 minBytes 1048576 maxBytes 4294967296 step: 2(factor) warmup iters: 5 iters: 20 validation: 1
#
# Using devices
#   Rank  0 Pid 175945 on    node001 device  0 [0x00] Tesla V100-SXM3-32GB
#   Rank  1 Pid 180379 on    node002 device  0 [0x00] Tesla V100-SXM3-32GB
node001:175945:175945 [0] NCCL INFO Bootstrap : Using ens3:10.141.0.5<0>
node001:175945:175945 [0] NCCL INFO NET/Plugin : No plugin found (libnccl-net.so), using internal implementation
node001:175945:175945 [0] NCCL INFO NCCL_IB_DISABLE set by environment to 1.
node001:175945:175945 [0] NCCL INFO NET/Socket : Using [0]ens3:10.141.0.5<0>
node001:175945:175945 [0] NCCL INFO Using network Socket
NCCL version 2.11.4+cuda11.6
node002:180379:180379 [0] NCCL INFO Bootstrap : Using ens3:10.141.0.6<0>
node002:180379:180379 [0] NCCL INFO NET/Plugin : No plugin found (libnccl-net.so), using internal implementation
node002:180379:180379 [0] NCCL INFO NCCL_IB_DISABLE set by environment to 1.
node002:180379:180379 [0] NCCL INFO NET/Socket : Using [0]ens3:10.141.0.6<0>
node002:180379:180379 [0] NCCL INFO Using network Socket
node002:180379:182573 [0] NCCL INFO Trees [0] -1/-1/-1->1->0 [1] 0/-1/-1->1->-1
node001:175945:177561 [0] NCCL INFO Channel 00/02 :    0   1
node001:175945:177561 [0] NCCL INFO Channel 01/02 :    0   1
node001:175945:177561 [0] NCCL INFO Trees [0] 1/-1/-1->0->-1 [1] -1/-1/-1->0->1
node001:175945:177561 [0] NCCL INFO Channel 00 : 1[60] -> 0[60] [receive] via NET/Socket/0
node002:180379:182573 [0] NCCL INFO Channel 00 : 0[60] -> 1[60] [receive] via NET/Socket/0
node001:175945:177561 [0] NCCL INFO Channel 01 : 1[60] -> 0[60] [receive] via NET/Socket/0
node002:180379:182573 [0] NCCL INFO Channel 01 : 0[60] -> 1[60] [receive] via NET/Socket/0
node001:175945:177561 [0] NCCL INFO Channel 00 : 0[60] -> 1[60] [send] via NET/Socket/0
node002:180379:182573 [0] NCCL INFO Channel 00 : 1[60] -> 0[60] [send] via NET/Socket/0
node001:175945:177561 [0] NCCL INFO Channel 01 : 0[60] -> 1[60] [send] via NET/Socket/0
node002:180379:182573 [0] NCCL INFO Channel 01 : 1[60] -> 0[60] [send] via NET/Socket/0
node001:175945:177561 [0] NCCL INFO Connected all rings
node002:180379:182573 [0] NCCL INFO Connected all rings
node001:175945:177561 [0] NCCL INFO Connected all trees
node001:175945:177561 [0] NCCL INFO threadThresholds 8/8/64 | 16/8/64 | 8/8/512
node001:175945:177561 [0] NCCL INFO 2 coll channels, 2 p2p channels, 1 p2p channels per peer
node002:180379:182573 [0] NCCL INFO Connected all trees
node002:180379:182573 [0] NCCL INFO threadThresholds 8/8/64 | 16/8/64 | 8/8/512
node002:180379:182573 [0] NCCL INFO 2 coll channels, 2 p2p channels, 1 p2p channels per peer
node001:175945:177561 [0] NCCL INFO comm 0x1551f0001000 rank 0 nranks 2 cudaDev 0 busId 60 - Init COMPLETE
#
#                                                       out-of-place                       in-place
#       size         count      type   redop     time   algbw   busbw  error     time   algbw   busbw  error
#        (B)    (elements)                       (us)  (GB/s)  (GB/s)            (us)  (GB/s)  (GB/s)
node001:175945:175945 [0] NCCL INFO Launch mode Parallel
node002:180379:182573 [0] NCCL INFO comm 0x1551f8001000 rank 1 nranks 2 cudaDev 0 busId 60 - Init COMPLETE
     1048576        262144     float     sum   1491.5    0.70    0.70  0e+00   1421.3    0.74    0.74  0e+00
     2097152        524288     float     sum   3077.5    0.68    0.68  0e+00   2568.8    0.82    0.82  0e+00
     4194304       1048576     float     sum   4617.3    0.91    0.91  0e+00   4622.5    0.91    0.91  0e+00
     8388608       2097152     float     sum   9483.1    0.88    0.88  0e+00   8911.9    0.94    0.94  0e+00
    16777216       4194304     float     sum    17516    0.96    0.96  0e+00    18613    0.90    0.90  0e+00
    33554432       8388608     float     sum    34799    0.96    0.96  0e+00    41837    0.80    0.80  0e+00
    67108864      16777216     float     sum    99790    0.67    0.67  0e+00    83126    0.81    0.81  0e+00
   134217728      33554432     float     sum   204614    0.66    0.66  0e+00   199530    0.67    0.67  0e+00
   268435456      67108864     float     sum   319701    0.84    0.84  0e+00   341630    0.79    0.79  0e+00
   536870912     134217728     float     sum   608809    0.88    0.88  0e+00   683016    0.79    0.79  0e+00
  1073741824     268435456     float     sum  1337187    0.80    0.80  0e+00  1247369    0.86    0.86  0e+00
  2147483648     536870912     float     sum  2638741    0.81    0.81  0e+00  2743454    0.78    0.78  0e+00
  4294967296    1073741824     float     sum  5996381    0.72    0.72  0e+00  5430549    0.79    0.79  0e+00
# Out of bounds values : 0 OK
# Avg bus bandwidth    : 0.810575
#
```

The test demonstrates the usage of PMIX, MPI, and GPU in Enroot containers on multiple nodes. In the preceding example, 2 nodes with 1 GPU on each is requested by the job. For better results the cluster administrator can tune the test parameters.

It should be noted that the image is quite large, and requires enough free space under `/var`. Also, the transfer timeout (`ENROOT_TRANSFER_TIMEOUT`) in `enroot.conf` must be large enough to download such a large container image to the compute nodes. A value of at least 600 seconds is recommended.

If there are issues when executing MPI jobs with PMIX, then to help debug the issues the Pyxis documentation ([https://github.com/NVIDIA/pyxis/wiki/Setup](https://github.com/NVIDIA/pyxis/wiki/Setup)) suggests setting up the following environment variables:

* `PMIX_MCA_ptl=^usock`

* `PMIX_MCA_psec=none`

* `PMIX_SYSTEM_TMPDIR=/var/empty`

* `PMIX_MCA_gds=hash` (as configured [here](#7334-how-are-enroot-and-pyxis-set-up-in-bcm))

This configuration change is typically carried out in the software image of the regular nodes. For example, for a node category called `default`:

```bash
[root@basecm11 ~]# category=default
[root@basecm11 ~]# cat <<EOF >> /cm/images/${category}/etc/default/slurmd
PMIX_MCA_ptl=^usock
PMIX_MCA_psec=none
PMIX_SYSTEM_TMPDIR=/var/empty
PMIX_MCA_gds=hash
EOF
[root@basecm11 ~]# systemctl restart slurmd
[root@basecm11 ~]# cmsh -c "device; imageupdate -c ${category} -w"
```

### 7.3.4  Prolog And Epilog Scripts

#### 7.3.4.1  What Prolog And Epilog Scripts Do

The workload manager runs prolog scripts before job execution, and epilog scripts after job execution. The purpose of these scripts can include:

* checking if a node is ready before submitting a job execution that may use it

* preparing a node in some way to handle the job execution

* cleaning up resources after job execution has ended.

The administrator can run custom prolog or epilog scripts for the queues from CMDaemon for LSF, by setting such scripts in the Base View or `cmsh` front ends.

**Example**

```bash
[basecm11->wlm[lsf]->jobqueue]% use normal
[basecm11->wlm[lsf]->jobqueue[normal]]% show | grep -i epilog
Prolog/Epilog user               root
Epilog
Host epilog                      /cm/local/apps/cmd/scripts/epilog
```

For Slurm, there are global prolog and epilog scripts, but editing them is not recommended. Indeed, in order to discourage editing them, the scripts cannot be set using the cluster manager front ends. Instead the scripts must be placed by the administrator in the software image, and the relevant nodes updated from the image.

#### 7.3.4.2  Detailed Workings Of Prolog And Epilog Scripts

Even though it is not recommended, some administrators may nonetheless wish to link and edit the scripts directly for their own needs, outside of the Base View or `cmsh` front ends. A more detailed explanation of how the prolog scripts work therefore follows:

When a workload manager is configured using `cm-wlm-setup` or using the Base View setup wizard, then the workload manager is configured to run the generic prolog located in `/cm/local/apps/cmd/scripts/prolog`, and the generic epilog located in `/cm/local/apps/cmd/scripts/epilog`. The generic prolog and epilog scripts call a sequence of scripts for a particular workload manager in special directories. The directories have paths in the format:

1. `/cm/local/apps/` \<*workload manager*>`/var/prologs/`

2. `/cm/local/apps/` \<*workload manager*>`/var/epilogs/`

In these directories, scripts are stored with names that have suffixes and prefixes associated with them that make them run in special ways, as follows:

* **suffixes used in the prolog/epilog directory:**

  * `-prejob` script runs prior to all jobs

* **prefixes used in the prolog/epilog directory:**

  * `00-` to

  * `99-`

  Number prefixes determine the order of script execution, with scripts with a lower number running earlier.

The script names can therefore look like:

**Example**

* `01-prolog-prejob`

* `10-prolog-prejob`

Return values for the prolog/epilog scripts have these meanings:

* `0`: the next script in the directory is run.

* *A non-zero return value*: no further scripts are executed from the prolog/epilog directory.

Often, the script in a prolog/epilog directory is not a real script but a symlink, with the symlink going to a real file located in a different directory. The general script is then able to take care of what is expected of the symlink. The name of the symlink, and destination file, usually hints at what the script is expected to do.

For example, if any health checks are marked to run as prejob checks during `cm-wlm-setup` configuration, then Slurm uses the symlink `01-prolog-prejob` within the prolog directory `/cm/local/apps/` \<*`workload manager`*>`/var/prologs/`. The symlink links to the script `/cm/local/apps/cmd/scripts/prolog-prejob`. In this case, the script is expected to run prior to the job.

**Example**

```bash
[root@basecm11 apps]# pwd
/cm/local/apps
[root@basecm11 apps]# ls -l *slurm*/var/prologs/
slurm/var/prologs/:
total 0
lrwxrwxrwx 1 root root ... 01-prolog-prejob -> /cm/local/apps/cmd/scripts/prolog-prejob
```

Epilog scripts (which run after a job run) have the location `/cm/local/apps/` \<*`workload manager`*>`/var/epilogs/`. Epilog script names follow the same execution sequence pattern as prolog script names.

It should be noted that the `01-prolog-prejob` symlink is created and removed by BCM on each compute node where prejob is enabled in the workload manager entity. Each such entity provides a `Enable Prejob` parameter that affects the symlink existence:

**Example**

```bash
[head->wlm[slurm]]% get enableprejob
yes
[head->wlm[slurm]]%
```

This parameter is set to `yes` by `cm-wlm-setup` when at least one health check is selected as a prejob one. If any healthcheck was configured as a prejob check before `cm-wlm-setup` execution, and the administrator had a checkmark for that health check, then the prejob is considered enabled.

#### 7.3.4.3  Workload Manager Configuration For Prolog And Epilog Scripts

BCM configures generic prologs and epilogs during workload manager setup with `cm-wlm-setup`. The administrator can configure prologs and epilogs using appropriate parameters in the configuration of the workload managers, by creating the symlinks in the local prologs and epilogs directories.

Generic prologs and epilogs are configured by default to run on job compute nodes (one run per each node per job) for Slurm and LSF.

The following parameters for prologs and epilogs can be configured with `cmsh` or Base View:

* **Slurm**

  * `Prolog Slurmctld`: the fully qualified path of a program to execute before granting a new job allocation. The program is executed on the same node where the `slurmserver` role is assigned. The parth corresponds to the `PrologSlurmctld` parameter in `slurm.conf`.

  * `Epilog Slurmctld`: the fully qualified path of a program to execute upon termination of a job allocation. The program is executed on the same node where the `slurmserver` role is assigned. Corresponds with the `EpilogSlurmctld` parameter in `slurm.conf`.

  * `Prolog`: the fully qualified path of a program to execute on job compute nodes before granting a new job or step allocation. The program corresponds to the `Prolog` parameter, and by default points to the generic prolog. This prolog runs on every node of the job if the `Prolog flags` parameter contains the flag `Alloc` (the default value), otherwise it is executed only on the first node of the job.

  * `Epilog`: the fully qualified path of a program to execute on job compute nodes when the job allocation is released.

* **LSF**

  * `Prolog`: the fully qualified path of a program to execute on the LSF server node on job allocation. As an LSF queue parameter, it corresponds to the `PRE_EXEC` parameter in `lsb.queues`.

  * `Epilog`: the fully qualified path of a program to execute on the LSF server node on job allocation release. As an LSF queue parameter, it corresponds to the `POST_EXEC` parameter in `lsb.queues`

  * `Host prolog`: the fully qualified path of a program to execute on each node of a job before the job is started. Corresponds to the `HOST_PRE_EXEC` parameter in `lsb.queues`. By default it is configured to run the generic prolog

  * `Host epilog`: the fully qualified path of a program to execute on each node of a job after the job is finished. Corresponds to the `HOST_POST_EXEC` parameter in `lsb.queues`. By default it is configured to run the generic epilog.

## 7.4  Enabling, Disabling, And Monitoring Workload Managers

#### 7.4.0.1  Enabling And Disabling A WLM

A WLM can be disabled for all nodes with `cm-wlm-setup`. Disabling the WLM means the workload management services are stopped by removing roles, and removing the WLM cluster object.

Alternatively, a WLM can be enabled or disabled by the administrator using role addition and role removal with Base View or `cmsh`. This is described further on in this section.

**Multiple WLM instances of the same type:** Versions of NVIDIA Base Command Manager prior to 9.0 already had the ability to have different workload managers run at the same time. However, NVIDIA Base Command Manager version 9.0 introduced the additional ability to run many workload managers of the same kind at the same time.

**Example**

Two WLM instances, Slurm and LSF, are already running at the same time in the cluster, with each WLM assigned to one category. Then, BCM can start up a third WLM instance, such as another Slurm WLM instance. These WLM instances are alternatively called WLM clusters, because they effectively allow one cluster to function as many separate clusters as far as running WLMs is concerned.

From the Base View or `cmsh` point of view a WLM consists of

* a WLM server, usually on the head node

* WLM clients, usually on the compute nodes

For the administrator, enabling or disabling the servers or clients is then simply a matter of assigning or unassigning a particular WLM server or client role on the head or compute nodes, as deemed appropriate.

The administrator typically also sets up an appropriate WLM environment module (`slurm`, `lsf`), so that it is loaded up for the end user (section [2.2.3](/admin/clustermanagement#223-setting-up-a-default-environment-for-all-users)).

### 7.4.1  Enabling And Disabling A WLM With Base View

A particular WLM package may be installed, but the WLM may not be enabled. This can happen, for example, if disabling a WLM that was previously enabled.

If a WLM instance exists, then the WLM client, submission, and server roles can be enabled or disabled from Base View by assigning or removing the appropriate roles to nodes, categories, or configuration overlays. Within the role, the properties of the WLM may be further configured by setting options.

#### 7.4.1.1  Workload Manager Role Assignment To An Individual Node With Base View

**Workload Manager Server** The following roles are WLM roles that can be assigned to a node:

* `server`

* `submit`

* `accounting` (for the Slurm WLM only, to configure and run the `slurmdbd` service)

* `client`

Typically these roles are assigned using configuration overlays.

For example, if the default Slurm configuration is carried out with `cm-wlm-setup`, then the Slurm server role is assigned to the head node, `basecm11`, which can be viewed using the navigation path:

<code>
  Devices > All Devices > Head Node

   \> Settings > Roles

   \> slurmserver
</code>

![Workload management role assignment on a head node](/base-command-manager/product-manuals/_fern-img/8b86455ba3d86dc1ed2b0773c048e371d31d8f363df9d4ecc402ef42e6c9d8e0.webp)

*Figure 7.16: Workload management role assignment on a head node*

Overriding the configuration overlay assignment is possible, at node or category level. For example at node level the role can be defined by assignment at node level, using the navigation path:

<code>
  Devices > All Devices > Head Node

   \> Settings > Roles

   \> +Add > SlurmServerRole
</code>

This allows parameters to be changed within the role. For example, for the `SlurmServerRole` the `Slurmctld start policy` can then be modified at node level.

Workload manager options that are not regarded as server role options can be found under the workload manager object. For Slurm this is in the navigation path:

<code>
  HPC > Workload Management Clusters
</code>

For example, for a Slurm instance in the Workload Management Clusters pane, a `builtin` or `backfill` option can be set for the `Scheduler` parameter (figure [7.17](#fig-base-view-workloadmanagement-choice-of-workloadmanager-head-scheduler)).

![Workload management role assignment options on a head node](/base-command-manager/product-manuals/_fern-img/1f4d35a18e1668da6fdf62cbe0ff97d9165b10e63cc71ab10d1fc6476846702f.webp)

*Figure 7.17: Workload management role assignment options on a head node*

To have the server start up on non-head nodes (but not for a head node), the `imageupdate` command (section [5.6.2](/admin/provisioning#562-updating-running-nodes-with-cmsh-using-imageupdate)) can be run. The workload manager server process and any associated schedulers then automatically start up.

**Workload Manager Client** Similarly, the workload manager client process can be enabled on a node or head node by having the workload manager client role assigned to it at a node level. Some basic options can be set for the client role.

Saving the role, and then running `imageupdate` (section [5.6.2](/admin/provisioning#562-updating-running-nodes-with-cmsh-using-imageupdate)), automatically starts up the client process with the options chosen, and managed by CMDaemon.

#### 7.4.1.2  Workload Manager Role Assignment To A Category With Base View

It is true that workload manager role assignment can be done as described in the preceding text for individual non-head nodes. However it is usually more efficient to assign roles using categories or configuration overlays, due to the large number of compute nodes in typical clusters.

For example, the case can be considered of all physical on-premises non-head nodes. By default these are in the `default` category. This means that, by default, roles in the category are automatically assigned to all those non-head nodes, unless, as an exception, an individual node configuration overrides the category setting and uses a role setting instead at node level.

The workload manager roles for the category `default` can be viewed by using the navigation path: <code>Grouping > Categories\[default] > Settings > Roles</code>

If the role has been assigned at category level, then clicking through to the subpane for a role allows role options to be edited and saved.

However,the default configuration using `cm-wlm-setup` assigns the role at configuration overlay level, which means that the role options (role settings) can

* either be configured using the navigation path from the configuration overlay level:

  `Grouping > Configuration Overlays[`*configuration overlay role*`] > Settings > Roles > `*role under configuration overlay role* <code> > Role settings</code>

* or they can be configured by adding a role at category level (or node level), with the `+Add` option. For example, for category level using the `default` category:

  <code>Grouping > Categories\[default] > Settings > Roles > + Add ></code>*category-level role*

For compute nodes, the role assigned is usually a workload manager client. If the assigned role is that of a workload manager client, then the node with that role can have queues, GPUs, and other parameters specified for it.

For example, queues can then be assigned using the navigation path:\
`HPC > WLM Management Clusters[`*Slurm instance* <code>] > Job Queues</code> while GPUs, if using Slurm as the workload manager with default settings, with a default `cm-wlm-setup` installation, have a configuration overlay `slurm-client-gpu` that is specified using the navigation path:

<code>
  Grouping > Configuration Overlays > slurm-client-gpu

   \> Settings > roles

   \> slurmclient

   \> Generic Resources

   \> gpu
</code>

The workload manager server role can also be assigned to a non-head node. For example, a Slurm server role can be taken on by a non-head node. This is the equivalent to the `--server-nodes` option of `cm-wlm-setup`.

Saving the roles with their options and then running `imageupdate` (section [5.6.2](/admin/provisioning#562-updating-running-nodes-with-cmsh-using-imageupdate)) automatically starts up the newly-configured workload manager.

#### 7.4.1.3  Workload Manager Role Options With Base View

Each workload manager client role (sometimes loosely called a compute node role) has options that can be set for `GPUs`, `Queues`, and `Slots`. Generally, the value that is set for `Slots` is the number of jobs expected to run on a node simultaneously. This number can, for example, be set to the number of threads. Threads (virtual cores) in the x86_64 architecture are provided by Intel’s hyper-threading (HT), or by AMD’s simultaneous multithreading (SMT).

The physical CPU, the cores on the CPU, and the threads of a core (HT, SMT) should not be confused with each other. They are distinct concepts, and can all have different values.

* `Slots`, in a workload manager, corresponds in BCM to:

  * the `CPUs` setting (a `NodeName` parameter) in Slurm’s `slurm.conf`

  * the `-n` flag, or the total number of processor slots requested, in IBM Spectrum LSF

  * the `nproc` (or `ncpus`) setting in PBS,

  In LSF setting the number of slots for the client role to `0` means that the client node does not run jobs on itself, but becomes a submit host, which means it is able to forward jobs to other client nodes.

  The default value for `Slots` is `AUTO`, which means that the value for `Slots` is auto-detected. The parameter may be alternatively be set to a non-negative number. Each WLM has a different implementation on how this is done. For instance, for Slurm, BCM uses Slurm’s own auto-detection implementation.

* `Queues` with a specified name are available in their associated role after they are created. The creation of queues is described in sections [7.6.2](#762-queues-display-and-handling-in-base-view) (using Base View) and [7.7.3](#773-job-queue-display-and-handling-in-cmsh-jobqueue-mode) (using `cmsh`).

All server roles also provide the option to enable or disable the `External Server` setting. Enabling that means that the server is no longer managed by BCM, but provided by an external device.

The `cmsh` equivalent of enabling an external server is described [here](#cmshexternalservertorque).

### 7.4.2  Enabling And Disabling A Workload Manager With `cmsh`

A particular workload manager package may be set up, but not enabled. This can happen, for example, if no WLM server or WLM client role has been assigned.

If a WLM instance exists, then the WLM client, server, or submit roles can be enabled from `cmsh` by assigning it from within the `roles` submode. Within the assigned role, the properties of the WLM may be further configured by setting options.

#### 7.4.2.1  Workload Manager Role Assignment To A Configuration Overlay With `cmsh`

In `cmsh`, workload manager role assignment to a configuration overlay (section [2.1.5](/admin/clustermanagement#215-roles)) can be done using `configurationoverlay` mode. By default `cm-wlm-setup` run as a TUI session creates some configuration overlays with suggestive names, and assigns roles to the configuration overlays according to what the names suggest. Thus, for example, with the `cm-wlm-setup` TUI session used to carry out an express setup for Slurm, the configuration overlays that get created are the following:

**Example**

```bash
[basecm11->configurationoverlay]% list
Name (key)           Priority   All head nodes Nodes            Categories       Roles
-------------------- ---------- -------------- ---------------- ---------------- ----------------
slurm-accounting     500        yes                                              slurmaccounting
slurm-client         500        no                              default          slurmclient
slurm-server         500        yes                                              slurmserver
slurm-submit         500        no                              default          slurmsubmit
wlm-headnode-submit  600        yes                                              slurmsubmit
```

Nodes in the default category can take on the `slurmclient` or `slurmsubmit` role by setting the nodes for the role using the associated configuration overlays `slurm-client` or `slurm-submit`.

The `wlm-headnode-submit` configuration overlay is a special overlay. It is applied only to the head node, and is shared among all installed workload managers. Setting this overlay means that the head node, by default, has a submit role for a given workload manager.

**Example**

```bash
[basecm11->configurationoverlay]% use slurm-client
[basecm11->configurationoverlay[slurm-client]]% show
Parameter                        Value
-------------------------------- ------------------------------------------------
Name                             slurm-client
Revision
All head nodes                   no
Priority                         500
Nodes
Categories                       default
Roles                            slurmclient
Customizations                   <0 in submode>
[basecm11->configurationoverlay[slurm-client]]% set nodes
node001  node002  node003  basecm11
[basecm11->configurationoverlay[slurm-client]]% set nodes node001..node002
[basecm11->configurationoverlay*[slurm-client*]]% commit
[basecm11->configurationoverlay[slurm-client]]% list
Name (key)           Priority   All head nodes Nodes            Categories       Roles
-------------------- ---------- -------------- ---------------- ---------------- ----------------
slurm-accounting     500        yes                                              slurmaccounting
slurm-client         500        no             node001,node002  default          slurmclient
slurm-server         500        yes                                              slurmserver
slurm-submit         500        no                              default          slurmsubmit
wlm-headnode-submit  600        yes                                              slurmsubmit
[basecm11->configurationoverlay[slurm-client]]%
```

All the head nodes can also be made to take on the configuration overlay role by setting its `All head nodes` value to `yes`. The union set of `All head nodes` with `Nodes` is the set of nodes to which the role is applied for that configuration overlay.

Values for the parameters in a role, such as the `slurmclient` role, can be set within the configuration overlay:

**Example**

```bash
[basecm11->configurationoverlay[slurm-client]]% roles
[basecm11->configurationoverlay[slurm-client]->roles]% use slurmclient
[basecm11->configurationoverlay[slurm-client]->roles[slurmclient]]% show
Parameter                          Value
---------------------------------- -------------------------------------
Name                               slurmclient
Revision
Type                               SlurmClientRole
Add services                       yes
WLM cluster                        slurm
Slots                              0
All queues                         no
Queues                             defq
Features
Sockets                            0
Cores per socket                   0
Threads per core                   0
Boards                             0
Sockets per board                  0
Real memory                        0B
Node address
Weight                             0
Port                               0
Tmp disk                           0
Reason
CPU spec list
Core spec count                    0
Mem spec limit                     0B
GPU auto detect                    BCM
Node customizations                <0 in submode>
Generic resources                  <0 in submode>
Cpu bindings                       None
Slurm hardware probe auto detect   yes
Memory autodetection slack         10.0%
IMEX                               no
Write procs always                 no
Write only Procs                   no
Add to topology                    yes
Nodesets
Power profiles                     <submode>
Nodeset features
[basecm11->configurationoverlay[slurm-client]->roles[slurmclient]]%
```

After the workload manager roles are assigned or unassigned, and after running `imageupdate` (section [5.6.2](/admin/provisioning#562-updating-running-nodes-with-cmsh-using-imageupdate)) for non-head nodes, the associated workload manager services automatically start up or stop as appropriate.

The configuration overlay role values are inherited by categories and nodes, unless the categories and nodes have their own values set. Thus, for role properties, a value set at node level overrides values set at category level, and a value set at configuration overlay level overrides a value set at category level. This is typical of how properties of objects are inherited in BCM levels.

#### 7.4.2.2  Workload Manager Role Assignment To A Category With `cmsh`

In `cmsh`, workload manager role assignment to a node category can be done using `category` mode, using the category name, assigning a role from the `roles` submode, setting the WLM instance for that role, and committing the modified role:

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% category
[basecm11->category]% use default
[basecm11->category[default]]% roles
[basecm11->category[default]->roles]% assign slurmclient
[basecm11->category[default]->roles*[slurmclient*]]% wlm list
Type    Name (key)            Server nodes Submit nodes     Client nodes
------- --------------------- ------------ ---------------- ----------------
slurm   slurm1                basecm11     basecm11,node001 node001,node002
[basecm11->category[default]->roles*[slurmclient*]]% set wlmcluster slurm1
[basecm11->category[default]->roles*[slurmclient*]]% commit
```

Settings that are assigned in the `slurmclient` role of the category overrule the `slurmclient` role configuration overlay settings.

The role assignment at category level requires the value for a WLM instance to be specified for `wlmcluster` before the `commit` command is successful.

#### 7.4.2.3  Workload Manager Role Assignment To An Individual Node With `cmsh`

In `cmsh`, assigning a workload manager role to a head node can be done in `device` mode. This can be done by using the head node name as the device, assigning the workload manager role to the device, setting the WLM instance value to the role within the `role` submode, and committing the modified role.

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% device
[basecm11->device]% use basecm11
[basecm11->device[basecm11]]% roles
[basecm11->device[basecm11]->roles]% assign slurmserver
[basecm11->category[default]->roles*[slurmserver*]]% wlm list
Type    Name (key)            Server nodes Submit nodes     Client nodes
------- --------------------- ------------ ---------------- ----------------
slurm   slurm1                basecm11     basecm11,node001 node001,node002
[basecm11->category[default]->roles*[slurmserver*]]% set wlmcluster slurm1
[basecm11->device*[basecm11*]->roles*[slurmserver*]]% commit
[basecm11->device[basecm11]->roles[slurmserver]]%
```

For regular nodes, role assignment is done using `device` mode, using the node name. Th node name is assigned the workload manager role, the WLM instance value is set for that role in the `role` submode, and the modified role is committed.

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% device
[basecm11->device]% use node001
[basecm11->device[node001]]% roles
[basecm11->device[node001]->roles]% assign slurmclient
[basecm11->device[node001]->roles*[slurmclient*]]% wlm list
Type    Name (key)            Server nodes Submit nodes     Client nodes
------- --------------------- ------------ ---------------- ----------------
slurm   slurm1                basecm11     basecm11,node001 node001,node002
[basecm11->device[node001]->roles*[slurmclient*]]% set wlmcluster slurm1
[basecm11->device[node001]->roles*[slurmclient*]]% commit
[basecm11->device[node001]->roles[slurmclient]]%
```

The role assignment at node level requires the value for a WLM instance to be specified for `wlmcluster` before the `commit` command is successful.

Role assignment values set in `device` mode have precedence over any role assignment values set in `category` mode for that node. This means, for example, that if a node is originally in a node category with a `slurmclient` role and queues set, then when the node is assigned a `slurmclient` role from `device` mode, its queue properties are empty by default.

#### 7.4.2.4  Setting Options For Workload Manager Settings With `cmsh`

In the preceding text, it is explained how the workload manager client or server is assigned a role (such as `slurmclient` or `slurmserver`) within the `roles` submode. It is done from within a main mode of `cmsh`. The main modes from which role assignment can be done are: `configurationoverlay`, `category` or `device`.

**Options for workload managers in general:** Whatever main mode is used, the workload manager options for a role can then be set with the usual object commands introduced in section [2.5.3](/admin/clustermanagement#253-working-with-objects).

* **WLM client options:** For example, the configuration options of a WLM client, such as the Slurm client, can be seen by using the `show` command for the role.

  Here it can be seen in the `slurmclient` role, provided by the default configuration overlay `slurm-client`:

  **Example**

  ```bash
  [basecm11->configurationoverlay[slurm-client]->roles[slurmclient]]% show
  Parameter                          Value
  ---------------------------------- ------------------------------------------------
  Name                               slurmclient
  Revision
  Type                               SlurmClientRole
  Add services                       yes
  WLM cluster                        slurm
  Slots                              0
  All queues                         no
  Queues                             defq
  Features
  Sockets                            0
  Cores per socket                   0
  Threads per core                   0
  Boards                             0
  Sockets per board                  0
  Real memory                        0B
  Node address
  Weight                             0
  Port                               0
  Tmp disk                           0
  Reason
  CPU spec list
  Core spec count                    0
  Mem spec limit                     0B
  GPU auto detect                    BCM
  Node customizations                <0 in submode>
  Generic resources                  <0 in submode>
  Cpu bindings                       None
  Slurm hardware probe auto detect   yes
  Memory autodetection slack         10.0%
  IMEX                               no
  Write procs always                 no
  Write only Procs                   no
  Add to topology                    yes
  Nodesets
  Power profiles                     <submode>
  Nodeset features
  ```

  The `Slots` option can be set in the role

  **Example**

  ```bash
  [basecm11->configurationoverlay[slurm-client]->roles[slurmclient]]% set slots 2
  [basecm11->configurationoverlay*[slurm-client*]->roles*[slurmclient*]]% commit
  [basecm11->configurationoverlay[slurm-client]->roles[slurmclient]]%
  ```

* **WLM server options:** Similarly, WLM server options can be managed from an assigned server role. For Slurm, the `slurmserver` role for a device shows:

  **Example**

  ```bash
  [basecm11->configurationoverlay[slurm-server]->roles[slurmserver]]% show
  Parameter                        Value
  -------------------------------- ------------------------------------------------
  Name                             slurmserver
  Revision
  Type                             SlurmServerRole
  Add services                     yes
  WLM cluster                      slurm
  External server                  no
  Slurmctld start policy           ALWAYS
  ```

**Option to set an external workload manager:** A workload manager can be set to run as an external server from its `slurmserver` role, within a configuration overlay or within device mode :

**Example**

```bash
[basecm11->device[basecm11]->roles[slurmserver]]% set externalserver on
[basecm11->device[basecm11]->roles[slurmserver*]]% commit
```

For convenience, setting the external server on the head node is recommended.

The Base View equivalent of configuring `externalserver` is described [here](#7413-workload-manager-role-options-with-base-view).

### 7.4.3  Monitoring The State Of Workload Manager Services

By default, the workload manager services are monitored. BCM attempts to restart the services using the service tools (section [3.15](/admin/configuring#315-managing-and-configuring-services)), unless the role for that workload manager service is disabled, or the service has been stopped.

Workload manager roles and corresponding services can be disabled using `cm-wlm-setup` (section [7.3](#73-installation-of-workload-managers)), Base View role configuration (section [7.4.1](#741-enabling-and-disabling-a-wlm-with-base-view)), or `cmsh` role configuration (section [7.4.2](#742-enabling-and-disabling-a-workload-manager-with-cmsh)).

The daemon service states can be viewed for each node using the shell, `cmsh`, or Base View (section [3.15](/admin/configuring#315-managing-and-configuring-services)).

Queue submission and scheduling daemons normally run on the head node.

#### 7.4.3.1  Viewing Services In Base View

From Base View services are viewable using the navigation path to the services running on the node. For example, on a head node `basecm11`, the navigation path:

<code>
  Devices > All Devices > basecm11

   \> Settings > Services
</code>

leads to a display similar to figure [7.18](#fig-base-view-head-services):

![Services seen on head node in Base View](/base-command-manager/product-manuals/_fern-img/41c9b078f39b5c6605eb950bd8ba164f261486a74cd8134db416f62a7023cef5.webp)

*Figure 7.18: Services seen on head node in Base View*

For a regular node, a similar navigation path for `node001`, for example, is:

<code>
  Devices > All Devices > node001

   \> Settings > Services
</code>

and leads to a display similar to figure [7.19](#fig-base-view-regular-node-services):

![Services seen on regular node in Base View](/base-command-manager/product-manuals/_fern-img/4e4b7e8ffe14ab9b43cdbd0479ef070262dcea7408866c46638c1ef2edf5c0c4.webp)

*Figure 7.19: Services seen on regular node in Base View*

#### 7.4.3.2  Viewing Roles In Base View

Services are often set with BCM roles (section [2.1.5](/admin/clustermanagement#215-roles)). The navigation path:\
<code>Devices > All Devices > basecm11 > Settings > Roles</code>\
shows the list of roles. Figure [7.20](#fig-base-view-head-wlm-roles) shows some of the Slurm roles that result in Slurm services running on the head node:

![Roles seen on head node in Base View](/base-command-manager/product-manuals/_fern-img/c75c25ab0c9f5ab64e04b83f5598a5dc29950bfce1b7e44edefdd25db2383249.webp)

*Figure 7.20: Roles seen on head node in Base View*

Similarly, the navigation path:\
<code>Devices > All Devices > node001 > Settings > Roles</code>\
shows the list of roles for a regular node. Figure [7.21](#fig-base-view-regular-node-wlm-roles) shows some of the Slurm roles that result in Slurm services running on the regular nodes:

![Roles seen on regular node in Base View](/base-command-manager/product-manuals/_fern-img/3ccf8629bf65f701e805b3725e401a3aa13931c751a5f23770e4bc7329eb1bb7.webp)

*Figure 7.21: Roles seen on regular node in Base View*

The roles seen in these figures are from the defaults that `cm-wlm-setup` provides in an express setup.

For regular nodes, the inheritance of roles from category level or configuration overlay level is indicated by the values in the parentheses alongside the role name. Thus, in figure [7.21](#fig-base-view-regular-node-wlm-roles), the `slurmsubmit` and `slurmclient` roles are decided by the default setting from the configuration overlay.

The assignment of roles can be varied to taste for WLMs. This allows WLM services to run on the head node or on the regular nodes.

#### 7.4.3.3  Viewing Services And Roles In `cmsh`

From `cmsh` the services states are viewable from within `device` mode, using the `services` command. One-liners from the shell to illustrate this are (output elided):

**Example**

```bash
[root@basecm11 ~]# cmsh -c "device services node001; status"
Service      Status
------------ -----------
...
munge        [   UP   ]
named        [   UP   ]
nslcd        [   UP   ]
...
slurmd       [   UP   ]
[root@basecm11 ~]# cmsh -c "device services basecm11; status"
Service      Status
------------ -----------
...
munge        [   UP   ]
...
slurmctld    [   UP   ]
slurmdbd     [   UP   ]
```

Roles can be viewed from within the main modes of `configurationoverlay`, `category`, or `device`. One-liners to view these are:

**Example**

```bash
[root@basecm11 ~]# cmsh -c "configurationoverlay; list"
Name (key)           Priority   All head nodes Nodes            Categories       Roles
-------------------- ---------- -------------- ---------------- ---------------- ----------------
slurm-client         500        no                              default          slurmclient
slurm-server         500        yes                                              slurmserver
wlm-headnode-submit  600        yes                                              slurmsubmit

[root@basecm11 ~]# cmsh -c "category; use default; roles; list -p"
Name (key)
----------------------------
[overlay:slurm-client:500] slurmclient

[root@basecm11 ~]# cmsh -c "device use node001; roles; list -p"
Name (key)
----------------------------------------
[overlay:slurm-client:500] slurmclient

[root@basecm11 ~]# cmsh -c "device use basecm11; roles; list -p"
Name (key)
----------------------------------------
[750] backup
[750] boot
[750] firewall
[750] headnode
[750] monitoring
[750] provisioning
[750] storage
[overlay:slurm-server:500] slurmserver
```

The `-p|--priority` option displays of the `list` command the priority setting for the roles.

## 7.5  Configuring And Running Individual Workload Managers

BCM deals with the various choices of workload managers in as generic a way as possible. This means that not all features of a particular workload manager can be controlled, so that fine-tuning must be done through the workload manager configuration files. Workload manager configuration files that are controlled by BCM should normally not be changed directly because BCM overwrites them. However, overwriting by CMDaemon is prevented on setting the directive:

`FreezeChangesTo` \<*workload manager*>`Config = <true|false>`

in `cmd.conf` (Appendix [C](/admin/cmdconf)), where \<*workload manager*> takes the value of `Slurm` or `LSF`, as appropriate. The value of the directive defaults to `false`.

A list of configuration files that are changed by CMDaemon, the items changed, and the events causing such a change are listed in Appendix [H](/admin/workloadmanagerconfigupdate).

A very short guide to some specific workload manager commands that can be used outside of the NVIDIA Base Command Manager 11 system is given in Appendix [F](/admin/workloadmanagementquickref).

### 7.5.1  Configuring And Running Slurm

#### 7.5.1.1  Slurm Packages

At the time of writing of this section (July 2026), BCM is integrated with Slurm packages for Slurm versions 25.05, 25.11, and 26.05. Slurm version 25.11 is installed by default.

For Slurm version 25.05, the following packages are available from the BCM repositories for Ubuntu 24.04:

* `slurm25.05`: Simple Linux Utility for Resource Management, Slurm Workload Management.

* `slurm25.05-contribs`: contributed utilities for Slurm

* `slurm25.05-devel`: Development package for Slurm. Includes the header files and static libraries for the SLURM API.

* `slurm25.05-example-configs`: Example configuration files for Slurm.

* `slurm25.05-libpmi`: Slurm’s implementation of the pmi libraries.

* `slurm25.05-openlava`: OpenLava/LSF wrappers for transition from OpenLava/LSF to Slurm.

* `slurm25.05-pam`: PAM module for restricting access to compute nodes via Slurm.

* `slurm25.05-perlapi`: Perl API to Slurm.

* `slurm25.05-prs`: Slurm PRS plugin.

* `slurm25.05-sackd`: Slurm authentication daemon. Used on login nodes that are not running slurmd daemons to allow authentication to the cluster.

* `slurm25.05-slurmctld`: Slurm control daemon.

* `slurm25.05-slurmd`: Slurm compute node daemon.

* `slurm25.05-slurmdbd`: Slurm database daemon.

* `slurm25.05-slurmrestd`: Slurm REST API translator.

* `slurm25.05-torque`: Torque/PBS wrappers for transition from Torque/PBS to Slurm.

For Slurm version 25.11, the value of 25.05 is simply replaced by 25.11 in the preceding list of packages.

Similarly, for Slurm version 26.05, the value of 25.05 is simply replaced by 26.05 in the preceding list of packages.

The distribution version of Slurm (package: `slurm`) is not integrated with BCM and conflicts with the preceding packages. It should not be used.

From BCM 11.34, BCM Slurm packages include the `acct_gather_energy/ipmi` plugin alongside the existing energy plugins (`gpu`, `ibmaem`, `pm_counters`, and `rapl`). This allows administrators to set `AcctGatherEnergyType=acct_gather_energy/ipmi` in `slurm.conf` to collect per-node power and energy data from IPMI-based baseboard sensors for job accounting and efficiency reporting. Configuration details can be found in the SchedMD documentation at [https://slurm.schedmd.com/slurm.conf.html#OPT_AcctGatherEnergyType](https://slurm.schedmd.com/slurm.conf.html#OPT_AcctGatherEnergyType).

Important updates from upstream are patched into the BCM repositories. If updating Slurm packages, all the Slurm packages should be updated to the same version, on the compute nodes as well as on the scheduling node.

#### 7.5.1.2  Building Custom Slurm Packages

The BCM Slurm packages can be rebuilt from source by the administrator, on the BCM cluster itself. Rebuilding allows important Slurm patches to be applied sooner than the standard BCM release cycle provides them, and allows the Slurm binaries to be optimized for a particular CPU or hardware configuration.

The build script, along with the RPM and DEB spec files that NVIDIA uses to build the packages, is shipped in a `slurm`\<*version*>`-builder` package, for example `slurm25.11-builder` or `slurm26.05-builder`. Because the spec files are bundled in the package, no separate download of them is needed. The builder package is available from the BCM repositories, but is not installed by default. Installing it places the build script in `/cm/local/apps/slurm/current/builder/`, which is not in the standard `$PATH`.

Only Slurm version 25.11 and higher can be built with this script. The earlier Slurm version that BCM also ships, 25.05, cannot be built with it.

The script can be run on BCM clusters running RHEL 9, RHEL 10, Ubuntu 22.04, Ubuntu 24.04, or Ubuntu 26.04. SLES is not supported.

The script takes a required `--version` option, in *X.Y.Z* format:

```bash
[root@basecm11 ~]# cd /cm/local/apps/slurm/current/builder
[root@basecm11 builder]# ./create-packages.sh --version 25.11.5
```

The script downloads the Slurm source tarball and loads the modulefiles that are needed for the build. When the build finishes, the resulting packages are saved to `/tmp/slurm`\<*version*>`-`\<*revision*>`-`\<*release-tag*>`/`, where \<*revision*> is a build counter that increases with each run, and \<*release-tag*> encodes the BCM version and a checksum of the source tarball.

**Validating the build environment:**

Adding the `--validate` option carries out a dry run that checks the prerequisites without building anything. Each check is reported as `[PASS]` or `[FAIL]`, and the script exits with 0 if every check passed, or 1 if any check failed:

```bash
[root@basecm11 builder]# ./create-packages.sh --version 25.11.5 --validate
Slurm version: 25.11.5                                                   [PASS]
Distribution                                                             [PASS]
Host tools                                                               [PASS]
Build tools                                                              [PASS]
Build dependencies                                                       [PASS]
Modules                                                                  [PASS]
Disk space                                                               [PASS]

All checks passed.
```

The checks cover the Slurm version, the distribution and its major version, the host tools (`wget`, `tar`, and `jq`), the build tool (`dpkg-buildpackage` on Ubuntu, or `rpmbuild` on RHEL), the build dependencies, the availability of the required modules, and whether at least 100MB of disk space is free.

**Building inside a software image:**

Packages that are intended for a particular software image should be built inside that image, so that the build uses the same operating system, libraries, and modules that the image provides. The image should be cloned first, using `cmsh` or Base View, and the build then run inside the clone with `cm-chroot`:

```bash
[root@basecm11 ~]# cm-chroot /cm/images/slurm-builder \
/cm/local/apps/slurm/current/builder/create-packages.sh --version 25.11.5
```

The build dependencies are installed automatically, driven by a `dependencies.yaml` file that ships with the builder package, whether the script is run on the host or inside a `cm-chroot` image. No manual dependency installation is required beforehand.

**Building from a different source tarball:**

A source tarball other than the one that the script downloads from upstream can be used by passing its path with `--archive`:

```bash
[root@basecm11 builder]# ./create-packages.sh --version 25.11.5 \
--archive /root/slurm-25.11.5.tar.bz2
```

The contents of the tarball must be inside a directory that matches the version being built. So, for Slurm 25.11.5, the tarball contents must be inside a directory called `slurm-25.11.5`, in the same way as the upstream Slurm tarballs.

The packages that are built are installed in the same way as for a Slurm upgrade, except that the packages are taken from the local directory instead of from the package repositories.

#### 7.5.1.3  Upgrading From Earlier Slurm Versions To `slurm25.11`

Upgrading between major versions of Slurm is generally possible. At the time of writing (December 2025) of this section, the upstream Slurm policy allows upgrades from three previous major release versions since version 24.11. Details on the upgrade compatibility can be seen at the SchedMD site at [https://slurm.schedmd.com/upgrades.html#compatibility_window](https://slurm.schedmd.com/upgrades.html#compatibility_window).

It is a good idea to upgrade one version at a time, rather than jumping too many versions ahead, which can require a full wipe of the Slurm configuration.

If Slurm is using Pyxis (section [7.3.3](#733-installation-and-configuration-of-enroot-and-pyxis-with-slurm-to-run-containerized-jobs)), then upgrading the Slurm version means that Pyxis needs to be reinstalled using `cm-wlm-setup`. The reinstallation run for Pyxis compiles Pyxis and recreates a plugin directory for the new Slurm version under `/cm/local/apps/slurm/`.

An upgrade from one major version of Slurm to another can be carried out according to the following example, which is for an update from major version 25.05 to version 25.11, and avoids total reconfiguration of the Slurm configuration:

* It is recommended that no jobs are running. Draining nodes (section [7.7.4](#774-nodes-drainage-status-and-handling-in-cmsh)) is one way to arrange this over time. No new jobs run on a drained node, but old ones are allowed to finish.

* When all running jobs are finished, then Slurm server services—`slurmctld` and `slurmdbd`—should be stopped using `cmsh` or Base View (section [3.15.2](/admin/configuring#3152-managing-and-configuring-servicesexamples)):

  **Example**

  ```bash
  [basecm11->device[basecm11]->services]% stop slurmctld
  ...Service slurmctld was stopped
  [basecm11->device[basecm11]->services]% stop slurmdbd
  ...Service slurmdbd was stopped
  ```

* The old Slurm packages should then be removed. There can be only one version of Slurm at a time, so there will be a package installation conflict if a new version is installed while an old one is still there.

  Removal can be carried out on RHEL-based systems with, for example:

  ```bash
  [root@basecm11 ~]# yum remove slurm25.05*
  ```

  In Ubuntu the equivalent is carried out using `apt remove slurm25.05*`.

  The old packages must also be removed from each software image that uses it:

  **Example**

  ```bash
  [root@basecm11 ~]# cm-chroot-sw-img /cm/images/<software image>
  ...
          [root@<software image> /]# yum remove slurm25.05*
  ...removal takes place...
  [root@<software image> /]# exit
  ```

  The `cm-chroot-sw-img` wrapper utility is discussed in section [9.4.1](/admin/softwareimagemanagement#941-installing-from-head-into-the-image-changing-the-root-directory-into-which-the-packages-are-deployed).

* The new packages can then be installed. For installation onto the RHEL head node, the installation might be carried out as follows:

  ```bash
  [root@basecm11 ~]# yum install slurm25.11 slurm25.11-contribs slurm25.11-devel \
  slurm25.11-libpmi slurm25.11-openlava slurm25.11-pam slurm25.11-perlapi \
  slurm25.11-prs slurm25.11-sackd slurm25.11-slurmctld slurm25.11-slurmd \
  slurm25.11-slurmdbd slurm25.11-slurmrestd slurm25.11-torque
  ```

  The same packages as on the head node are installed by default in the software image when installing with `cm-wlm-setup` in versions of Slurm from version 24 onward. The installation is carried out manually for the upgrade in each software image with:

  **Example**

  ```bash
  [root@basecm11 ~]# cm-chroot-sw-img /cm/images/<software image>
  ...
  [root@<software image> /]# yum install slurm25.11-slurmd slurm25.11-contribs slurm25.11-devel \
  slurm25.11-libpmi slurm25.11-openlava slurm25.11-pam slurm25.11-perlapi \
  slurm25.11-prs slurm25.11-sackd slurm25.11-slurmctld \
  slurm25.11-slurmdbd slurm25.11-slurmrestd slurm25.11-torque
  ...installation takes place
  [root@<software image> /]# exit
  ```

* The new Slurm version is then set in `cmsh` or Base View, in the Slurm WLM cluster configuration:

  **Example**

  ```bash
  [root@basecm11 ~]# cmsh
  [basecm11]% wlm use slurm
  [basecm11->wlm[slurm]]% set version 25.11; commit
  ```

* Slurm server services `slurmctld` and `slurmdbd` should then be started again using `cmsh` or Base View:

  **Example**

  ```bash
  [basecm11->device[basecm11]->services]% start slurmdbd
  [basecm11->device[basecm11]->services]% start slurmctld
  ```

* The nodes can then have their new image placed on them, and the new Slurm configuration can then be taken up. This can be done in the following two ways:

  1. The regular nodes can then be restarted to supply the live nodes with the new image and get the new Slurm configuration running.

  2. Alternatively, the `imageupdate` command (section [5.6.2](/admin/provisioning#562-updating-running-nodes-with-cmsh-using-imageupdate)) can be run on the live nodes to supply them with the image.

     Running the `imageupdate` command in dry mode (the default) first is recommended. The `synclog` command can then be run to check there are no unexpected changes that will take place due to the update. If all is well, then `imageupdate`’s wet mode flag `-w` can be used in order to really carry out the task.

     For example, the change can be checked, and then actually carried out, for the image on `node001` with:

     ```bash
     [root@basecm11 ~]# cmsh
     [basecm11]% device use node001
     [basecm11->device[node001]]% imageupdate
     Performing dry run (use synclog command to review result, then pass -w to perform real update)...
     ...some messages...
     imageupdate [ COMPLETED ]
     [basecm11->device[node001]]% synclog
     ...rsync dry run output...
     [basecm11->device[node001]]% imageupdate -w
     ...same messages as before, but this time it really happens...
     [basecm11->device[node001]]% commit
     ```

     The last `commit` command triggers the reconfiguration of the file `/etc/systemd/system/slurmd.service.d/99-cmd.conf` on the node. After a short time—around 30 seconds—the file is regenerated. The `slurmd` service on the node can then be restarted with:

     ```bash
     [root@basecm11 ~]# ssh node001 "systemctl daemon-reload"
     cmsh -c "device services node001; use slurmd; restart"
     ```

#### 7.5.1.4  IMEX

NVIDIA IMEX (Internode Memory Exchange Service) is a secure service that facilitates the mapping of GPU memory over NVLink between the GPUs in an NVLIink domain.

The `imexctl` command in `device` mode lists the status and other properties of the nodes.

**Example**

```bash
[basecm11->device]% imexctl
Node                IP            Status   Version     Connection        IP            Status
------------------- ------------- -------- ----------- ----------------- ------------- ----------
dgx-gb200-c1        10.140.2.134  READY    570.172.08  dgx-gb200-m06-c1  10.140.2.134  CONNECTED
dgx-gb200-c1        10.140.2.134  READY    570.172.08  dgx-gb200-m06-c2  10.140.2.135  CONNECTED
dgx-gb200-c1-dpu0   0.0.0.0
dgx-gb200-c1-dpu1   0.0.0.0
dgx-gb200-c2        10.140.2.135  READY    570.172.08  dgx-gb200-m06-c1  10.140.2.134  CONNECTED
dgx-gb200-c2        10.140.2.135  READY    570.172.08  dgx-gb200-m06-c2  10.140.2.135  CONNECTED
basecm11            0.0.0.0       NONE
basecm11-k8s-01     0.0.0.0       NONE
basecm11-k8s-02     0.0.0.0       NONE
basecm11-k8s-03     0.0.0.0       NONE
basecm11-slogin-0   0.0.0.0       NONE
[basecm11->device]%
```

**Pinning IMEX to a specific network (FQDN or IP in `nodes_config.cfg`):**

By default, the autogenerated IMEX peer list in `/etc/nvidia-imex/nodes_config.cfg` uses the short hostname of each node. IMEX can instead be pinned to a particular network. When a network has the `imex` parameter enabled, the fully qualified domain name (FQDN) on that network is written to `nodes_config.cfg` for each peer. For example, for an IMEX network called *imexnetwork*:

```bash
[root@basecm11 ~]# cmsh
[basecm11]% network use imexnetwork
[basecm11->network[imexnetwork]]% set -e imex yes
[basecm11->network*[imexnetwork*]]% commit
```

The resulting config file uses the FQDN for each node:

```bash
root@node001:~# cat /etc/nvidia-imex/nodes_config.cfg
# This section of this file was automatically generated by cmd. Do not edit manually!
# BEGIN AUTOGENERATED SECTION -- DO NOT REMOVE
node001.eth.cluster
node002.eth.cluster
node003.eth.cluster
# END AUTOGENERATED SECTION   -- DO NOT REMOVE
```

The peers can be written as IP addresses instead of FQDNs by also enabling the `imex ip` parameter on the same network:

```bash
[root@basecm11 ~]# cmsh
[basecm11]% network use imexnetwork
[basecm11->network[imexnetwork]]% set -e imex yes
[basecm11->network*[imexnetwork*]]% set -e "imex ip" yes
[basecm11->network*[imexnetwork*]]% commit
```

The resulting config file uses the IP address of each node on that network, with the node name retained as a comment:

```bash
root@node001:~# cat /etc/nvidia-imex/nodes_config.cfg
# This section of this file was automatically generated by cmd. Do not edit manually!
# BEGIN AUTOGENERATED SECTION -- DO NOT REMOVE
# node001
10.141.0.1
# node002
10.141.0.2
# node003
10.141.0.3
# END AUTOGENERATED SECTION   -- DO NOT REMOVE
```

For Slurm, BCM can enable the IMEX daemon either globally, or per job. **Enabling the IMEX daemon globally for Slurm:**

If IMEX is set globally, then it means that it is set to run on all nodes at runtime.

The advantage of this configuration is that it is easy to set up, and easy to test to see if it is all working.

A disadvantage is that a user running a job on one node can read memory from a job run by another user on another node. It requires overcoming difficult hurdles to carry out, but it is not impossible. The administrator should therefore weigh up if this seems a significant issue for the cluster being administered.

The IMEX global service can be run by setting the values for the service for the compute nodes. For example, nodes in a `dgx-gb200` category can have the service added and set to:

```bash
[basecm11->category[dgx-gb200]->services[nvidia-imex]]% show
Parameter                        Value
-------------------------------- ------------------------------------------------
Revision
Service                          nvidia-imex
Run if                           always
Monitored                        yes
Autostart                        yes
Managed                          yes
```

Per-rack IMEX configuration can be forcibly created, regardless of domains and partitions, with:

```bash
[basecm11->category[dgx-gb200]->services[nvidia-imex]]% set -e rack yes
```

**Enabling and disabling the IMEX daemon per job for Slurm:**

Configuring per job means that IMEX runs just before the job starts, and that the service runs only on a node that needs it for the job.

A disadvantage is that verifying that it actually works requires a job run.

Running the IMEX daemon per job has the advantage that one user running a job cannot read the memory of a job run by another user on another node.

To run IMEX per job, any global IMEX setting must first be cleared away. This can be done by first:

* removing the `nvidia-imex` service configuration entirely from CMDaemon

  **Example**

  ```bash
  [basecm11->category[dgx-gb200]->services[nvidia-imex]]% remove nvidia-imex; commit
  ```

* stopping the service on the compute nodes, for example with `pdssh` or `pdexec`, or simply carrying out a reboot

The value of `imex` in the `slurmclient` role can then be set:

```bash
[root@basecm11 ~]# cmsh
[basecm11]% configurationoverlay roles slurm-client-gpu
[basecm11->configurationoverlay[slurm-client-gpu]->roles]% use slurmclient
[basecm11->configurationoverlay[slurm-client-gpu]->roles[slurmclient]]% set imex yes
[basecm11->configurationoverlay*[slurm-client-gpu*]->roles*[slurmclient*]]% commit
[basecm11->configurationoverlay[slurm-client-gpu]->roles[slurmclient]]%
```

Committing that `imex` setting configures Slurm prolog and epilog scripts in the backend as follows:

* the prolog script configures the IMEX daemon with the nodes allocated to the GPU job and starts the IMEX daemon on the node

* the epilog cleans up the configuration and stops the IMEX daemon on the node

The TCP port used by IMEX for peer communication is defined by `SERVER_PORT` in `/etc/nvidia-imex/config.cfg`.

For running IMEX per job, the port in the file is written in as a random port for that job, in the allowed range of 0 to 65535.

To use an IMEX that is not managed by BCM, the `SERVER_PORT` value needs to be changed manually for all nodes to suit that other IMEX. This can be done with the help of the `pdcp` command, which comes with the `pdsh` package (section [14.1](/admin/administration#141-parallel-shells-pdsh-and-pexec)). The `pdcp` command can copy the `config.cfg` file from the BCM software image to all nodes that no longer use BCM to run IMEX per job.

#### 7.5.1.5  Workload Power Profile Settings

NVIDIA Blackwell GPUs support workload power profile settings (WPPS). The [*NVIDIA Mission Control System Administration Guide*](https://docs.nvidia.com/mission-control/docs/systems-administration-guide/2.0.0/) has more background information on WPPS at:

[https://docs.nvidia.com/mission-control/docs/systems-administration-guide/2.0.0/wpps/introduction.html](https://docs.nvidia.com/mission-control/docs/systems-administration-guide/2.0.0/wpps/introduction.html)

For WPPS to work as expected, a node that has a job allocated to it must have the job allocated exclusively to it, and oversubscribe ([here](/admin/configuring#31726-gpu-configuration-for-hpc-workload-managers)) should not be set.

Each GPU in a job can have a specific workload power profile set for it. The profile can vary per GPU and per user. The `gpuworkloadpowerprofiles` command ([here](#management-using-gpuworkloadpowerprofiles)) can be used to configure the GPU workload power profiles.

BCM allows the user who is running a Slurm job to change the job power profiles in two ways:

1. Statically: the job prolog script switches the power profiles for all GPUs allocated to the job just before the job starts. That is, the power profile is managed at job submission time.

2. Dynamically: the job process sets power profiles for each allocated GPU during job execution. That is, the power profile is managed during the job runtime.

In both cases, when the job is finished, the epilog script resets the GPU power profiles back to the default.

Workload power profiles settings are a part of the `slurmclient` role, located within the `Power profiles` submode. They can be reached from within the configuration overlay, category, or node level:

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% configurationoverlay roles slurm-client-gpu
[basecm11->configurationoverlay[slurm-client-gpu]->roles]% use slurmclient
[basecm11->configurationoverlay[slurm-client-gpu]->roles[slurmclient]]% powerprofiles
[basecm11->configurationoverlay[slurm-client-gpu]->roles[slurmclient]->powerprofiles]% show
Parameter                        Value
-------------------------------- ------------------------------------------------
Disabled                         yes
Fail on error                    no
Job keyword                      wpps
Jobs profiles directory          /var/run/nvidia/workload-power-profiles
Debug                            no
Debug log directory              /var/spool/cmd/wlm/wpps
[basecm11->configurationoverlay[slurm-client-gpu]->roles[slurmclient]->powerprofiles]% set disabled no
[basecm11->configurationoverlay*[slurm-client-gpu*]->roles*[slurmclient*]->powerprofiles*]% commit
[basecm11->configurationoverlay[slurm-client-gpu]->roles[slurmclient]]%
```

With Base View, the equivalent navigation path to the preceding is:

<code>
  Grouping > Configuration Overlays > slurm-client-gpu

   \> Settings > Roles

   \> slurmclient

   \> Power profiles
</code>

The `Power profiles` parameters as shown in `cmsh` are:

1. `Disabled`: forbids a job from changing workload power profiles (`yes` by default)

2. `Fail on error`: allows prolog and epilog to fail if a workload power profiles change fails for any reason

3. `Job keyword`: a keyword, `wpps`, in the JSON object, used by the WLM job, to specify a workload power profiles setting in the comment field.

4. `Jobs profiles directory`: a top directory which includes job ID directories, and used by the job to change the workload power profiles

5. `Debug`: setting it to `yes` enables prolog and epilog debug messages The prolog and epilog then write debug logs to the location set by the `Debug log directory` parameter,

6. `Debug log directory`: directory where prolog and epilog create debug log files per job. The logs take the format: `/var/spool/cmd/wlm/wpps/` \<*JOB ID*>`.log` by default. The log files are not cleaned up automatically.

If WPPS is enabled then:

* If a job requires static job profiles management, then special BCM prolog and epilog scripts are enabled in Slurm on compute nodes. The scripts parse the `SLURM_JOB_COMMENT` environment variable that is passed by Slurm. The scripts search for a JSON object that includes the key `wpps`. The key used can be changed using the `Job keyword` parameter. The expected format of the JSON object is:

  ```bash
  {"wpps": {"profiles": PROFILES}}
  ```

  Here, `PROFILES` is either

  * a JSON list of strings (workload profile names or their numbers) or

  * a single string (one workload profile name) or

  * a workload profile number.

  The values that `PROFILES` can take are:

  * `max_p`

  * `max_q`

  * `llm_training`

  * `llm_inference`

  On matching, the specified profiles are set for all the GPUs on the node that are allocated for the job when the job starts.

  For example, the following job submission command instructs the prolog script to set the workload profiles to `max_p` and `compute`:

  ```bash
  $ sbatch --gres=gpu:b100:8 --comment='{"wpps": {"profiles": ["max_p", "compute"]}}' job.sh
  ```

  All allocated GPUs on the node get the specified workload profiles, which means that job allocation must be configured to run on that node as a job that excludes other jobs running on it. If the cluster administrator has set oversubscribe ([here](/admin/configuring#31726-gpu-configuration-for-hpc-workload-managers)) for Slurm, then that takes precedence over exclusivity, and must therefore be taken into account.

* If a job requires dynamic profiles management, then the job process can notify BCM to update the power profiles of specific GPUs during job execution. The prolog creates a directory of the form `/var/run/nvidia/workload-power-profiles/<JOB_ID>/` per job. The following files are created within the directory:

  1. `username`: read-only (for users) file that includes the current job user name. Used by BCM.

  2. `uuids`: read-only (for users) file that includes a list of GPU UUIDs (one per line) allocated for this job.

  3. `profiles`: file that can be used by the job process to set new profiles. The file is empty by default. An empty file means that BCM does not modify the profiles. If the job process writes two lines:

     ```bash
                             max_p
                             compute
     ```

     then BCM reads this file almost immediately, and applies these two workload profiles to the GPUs whose UUIDs are specified in `uuids` file.

What users are running in each workload power profile can be viewed with a PromQL query, as explained [here](#7516-advanced-slurm-job-accounting).

**Management of node workload profiles using `gpuworkloadpowerprofiles`, by regular users:**  The user, for example `John`, can be given access to checking and managing GPU power profiles by running the `allowgpuworkloadpowerprofiles` command.

**Example**

```bash
[basecm11->user[john]]% set allowgpuworkloadpowerprofiles yes
```

The `gpuworkloadpowerprofiles` command can then be run to check the current node profiles:

**Example**

```bash
[basecm11->device]% gpuworkloadpowerprofiles show -n node001
Node         GPU      Profiles
------------ -------- ------------
node001      0        COMPUTE(2)
node001      1        MAX_P(0)
node001      2        MAX_P(0)
node001      3        MAX_P(0)
node001      4        MAX_P(0)
node001      5        MAX_P(0)
node001      6        MAX_P(0)
node001      7        MAX_P(0)
[basecm11->device]%
```

This may be useful for debug purposes.

The BCM script `cm-gpu-workload-power-profiles` can then be used to change the profiles as follows:

* The user first gets the GPU UUIDs:

  **Example**

  ```bash
  root@dgx-gb200-n07-c2:~# nvidia-smi --query-gpu=uuid --format=csv,noheader --id=0,1,2,3
  GPU-1e72bc8d-b967-6031-24bd-c5a08ad090e1
  GPU-3a6ac832-3423-68cc-ed1f-64f2b46d248d
  GPU-f40fabb7-eb9b-0253-4bd5-08b4a12916ea
  ```

* The user can then use the script to change the profile. For example, just for the GPUs 1 and 2:

  **Example**

  ```bash
  root@dgx-gb200-n07-c2:~# /cm/local/apps/cmd/sbin/cm-gpu-workload-power-profiles -p compute -u john \
  3a6ac832-3423-68cc-ed1f-64f2b46d248d f40fabb7-eb9b-0253-4bd5-08b4a12916ea
  ```

  The script carries the profile change out with the help of CMDaemon in the back end.

  Slurm’s prolog and epilog actually work with the script in BCM when carrying out dynamic profiles management, so that the user does not need to use the script manually.

**Management of external users to allow them to use profiles:** External users, that is users managed by an external LDAP and not managed by the BCM LDAP, can use the workload power profile settings if their user name or UID is added to the file:

`/cm/local/apps/cmd/etc/allow-users-wpps.conf`

The file must be created on the head node, or on both head nodes if the cluster has HA. The file should have its mode set to `0600`. The user name or UID should be added on its own line in the file.

#### 7.5.1.6  Advanced Slurm Job Accounting

PromQL queries can be run and then filtered by Slurm job labels with BCM. The labels are taken either from a job comment or from an account name used by the job. After the labels for the job are extracted, the labeled entity is stored in the monitoring data. The administrator can then run PromQL queries, and filter results by label. Examples of such PromQL queries are the `job_gpu_wasted` or `job_gpu_utilization` queries (section [12.4.1](/admin/monitoringaccounting#1241-two-job-gpu-metrics-used-in-promql-queries)).

`Extract accounting info` must be set to `yes` to enable labels to be extracted from job comments or account names:

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% wlm use slurm
[basecm11->wlm[slurm]]% accounting
[basecm11->wlm[slurm]->show]% accounting
Parameter                        Value
-------------------------------- ------------------------------------------------
Managed hierarchy
Separator                        _
Job comment labels
Extract accounting info          no
[basecm11->wlm[slurm]->accounting]% set extractaccountinginfo yes
[basecm11->wlm*[slurm*]->accounting*]% commit
```

In addition, the administrator must configure the job comment label format and the format of Slurm account names, if they exist. Without that configuration, BCM cannot parse the labels.

**Job comment labels:** A user running the job can specify the label for the job comment in a special format. Such a label could be, for example, a tag to indicate the artificial neural network model, where different groups of jobs use different models. The administrator (after having enabled accounting information extraction) can set a regex for the tag in a `Job comment field` parameter in `accounting` submode:

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% wlm use slurm
[basecm11->wlm[slurm]]% accounting
[basecm11->wlm[slurm]->accounting]% set jobcommentlabels model
[basecm11->wlm*[slurm*]->accounting*]% commit
```

In the preceding example, the label `model` is set in the monitoring data when the job comment includes a JSON object with `model` as a key. The value must be a string that will be a value for the label `model`. For example `"model": "llm123"`. The JSON object may contain other information that will be ignored by BCM when it reads the labels from the comment.

**Account name labels:** Several labels can be assigned by BCM to a job parsed from an associated account name. The labels can be used to represent a hierarchy of organizational entities, such as department, project, team, and so on. The following configuration options allow this representation:

1. `Managed hierarchy`: representation of the account name as a list of organizational entity labels.

2. `Separator`: a separator for the labels in the account names. By default this is the underscore character, \_. The last entity is separated with double separator. This means that the last entity (and only the last entity) can have a single separator in the name itself.

For instance, if Slurm account names use the following format:

```bash
DEPARTMENT_PROJECT_TEAM
```

then `Managed hierarchy` values can be set as follows:

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% wlm use slurm
[basecm11->wlm[slurm]]% accounting
[basecm11->wlm[slurm]->accounting]% set managedhierarchy department project team
[basecm11->wlm*[slurm*]->accounting*]% commit
```

It is up to the administrator to create the accounting hierarchy in Slurm, and set names as described by the `Managed hierarchy` parameter.

**Example**

```bash
[root@basecm11 ~]# module load slurm
[root@basecm11 ~]# sacctmgr add account NVIDIA Description="NVIDIA account" Organization=NVIDIA parent=root -i
[root@basecm11 ~]# sacctmgr add account Department1 Organization=NVIDIA parent=NVIDIA -i
[root@basecm11 ~]# sacctmgr add account Department1_Project1 Organization=NVIDIA parent=Department1 -i
[root@basecm11 ~]# sacctmgr add account Department1_Project1__Team_1 Organization=NVIDIA parent=Department1 -i
[root@basecm11 ~]# sacctmgr add account Department1__Team_2 Organization=NVIDIA parent=Department1 -i
```

In the preceding example two teams have been made. Team 1 is defined according to the full entities hierarchy (department, project, team), while Team 2 is defined only under a department. BCM correctly recognizes such "clipped" hierarchy locations for a team in the account names.

Similar to the Slurm command `sshare`, an administrator can display the Slurm account hierarchy with the `fairshare` command in `cmsh`:

**Example**

```bash
[basecm11->wlm[slurm]]% fairshare -t
Account                       fairshare    raw_shares raw_usage  norm_shares norm_usage parent
----------------------------- ------------ ---------- ---------- ----------- ---------- -------------------
root (top account)            0.0          0          0          0.0         0.0
nvidia                        0.0          1          0          0.5         0.0        root (top account)
department1                   0.0          1          0          1.0         0.0        nvidia
department1__team_2           0.0          1          0          0.333333    0.0        department1
department1_project1          0.0          1          0          0.333333    0.0        department1
department1_project1__team_1  0.0          1          0          0.333333    0.0        department1
root                          1.0          1          0          0.5         0.0        root (top account)
[basecm11->wlm[slurm]]% fairshare -f ""
root
 ├─nvidia
 │  └─department1
 │     ├─department1__team_2
 │     ├─department1_project1
 │     └─department1_project1__team_1
 └─root
```

The following command options can be used:

1. `-t|--table`: print accounts fairshare parameters as a table

2. `-a|--account <name>`: print information for specific account

3. `-f|--fields <PARAMETERS>`: display only specified fairshare account parameters (comma-delimited) Format:

   ```bash
         <FIELD>[%<MIN>[-<MAX>]][,<FIELD>[%<MIN>[-<MAX>]],...] ;
   ```

   where `MIN` and `MAX` are minimum and maximum value lengths. The parameter can be combined with others.

The following example uses labels from both job comment and account names:

**Example**

```bash
[root@basecm11 ~]# su - alice
[alice@basecm11 ~]$ module load slurm
[alice@basecm11 ~]$ sbatch -A department1_project1__team_1 --comment='{"model": "llm123"}' --wrap="hostname"
Submitted batch job 1
[alice@basecm11 ~]$
```

PromQL queries with these labels are run later on.

In `cmsh` the administrator can validate how BCM parses the job labels from both job comment and from the Slurm account name:

```bash
[basecm11->wlm[slurm]->jobs]% info 1 | grep "accounting info" -i
Accounting info       {"department":"department1","model":"llm123","project":"project1","team":"team_1"}
[basecm11->wlm[slurm]->jobs]%
```

Jobs information can also be displayed by filtering using the labels (some output elided for clarity):

```bash
[basecm11->wlm[slurm]->jobs]% filter -i team="team_1"
Job ID  Job name   User   Queue   Submit time  Start time  End time  Nodes     Exit code
------- ---------- ------ ------- ------------ ----------- --------- --------- ----------
1       wrap       alice          13:28:46     13:28:46    13:28:46            1
2       wrap       alice  defq    13:28:59     13:28:59    13:30:00  node001   0
3       wrap       alice  defq    13:30:39     13:30:39    13:31:40  node001   0
[basecm11->wlm[slurm]->jobs]%
```

The following PromQL query (section [12.3](/admin/monitoringaccounting#123-promql-queries)) filters the team:

```bash
[basecm11->monitoring->labeledentity]% instantquery "job_gpu_wasted{team=\"team_1\"}[1h]"
Name            category department   group  hostname job_id  job_name project   queue  team    user   wlm   ...
--------------- -------- ------------ ------ -------- ------- -------- --------- ------ ------- ------ ----- ...
job_gpu_wasted  default  department1  alice  node001  1       wrap     project1  defq   team_1  alice  slurm ...
job_gpu_wasted  default  department1  alice  node002  2       wrap     project1  defq   team_1  alice  slurm ...
```

The following query filters the model name:

```bash
[basecm11->monitoring->labeledentity]% instantquery "job_gpu_wasted{model=\"llm123\"}[1h]"
Name            category group  hostname job_id   job_name model    queue    user   wlm   ...
--------------- -------- ------ -------- -------- -------- -------- -------- ------ ----- ...
job_gpu_wasted  default  alice  node001  1        wrap    foo      defq     alice  slurm  ...
job_gpu_wasted  default  alice  node002  2        wrap    foo      defq     alice  slurm  ...
```

The following query shows what users are running in each WPPS profile:

```bash
[basecm11->monitoring->labeledentity]% instantquery -q job_gpu_workload_power_profile_for_user
Name                                     gpu_workload_power_profile user       Timestamp  ... Value
---------------------------------------- -------------------------- ---------- -----------... -----
job_gpu_workload_power_profile_for_user  COMPUTE                    avolkov    Mon Jun  2 ... 2
job_gpu_workload_power_profile_for_user  LLM_INFERENCE              avolkov    Mon Jun  2 ... 2133
job_gpu_workload_power_profile_for_user  LLM_INFERENCE              root       Mon Jun  2 ... 23
job_gpu_workload_power_profile_for_user  LLM_INFERENCE              shoreline  Mon Jun  2 ... 336
job_gpu_workload_power_profile_for_user  LLM_INFERENCE              wglantz    Mon Jun  2 ... 12
job_gpu_workload_power_profile_for_user  LLM_TRAINING               root       Mon Jun  2 ... 7
job_gpu_workload_power_profile_for_user  LLM_TRAINING               shoreline  Mon Jun  2 ... 331
job_gpu_workload_power_profile_for_user  MAX_P                      avolkov    Mon Jun  2 ... 2134
job_gpu_workload_power_profile_for_user  MAX_P                      root       Mon Jun  2 ... 60
job_gpu_workload_power_profile_for_user  MAX_P                      shoreline  Mon Jun  2 ... 379
job_gpu_workload_power_profile_for_user  MAX_P                      wglantz    Mon Jun  2 ... 12
job_gpu_workload_power_profile_for_user  MAX_Q                      root       Mon Jun  2 ... 8
job_gpu_workload_power_profile_for_user  MAX_Q                      shoreline  Mon Jun  2 ... 320
```

#### 7.5.1.7  Slurm PRS Settings

Power Reservation Steering (PRS) and its deployment is covered in [Chapter 10](/nvidia-mission-control/prs) of the *NVIDIA Mission Control Manual*.

The `prssettings` submode in `wlm` mode configures the certificate paths used by the Slurm PRS plugin.

**Example**

```bash
[basecm11->wlm[slurm]->prssettings]% show
Certificate path                 /cm/local/apps/prs/etc/${WLM_NAME}.pem
Private key path                 /cm/local/apps/prs/etc/${WLM_NAME}.key
```

The `Certificate path` and `Private key path` settings specify the TLS certificate and key used for secure communication with the PRS service. The `${WLM_NAME}` variable is automatically substituted with the name of the WLM instance.

#### 7.5.1.8  Configuring Slurm

After Slurm setup is configured and installed with `cm-wlm-setup` (section [7.3](#73-installation-of-workload-managers)), the Slurm software components are installed in a symlinked directory `/cm/local/apps/slurm/current`. The same set of Slurm packages should be installed on the head nodes and in each software image where any of the Slurm services run.

Slurm clients and servers can be configured to some extent using role assignment (sections [7.4.1](#741-enabling-and-disabling-a-wlm-with-base-view) and [7.4.2](#742-enabling-and-disabling-a-workload-manager-with-cmsh)).

Using `cmsh`, advanced option parameters can be set under the `slurmclient` and `slurmserver` roles. The settings for the roles can be done at configuration overlay, category, or node level (sections [2.1.5](/admin/clustermanagement#215-roles), [2.1.6](/admin/clustermanagement#216-configuration-overlay)).

By default, the `cm-wlm-setup` utility configures Slurm using configuration overlays.

**Example**

```bash
[basecm11->configurationoverlay]% list
Name (key)           Priority   All head nodes Nodes            Categories       Roles
-------------------- ---------- -------------- ---------------- ---------------- ----------------
slurm-accounting     500        yes                                              slurmaccounting
slurm-client         500        no                              default          slurmclient
slurm-server         500        yes                                              slurmserver
slurm-submit         500        no                              default          slurmsubmit
wlm-headnode-submit  600        yes                                              slurmsubmit
```

The settings within the roles can be viewed and modified. For example, the `slurmclient` role of the `slurm-client` configuration overlay can be viewed:

**Example**

```bash
[basecm11->configurationoverlay]% roles slurm-client
[basecm11->configurationoverlay[slurm-client]->roles]% show slurmclient
Parameter                        Value
-------------------------------- ------------------------------------------------
Name                             slurmclient
Revision
Type                             SlurmClientRole
Add services                     yes
WLM cluster                      slurm
Slots                            0
All Queues                       no
Queues                           defq
Features
Sockets                          0
Cores Per Socket                 0
ThreadsPerCore                   0
Boards                           0
SocketsPerBoard                  0
RealMemory                       0B
NodeAddr
Weight                           0
Port                             0
TmpDisk                          0
Reason
CPU Spec List
Core Spec Count                  0
Mem Spec Limit                   0B
GPU auto detect                  BCM
Node Customizations              <0 in submode>
Generic Resources                <0 in submode>
Cpu Bindings                     None
Slurm hardware probe autodetect  yes
Memory autodetection slack       0.0%
IMEX                             no
```

**Assigning nodes to Slurm queues:**

Slurm can configure *nodesets* [(`man slurm.conf.5`)](https://slurm.schedmd.com/slurm.conf.html). Nodesets are a way to conveniently group nodes under a unique arbitary name, so that features can be assigned to a group of nodes.

Starting with BCM version 11, BCM can be used to configure Slurm nodesets using the `Nodesets` and `Nodeset features` options within the `slurmclient` role options:

* `Nodesets`: An arbitrary name can be set for the `Nodesets` parameter. Names that are set are automatically added to `slurm.conf`. Nodes with the `slurmclient` role are then associated with this arbitrary nodeset name in `slurm.conf`. For example, if the `nodesets` parameter is set to `ns1` and the role is assigned only to node `node001`, then BCM translates this configuration after a short time into a [`slurm.conf`](/cm/shared/apps/slurm/etc/slurm/slurm.conf) line that looks like:

  `NodeSet=ns1 Nodes=node001`

  In an express Slurm setup by `cm-wlm-setup` ([here](#7321-express-installation)), the `slurmclient` role is set by default for all nodes using the configuration overlay. This means that setting the `nodesets` parameter in the `slurmclient` role there sets it for all nodes. After a short while, the `NodeSet` line in [`slurm.conf`](/cm/shared/apps/slurm/etc/slurm/slurm.conf) changes to match the parameter change:

  **Example**

  ```bash
          [basecm11->configurationoverlay[slurm-client]->roles[slurmclient] get nodesets
          [basecm11->configurationoverlay[slurm-client]->roles[slurmclient] set nodesets ns1; commit
          then, after a minute or so:
          [basecm11->...->roles[slurmclient] !grep -i nodeset /cm/shared/apps/slurm/etc/slurm/slurm.conf
          [basecm11->...->roles[slurmclient] NodeSet=ns1 Nodes=node[001-003]     for a 3-node cluster
  ```

* `Nodeset features`: All values of the `Nodeset features` parameter are added to nodes that have the `slurmclient` role. They are added as Slurm node features, which means that there is no need to duplicate them in the `Features` parameter of the `slurmclient` role. The values that are set are a list of strings.

  The Slurm nodesets are added to `slurm.conf` with the same name as these features. This is useful when the administrator needs to assign sets of nodes to queues based on the node features.

  For example, if the parameter has a value `bigmem`, and the `slurmclient` role is assigned to node `node001`, then BCM adds lines with:

  `NodeName=node001 Features=bigmem ...`\
  and\
  `NodeSet=bigmem Feature=bigmem`\
  to `slurm.conf`.

  For the 3-node case specified by the configuration overlay of earlier, the change is illustrated by the following:

  **Example**

  ```bash
  [basecm11->...->roles[slurmclient]]% get nodesetfeatures
  [basecm11->...]->roles[slurmclient]]% !grep -i ^Node /cm/shared/apps/slurm/etc/slurm/slurm.conf
  NodeName=node[001-003] ... Features=location=local
  NodeSet=ns1 Nodes=node[001..003]
  [basecm11->...->roles[slurmclient]]% set nodesetfeatures bigmem
              ...wait a little for the change to happen...
  [basecm11->...->roles[slurmclient]]% !grep -i ^Node /cm/shared/apps/slurm/etc/slurm/slurm.conf
  NodeName=node[001-003] ... Features=location=local,bigmem
  NodeSet=ns1 Nodes=node[001-003]
  NodeSet=bigmem Feature=bigmem
  ```

  The `Nodeset features` parameter does not automatically add the nodesets to any queues. The administrator must add the nodesets to the queues separately.

**Specifying nodesets for Slurm using `wlm` mode with `jobqueues`, vs specifying nodes using the `slurmclient` role’s `queues` parameter:** Specifying which nodes go into Slurm job queues can be specified using either nodesets or nodes.

* The administrator can specify which nodesets are included in Slurm job queues by setting the `nodesets` parameter for a job queue, within a `jobqueue` submode.

  For example, the nodeset `ns1` defined in the `slurmclient` role earlier can be included in `defq` with:

  **Example**

  ```bash
  root@basecm11:~# cmsh
  [basecm11]% wlm jobqueue
  [basecm11->wlm[slurm]->jobqueue]% use defq
  [basecm11->wlm[slurm]->jobqueue[defq]]% set nodesets ns1; commit
  ```

  If the `nodesets` parameter is set for a queue, then BCM does not add any nodes that are specified by the `Compute nodes` parameter, but only adds the nodes in the `nodesets` specification to a line with the format:

  `PartitionName=... Nodes=` \<*nodesets*>` ...`

  in `slurm.conf`. As a reminder, a queue in Slurm terminology is a partition.

* The administrator can specify the nodes that are associated with a job queue.

  * Prior to BCM version 11, job queues were specified for nodes only by using the `queues` parameter of the `slurmclient` role at the `device`, `category`, or `configurationoverlay` mode level.

    For example, for the configuration overlay `slurm-client` that defines the Slurm client configuration by default, the nodes for the Slurm client role are the nodes in the default category `default`. Within the configuration overlay, within the `slurmclient` role, the default queue to be used is set to `defq` by default:

    **Example**

    ```bash
    root@basecm11:~# cmsh
    [basecm11]% configurationoverlay use slurm-client
    [basecm11->configurationoverlay[slurm-client]]% get categories
    default
    [basecm11->configurationoverlay[slurm-client]]% roles
    [basecm11->configurationoverlay[slurm-client]->roles]% use slurmclient
    [basecm11->configurationoverlay[slurm-client]->roles[slurmclient]]% get queues
    defq
    ```

  * Starting with BCM version 11, the administrator can also add nodes to queues directly from within `wlm` mode for a particular WLM, within the `jobqueue` mode for a particular queue, by setting nodes for particular node grouping parameters. For example, for Slurm the following queue parameters are available:

    **Example**

    ```bash
    [basecm11->wlm[slurm]->jobqueue[defq]]% show | egrep -i '(overlay|nodegroups|compute|catego|nodeset)'
    Nodesets
    Overlays
    Categories
    Nodegroups
    Compute nodes
    ```

    Thus `defq` is used by nodes that have been specified in the following groupings:

    * `Nodesets`: nodes in these nodesets

    * `Overlays`: nodes in these configuration overlays (including nodes of categories that are in this overlay)

    * `Categories`: nodes in these categories

    * `Nodegroups`: nodes in these node groups

    * `Compute nodes`: nodes listed in this parameter

**Slurm Hardware Autodetection (non-GPU):** The setting `Slurm hardware probe autodetect` in the Slurm role enables automated hardware detection for Slurm for non-GPU hardware. (Specifically for GPUs is the related Slurm `GPU auto detect` setting ([here](#slurm-hardware-autodetection-for-gpus))).

`Slurm hardware probe autodetect` enables detection for the following Slurm parameters:

* `corespersocket`

* `threadspercore`

* `boards`

* `socketsperboard`

* `sockets`

* `realmemory`

The autodetected parameters are placed in the `NodeName` line in `slurm.conf`.

The Slurm client role parameters can be modified. For example `Core Spec Count`:

**Example**

```bash
[basecm11->configurationoverlay[slurm-client]->roles]% set slurmclient corespeccount 2
[basecm11->configurationoverlay*[slurm-client*]->roles*]% commit
```

As usual, values set at node level override the values set at categories and configuration overlays level.

For example, to set `corespeccount` to 4, only for node001 but not for other nodes, the session might run further as:

**Example**

```bash
[basecm11->configurationoverlay[slurm-client]->roles]% device use node001
[basecm11->device[node001]]% roles
[basecm11->device[node001]->roles]% assign slurmclient
[basecm11->device*[node001*]->roles*[slurmclient*]]% set corespeccount 4
[basecm11->device*[node001*]->roles*[slurmclient*]]% commit
Field                    Message
------------------------ ----------------------------------------------------------------
wlmCluster               Error: The WLM cluster should be set
[basecm11->device*[node001*]->roles*[slurmclient*]]% wlm list
Type   Name (key)               Server nodes Submit nodes     Client nodes
------ ------------------------ ------------ ---------------- ----------------
Slurm  slurm                    basecm11     basecm11,node001 node001,node001
[basecm11->device*[node001*]->roles*[slurmclient*]]% set wlmcluster slurm
[basecm11->device*[node001*]->roles*[slurmclient*]]% commit
```

In the preceding session, the role needs to be assigned at node level with `assign slurmclient` because it does not initially exist at node level. If it already existed, then `use slurmclient` could have been used to descend into that role.

Also in the preceding session, one of the values that the Slurm client needs to know is `wlmcluster`, which decides which WLM it is to work with on the cluster. The value is selected from the list of WLM instance names in `wlm` mode.

The level of the active role can be seen with the `list` command. For example, the Slurm client role assignment at node level is seen here:

**Example**

```bash
[basecm11->device[node001]->roles[slurmclient]]% list
Name (key)
-----------------------------------
[overlay:slurm-submit] slurmsubmit
slurmclient
```

Removing the assignment has the `list` command display the configuration overlay Slurm client role assignment:

**Example**

```bash
[basecm11->device[node001]->roles[slurmclient]]% unassign slurmclient; commit
[basecm11->device[node001]->roles[slurmclient]]% list
Name (key)
-----------------------------------
[overlay:slurm-submit] slurmsubmit
[overlay:slurm-client] slurmclient
```

**Slurm Hardware Autodetection For GPUs:**  The Slurm `GPU auto detect` setting is a setting seen in the session output [here](#7518-configuring-slurm). It manages Slurm GRES configuration ([https://slurm.schedmd.com/gres.conf.html](https://slurm.schedmd.com/gres.conf.html)) automatically, and can be set:

* globally, for all Slurm compute nodes in a Slurm instance, from within the `wlm` mode of `cmsh`

* for a particular role, such as in a device role, a category role, and a configuration overlay role for a Slurm client

  **Example**

  ```bash
  [basecm11->configurationoverlay[slurm-client]->roles[slurmclient]]% set gpuautodetect <TAB><TAB>
  bcm     none    nrt    nvml    off     oneapi  rsmi
  ```

If `GPU auto detect` is assigned a value, then a corresponding value is assigned to the `autodetect` parameter in Slurm’s `gres.conf` file. One out of 7 values can be assigned to `GPU auto detect`:

1. `bcm`: to use BCM values, which are the values that CMDaemon automatically puts in for the vendor (NVIDIA, Intel, AWS, AMD) and for the number of GPUs.

2. `none`: to not have the `autodetect` parameter exist in `gres.conf`. In this case, there is actually no corresponding value that can be assigned to the `autodetect` of `gres.conf`.

3. `nrt`: to detect AWS Trainium/Inferentia devices. \<— not yet, in October 2024, trunk, or bcm10.24.09

4. `nvml`: to detect NVIDIA GPUs.

5. `off`: to turn Slurm GPU autodetection off.

6. `oneapi`: to detect Intel GPUs.

7. `rsmi`: to detect AMD GPUs

Slurm GPU autodetection is described further [here](#slurmautodetection).

**Slurm accounting database configuration in `cmsh`:**  After package setup is carried out with `cm-wlm-setup` (section [7.3](#73-installation-of-workload-managers)), `cmsh` can be used to modify the settings for the Slurm accounting database. Changes can be carried out in the `slurm-accounting` configuration overlay:

```bash
[basecm11->configurationoverlay[slurm-accounting]]% show
Parameter                        Value
-------------------------------- ---------------------------
Name                             slurm-accounting
Revision
All head nodes                   no
Priority                         500
Nodes                            node001,node002
Categories
Roles                            slurmaccounting
Customizations                   <0 in submode>
```

In the preceding overlay, `slurmdbd` runs on the accounting node(s). It is possible to run `slurmdbd` on both head nodes or on one or two compute nodes, as set in the configuration overlay. It is not possible to mix up head nodes and compute nodes for this configuration, and it is not possible to run `slurmdbd` on more than two nodes.

Further Slurm accounting changes can be carried out within the `slurmaccounting` role:

```bash
[basecm11->configurationoverlay[slurm-accounting]->roles[slurmaccounting]]% show
Parameter                        Value
-------------------------------- --------------------------
Name                             slurmaccounting
Revision
Type                             SlurmAccountingRole
Add services                     yes
High availability                yes
Primary accounting server        node001
DbdPort                          6819
StorageHost                      node001
StoragePort                      3306
StorageLoc                       slurm_acct_db
StorageUser                      slurm
```

The `primaryaccountingserver` parameter defines which node is primary, that is, which one is `AccountingStorageHost` in `slurm.conf`. The other node setting in the configuration overlay is the `AccountingStorageBackupHost`.

`StorageHost`, `StoragePort`, `StorageLoc` and `StorageUser` are settings for connecting to the MySQL database, If these are for an external host, then they must be configured manually so that they are reachable by the nodes running `slurmdbd`.

The `highavailability` parameter sets the high availability mode for `slurmdbd`. If set to `yes`, then the service runs on both nodes at the same time.

**Generic resources (gres) configuration in Slurm:** In order to configure generic resources, the `genericresources` mode can be used to set a list of objects. Each object then represents one generic resource available on nodes.

Each value of `name` in `genericresources` must already be defined in the list of `GresTypes`. The list of `GresTypes` is defined in the `wlm` role for the instance.

**Example**

```bash
[basecm11->wlm[slurm]]% get grestypes
gpu
```

Several generic resources entries can have the same value for `name` (for example `gpu`), but must have a unique alias. The alias is a string that is used to manage the resource entry in `cmsh` or in Base View. The string is enclosed in square brackets in `cmsh`, and is used instead of the `name` for the object. The alias does not affect Slurm configuration.

For example, to add two GPUs for all the nodes in the default category which are of type `k20xm`, and to assign them to different CPU cores, the following `cmsh` commands can be run:

**Example**

```bash
[basecm11]% configurationoverlay use slurm-client
[basecm11->configurationoverlay[slurm-client]]% roles
[basecm11->configurationoverlay[slurm-client]->roles*]% use slurmclient
[...[slurmclient]]% genericresources
[...[slurmclient]->genericresources]% add gpu0
[...[slurmclient*]->genericresources*[gpu0*]]% set name gpu
[...[slurmclient*]->genericresources*[gpu0*]]% set file /dev/nvidia0
[...[slurmclient*]->genericresources*[gpu0*]]% set cores 0-7
[...[slurmclient*]->genericresources*[gpu0*]]% set type k20xm
[...[slurmclient*]->genericresources*[gpu0*]]% add gpu1
[...[slurmclient*]->genericresources*[gpu1*]]% set name gpu
[...[slurmclient*]->genericresources*[gpu1*]]% set file /dev/nvidia1
[...[slurmclient*]->genericresources*[gpu1*]]% set cores 8-15
[...[slurmclient*]->genericresources*[gpu1*]]% set type k20xm
[...[slurmclient*]->genericresources*[gpu1*]]% commit
[...[slurmclient]->genericresources[gpu1]]% list
Alias (key) Name     Type     Count    File
----------- -------- -------- -------- ----------------
gpu0        gpu      k20xm             /dev/nvidia0
gpu1        gpu      k20xm             /dev/nvidia1
[...[slurmclient]->genericresources[gpu1]]%
```

Typically this configuration is done automatically during the GPU configuration process as outlined in the GPU Configuration Screens section [here](#7323-gpu-configuration-screens), where a configuration overlay for the GPUs is given the default name `slurm-client-gpu`.

In Base View, the navigation path:

<code>
  Grouping > Configuration Overlays > slurm-client-gpu

   \> Settings > Roles

   \> slurmclient

   \> Generic resources

   \> + Add
</code>

provides the equivalent (figure [7.22](#fig-base-view-workloadmanagement-slurmgres-nvidiaconfig)):

![Base View access to NVIDIA GPU configuration options](/base-command-manager/product-manuals/_fern-img/7b0373fbc14f6119f5ac555808a430c094f101a772a6728b7881dde50893a050.webp)

*Figure 7.22: Base View access to NVIDIA GPU configuration options*

After the generic resources are committed, BCM updates the `gres.conf` file.

Since NVIDIA Base Command Manager version 8.2, a single `gres.conf` configuration file, located at `/cm/shared/apps/slurm/etc/slurm/gres.conf` is used.

If the category consists of `node001` and `node002`, then the entries to the `gres.conf` file in this case would look like:

**Example**

```bash
# This section of this file was automatically generated by cmd. Do not edit manually!
# BEGIN AUTOGENERATED SECTION -- DO NOT REMOVE
NodeName=node[001,002] Name=gpu Type=k20xm Count=1 File=/dev/nvidia0 Cores=0-7
NodeName=node[001,002] Name=gpu Type=k20xm Count=1 File=/dev/nvidia1 Cores=8-15
# END AUTOGENERATED SECTION   -- DO NOT REMOVE
[root@basecm11 ~]#
```

**Slurm topology configuration:**

Slurm supports topology-aware resource allocation to optimize job performance. BCM supports configuration for the `topology/tree` and `topology/block` Slurm plugins using the `topograph` service ([here](#topograph)):

* `topology/tree`: models the cluster network as a hierarchical structure, where Slurm allocates resources to jobs to minimize network contention. Nodes are grouped under leaf switches, which connect to higher-level switches. The plugin helps to allocate nodes that are close together in the network hierarchy. The plugin requires all nodes for a single job be connected using switches. The configuration of the plugin is defined using switches and their relationships.

* `topology/block`: models the network as non-overlapping blocks of nodes. The plugin aims to keep jobs contiguous within blocks for better communication. The plugin does not require all nodes to be part of blocks. The configuration is defined using blocks of nodes and their groupings.

The network topology configuration for a Slurm instance \<*slurmcluster*> is described by:\
`/cm/shared/apps/slurm/etc/` \<*slurmcluster*>`/topology.conf`

The file is modified in an autogenerated section when the cluster administrator modifies the internal topology settings in BCM, or when the topology arrangement record is fetched from Topograph, the topology generation service ([here](#topograph-service-integration)). The topology settings can be modified in BCM via the `topologysettings` submode of the WLM instance in `cmsh`:

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% wlm use slurm
[basecm11->wlm[slurm]]% topologysettings
[basecm11->wlm[slurm]->topologysettings]% show
Located Parameter                        Value
-------------------------------- ------------------------------------------------
Topology plugin                  Block
Topology source                  Internal
Parameters                       <submode>
Tree settings                    <submode>
Block settings                   <submode>
Topograph settings               <submode>
```

A visualization (figure [7.23](#fig-visualization-cmsh-wlm-topology-settings)) of `topologysettings`, and its submodes and settings may be useful when reading the contents of this section:

![Visualization of settings under topologysettings](/base-command-manager/product-manuals/_fern-img/c0cb3d6992f03150e7ed75c8c4666b0da440379363af789bd4deea30bac539a1.webp)

*Figure 7.23: Visualization of settings under topologysettings*

BCM allows a topology configuration to be generated for both the `topology/tree` and `topology/block` Slurm plugins. By default neither of these plugins is enabled. To enable topology generation, the administrator can select the plugin type within WLM mode using the `Topology plugin` parameter, and can select the `Topology source`:

```bash
[root@basecm11 ~]# cmsh
[basecm11]% wlm use slurm
[basecm11->wlm[slurm]]% set topologyplugin{<TAB><TAB>}
3d torus   block   default   none   tree
[basecm11->wlm*[slurm*]]% set topologyplugin tree
Tree
[basecm11->wlm*[slurm*]]% set topologysource{<TAB><TAB>}
internal   none       topograph
[basecm11->wlm*[slurm*]]% set topologysource internal
[basecm11->wlm*[slurm*]]% commit
```

By default, both `Topology source` and `Topology plugin` are set to `none`, which means that `topology.conf` is not updated by BCM.

Within `topologysettings`, the `Topology plugin` parameter configures plugins in the Slurm-related `.conf` files:

**Example**

```bash
[basecm11->wlm[slurm]->topologysettings]% set topologyplugin{<TAB><TAB>}
3d torus  block      default    none       tree
```

* `none`: no plugin is configured in `slurm.conf`

* `default`: the `topology/default` plugin is set in `slurm.conf`

* `3d torus`: the `topology/3d_torus` plugin is set in `slurm.conf`

* `block`: the `topology/block` plugin is set in `slurm.conf` and `topology.conf` is updated

* `tree`: the `topology/tree` plugin is set in `slurm.conf` and `topology.conf` is updated

The topology settings can be configured in a similar way in Base View.

Within `topologysettings`, there are these 4 submodes: `Parameters`, `Tree settings`, `Block settings`, and `Topograph settings`:

1. The `parameters` submode manages parameters that are common for all plugins:

   **Example**

   ```bash
   [basecm11->wlm[slurm]->topologysettings]% parameters
   [basecm11->wlm[slurm]->topologysettings->parameters]% show
   Parameter                        Value
   -------------------------------- ------------------------------------------------
   Dragonfly                        no
   Route part                       no
   Switch as node rank              no
   Route tree                       no
   Topo Optional                    no
   ```

   These correspond to values of `TopologyParam` in `slurm.conf` (`man slurm.conf.5`).

2. The `treesettings` submode allows access to some parameters that modify the topology for the `topology/tree` plugin:

   **Example**

   ```bash
   [basecm11->wlm[slurm]->topologysettings]% treesettings
   [basecm11->wlm[slurm]->topologysettings->treesettings]% show
   Parameter                        Value
   -------------------------------- ------------------------------------------------
   Topology switches
   Topology ephemeral switches      yes
   ```

   The `treesettings` parameters are:

   * `topologyephemeralswitches`: A boolean to allow ephemeral switches to be added to `topology.conf`

   * `topology switches`: A Slurm cluster configuration parameter that defines the list of switches used to write the topology file:

     **Example**

     ```bash
     [basecm11->wlm[slurm]->topologysettings->treesettings]% set topologyswitches switch01 switch02 switch03
     [basecm11->wlm[slurm*]]% commit
     ```

     The switches-to-nodes mapping does not require the switch devices to exist. The mapping can be defined in one of the following ways:

     * Definitions using the `switchports` parameter: the port definitions ([here](/admin/configuring#3811-port-assignments-for-switches)) for a node or a switch must normally be configured to let BCM construct the topology tree in `topology.conf`. The definitions can be carried out using their `switchports` parameter:

       **Example**

       ```bash
       [root@basecm11 ~]# cmsh
       [basecm11]% device use node001
       [basecm11->device[node001]]% set switchports switch01:3
       [basecm11->device[node001*]]% commit
       [basecm11->device[node001]]% use switch01
       [basecm11->device[switch01]]% set switchports switch02:15
       [basecm11->device[switch01*]]% commit
       ```

     * Definitions using the `SlurmTopology` parameter: the Slurm network topology can be configured without configuring the ports in BCM, by using their `SlurmTopology` parameter:

       **Example**

       ```bash
       [root@basecm11 ~]# cmsh
       [basecm11]% device
       [basecm11->device]% set node001 -e SlurmTopology switch02 switch01
       [basecm11->device*]% set node002 -e SlurmTopology switch02 switch01
       [basecm11->device*]% set node003 -e SlurmTopology switch03
       [basecm11->device*]% commit
       ```

       The preceding example populates the autogenerated section of `topology.conf` as follows:

       **Example**

       ```bash
       SwitchName=switch01 Switches=switch02
       SwitchName=switch02 Nodes=node[001,002]
       SwitchName=switch03 Nodes=node003
       ```

     The following `AdvancedConfig` directives ([here](/admin/cmdconf#c80-advancedconfig-directive)) can be used to control the topology parameters layout further.

     * `SlurmStraightExtraTopology`: If set to a value of `0`, then the order of switches is reversed when setting the extra values. For example, to get the same content of `topology.conf` as in the preceding example, the following lines can then be committed:

       **Example**

       ```bash
       [root@basecm11 ~]# cmsh
       [basecm11]% device
       [basecm11->device]% set node001 -e SlurmTopology switch01 switch02
       [basecm11->device*]% set node002 -e SlurmTopology switch01 switch02
       [basecm11->device*]% set node003 -e SlurmTopology switch03
       [basecm11->device*]% commit
       ```

       In topology/plugin configuration, switches and nodes cannot both be connected to the same switch. This is consistent with the description in `man topology.conf.5`. If the configuration in BCM has both nodes and switches connected to the same switch, then only the nodes-to-switch connection is written to `topology.conf`.

     * `SlurmConcatTopologySwitchName`: If set to `1`, then it allows concatenation of the switch names in the topology defined using the `SlurmTopology` node extra setting. The `SlurmTopology` setting is described earlier on. The concatenation starts in order of parent switches first. Thus, switch `switch02` that is directly connected to switch `switch01` is named `switch01-switch02` in `topology.conf`.

       **Example**

       ```bash
       [root@basecm11 ~]# cmsh
       [basecm11]% device
       [basecm11->device]% set node001 -e SlurmTopology switch01 switch03
       [basecm11->device*]% set node002 -e SlurmTopology switch01 switch03
       [basecm11->device*]% set node002 -e SlurmTopology switch01 switch03
       [basecm11->device*]% set node003 -e SlurmTopology switch01 switch03
       [basecm11->device*]% set node003 -e SlurmTopology switch01 switch03
       [basecm11->device*]% set node004 -e SlurmTopology switch02 switch03
       [basecm11->device*]% set node005 -e SlurmTopology switch02 switch03
       [basecm11->device*]% set node006 -e SlurmTopology switch02 switch03
       [basecm11->device*]% commit

       ```

       The preceding results in the following content within `topology.conf`:

       **Example**

       ```bash
       SwitchName=switch03 Switches=switch03-switch[01,02]
       SwitchName=switch03-switch01 Nodes=node[001-003]
       SwitchName=switch03-switch02 Nodes=node[004-006]
       ```

3. The `blocksettings` submode under `topologysettings` is where the `topology/block` plugin settings are located:

   **Example**

   ```bash
   [basecm11->wlm[slurm]->topologysettings]% blocksettings
   [basecm11->wlm[slurm]->topologysettings->blocksettings]% show
   Parameter                        Value
   -------------------------------- ------------------------------------------------
   Block entity                     NodeGroup
   Block sizes                      2 4
   ```

   The parameters of the `topology/block` plugin are:

   * `Block entity`: what BCM entity type defines a block. Possible entity type values are:

     * `nodegroup`: if a node is in several nodegroups then it goes to the first block

     * `rack`: if a pair of racks is configured as twins, then nodes from both racks go to a single block

     Nodes with a `slurmclient` role that belong to the specified entity are grouped in a single block. For instance, if two nodegroups are defined in BCM as:

     * `ng1`: a nodegroup that includes `node001` and `node002`, both with the `slurmclient` role\
       and

     * `ng2`: a nodegroup that includes `node003` and `node004`, both with the `slurmclient` role

     then `topology.conf` is updated with the following lines:

     **Example**

     ```bash
     BlockName=ng1 Nodes=node[001,002]
     BlockName=ng2 Nodes=node[003,004]
     ```

   * `Block sizes`: corresponds to the parameter in `topology.conf` with the same name. It displays a list of the planning base block size, alongside any higher-level block sizes that would be enforced. More details can be found in `man topology.conf.5`.

4. Topograph settings can be found within the `topographsettings` submode, under `topologysettings`. The settings are described further on.

**Topograph service integration:**  A topograph in real life can be a monument that shows important geographical properties (for example altitude, latitude, roads, and so on) in a very visible location (typically on a hilltop). In BCM, Topograph is used to mean the topological record that is visible to the cluster manager in BCM. Topograph runs as a system service, and BCM fetches topology information from the service when required, updating `topology.conf` as needed.

Currently, Topograph, when used with cloud services, supports only cloud GPU nodes that are supported by the topology API that the cloud providers provide. The nodes in the cloud must exist—that is, it must be possible to stop them—during topology generation. If Topograph cannot get the topology for a node, then the node in `topology.conf` is put under a special fake switch (if node is set to tree topology) or block (if the node is set to block topology).

Basic Topograph configuration with some default settings is carried out with `cm-wlm-setup` ([here](#topology-configuration-with-cm-wlm-setup)), as part of Topology configuration.

The integration between BCM and Topograph can then be further configured within the `topographsettings` submode:

**Example**

```bash
[basecm11->wlm[slurm]->topologysettings]% topographsettings
[basecm11->wlm[slurm]->topologysettings->topographsettings]% show
Parameter                        Value
-------------------------------- ------------------------------------------------
Hostname                         localhost
Config path                      /etc/topograph/topograph-config.yaml
HTTP parameters
Pass cloud credentials           yes
Fetch timeout                    20
Fetch attempts                   12
Fetch wait time                  15
```

The Topograph settings are:

* `Hostname`: the hostname where these settings run

* `Config path`: a path for the YAML configuration of the Topograph settings

* `HTTP parameters`: used to pass a string of HTTP parameters to the HTTP API service

* `Pass cloud credentials`: if set to `yes`, then cloud service provider credentials are passed on to the topology generator

* `Fetch timeout`: the Topograph API timeout value (in seconds)

* `Fetch attempts`: the number of attempts to carry out when trying to get a topology from Topograph

* `Fetch waittime`: the wait time between fetch attempts (in seconds)

and there are also extra settings, which are used with default values when configuring Topograph manually:

* `HttpPort`: the tcp port used by Topograph to listen on (default: `49021`)

* `HttpSSL`: is Topograph using SSL? (default: `true`)

* `RequestAggregationDelay`: delay for request aggregation (default: `15s`)

* `PageSize`: number of results per API call (default: `100`)

* `SSLCertPath`: server certificate path (default: `/etc/topograph/ssl/server-cert.pem`)

* `SSLCertKeyPath`: server certificate key path (default: `/etc/topograph/ssl/server-key.pem`)

* `SSLCACert`: certificate authority certificate path (default: `/etc/topograph/ssl/ca-cert.pem`)

* `version4`: when set to `true`, BCM uses the Topograph 4 API. This setting requires the `topograph4` package (see “Using Topograph 4” below).

The service has its own configuration file, `topography-config.yaml`, which is managed by BCM. The administrator can modify it manually if necessary, to put in settings that are outside of the group of standard and extra topograph settings listed in the preceding text.

If standard or extra topography settings in the navigation path:

`cmsh > wlm > topologysettings > topographsettings`

are set, then the `topography-config.yaml` file synchronizes its values from there. That is, no manual changes are typically needed in BCM-managed clusters for the BCM-managed variables.

If the node running the Topograph service is not the node running the `Slurm` server, then all certificate paths must be in a shared location, such as `/cm/shared`, and the token `UPDATE_TOPOLOGY_TOKEN` must be added to the profile `node`. Profiles are described in section [6.5](/admin/usermanagement#65-tokens-and-profiles).

All certificates are managed by BCM and must share the same certificate authority file path.

BCM uses the script `/cm/local/apps/cmd/scripts/topograph.certs.sh` to generate all certificates. An alternative certificate generator can be set by the administrator using the `AdvancedConfig` directive ([here](/admin/cmdconf#c80-advancedconfig-directive)) `TopographCertificatesScript` to set a custom script path, to use the same environment variables and options.

If no automatic script generation is wanted then it can be disabled by setting the `AdvancedConfig` directive `TopographSkipCertificates` to `yes`:

```bash
[root@basecm11~]# cm-manipulate-advanced-config.py TopographSkipCertificates=yes
Updated: /cm/local/apps/cmd/etc/cmd.conf
```

###### Topology configuration with `cm-wlm-setup`:

The topology source can be configured using `cm-wlm-setup` (figure [7.24](#fig-cm-wlm-setup-topology-source-screen)), along with some settings:

![Topology source configuration in cm-wlm-setup](/base-command-manager/product-manuals/_fern-img/09bfc27a5861ab29e884f041e362f87886de873e9fb985dce0d182dd4f34f929.webp)

*Figure 7.24: Topology source configuration in cm-wlm-setup*

If the topology source is Topograph, then a specific node can be selected (figure [7.25](#fig-cm-wlm-setup-topograph-node-screen)):

![Topograph node configuration in cm-wlm-setup](/base-command-manager/product-manuals/_fern-img/8ebba13dcb3e60438759cd586d7b97d090879e33cbe53326b6bb040800a16fb9.webp)

*Figure 7.25: Topograph node configuration in cm-wlm-setup*

The configuration sets all the extra values of section [7.5.1.8](#topograph-service-integration), it installs the Topograph service on the software image or in the node if necessary, and adds `UPDATE_TOPOLOGY_TOKEN` to the node profile in `cmsh`, if the Topograph node and Slurm server nodes are different.

The plugin can also be configured with `cm-wlm-setup` (figure [7.26](#fig-cm-wlm-setup-topology-plugin-screen)):

![Topology plugin configuration in cm-wlm-setup](/base-command-manager/product-manuals/_fern-img/851dab2ec08db3270398976de14431bf267e34b38751ab6fe648a2400af4730b.webp)

*Figure 7.26: Topology plugin configuration in cm-wlm-setup*

For more advanced and specific configurations, a further manual configuration is necessary.

###### Configuring topology manually:

The `topograph` package is available from the BCM repositories for Ubuntu 22.04 and later, and for RHEL9-compatible distributions:

**Example**

```bash
root@basecm11:~# apt install topograph
...
Need to get 30.1 MB of archives.
After this operation, 0 B of additional disk space will be used.
...
```

After picking up the package, the service can be set up on any node. The `hostname` parameter in `topographsettings` is set to `localhost` by default, which is taken from the node that has the `slurmserver` role assigned to it. The value should be the Topograph server hostname or IP address, which means that if the Topograph service is running on a node without the `slurmserver` role, then the value must be manually adjusted.

Typically, since `slurmserver` usually runs on the head node, `topograph` also runs on the head node, and if the cluster is an HA cluster (Chapter [15](/admin/ha)) then it should be set up on both head nodes.

The service can be set up on the head node(s) in BCM using the `services` submode of `device` mode:

**Example**

```bash
[basecm11->device[basecm11]]% services
[basecm11->device[basecm11]->services]% add topograph
[basecm11->device*[basecm11*]->services*[topograph*]]% set autostart yes
[basecm11->device*[basecm11*]->services*[topograph*]]% set monitored yes
[basecm11->device*[basecm11*]->services*[topograph*]]% set managed yes
[basecm11->device*[basecm11*]->services*[topograph*]]% commit
[basecm11->device[basecm11]->services[topograph]]% status
Service                     Status
--------------------------- -----------
topograph                   [   UP   ]
                 repeated for the other head node if using HA
```

The certificates for the `topograph` service are generated automatically. The certificates are used by BCM to carry out service API calls.

After restarting CMDaemon on nodes with the `slurmserver` role with:

`systemctl restart cmd`

a `topology.conf` file is generated in `/cm/shared/apps/slurm/etc/` \<*slurmcluster*>`/topology.conf`.

A Slurm topology configuration for the Slurm `topology/tree` plugin ([https://slurm.schedmd.com/topology.conf.html](https://slurm.schedmd.com/topology.conf.html)) is generated if a Slurm compute node is affected by:

* poweroff, shutdown, or power up

* creation or termination in cloud nodes

* a Slurm-related configuration change due to a BCM configuration change

###### Using Topograph 4:

From BCM 11.34, Topograph 4 is available via the `topograph4` package. The `topograph4` and `topograph` packages conflict and cannot both be installed on the same software image or node. The `topograph` package (Topograph 3.x) is installed by default.

To use Topograph 4, both of the following steps are required:

1. The `topograph` package is removed and `topograph4` is installed:

   For Ubuntu distributions:

   **Example**

   ```bash
   root@basecm11:~# apt remove topograph
   root@basecm11:~# apt install topograph4
   ```

   For RHEL-based distributions, `yum` can resolve the package conflict directly with the `--allowerasing` option, which removes `topograph` as part of installing `topograph4`:

   **Example**

   ```bash
   [root@basecm11 ~]# yum install --allowerasing topograph4
   ```

2. The `version4` extra value is set in `topographsettings`:

   **Example**

   ```bash
   [basecm11->wlm[slurm]->topologysettings->topographsettings]% set -e version4 true
   [basecm11->wlm*[slurm*]->topologysettings*->topographsettings*]% commit
   ```

Both steps are required. Installing `topograph4` without setting `version4` to `true`, or setting `version4` to `true` while the `topograph` package is still installed, causes the Topograph service to fail.

The `version4` extra value is a setting on the Slurm WLM instance, not a per-node setting, so it only needs to be set once, regardless of how many nodes run Topograph.

`topograph4` must be installed on every node on which `topograph` is currently running. On an HA cluster (Chapter [15](/admin/ha)), that means both head nodes, matching the placement described in the preceding text. If Topograph runs from a software image rather than only on head nodes, `topograph4` must be installed into the image (section [9.4.1](/admin/softwareimagemanagement#941-installing-from-head-into-the-image-changing-the-root-directory-into-which-the-packages-are-deployed)) and the standard `updateprovisioners` (section [5.2.4.4](/admin/provisioning#5244-provisioning-role-change-notification-with-updateprovisioners)) and `imageupdate` (section [5.6.2](/admin/provisioning#562-updating-running-nodes-with-cmsh-using-imageupdate)) commands must be used to propagate the change to the running nodes, rather than it being installed directly on a running node.

Installing `topograph4` replaces the systemd unit that was installed by the `topograph` package. As with other BCM-managed services whose systemd unit changes (for example, the `slurmd` service after a Slurm software-image upgrade, section [7.5.1.3](#7513-upgrading-from-earlier-slurm-versions-to-slurm2511)), the systemd unit files must be reloaded and the service restarted on every node where `topograph4` was just installed, following the placement described in the preceding paragraph:

**Example**

```bash
[root@basecm11 ~]# systemctl daemon-reload
cmsh -c "device services basecm11; use topograph; restart"
```

The `FakeNodes` and `FakeNodesPool` extra settings, which were special values used in earlier versions of some Slurm clusters, are no longer needed in recent versions of Slurm, and are not supported in Topograph 4. If these settings are configured when `version4` is active, BCM logs a warning and ignores them.

To revert to Topograph 3, the `version4` extra value must be cleared, and the `topograph` package reinstalled on every node currently running `topograph4` – directly on the node if it was installed there (for example, a head node), or in the software image, followed by `updateprovisioners` and `imageupdate`, if it was installed via a software image.

###### For cloud service providers

managed by BCM there are some extra considerations for the `topograph` service:

* For AWS clouds the compute nodes must be running (exist), and must have a flavor that supports the AWS topology API ([https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-topology.html](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-topology.html)). One of the supported flavors is the `p5.48xlarge` instance currently used by DGX Cloud.

  Requirements:

  * To access the AWS instance topology API using the `topograph` service, a prerequisite for an IAM identity is to have permissions for `ec2:DescribeInstanceTopology`. This permission can be enabled through an AWS-managed policy called `AmazonEC2ReadOnlyAccess`.

  * Topograph needs credentials to perform the AWS API call.

    * If the administrator sets the value of `Pass cloud credentials` to `yes`, then BCM sends the credentials to the `topograph` service on each topology fetch.

    * If the administrator sets the value of `Pass cloud credentials` to `no` in BCM, then the profile of the EC2 instance where `topograph` runs has an IAM role with the `AmazonEC2ReadOnlyAccess` policy enabled. AWS EC2 instances support an IMDS API that provides metadata related to the instance itself. One of the features of this API is the support of a profile role for an instance.

* For OCI clouds the nodes must exist in OCI, and

  * the administrator can set the value of `Pass cloud credentials` to `yes`

  or

  * the administrator can set the value of `Pass cloud credentials` to `no` and specify some named dynamic group ([https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/managingdynamicgroups.htm](https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/managingdynamicgroups.htm)) policies in the tenancy.

    Each named dynamic group must have permissions to inspect certain resources. Additionally, the special BCM `thebcmnonprod-topo-dg` dynamic group must have various permissions set to use a variety of resources. The permissions can be set according to the OCI policy syntax ([https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm#Writing](https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm#Writing)) as follows:

    ```bash
    Allow dynamic-group <dynamic_group_name> to inspect compute-capacity-topologies in tenancy
    Allow dynamic-group <dynamic_group_name> to inspect compute-bare-metal-hosts in tenancy
    Allow dynamic-group <dynamic_group_name> to inspect compute-hpc-islands in tenancy
    Allow dynamic-group <dynamic_group_name> to inspect compute-network-blocks in tenancy
    Allow dynamic-group <dynamic_group_name> to inspect compute-local-blocks in tenancy
    ```

* For GCP clouds the requirement is that the placement policy for VMs should be `compact`.

After the Topograph package is installed, the service started, and the administrator has met the requirements for the cloud topology API, then the `topologyplugin` and `topologysource` values must be set:

**Example**

```bash
[basecm11]% wlm use slurm
[basecm11->wlm[slurm]]% topologysettings
[basecm11->wlm[slurm]->topologysettings]% set topologyplugin tree
[basecm11->wlm[slurm]->topologysettings*]% set topologysource topograph
[basecm11->wlm[slurm]->topologysettings*]% commit
```

If `topologysource` is set to a value of `none`, then `topology.conf` content is not updated by BCM. Setting a value of `topograph` causes the Slurm topology to be fetched from the `topograph` service. The `topograph` service currently supports only the tree and block plugins.

Two additional `cmsh` commands allow testing:

* The `topology update` command starts a topology update in the background.

* The `topology print` command prints the generated content for Slurm `topology.conf` to STDOUT. This is a synchronous operation, which means that it can freeze for 10-15 seconds when Topograph is in use.

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% wlm use slurm
[basecm11->wlm[slurm]]% topology update
Topology update initiated
[basecm11->wlm[slurm]]% topology print
SwitchName=nn-468b60a0020d2b170 Switches=nn-7a2f7858c1f7d5cd1
SwitchName=nn-7a2f7858c1f7d5cd1 Switches=nn-73d157eb3d683970e,nn-400810bf9f5e465d6
SwitchName=nn-400810bf9f5e465d6 Nodes=cnode001
SwitchName=nn-73d157eb3d683970e Nodes=cnode002
```

The `topograph` service logs can be seen with the `systemd` command: `journalctl -u topograph -f`

###### Prometheus exporter sampling

of the `topograph` service can be configured in CMDaemon. The `topograph` service sends out Prometheus metrics, which can be added to BCM as follows:

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% monitoring setup
[basecm11->monitoring->setup]% add prometheus topograph
[basecm11->monitoring->setup*[topograph*]]% set urls https://localhost:49021/metrics
[basecm11->monitoring->setup*[topograph*]]% set -e NoPostAllowed yes
[basecm11->monitoring->setup*[topograph*]]% set https yes
[basecm11->monitoring->setup*[topograph*]]% set cacertificatepath /etc/topograph/ssl/ca-cert.pem
[basecm11->monitoring->setup*[topograph*]]% set privatekeypath /etc/topograph/ssl/server-key.pem
[basecm11->monitoring->setup*[topograph*]]% set certificatepath /etc/topograph/ssl/server-cert.pem
[basecm11->monitoring->setup*[topograph*]]% nodeexecutionfilters
[basecm11->monitoring->setup*[topograph*]->nodeexecutionfilters]% active
Added active resource filter
[basecm11->monitoring->setup*[topograph*]->nodeexecutionfilters]% commit
```

If, in the following session, the number of measurables is not zero, then it is a confirmation that the metrics are consumed by BCM:

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% monitoring setup
[basecm11->monitoring->setup]% use topograph
[basecm11->monitoring->setup[topograph]]% show | grep measurables -i
Measurables                      26:comma-separated list of measurables
```

**Slurm drain reason policy:** CMDaemon allows nodes to be drained:

* either by user request, using the `drain` command (section [7.7.4](#774-nodes-drainage-status-and-handling-in-cmsh)) or

* automatically, when a monitoring trigger (section [10.4.5](/admin/monitoring#1045-monitoring-configuration-triggers)) is configured. For example, if some healthcheck fails, then the appropriate node can be drained automatically.

The administrator can also manually drain a node outside of `cmsh`, using the Slurm `scontrol` command from the terminal, as described in `man scontrol.1`.

In all these cases the drain reason can be specified. By default, if a node is already drained, then a second drain command with a new drain reason replaces the old drain reason.

The behavior can be configured with the parameter `Drain reason policy`, within the Slurm cluster settings. The `Drain reason policy` can take one of the following (case-insensitive) values:

* `REPLACE`: the old drain reason(s) is replaced by a new one

* `APPEND`: the new drain reason is separated by a comma, and appended to the existing one(s).

* `SKIP`:

  * If a drain reason already exists, then setting the new drain reason is skipped.

  * If no drain reason already exists, then the new drain reason is applied.

In the following example, the drain reason policy is set to `APPEND`. This means that CMDaemon always appends a new drain reason to any existing ones.

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% wlm use slurm
[basecm11->wlm[slurm]]% set drainreasonpolicy APPEND
[basecm11->wlm[slurm*]]% commit
```

It is also possible to temporarily set an append policy in `cmsh` when draining a node, by using the `+` operator as a prefix to the drain reason:

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% device use node001
[basecm11->device[node001]]% drain --reason="+this will be appended regardless of the current policy"
```

**Slurm services restart or reconfiguration conditions:**

* When parameters in the Slurm configuration files are changed by BCM using CMDaemon, typically by actions of `cmsh` or Base View, then Slurm services automatically restart, and `scontrol reconfigure` is automatically run, as required.

* When parameters in the Slurm configuration files are changed directly, then BCM does not detect a change automatically, and therefore does not automatically restart or reconfigure Slurm.

Slurm subsystems are restarted and reconfigured based on the following list of conditions:

* `slurmctld` and `slurmd` are restarted if:

  1. any of the following global `slurm.conf` parameters managed by CMDaemon are changed:

     * `SelectType`

     * `SelectTypeParameters`

     * `GresTypes`

     * `StateSaveLocation`

     * `SchedulerType`

     * `SchedulerParameters`

     * `SlurmctldParameters`

  2. `gres.conf` is changed (by CMDaemon)

  3. [`oci.conf` (`https://slurm.schedmd.com/oci.conf.html`)](https://slurm.schedmd.com/oci.conf.html) is changed (by CMDaemon). In `cmsh` this typically happens using the `ocisettings` submode under the `wlm` mode.

  4. nodes are changed (by CMDaemon) in `slurm.conf` (nodes are renamed, added, or removed).

* An `scontrol reconfigure` is carried out if:

  1. any Slurm parameters managed by BCM, that are not mentioned in the preceding list of conditions, are changed. This is true also for the `Partition` and `Node` parameters within the `slurm.conf` file, except for the `NodeName` and `PartitionName` parameters specifically.

  2. `cgroups.conf` is changed (by CMDaemon)

  3. `topology.conf` is changed (by CMDaemon)

A restart or a reconfigure is not done by CMDaemon under other conditions.

**Slurm resource consumption monitoring configuration:** Slurm allows the configuration of how consumable resources (core, CPU, memory, etc) are tracked and shared among jobs on a node. At the time of writing of this section (November 2022), `cmsh` or Base View can be used to configure the tracking and sharing of resources as in the following text.

* `SelectType`: this plugin configures the algorithm used to select resources for jobs. By default, NVIDIA Base Command Manager configures the `select/cons_tres` plugin. This is an advanced version of `select/cons_res` plugin, and it also allows GPUs to be tracked separately from other consumable resources.

  Further details on `cons_res` can be found in the Slurm documentation at [https://slurm.schedmd.com/cons_res.html](https://slurm.schedmd.com/cons_res.html) and [https://slurm.schedmd.com/cons_res_share.html](https://slurm.schedmd.com/cons_res_share.html).

  The `SelectType` parameter is configured in `cmsh` or Base View, from within the Slurm cluster configuration settings:

  **Example**

  ```bash
    [root@basecm11 ~]# cmsh
    [basecm11]% wlm use slurm
    [basecm11->wlm[slurm]]% set selecttype select{<TAB><TAB>}
    select/cons_res   select/cons_tres  select/linear
    [basecm11->wlm[slurm]]%
  ```

* `SelectTypeParameters`: allows the configuration of the resource selection plugin that is specified for the `SelectType` parameter. The possible values depend on the plugin type. For `select/cons_tres`, the values follow the pattern:

  * `CR_Memory` or

  * `CR_` \<*COMPUTE_UNIT*>`[_Memory]` where \<*COMPUTE_UNIT*> takes one of the following values:

    * `Core`

    * `CPU`

    * `Socket`

    * `Board`

  The value of `SelectTypeParameters` specifies if the \<*COMPUTE_UNIT*> resource is tracked, or if the \<*COMPUTE_UNIT*> resource is tracked together with memory, or if only memory is tracked.

  There are also a few special values that can be applied to `SelectTypeParameters`:

  * `CR_ONE_TASK_PER_CORE`: allocate one task per core (used only with the `select/linear` plugin)

  * `CR_CORE_DEFAULT_DIST_BLOCK`: allocate cores within a node using a block distribution

  * `CR_LLN`: schedule resources to jobs on the least loaded nodes

  * `CR_Pack_Nodes`: if a job allocation contains more resources than will be used for launching tasks, then rather than distributing a job’s tasks evenly across its allocated nodes, pack them as tightly as possible on these nodes.

* `OverSubscribe` ([here](/admin/configuring#31726-gpu-configuration-for-hpc-workload-managers)):

  * if the `select/linear` plugin is used, then the `OverSubscribe` parameter controls whether or not the nodes are shared among jobs

  * if the `select/cons_res` or `select/cons_tres` plugins are used, then the `OverSubscribe` parameter controls whether or not the configured consumable resources are shared among jobs. For these plugins, when a consumable resource such as a core, socket, CPU, or other, is shared, it means that more than one job can be assigned to it. The parameter is set per Slurm partition (queue) and accepts the following values:

    * `EXCLUSIVE`: allocate entire node for a job;

    * `FORCE`: makes all resources (except for GRES) in the Slurm partition available for oversubscription without any means for users to disable it (may be followed with a colon and maximum number of jobs in running or suspended state);

    * `YES`: makes all resources (except for GRES) in the Slurm partition available for sharing upon request by the job (may be followed with a colon and maximum number of jobs in running or suspended state);

    * `NO`: no resource is allocated to more than one job.

* `AccountingStorageTRES`: A comma-separated list of resources that the administrator wants to track on the cluster. By default the following resources (TRES) are tracked:

  * billing

  * CPU

  * energy

  * memory

  * node

  * fs/disk

  * pages

  * vmem

  These default TRES cannot be disabled, but only appended to. Resources use is recorded when used on the cluster. If GPUs of different types are tracked, then job requests with matching type specifications are recorded.

  **Example**

  If:\
  `AccountingStorageTRES=gres/gpu:tesla,gres/gpu:volta` is set\
  then:\
  `gres/gpu:tesla` and `gres/gpu:volta` track only jobs that explicitly request those two GPU types.

**Slurm REST API:**  `slurmrestd` is Slurm’s REST API daemon. It is installed with the BCM package `slurm25.05-slurmrestd`, or `slurm25.11-slurmrestd`. The distribution package, `slurm-slurmrestd`, should not be installed, and indeed its installation is not suggested by the package manager in a cluster that is correctly configured.

**Slurm REST API package installation and version matching:** If installing the REST API package, then care must be taken to match the versions exactly to its sibling Slurm packages ([here](#7511-slurm-packages)). For example, if the already-installed packages have version 25.05:

**Example**

```bash
[root@basecm11 ~]# rpm -qa slurm*      #what are the already installed packages?
slurm25.05-25.05.8-101124_cm11.0_0639470153.x86_64
slurm25.05-perlapi-25.05.8-101124_cm11.0_0639470153.x86_64
slurm25.05-slurmdbd-25.05.8-101124_cm11.0_0639470153.x86_64
slurm25.05-slurmd-25.05.8-101124_cm11.0_0639470153.x86_64
slurm25.05-slurmctld-25.05.8-101124_cm11.0_0639470153.x86_64
slurm25.05-contribs-25.05.8-101124_cm11.0_0639470153.x86_64
slurm25.05-devel-25.05.8-101124_cm11.0_0639470153.x86_64
slurm25.05-prs-25.05.8-101124_cm11.0_0639470153.x86_64
```

and if the Slurm REST API package version to be installed is as indicated by the following:

**Example**

```bash
    root@basecm11 ~]# yum info slurm25.05-slurmrestd | egrep '(Name|Release|Source)'  #what will install?
Name         : slurm25.05-slurmrestd
Release      : 102530_cm11.0_f08198ecda
Source       : slurm25.05-25.05.9-102530_cm11.0_f08198ecda.src.rpm
```

then it means that all already-installed Slurm packages must be upgraded to release `102530_cm11.0_f08198ecda` too.

The reason behind matching versions exactly is that the upstream versions can have significant configuration changes between patch versions (here 25.05.8 changing to 25.05.9). These changes may result in a non-functioning workload manager. This is true, not only when considering the Slurm REST API package, but also true when considering the other Slurm packages.

**The user `daemon` cannot be in the `bin` group for `slurm25.05-slurmrestd` on SLES15:** Slurm 25.05 expects that the user `daemon` should be a member of only the group `daemon`. The `groups` command lists the groups that a user is in, so it can be used to check to see if the user `daemon` is in the group `bin` as well in the group `daemon` with:

**Example**

```bash
[root@basecm11 ~]# groups daemon
daemon : daemon bin
```

Here the user `daemon` is in the group `bin` and as well as in the group `daemon`. For `slurmrestd` to work properly, the group `bin` must have user `daemon` deleted from it. The `gpasswd` command can do that with:

**Example**

```bash
[root@basecm11 ~]# gpasswd -d daemon bin
```

If `slurmrestd` is running on a compute node, then the `gpasswd` command must be run in the image of the compute node instead. For example, if the image is `default-image`:

**Example**

```bash
[root@basecm11 ~]# cm-chroot-sw-img /cm/images/default-image gpasswd -d daemon bin
```

The `imageupdate` command can then be run so that the change is picked up by the node.

The `gpasswd` command should be run for any group, other than group `daemon`, that user `daemon` is a member of.

**Slurm REST API and authentication:** The slurmrestd service can be configured with JWT ([JSON Web Token](https://tools.ietf.org/html/rfc7519)) authentication as follows:

1. The JWT key is generated in the Slurm cluster configuration directory, and its ownership and permissions are then changed:

   **Example**

   ```bash
     [root@basecm11 ~]# module load slurm  # Loads SLURM_CONF environment variable from modulefile
     [root@basecm11 ~]# JWT_KEY=`dirname $SLURM_CONF`/jwt.key
     [root@basecm11 ~]# install -m 0600 -o slurm -g slurm <(dd if=/dev/random bs=32 count=1) $JWT_KEY
   ```

   The location of the key can differ, but user `slurm` must have read access to the file.

2. The JWT plugin is configured in `slurm.conf` for the Slurm cluster instance. For example, for a Slurm cluster instance \<*cluster name*>:

   **Example**

   ```bash
     AuthAltTypes=auth/jwt
     AuthAltParameters=jwt_key=/cm/shared/apps/slurm/etc/<cluster name>/jwt.key
   ```

   The `slurmctld` service is restarted to apply the plugin settings. For example, if it is running on the head node:

   ```bash
   [root@basecm11 ~]# systemctl restart slurmctld.service
   ```

3. A `systemd` drop-in file is created for the new `slurmrestd` service:

   **Example**

   ```bash
     [root@basecm11 ~]# slurmrestapidir="/etc/systemd/system/slurmrestd.service.d"
     [root@basecm11 ~]# mkdir $slurmrestapidir
     [root@basecm11 ~]# echo "[Service]" > $slurmrestapidir/99-cmd.conf
     [root@basecm11 ~]# echo "Environment=SLURM_CONF=$SLURM_CONF" >> $slurmrestapidir/99-cmd.conf
   ```

   Future versions of BCM may automatically create or update the file `99-cmd.conf`. It is therefore recommended to use that file name as a best practice for cluster administration.

4. The `slurmrestd` service is configured within `cmsh` so that it can be monitored by BCM:

   **Example**

   ```bash
     [root@basecm11 ~]# cmsh
     [basecm11]% device services master
     [basecm11->device[basecm11]->services]% add slurmrestd
     [basecm11->device*[basecm11*]->services*[slurmrestd*]]% set monitored yes
     [basecm11->device*[basecm11*]->services*[slurmrestd*]]% set autostart yes
     [basecm11->device*[basecm11*]->services*[slurmrestd*]]% commit
     [basecm11->device[basecm11]->services[slurmrestd]]%.
   ```

5. A ping-like `curl` check can be run with custom extra headers to ensure that the Slurm REST API service is running properly, as follows:

   **Example**

   ```bash
     [root@basecm11 ~]# export $(scontrol token username=cmsupport)
         [root@basecm11 ~]# curl 0.0.0.0:6820/openapi \
         -H "X-SLURM-USER-TOKEN: $SLURM_JWT" \
         -H "X-SLURM-USER-NAME: cmsupport"
       % Total    % Received % Xferd  Average Speed     Time     Time     Time  Current
                                      Dload  Upload    Total    Spent     Left  Speed
       0     0    0        0 0     0        0     0 --:--:-- --:--:-- --:--:--        0
         {
       "tags": [
         {
           "name": "slurm",
           "description": "methods that query slurmdbd"
         },
         {
           "name": "openapi",
           "description": "methods that query for OpenAPI specifications"
         }

     [...]
   ```

The `slurmrestd` daemon configuration is specified by its command line arguments. These can be made permanent in `/etc/sysconfig/slurmrestd`.

**GPU autodetection:**

Slurm supports GPU autodetection from version 20 onward, using the `AutoDetect` flag in `gres.conf`.

Slurm GPU autodetection allows AMD, Intel, and NVIDIA GPUs to have their GPU parameters be set automatically, if autodetection is also enabled in [`gres.conf`](https://slurm.schedmd.com/gres.conf.html). Slurm GPU autodetection removes the need for explicit GPU configuration in `gres.conf`.

The number of GPUs must however still be specified explicitly by the administrator. This is because at the time of writing (October 2024) Slurm has no GPU autodetection by default.

In BCM, the Slurm GPU hardware detection setting has 7 options, as covered [here](#slurm-hardware-autodetection-for-gpus).

* Setting the `bcm` option for Slurm GPU autodetection removes the need to specify any further GPU autodetect option.

* Setting a GPU vendor (NVIDIA, Intel, AMD) option for Slurm GPU autodetection means that the `Gres=...` parameter in `NodeName` lines in `slurm.conf` is still required in order to tell `slurmctld` how many GRES to expect. This means that the administrator must define GPUs in BCM, in the `genericresources` mode of the `slurmclient` role, if that has not already been specified during `cm-wlm-setup`.

  However there is no need in this case to specify all the details. It is enough to add a single generic resource named `gpu`, and to specify the number of such GPUs. In order to skip adding the generic resources to `gres.conf`, while still allowing GRES information to be added the `slurm.conf` file, the flag `AddToGresConfig` should be set to `no` in the `genericresource` entity. For example:

  **Example**

  ```bash
  [basecm11]% configurationoverlay use slurm-client
  [basecm11->configurationoverlay[slurm-client]]% roles
  [basecm11->configurationoverlay[slurm-client]->roles]% use slurmclient
  [...[slurmclient]]% genericresources
  [...[slurmclient]->genericresources]% add autodetected-gpus
  [...[slurmclient*]->genericresources*[autodetected-gpus*]]% set name gpu
  [...[slurmclient*]->genericresources*[autodetected-gpus*]]% set count 8
  [...[slurmclient*]->genericresources*[autodetected-gpus*]]% set addtogresconfig no
  [...[slurmclient*]->genericresources*[autodetected-gpus*]]% commit
  [...[slurmclient]->genericresources[autodetected-gpus]]% wlm use slurm
  [basecm11->wlm[slurm]]% set gpuautodetect nvml
  [basecm11->wlm*[slurm*]]% commit
  [basecm11->wlm[slurm]]%
  ```

Initial generic resources configuration for Slurm GPU autodetection can also be done during Slurm setup by `cm-wlm-setup`. If GPU configuration is chosen in the TUI screen of `cm-wlm-setup` (figure [7.27](#fig-cm-wlm-setup-configure-gpus-screen)):

![The screen prompting for GPU configuration in cm-wlm-setup](/base-command-manager/product-manuals/_fern-img/dd25a82e017ff1e9058253a83d5176e4d6085a0fb1ee151ef782651980850f1d.webp)

*Figure 7.27: The screen prompting for GPU configuration in cm-wlm-setup*

then the TUI allows Slurm GPU autodetection options to be selected (figure [7.28](#fig-cm-wlm-setup-gpu-autodetect-options-screen)):

![The GPU configuration screen of cm-wlm-setup](/base-command-manager/product-manuals/_fern-img/b52da4ff53650965092f58ca3d25bb05e73717f2460de2163bcfc2336b93e26d.webp)

*Figure 7.28: The GPU configuration screen of cm-wlm-setup*

The options are the same as those described in the list of 7 options for `GPU auto detect` ([here](#7518-configuring-slurm)). The options result in the following actions:

* `BCM autodetects GPUs`: BCM automatically detects numbers and types of GPUs on the selected nodes and configures `slurm.conf` appropriately. The administrator is not asked to configure anything. This option does not work if the nodes have GPUs from a mix of vendors.

* `Slurm autodetects` \<*vendor*>` GPU details`: the administrator is prompted to specify numbers and types of GPUs later on. These values are then added to the `Gres` parameter of `NodeName` lines in `slurm.conf`, while Slurm autodetects the rest of the GPU details.

* `Manual GPU configuration in cm-wlm-setup`: the administrator is prompted to enter the GPU parameters manually. The manual entries are then converted to appropriate lines in `gres.conf`.

**Slurm GPU cluster settings:** When a GPU is configured the following parameters can be configured with BCM:

<table>
  <tbody>
    <tr>
      <td>
        **Base View**
      </td>

      <td>
        **Slurm Object Value Within**
      </td>

      <td>
        **Description**
      </td>
    </tr>

    <tr>
      <td>
        **Option**
      </td>

      <td>
        **WLM Mode Of `cmsh`**
      </td>

      <td />
    </tr>

    <tr>
      <td>
        `Select Type`
      </td>

      <td>
        `SelectType`
      </td>

      <td>
        Identifies the type of resource selection algorithm to be used. Changing this value causes the 

        `slurmctld`

         daemon to be restarted. Default: Consumable trackable resource:

        `select/cons_tres`
      </td>
    </tr>

    <tr>
      <td>
        `Select Type Parameters`
      </td>

      <td>
        `SelectTypeParameters`
      </td>

      <td>
        Parameters for the resource selection algorithm. Acceptable values for these parameters depend upon the algorithm selected. Default: Core as a consumable resource: 

        `CR_Core`
      </td>
    </tr>

    <tr>
      <td>
        `Accounting Storage TRES`
      </td>

      <td>
        `AccountingStorageTRES`
      </td>

      <td>
        Comma-separated list of resources to be tracked on the cluster, requested by an 

        `sbatch`

        /

        `srun`

         job on submission. Default: GPU as a generic resource: 

        `gres/gpu`
      </td>
    </tr>
  </tbody>
</table>

**Example**

```bash
[basecm11->wlm[slurm]]% get selecttype
select/cons_tres
```

**MIG and Slurm:** NVIDIA’s Multi-Instance GPU (MIG) technology is a way to optimize GPU use. MIG allows a single GPU to be partitioned into up to 7 separate logical GPU instances, each providing separate GPU resources to user jobs. Slurm is MIG-capable since version 21.08.

BCM automates the configuration of MIG profiles as GPU generic resource types. This means that a user can request GPUs by type, and Slurm then tracks the MIG profiles usage.

MIG detection on Slurm compute nodes (nodes with the `slurmclient` role assigned) means that the `slurm.conf` and `gres.conf` files are automatically configured by CMDaemon as follows:

* `slurm.conf`:

  1. For each node, `NodeName` parameter lines have a `Gres` specification (generic resource type specification) with the MIG profile names appended as strings. The strings take the format: `       gpu:` \<*profile*>`:<`*number*>

     where \<*number*> is the number of instances with the profile name of `gpu:` \<*profile*>. For example:

     1. A GPU on `node001` is partitioned into two MIG instances, one with a profile name of `3g.40gb`, and the other with a profile name of `4g.40gb`:

        **Example**

        ```bash
        NodeName=node001 ... Gres=gpu:3g.40gb:1,gpu:4g.40gb:1 ...
        ```

     2. A GPU on `node001` is partitioned into two MIG instances, both with same profile name `3g.20gb`. Also present is a regular GPU, `a40`, that is configured manually as a generic resource:

        **Example**

        ```bash
        NodeName=node001 ... Gres=gpu:a40:1,gpu:3g.20gb:2 ...
        ```

  2. The `GresTypes` parameter line has the MIG profiles from all the compute nodes.

     **Example**

     ```bash
     GresTypes=3g.40gb,4g.40gb,gpu
     ```

  3. The `AccountingStorageTRES` parameter line includes the new generic resource per MIG profile.

     **Example**

     ```bash
     AccountingStorageTRES=gres/gpu,gres/gpu:3g.40gb,gres/gpu:4g.40gb
     ```

* `gres.conf`: the `AutoDetect` parameter is set to `NVML` for the nodes where MIGs are detected.

  **Example**

  ```bash
  NodeName=node[001-016] AutoDetect=NVML
  ```

  In this case Slurm detects the MIG details (links, file, cores, and so on) automatically.

If the GPUs are repartitioned by BCM, then the Slurm configuration is by default automatically updated with the new GPU types according to the new MIG profiles. The default value of `yes` can be modified with the `configuremigs` parameter in Slurm cluster settings:

**Example**

```bash
[basecm11->wlm[slurm]]% set configuremigs no; commit
```

The administrator can validate that the MIG devices are correctly recognized by Slurm, by checking the `Gres` line output of the `scontrol show node` command:

**Example**

```bash
[root@basecm11 ~]# scontrol show node node001 | grep "Gres="
   Gres=gpu:4g.40gb:1(S:0),gpu:3g.40gb:1(S:0)
```

The presence of a socket value such as `S:0` indicates that Slurm detected the MIG details on the node as expected.

**Slurm node settings:**

The parameter value for a Slurm option in `slurm.conf` is set by CMDaemon, if its value is not: `0`.

A parameter value of `0` means that the default values of Slurm are used. These usually have the value: `0`.

The advanced options that CMDaemon manages for Slurm are:

<table>
  <colgroup>
    <col />

    <col />

    <col />
  </colgroup>

  <thead>
    <tr>
      <th>
        **Base View Option**
      </th>

      <th>
        **Slurm Option**
      </th>

      <th>
        **Description**
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td rowspan="2">
        `Features`
      </td>

      <td>
        `Feature=<`

        *string*

        `>`

         entry in the file 

        `slurm.conf`
      </td>

      <td>
        Arbitrary strings can be entered to indicate some characteristics of a node, one string per entry. For example: 

        `text1`

         

        `text2`

         and so on. These become part of the: 

        `Feature=text1,text2...`

         attribute to the 

        `NodeName=<`

        *`node name`*

        `>`

         entry line in 

        `slurm.conf`

        , as indicated in 

        `man slurm.conf.5`

        . The strings also become added attributes to the 

        `GresTypes`

         entry of that file. Default: blank.
      </td>
    </tr>

    <tr>
      <td>
        `File=<`

        *device*

        `>`

         entries in the file 

        `gres.conf`
      </td>

      <td>
        This is only implemented if the number of GPUs has been set by the administrator using BCM, by setting the basic Slurm client option 

        `GPUs`

        . The 

        `GPUs`

         option is seen, for example, in Base View, using the navigation path 

        `Grouping`

         \> 

        `Node categories[default]`

         \> 

        `Edit`

         \> 

        `Settings`

        `Roles`

         \>
      </td>
    </tr>

    <tr>
      <td rowspan="2">
        `slurmclient`

         \> 

        `GPUs`

        . Each device detected on the host node can be added as an entry. For example: 

        `/dev/nvidia0`

         

        `/dev/nvidia1`

         and so on. Alternatively, they can be added as a range in one line, for example: 

        `/dev/nvidia[0-1]`

         These become part of the: 

        `Name=gpu File=<`

        *device*

        `>`

         lines in 

        `gres.conf`

        , as indicated in 

        `man gres.conf.5`

        . Default: blank
      </td>

      <td />

      <td />
    </tr>

    <tr>
      <td>
        `CPU`
      </td>

      <td>
        Number of logical processors on the node. For Slurm 20 and beyond, CMDaemon detects the number of CPU cores, and sets 

        `procs=`

        *`number of cores`*

         using slots autodetection. Default for Slurm prior to version 20: 

        `0`
      </td>
    </tr>

    <tr>
      <td>
        `Sockets`
      </td>

      <td>
        `Sockets`
      </td>

      <td>
        Processor chips on node. If this is defined, then 

        `SocketsPerBoard`

         must not be defined. Default: 

        `0`
      </td>
    </tr>

    <tr>
      <td>
        `Cores per socket`
      </td>

      <td>
        `CoresPerSocket`
      </td>

      <td>
        Number of cores per socket. Default: 

        `0`
      </td>
    </tr>

    <tr>
      <td>
        `ThreadsPerCore`
      </td>

      <td>
        `ThreadsPerCore`
      </td>

      <td>
        Number of logical threads for a single core. Default: 

        `0`
      </td>
    </tr>

    <tr>
      <td>
        `Boards`
      </td>

      <td>
        `Boards`
      </td>

      <td>
        Number of baseboards in a node. Default: 

        `0`
      </td>
    </tr>

    <tr>
      <td>
        `SocketsPerBoard`
      </td>

      <td>
        `SocketsPerBoard`
      </td>

      <td>
        Number of processor chips on baseboard. If this is defined, then 

        `Sockets`

         must not be defined. Default: 

        `0`
      </td>
    </tr>

    <tr>
      <td>
        `RealMemory`
      </td>

      <td>
        `RealMemory`
      </td>

      <td>
        Size of real memory on the node, MB. Default: 

        `0`
      </td>
    </tr>

    <tr>
      <td>
        `NodeHostname`
      </td>

      <td>
        `NodeHostname`
      </td>

      <td>
        Default: as defined by Slurm’s 

        `NodeName`

         parameter.
      </td>
    </tr>

    <tr>
      <td>
        `NodeAddr`
      </td>

      <td>
        `NodeAddr`
      </td>

      <td>
        Default: as set by Slurm’s 

        `NodeHostname`

         parameter.
      </td>
    </tr>

    <tr>
      <td>
        `State`
      </td>

      <td>
        `State`
      </td>

      <td>
        State of the node with user jobs. Possible Slurm values are: 

        `DOWN`

        , 

        `DRAIN`

        , 

        `FAIL`

        , 

        `FAILING`

        , and 

        `UNKNOWN`

        . Default: 

        `UNKNOWN`
      </td>
    </tr>

    <tr>
      <td>
        `Weight`
      </td>

      <td>
        `Weight`
      </td>

      <td>
        The priority of the node for scheduling. Default: 

        `0`
      </td>
    </tr>

    <tr>
      <td>
        `Port`
      </td>

      <td>
        `Port`
      </td>

      <td>
        Port that slurmd listens to on the compute node. Default: as defined by 

        `SlurmdPort`

         parameter. If 

        `SlurmdPort`

         is not specified during build: Default: 

        `6818`

        .
      </td>
    </tr>

    <tr>
      <td>
        `TmpDisk`
      </td>

      <td>
        `TmpDisk`
      </td>

      <td>
        Total size of Slurm’s temporary filesystem, 

        `TmpFS`

        , typically 

        `/tmp`

        , in MB. 

        `TmpFS`

         is the storage location available to user jobs for temporary storage. Default: 

        `0`
      </td>
    </tr>

    <tr>
      <td>
        `Options`
      </td>

      <td>
        `extra options`
      </td>

      <td>
        Extra options that are added to 

        `slurm.conf`
      </td>
    </tr>
  </tbody>
</table>

Further Slurm documentation is available:

* in `man` pages under `/cm/local/apps/slurm/current/man/`

* as HTML documentation in the version dependent directory of the form:

  `/cm/local/apps/slurm/current/share/doc/slurm-` \<*version*>`/html`, or

* at the Slurm website at [http://slurm.schedmd.com/documentation.html](http://slurm.schedmd.com/documentation.html)

Slurm is set up with reasonable defaults, but administrators familiar with Slurm can reconfigure the configuration file using a web browser. The web browser can be used with the HTML documentation of the installed Slurm version, in the version dependent directory of the form:

`/cm/local/apps/slurm/current/share/doc/slurm-` \<*version*>`/html/`

The choice of JavaScript-based configuration generators is then:

* `configurator.easy.html`: for a simplified configurator

* `configurator.html`: for a full version of the configurator.

If the configuration file becomes mangled beyond repair, the original default can be regenerated once again by re-installing the Slurm package, then running the script `/cm/local/apps/slurm/current/scripts/cm-restore-db-password`, and then running `cm-wlm-setup`. Care must be taken to avoid duplicate parameters being set in the configuration file—`slurmd` may not function correctly in such a configuration.

#### 7.5.1.9  Running Slurm

Slurm can be disabled and re-initialized with the `cm-wlm-setup tool` (section [7.3](#73-installation-of-workload-managers)) during package installation itself.

Alternatively, role assignment and role removal can be used to adjust what nodes, if any, run Slurm. The assignment and removal of roles can be carried out from Base View (section [7.4.1](#741-enabling-and-disabling-a-wlm-with-base-view)) or `cmsh` (section [7.4.2](#742-enabling-and-disabling-a-workload-manager-with-cmsh)).

The Slurm workload manager runs these daemons:

1. as servers:

   1. `slurmdbd`: The database that tracks job accounting. It is part of the `slurmdbd` service.

   2. `slurmctld`: The controller daemon. Monitors Slurm processes, accepts jobs, and assigns resources. It is part of the `slurm` service.

   3. `munged`: The authentication (client-and-server) daemon. It is part of the `munge` service.

2. as clients:

   1. `slurmd`: The compute node daemon that monitors and handles tasks allocated by `slurmctld` to the node. It is part of the `slurm` service.

   2. `slurmstepd`: A temporary process spawned by the `slurmd` compute node daemon to handle Slurm job steps. It is not initiated directly by users or administrators.

   3. `munged`: The authentication (client-and-server) daemon. It is part of the `munge` service.

Logs for the daemons are saved on the node that they run on. Accordingly, the locations are:

* `/var/log/slurmdbd`

* `/var/log/slurmd`

* `/var/log/slurmctld`

* `/var/log/munge/munged.log`

### 7.5.2  Installing, Configuring, And Running LSF

IBM prefers to make LSF available directly from their [Passport Advantage Online website](http://www.ibm.com/software/passportadvantage), which is why it is not available by direct selection in [figure 3.9 of the *Installation Manual*](/installation/installing#fig-workload).

IBM provides LSF in 2 ways.

Somewhat confusingly, the archived IBM Spectrum LSF Suite version 10.2.0.9 has LSF Standard edition 10.1 as a component. The component is supported, but installation from the suite is not supported by BCM. That is, installation using the official IBM method or by carrying out a manual installation are both not supported by BCM. A cluster administrator should therefore not try to install LSF Standard Edition 10.1 from a IBM Spectrum LSF Suite release.

#### 7.5.2.1  Installing LSF

The workload manager LSF version 10.1 is installed and integrated into NVIDIA Base Command Manager 11 with the following steps:

1. The following LSF files should be downloaded from the IBM web site into a directory on the head node:

   * Installation package: `lsf` \<*lsf_ver*>`_lsfinstall_linux_<`*cpu_arch*>.tar.Z

   * Distribution package: `lsf` \<*lsf_ver*>`_linux<`*kern_ver*>-glibc \<*glibc_ver*>`-<`*cpu_arch*>.tar.Z

   * Documentation package (optional): `lsf` \<*lsf_ver*>`_documentation.tar.Z`

   Here:

   * \<*lsf_ver*> is the LSF version, for example: `10.1`

   * \<*kern_ver*> is the Linux kernel version, for example: `2.6`

   * \<*glibc_ver*> is the glibc library version, for example: `2.3`

   * \<*cpu_arch*> is the CPU architecture, for example: `x86_64`

   A check should be done to ensure that the `tar.Z` files have not been renamed or had their names changed to lower case during the download, in order to avoid installation issues. All the files must be in the same directory before installation.

   In case of an existing failover setup, the installation is done on the active head node.

   A license file for LSF may also be needed for the installation, but it does not have to be in the same directory as the other `tar.Z` files.

2. The `cm-lsf` package must be installed on the head node. The `cm-lsf-client` package must be installed on both the head node and within the software images. By default they should have been already installed. If not then they can be installed manually from the BCM repository. For RHEL-based distributions the procedure looks like:

   ```bash
   [root@basecm11 ~]# yum install cm-lsf cm-lsf-client
   [root@basecm11 ~]# chroot <IMAGE> yum install cm-lsf-client
   ```

   For SLES distributions the procedure looks like:

   ```bash
   [root@basecm11 ~]# zypper install cm-lsf cm-lsf-client
   [root@basecm11 ~]# chroot <IMAGE> zypper install cm-lsf-client
   ```

   For Ubuntu distributions the procedure looks like:

   ```bash
   [root@basecm11 ~]# apt-get install cm-lsf cm-lsf-client
   [root@basecm11 ~]# cm-chroot-sw-img <IMAGE>
   [root@basecm11 ~]# apt-get install cm-lsf-client
   ...
   [root@basecm11 ~]# exit
   ```

   The `cm-lsf` and `cm-lsf-client` packages contain a template for an environment module file, an installation configuration file, and systemd unit files. The installation configuration file may be tuned by the administrator if required. It is passed to the `lsfinstall` script distributed with LSF, which is executed by `cm-wlm-setup` during setup. To change the default values in the installation configuration file, the administrator should change the template file:

   ```bash
   [root@basecm11 ~]# cd /cm/shared/apps/lsf/var/cm/
   [root@basecm11 cm]# vi install.config.template
   ...
   ```

   Values enclosed by a percentage sign, ‘%’, are replaced by `cm-wlm-setup` during installation. If such values are replaced by custom values, then `cm-wlm-setup` does not change them, and the custom values are used during installation.

   If `install.config` is changed instead of the template file, then `cm-wlm-setup` replaces it with the configuration file generated from the template. So, changing `install.config` directly should almost certainly not ever be done.

3. `cm-wlm-setup` is run. The directory where the LSF files were downloaded is specified on one of the setup screens, or with the `--archives-location` option.

   **Example**

   ```bash
     [root@basecm11 ~]# cm-wlm-setup --wlm lsf --setup --archives-location /root/lsf
   ```

   The same can be achieved by executing `cm-wlm-setup` without any command line arguments. The required information can be specified within the TUI configuration screens in this case. Also the same can be achieved with the WLM Wizard in Base View.

4. The nodes are then rebooted, and the LSF command `bhosts` then displays an output similar to:

   **Example**

   ```bash
   [root@basecm11 ~]# module load lsf
   [root@basecm11 ~]# bhosts
   HOST_NAME   STATUS  JL/U   MAX  NJOBS   RUN  SSUSP ...
   basecm11        ok     -     2      0     0      0 ...
   head2           ok     -     0      0     0      0 ...
   node001         ok     -     1      0     0      0 ...
   node002         ok     -     1      0     0      0 ...
   node003    unavail     -     1      0     0      0 ...
   node004     closed     -     1      0     0      0 ...
   node005         ok     -     1      0     0      0 ...
   ```

   The output in the preceding example has been truncated for this manual, for convenience.

   The installation status can be checked with the service `lsfd` (some output elided):

   ```bash
   [root@basecm11 ~]# systemctl status lsfd
    lsfd.service - IBM Spectrum LSF
      Loaded: loaded (/usr/lib/systemd/system/lsfd.service; enabled; vendor preset: disabled)
      Active: active (running) since Sat 2023-01-14 17:48:05 CET; 1 day 15h ago
     Process: 54334 ExecStart=/cm/shared/apps/lsf/current/etc/lsf_daemons start (code=exited, status=0/SUCCESS)
       Tasks: 13 (limit: 23269)
      Memory: 179.5M
      CGroup: /system.slice/lsfd.service
              |- 54410 /cm/shared/apps/lsf/...10.1/linux2.6-glibc2.3-x86_64/etc/res
              |- 54412 /cm/shared/apps/lsf/...10.1/linux2.6-glibc2.3-x86_64/etc/sbatchd
              |- 54427 /cm/shared/apps/lsf/...10.1/linux2.6-glibc2.3-x86_64/etc/mbatchd -d
                                                                    /cm/shared/apps/l...
              |-102312 /cm/shared/apps/lsf/...10.1/linux2.6-glibc2.3-x86_64/etc/eauth -s
              |-344591 /cm/shared/apps/lsf/...10.1/linux2.6-glibc2.3-x86_64/etc/lim -d
          |                                                         /cm/shared/apps/l..
              |-344595 /cm/shared/apps/lsf/...10.1/linux2.6-glibc2.3-x86_64/etc/pim -d
                                                                    /cm/shared/apps/...
              |-344612 /cm/shared/apps/lsf/...10.1/linux2.6-glibc2.3-x86_64/etc/melim
              |-344647 /cm/shared/apps/lsf/...10.1_linux2.6-glibc2.3-x86_64/10.1...
              `-457629 /cm/shared/apps/lsf/...10.1_linux2.6-glibc2.3-x86_64/10.1/...

   Jan 14 23:29:30 basecm11 mbatchd[54427]: Jan 14 23:29:30 2023 54427:54427 3 10.1 ...
   ...
   [root@basecm11 ~]#
   ```

   while default queues can be seen by running:

   ```bash
   [root@basecm11 ~]# module load lsf
   [root@basecm11 ~]# bqueues
   QUEUE_NAME      PRIO STATUS          MAX JL/U JL/P  ...
   owners           43  Open:Active       -    -    -  ...
   priority         43  Open:Active       -    -    -  ...
   night            40  Open:Active       -    -    -  ...
   chkpnt_rerun_qu  40  Open:Active       -    -    -  ...
   short            35  Open:Active       -    -    -  ...
   license          33  Open:Active       -    -    -  ...
   normal           30  Open:Active       -    -    -  ...
   interactive      30  Open:Active       -    -    -  ...
   idle             20  Open:Active       -    -    -  ...
   ```

   The output in the preceding example has been truncated for this manual, for convenience.

   If more than one instance of an LSF cluster is set up, then the full modulefile name should be specified. For example:

   ```bash
   [root@basecm11 ~]# module load lsf/lsf1/10.1
   ```

#### 7.5.2.2  Configuring LSF

**LSF server configuration:** After LSF is set up with `cm-wlm-setup`, the following CMDaemon settings can be modified for the LSF server role:

* `External Server`: a value of `yes` means that LSF server daemons are running on an external server that is not managed by BCM.

The following settings are available in LSF cluster settings, and are applied to all the LSF roles of the LSF cluster:

* `Prefix`: this sets the path to the root location of the LSF installation. The default value is `/cm/shared/apps/lsf/current`.

* `Var`: this sets the path to the `var` directory of LSF. The default value is `/cm/shared/apps/lsf/var`.

* `Cgroups`: this is a submode that contains LSF-related cgroups settings.

The cgroups settings that affect LSF behavior are available using the LSF instance. For example, for an instance `lsf`, the settings can be accessed within `cmsh` using `cmsh->wlm[lsf]->cgroups`. The settings available are:

* `Automount`: if `yes`, then the workload manager tries to mount a subsystem if it is not mounted yet. The default value is `No`.

* `Job Cgroup Template`: this is the template relative job cgroup path. The token `$CLUSTER` specified in this template path is replaced with the actual LSF cluster name, and `$JOBID` is replaced by the job ID. The path is used by the BCM monitoring system in order collect job metrics from the cgroups. By default, the path is set to `"lsf/$CLUSTER/job.$JOBID.*"`.

* `Process Tracking`: if `yes`, then processes are tracked based on job control functions such as: termination, suspension, resume, and other signaling. These are used on Linux systems that support the freezer subsystem under cgroups. The parameter sets LSF_PROCESS_TRACKING in `lsf.conf`.

* `Linux Cgroup Accounting`: if `yes`, then LSF tracks processes based on CPU and memory accounting. This is for Linux systems that support the memory and cpuacct subsystems under cgroups. Once enabled, this parameter takes effect for new jobs. The parameter sets LSF_LINUX_CGROUP_ACCT in `lsf.conf`.

  If this parameter and `Process Tracking` are both enabled, then they take precedence over the parameters LSF_PIM_LINUX_ENHANCE and EGO_PIM_SWAP_REPORT in `lsf.conf`.

* `Mount Point`: specifies a path where cgroups is mounted. It only makes sense to set this when the location is not standard for the operating system.

* `Resource Enforce`: If `yes`, then resource enforcement is carried out through the Linux memory and cpuset subsystems under cgroups. This is for Linux systems with cgroup support. The parameter sets LSB_RESOURCE_ENFORCE in `lsf.conf`.

The server role settings can be modified as follows:

* Within Base View: For example for a head node `basecm11`, using a navigation path of <code>Devices > All Devices > Head Node > Settings > Roles > + Add > LsfServerRole</code>

* Within `cmsh`: For a particular category in the `category` mode, or a particular device in the `device` mode, the `roles` submode is chosen. Within the `roles` submode, the `lsfserver` object can be assigned or used. The following example shows how to set the LSF `prefix` parameter for the `default` category.

  **Example**

  ```bash
  [root@basecm11~]# cmsh
  [basecm11]% configurationoverlay use lsf-server; roles
  [basecm11->configurationoverlay[lsf-server]->roles]% use lsfserver
  [basecm11->...[lsfserver]]% set externalserver yes
  [basecm11->...[lsfserver*]]% commit
  ```

The global LSF cluster settings can be modified as follows:

* Within Base View:\
  For example, for a head node `basecm11`, using a navigation path of:\
  `HPC > Workload Management Clusters > `*WLM (LSF) instance* <code />

* Within `cmsh`:\
  A particular LSF cluster instance can be chosen within `wlm` mode, to set its global parameters. The following example shows how to set the LSF `prefix` parameter for the `lsf1` cluster.

  **Example**

  ```bash
  [root@basecm11~]# cmsh
  [basecm11]% wlm use lsf1
  [basecm11->wlm[lsf1]]% set prefix /cm/shared/apps/lsf2
  [basecm11->wlm*[lsf1*]]% commit
  ```

**LSF client configuration:** After installation, the following CMDaemon settings can be specified for the LSF client role:

* \*\*Queues   \*\* In `cmsh`, queues can be added using `jobqueue` mode. In LSF, the default `queue` is `normal`. More arbitrarily-named queues can be specified with:

  **Example**

  ```bash
  [basecm11->wlm[lsf]->jobqueue]% add abnormal
  [basecm11->wlm[lsf]->jobqueue*[abnormal*]]% add subnormal
  [basecm11->wlm[lsf]->jobqueue*[subnormal*]]% add supernormal
  [basecm11->wlm[lsf]->jobqueue*[supernormal*]]% commit
  [basecm11->wlm[lsf]->jobqueue*[supernormal]]% ..
  [basecm11->wlm[lsf]->jobqueue*]% list
  Name (key)   Nodes
  ------------ ------------------------
  abnormal
  normal       node001..node005
  subnormal
  supernormal
  ```

  The `jobqueue` values can be set for the LSF client role:

  **Example**

  ```bash
  [basecm11->wlm[lsf]->jobqueue*]% configurationoverlay
  [basecm11->configurationoverlay]% use lsf-client
  [basecm11->configurationoverlay[lsf-client]]% roles
  [basecm11->...->roles]% use lsfclient
  [basecm11->...->roles[lsfclient]]% get queues
  normal
  [basecm11->...->roles[lsfclient]]% set queues abnormal subnormal supernormal normal
  [basecm11->...->roles*[lsfclient*]]% commit
  [basecm11->...->roles*[lsfclient*]]% show
  Parameter                        Value
  -------------------------------- ------------------------------------------------
  Name                             lsfclient
  Revision
  Type                             LSFClientRole
  Add services                     yes
  WLM cluster                      lsf
  Slots                            auto
  All Queues                       no
  Queues                           subnormal,supernormal,abnormal,normal
  Server                           yes
  Host Model
  Host Type                        LINUX
  GPUs                             0
  Node Customizations              <0 in submode>
  ```

  Alternatively, queues can be managed using Base View (section [7.6.2](#762-queues-display-and-handling-in-base-view)).

* \*\*Specifying nodes for job queues for LSF   \*\* The administrator can specify the nodes that are associated with a job queue.

  * Prior to BCM version 11, job queues were specified for nodes only by using the `queues` parameter of the `lsfclient` role at the `device`, `category`, or `configurationoverlay` mode level.

    For example, for the configuration overlay `lsf-client` that defines the LSF client configuration by default, the nodes for the LSF client role are the nodes in the default category `normal`. Within the configuration overlay, within the `lsfclient` role, the default queue to be used is set to `normal` by default:

    **Example**

    ```bash
    root@basecm11:~# cmsh
    [basecm11]% configurationoverlay use lsf-client
    [basecm11->configurationoverlay[lsf-client]]% get categories
    default
    [basecm11->configurationoverlay[lsf-client]]% roles
    [basecm11->configurationoverlay[lsf-client]->roles]% use lsfclient
    [basecm11->configurationoverlay[lsf-client]->roles[lsfclient]]% get queues
    normal
    ```

  * Starting with BCM version 11, the administrator can also add nodes to queues directly from within `wlm` mode for a particular WLM, within the `jobqueue` mode for a particular queue, by setting nodes for particular node grouping parameters. For example, for LSF the following queue parameters are available:

    **Example**

    ```bash
    [basecm11->wlm[lsf]->jobqueue[normal]]% show | egrep -i '(overlay|nodegroups|compute|catego)'
    Overlays
    Categories
    Nodegroups
    Compute nodes
    ```

    Thus `normal` is used by nodes that have been specified in the following groupings:

    * `Overlays`: nodes in these configuration overlays (including nodes of categories that are in this overlay)

    * `Categories`: nodes in these categories

    * `Nodegroups`: nodes in these node groups

    * `Compute nodes`: nodes listed in this parameter

* \*\*Options   \*\* A navigation path of: <code>Devices > All Devices > node001 > Settings > Roles > + Add > LSFClientRole</code>\
  lets options be set for a regular node `node001` (figure [7.29](#fig-base-view-node-roles-lsf)):

![Base View access to LSF configuration options using roles window options](/base-command-manager/product-manuals/_fern-img/4b3f5ea42ebef5373627aa754d3337071f67e1595395da7e4e55ce8f730b83ec.webp)

*Figure 7.29: Base View access to LSF configuration options using roles window options*

Available options are:

* **Slots**: The number of CPUs per node. By default LSF tries to determine the value automatically with the `auto` setting. If the number of slots is set to `0`, then the node becomes an LSF submit host, so that no jobs can run on the host, but users can submit their jobs from this host using the LSF utilities.

* **Queues**: `All` queues can be set, or queues can be selected.

* **Server**: Whether the node is an LSF server

* **Host Model**, **Host Type**: Possible values for these are defined in `lsf.shared`

* **GPUs**: The number of GPUs per node.

* **Node Customizations**: LSF node custom properties (section [7.11](#711-custom-node-parameters)).

From `cmsh` these properties are accessible from within the appropriate node or category `roles` submode (section [7.4.2.4](#7424-setting-options-for-workload-manager-settings-with-cmsh)).

**Submission hosts:** By default, all compute nodes to which the `lsfclient` role is assigned, also become submission hosts. This means that LSF users can submit their jobs from those compute nodes. If the administrator wants to allow users to submit their jobs from a non-compute node—for example from a login node—then the `lsfsubmit` role should be assigned, for example:

**Example**

```bash
[root@basecm11~]# cmsh
[...->configurationoverlay[lsf1-submit]]% roles
[...->roles]% assign lsfsubmit
[...->roles*[lsfsubmit*]]% append lsfclusters lsf1
[...->roles*[lsfsubmit*]]% commit
[...->roles[lsfsubmit]]%
```

Configuring a node according to the preceding steps then allows users to submit their jobs from that node, without the submitted jobs getting scheduled to run on that node.

If more than one LSF cluster is set up, and they share the same submit host, then a single `lsfsubmit` role can be used. In this case, all the LSF cluster names should be appended to the `lsfcluster` parameter of the role.

**Further configuration:** For further configuration the *Administering Platform LSF* manual provided with the LSF software should be consulted.

#### 7.5.2.3  Running LSF

Role assignment and role removal enables and disables LSF from Base View (sections [7.4.1](#741-enabling-and-disabling-a-wlm-with-base-view)) or `cmsh` (section [7.4.2](#742-enabling-and-disabling-a-workload-manager-with-cmsh)).

An active LSF master service (typically, but not necessarily on a head node) has the following LSF-related processes running on it:

<table>
  <colgroup>
    <col />

    <col />
  </colgroup>

  <thead>
    <tr>
      <th>
        **Process/Service**
      </th>

      <th>
        **Description**
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `res`
      </td>

      <td>
        Remote Execution Server*
      </td>
    </tr>

    <tr>
      <td>
        `sbatchd`
      </td>

      <td>
        client batch job execution daemon*
      </td>
    </tr>

    <tr>
      <td>
        `mbatchd`
      </td>

      <td>
        master batch job execution daemon
      </td>
    </tr>

    <tr>
      <td>
        `eauth`
      </td>

      <td>
        External Authentication method
      </td>
    </tr>

    <tr>
      <td>
        `lim`
      </td>

      <td>
        Load Information Manager*
      </td>
    </tr>

    <tr>
      <td>
        `pim`
      </td>

      <td>
        Process Information Manager*
      </td>
    </tr>

    <tr>
      <td>
        `pem`
      </td>

      <td>
        Process Execution Manager*
      </td>
    </tr>

    <tr>
      <td>
        `vemkd`
      </td>

      <td>
        Platform LSF Kernel Daemon
      </td>
    </tr>

    <tr>
      <td>
        `egosc`
      </td>

      <td>
        Enterprise Grid Orchestrator service controller
      </td>
    </tr>

    <tr>
      <td>
        `mbschd`
      </td>

      <td>
        master batch scheduler daemon
      </td>
    </tr>
  </tbody>
</table>

\*These services/processes run on compute nodes.

Non-active LSF-masters running as compute nodes run the processes marked with an asterisk only.

LSF daemon logs are kept under `/cm/local/apps/lsf/var/log/`, on each of the nodes where LSF services run.

## 7.6  Using Base View With Workload Management

Viewing the workload manager services from Base View is described in section [7.4.3](#743-monitoring-the-state-of-workload-manager-services). The HPC (High Performance Computing) icon, which looks like a speedometer, is the Base View resource that allows the following items to be accessed:

* WLM clusters: for WLM cluster settings for a WLM cluster instance to be viewed and managed

* jobs: for jobs to be viewed and managed

* queues: for queues to be viewed and managed

* job queue stats: for job queue statistics to be viewed

These items are described next.

### 7.6.1  Jobs Display And Handling In Base View

The navigation path `HPC` > `Jobs` opens up the `Job list` window. This displays a list of recent job IDs, along with the user, status, scheduler used, and queue (figure [7.30](#fig-base-view-workloadmanagement-jobs-main)).

![Workload manager job list window](/base-command-manager/product-manuals/_fern-img/d7985a77f3ec2c02d0e2211cad796b722332add6094f4ba28383a507180055ea.webp)

*Figure 7.30: Workload manager job list window*

* The ↗ in the `Actions` column opens up a screen that allows a particular job to be examined (figure [7.31](#fig-base-view-workloadmanagement-jobs-show-button)):

![Workload manager job subwindow](/base-command-manager/product-manuals/_fern-img/1c677d059894d44c6674e6ef88f46c29c8f00dfd50f4457c3e7b966d573b85d9.webp)

*Figure 7.31: Workload manager job subwindow*

* The ⋮ in the `Actions` column allows a particular job to be managed (figure [7.32](#fig-base-view-workloadmanagement-jobs-manage-button)):

![Workload manager job management window](/base-command-manager/product-manuals/_fern-img/3a5fd6cdc583004bf2db063266d8ab66fa74f1a647d7617f6b4cc473b42f41b5.webp)

*Figure 7.32: Workload manager job management window*

The menu options allow the selected job to be managed as follows:

* The `Hold` option stops selected queued jobs from being considered for running by putting them in a `Hold` state (`H` in the `Status` column).

* The `Release` option releases selected queued jobs in the `Hold` state so that they are considered for running again.

* The `Suspend` option suspends selected running jobs (`S` in the `Status` column).

* The `Resume` option allows selected suspended jobs to run again.

* The `Cancel` option removes selected jobs from the queue.

### 7.6.2  Queues Display And Handling In Base View

The navigation path <code>HPC > Workload Management Clusters > Job Queues</code> displays a list of queues available (figure [7.33](#fig-base-view-workloadmanagement-queues-main)).

![Workload manager queues](/base-command-manager/product-manuals/_fern-img/8335d524b4709293382743f4b77cf95e00056872ec90d90e6c17198b8de3ae2f.webp)

*Figure 7.33: Workload manager queues*

Queues can be added with the `+ Add` option, or deleted with the ⋮ option. Opening a screen with the ↗ option allows queue parameters for an existing to be set, for example as in figure [7.34](#fig-base-view-workloadmanagement-queues-edit-slurm).

![Workload manager queue parameters configuration](/base-command-manager/product-manuals/_fern-img/0beaf3508f8951db80a450e2c3b5e9d69c4170de1a517f0bd1cbda84afa45bca.webp)

*Figure 7.34: Workload manager queue parameters configuration*

## 7.7  Using `cmsh` With Workload Management

The `wlm` mode in `cmsh` gives the administrator access to the WLM instances running on the cluster.

The `cmsh` tree (Appendix [M](/admin/cmshtree)) has the following submodes structure under the `wlm` mode:

```bash
`-- wlm
    |-- accounting
    |-- cgroups
    |-- chargeback
    |-- jobqueue
    |-- jobs
    |-- ocisettings
    `-- placeholders
```

* `accounting`: provides ways to set some advanced Slurm job accounting properties ([here](#7516-advanced-slurm-job-accounting))

* `cgroups`: provides ways to configure WLMs using the cgroup mechanism of the Linux kernel (section [7.10](#710-cgroups))

* `chargeback`: provides ways to measure the costs of requested IT resources for WLM jobs (Chapter [13](/admin/monitoringchargeback))

* `jobqueue`: allows WLM job queues to be managed (section [7.7.3](#773-job-queue-display-and-handling-in-cmsh-jobqueue-mode))

* `jobs`: allows WLM jobs to be viewed and managed (section [7.7.2](#772-the-jobs-submode-in-cmsh))

* `ocisettings`: allows OCI settings ([Chapter 2 of the *Cloudbursting Manual*](/cloudbursting/codcloud)) to be viewed and managed

* `placeholders`: allows nodes to be configured in advance, for planning resource use in WLMs (section [8.4.8](/admin/cm-scale#848-queue-node-placeholders))

In addition to these submodes, `wlm` mode provides several commands at the entity level:

* `activeservers`: displays the active WLM server nodes (section [7.7.1](#771-the-activeservers-command))

* `grid`: shows a visual grid of historic job information (section [7.7.2.6](#7726-the-grid-command))

* `filter`: filters job information across WLM instances ([here](#7724-the-filter-command-within-jobs-submode))

* `statistics`: displays job statistics ([here](#7725-the-statistics-command))

The monitoring commands `healthoverview` ([here](/admin/monitoring#1065-monitoring-data-health-overviewthe-healthoverview-command)), `samplenow` ([here](/admin/monitoring#10621-the-samplenow-command-for-on-demand-measurable-samples)), and `monitoringactionhistory` ([here](/admin/monitoring#1066-monitoring-data-about-the-monitoring-action-historythe-monitoringactionhistory-command)) are also available in `wlm` mode, and described in Chapter [10](/admin/monitoring).

For basic WLM management using `cmsh`, the administrator is expected to use `wlm` mode with the `jobs` and `jobqueue` submodes.

If there is just one WLM instance running on the cluster, then an administrator that accesses `wlm` mode drops straight into the object representing that WLM instance, and can then access the submodes.

If there is more than one WLM running, then the administrator must select a WLM instance from the top level `wlm` mode, with the `use` command, in order to access the submodes.

While at the top level `wlm` mode, the instances can be listed. The list shows the nodes used by the instance, and the node roles assigned to the nodes.

Suppose BCM is being used to manage two WLM instances:

* one Slurm WLM, named `slr`

* one Slurm WLM, named `uc`

with their nodes having been allocated roles as follows:

**Example**

```bash
[basecm11->wlm]% list
Type   Name (key)               Server nodes Submit nodes               Client nodes
------ ------------------------ ------------ -------------------------  ----------------
Slurm  slr                      node001      basecm11,node001..node003  node002,node003
Slurm  uc                       node004      basecm11,node004..node006  node005,node006
```

Then one way to list all jobs running per WLM instance, queue, and user, is with the `filter` command:

```bash
[basecm11->wlm]% filter --running
WLM  Job ID Job name  User  Queue  Submit time Start time   End time  Nodes             Exit code
---- ------ --------- ----- ------ ----------- ------------ --------- ----------------- ----------
slr  103    sjob      maud  defq   15:43:02    15:43:03     N/A       node002,node003   0
slr  104    sjob      maud  defq   15:43:02    15:43:25     N/A       node002,node003   0
slr  105    sjob      maud  defq   15:43:02    15:43:33     N/A       node002,node003   0
slr  106    sjob      maud  defq   15:43:02    15:43:36     N/A       node002,node003   0
slr  171    sjob      maud  defq   14:20:09    14:20:23     N/A       node002,node003   0
uc   200    sjob      fred  batch  14:22:18    14:23:20     N/A       node005,node006   0
```

The `filter` command can also be run within the `jobs` mode, for a particular WLM instance, and is described in more detail [here](#7724-the-filter-command-within-jobs-submode).

An alternate way to list all jobs from `wlm` mode is with a `foreach` command to descend into `jobs` submode to list the jobs for each WLM instance:

**Example**

```bash
[basecm11->wlm]% foreach * (jobs ; list)
Type  Job ID  User  Queue  Running time Status     Nodes
----- ------- ----- ------ ------------ ---------- ----------------
Slurm 55      maud  defq   18m 10s      COMPLETED  node002,node003
Slurm 56      maud  defq   18m 5s       COMPLETED  node002,node003
Slurm 57      maud  defq   2m 11s       RUNNING    node002,node003
Slurm 58      maud  defq   0s           PENDING

Type  Job ID  User  Queue  Running time Status     Nodes
----- ------- ----- ------ ------------ ---------- ----------------
Slurm 96      maud  batch  2m 30s       RUNNING    node005,node006
Slurm 97      maud  batch  0s           PENDING
Slurm 98      maud  batch  0s           PENDING
```

The `jobs` submode is now discussed further.

### 7.7.1  The `activeservers` Command

The `activeservers` command displays the nodes currently acting as active WLM servers. It helps a cluster administrator check which head or server node is actually handling the workload manager, particularly in high-availability configurations.

**Example**

```bash
[basecm11->wlm]% activeservers
slurm                    basecm11
```

The output shows the WLM instance name and the hostname of its active server node.

### 7.7.2  The `jobs` Submode In `cmsh`

Within the `jobs` submode of a WLM instance, the administrator can list jobs that are running or queued up for that particular instance. For example, the running and queued jobs listed for a Slurm instance may be displayed as:

**Example**

```bash
[basecm11->wlm[slurm]->jobs]% list
Type      Job ID        User        Queue        Running time Status   Nodes
--------- ------------- ----------- ------------ ------------ -------- -------------
Slurm     3117          user1       hydroq       1s           RUNNING  node002
Slurm     3118          user2       workq        1s           RUNNING  node001
Slurm     3119          user1       hydroq       0s           PENDING
Slurm     3120          user3       hydroq       0s           PENDING
Slurm     3121          user1       hydroq       0s           PENDING
Slurm     3122          user1       hydroq       0s           PENDING
```

The number of jobs can be very large. The `wait` command in `jobs` mode can be used to provide a shorter running summary. The following `wait` command displays a running summary that regularly displays a tally of the running and pending jobs; waits for all of them to complete; and has the waiting-for-completion condition overruled by a timeout of 10 minutes:

**Example**

```bash
[basecm11->wlm[slurm]->jobs]% wait --timeout 10m --all
          0s| running: 4, pending: 12
          1m| running: 3, pending: 12
          2m| running: 4, pending: 11
          5m| running: 4, pending: 10
          7m| running: 4, pending: 9
          9m| running: 3, pending: 8
* timeout *
```

By default `wait` runs every minute until the specified timeout. Also, by default, as indicated by the missing 3rd and 4th minutes in the example, the outputs are only displayed with the tally changes. Further options to the `wait` command within `jobs` mode can be found in the help text display output when `help wait` is run.

In the `foreach` jobs listings for the two Slurm WLM instances shown earlier, the jobs are in a running, queued up, or completed state. They are also all being run by a user `maud`, who happens to be making use of both workload managers.

For Slurm, completed jobs are shown for a short time with the status `COMPLETED`.

#### 7.7.2.1  Commands That Change The Status Of A Queued Or Running Job

Within a `jobs` submode, the following commands, used with a job ID, can change the status of a particular queued or running job:

* `hold`: puts a queued job into a `hold` state. This prevents the job from being considered for running.

* `release`: releases a job from a `hold` state, putting it back in the queue, so that it can be considered for running.

* `suspend`: pauses a running job

* `resume`: resumes a suspended job

* `remove`: removes a job

For example, continuing the case earlier on of the `cmsh` session with the `foreach` listing ([here](#77-using-cmsh-with-workload-management)):

The administrator can `suspend` the running job with job ID 57 on the Slurm instance as follows:

**Example**

```bash
[basecm11->wlm]% jobs slr; suspend 57
[basecm11->wlm[slr]->jobs]% list | head -2; list | grep 57
Type  Job ID  User  Queue  Running time Status     Nodes
----- ------- ----- ------ ------------ ---------- ----------------
Slurm 57      maud  defq   2m 51s       SUSPENDED  node002,node003
```

The administrator can then `resume` the suspended job ID 57 as follows:

**Example**

```bash
[basecm11->wlm[slr]->jobs]% resume 57
```

#### 7.7.2.2  Commands To Inspect Jobs:

Within the `jobs` submode, the following commands can be used to inspect a job:

* `show` \<*job ID*>: properties are shown for a running or pending job.

  The properties that are displayed are taken directly from commands associated with particular workload managers:

  * For Slurm: `scontrol show jobs`

  * For LSF: `bjobs`

* `info` \<*job ID*>: details are shown about a particular job ID. The job can be `pending`, `running`, or `completed` jobs. The data is taken from the BCM database.

* `statistics`: statistics are shown for jobs. More detail on the `statistics` command is given [here](#7725-the-statistics-command).

* `list`: lists pending and running job IDs along with some other associated properties. Recently completed jobs are also displayed. Completed jobs do not remain listed for longer than a few minutes. The `filter` command (section [7.7.2.4](#7724-the-filter-command-within-jobs-submode)) can be used instead to display all jobs for that WLM instance, using data taken from the BCM database.

* `dumpmonitoringdata [`*OPTIONS*`] [` \<*start-time*>` <`*end-time*>] \<*metric*>` <`*job id*>: Displays the monitoring data for a specific metric or healthcheck for a running or completed job. Example: `dumpmonitoringdata CtxtSwitches 170`

  More detail is given on the `dumpmonitoringdata` command in section [10.6.4](/admin/monitoring#1064-data-values-over-a-periodthe-dumpmonitoringdata-command).

* `latestmonitoringdata [`*OPTIONS*`]` \<*job ID*>: Displays the last measured job monitoring data for the job.

  * `latesthealthdata` \<*job ID*>: The subset of health checks within the last measured monitoring data.

  * `latestmetricdata` \<*job ID*>: The subset of metrics within the last measured monitoring data.

  More detail is given on the `latest*data` commands in section [10.6.3](/admin/monitoring#1063-the-latest-data-and-counter-valuesthe-latestdata-and-latestmetriccounters-commands).

* `measurables` \<*job ID*>: The measurables used for job monitoring data.

  * `healthchecks` \<*job ID*>: The subset of health checks within the measurables used for job monitoring data.

  * `metrics` \<*job ID*>: The subset of metrics within the measurables used for job monitoring data.

  * `enummetrics` \<*job ID*>: The subset of enummetrics within the measurables used for job monitoring data.

#### 7.7.2.3  The `info` Command Within `jobs` Submode

Within the `jobs` submode of `wlm`, the `info` \<*job ID*> command shows job information details stored in the BCM database. BCM starts updating the job information in its database as soon as it detects a new job. When the job is completed BCM pulls a final job state and exit code from the workload manager.

**Example**

```bash
[basecm11->wlm[slr]->jobs]% info 3
Parameter                        Value
-------------------------------- ------------------------------------------------------
Job ID                           3
Revision
Job name                         matrix-math---model-other-model-args:3-tasks:1.sbatch
Job array ID
Job task ID
User                             joe
Group                            joe
Account                          math
Accounting info                  < not set >
Workload manager cluster         slurm
Queue                            defq
Nodes                            node002
Submit time                      27/07/2026 02:35:24
Start time                       27/07/2026 02:35:24
End time                         27/07/2026 02:36:25
Run time                         1m 1s
Persistent                       no
Exit code                        0
Status                           COMPLETED
Requested CPUs                   1
Requested CPU cores              0
Requested GPU                    0
Requested memory                 3.2GiB
Requested slots                  0
Monitoring                       yes
Comment                          __model:other-model
Run directory                    /home/joe/war
Stdin file                       /dev/null
Stdout file                      /home/joe/war/matrix-3.out
Stderr file                      /home/joe/war/matrix-3.err
Total power usage                < not set >
Total GPU power usage            < not set >
Total CPU power usage            < not set >
Total power under allocation     < not set >
QOS                              normal
[basecm11->wlm[slurm]->jobs]%
```

**The power usage fields for WLM jobs in the preceding output:** `Total power usage`, `Total GPU power usage`, `Total CPU power usage`, and `Total power under allocation`, are populated based on metrics configured in the `wlmjobpowerusagesettings` submode in `partition` mode (described later on in this section).

For the associated metrics, power usage is calculated per job, for completed jobs by computing the energy consumption (the sum of power consumed over time) from the job start time until the job end time.

If no metrics are configured, then the power usage fields remain `< not set >`.

When the metrics are configured, the `info` output for a completed job shows its energy consumption:

**Example**

```bash
Total power usage                0 Wh
Total GPU power usage            556.649 Wh
Total CPU power usage            61.2204 Wh
Total power under allocation     0.0%
```

The change from `< not set >` to values only show up some time after the job has completed, to allow values to be properly gathered.

**The `wlmjobpowerusagesettings` submode under `partition` mode:** has power usage parameters that can be associated with metrics:

**Example**

```bash
[basecm11->partition[base]->wlmjobpowerusagesettings]% show
Job age                          5m
Timeout                          30s
Disabled                         no
Node power metrics
GPU power metrics
CPU power metrics
Power under allocation metrics
```

* `Job age`: Minimum age of a job before power usage is calculated.

* `Timeout`: Timeout for power data collection.

* `Disabled`: Disables job power usage calculation when set to `yes`.

* `Node power metrics`: Metrics used for total node power usage.

* `GPU power metrics`: Metrics used for GPU power usage.

* `CPU power metrics`: Metrics used for CPU power usage.

* `Power under allocation metrics`: Metrics used for power consumption under allocation.

Metrics can be configured to be part of the power metrics by adding or appending them:

**Example**

```bash
[basecm11->partition*[base*]->wlmjobpowerusagesettings*]% set nodepowermetrics<tab><tab>
Display all 350 possibilities? (y or n)
alertlevel:count           managedservicesok:pass       sys_class_net_addr_assign_type:eth1
alertlevel:maximum         managedservicesok:total      sys_class_net_carrier:ens3
alertlevel:sum             managedservicesok:unknown    sys_class_net_carrier:eth0
...
[basecm11->partition*[base*]->wlmjobpowerusagesettings*]% set nodepowermetrics utilization:cmd
...
[basecm11->partition*[base*]->wlmjobpowerusagesettings*]% append nodepowermetrics udpinerrors
[basecm11->partition*[base*]->wlmjobpowerusagesettings*]% show
Parameter                        Value
-------------------------------- ------------------------------------------------
Job age                          5m
Revision
Timeout                          30s
Disabled                         no
Node power metrics               UdpInErrors,Utilization:cmd
...
```

#### 7.7.2.4  The `filter` Command Within `jobs` Submode

If run at the top-level `wlm` mode, then the `filter` command lists jobs for all WLM instances.

It can also be run at the submode-level `jobs` mode, for a particular WLM instance, in which case it lists only the jobs for that instance (section [11.5](/admin/monitoringjob#115-job-monitoring-in-cmsh)).

The `filter` command without any options is a bit like an extension of the `list` command in that it lists currently pending and running jobs, although in a different format. However, in addition, it also lists past tasks, with their start and end times.

An example to illustrate the output format for a Slurm instance, somewhat simplified for clarity, is:

**Example**

```bash
[basecm11->wlm[myslurminstance]]% filter
Job ID Job name       User  Queue Submit time Start time End time Nodes            Exit code
------ -------------- ----- ----- ----------- ---------- -------- ---------------- ---------
2      hello          fred  defq  15:00:51    15:00:51   15:00:52 node001          0
3      mpirun         fred  defq  15:03:17    15:03:17   15:03:18 node001          0
...
25     slurmhello.sh  fred  defq  16:17:30    16:17:31   16:17:33 node001..node004 0
26     slurmhello.sh  fred  defq  16:18:39    16:18:40   16:19:02 node001..node004 0
27     slurmhello.sh  fred  defq  16:18:41    16:19:03   16:19:25 node001..node004 0
28     slurmhello.sh  fred  defq  16:18:41    N/A        N/A      node001..node004 0
29     slurmhello.sh  fred  defq  16:18:42    N/A        N/A      node001..node004 0
```

In the preceding example, the start and end times for jobs 28 and 29 are not yet available because the jobs are still pending.

Because all jobs for that WLM instance—historic and present—are displayed by the `filter` command, it means that finding a particular job in the output displayed can be hard. The displayed output can therefore be filtered further.

The following options to the `filter` command are therefore available in order to find particular groupings of jobs:

* `-w|--wlm`: by WLM instance

* `-u|--user`: by user

* `-g|--group`: by group

* `--ended`: by jobs that ended successfully, with a zero exit status

* `--running`: by jobs that are running

* `--pending`: by jobs that are pending

* `--failed`: by jobs that finished unsuccessfully, with a non-zero exit status

It may take about a minute for CMDaemon to become aware of job data. This means that, for example, a job submitted 10s ago may not show up in the output.

Further options to `filter` command can be seen by running the command `help filter` within the `wlm` or `jobs` modes.

#### 7.7.2.5  The `statistics` Command

The `statistics` command without any options displays an overview of states for all past and present jobs:

**Example**

```bash
[basecm11->wlm[uc]]% statistics
Pending    Running    Finished   Error      Nodes
---------- ---------- ---------- ---------- ----------
4          0          154        5          309
```

The options available include the following:

* `-w|--wlm` \<*WLM instance*>: by WLM instance

* `-u|--user`: by user

* `-g|--group`: by group

* `-a|--account`: by account

* `-i|--accounting-info <field>[,<field>,...]`: by free text accounting fields

* `--hour` : by hour

* `--day`: by day

* `--week`: by week

* `--interval`: by interval

The jobs statistics can be split across users. An example of the output format in this case, somewhat simplified for clarity, is:

**Example**

```bash
[basecm11->wlm[slurm]->jobs]% statistics --user
User        Pending    Running    Finished   Error      Nodes
---------------------- ---------- ---------- ---------- ----------
alice       0          0          2          0          1
bob         0          0          5          0          4
charline    0          1          2          0          2
dennis      0          0          6          0          4
eve         0          0          4          0          1
frank       0          0          1          0          1
```

The job statistics can be displayed over various time periods, if there are jobs within the associated period. An example of the output format for an interval of 60s is:

**Example**

```bash
[basecm11->wlm[slurm]->jobs]% statistics --interval 60
Date                 Pending    Running    Finished   Error      Nodes
-------------------- ---------- ---------- ---------- ---------- ----------
2020/05/13 15:00:00  0          0          1          0          1
2020/05/13 15:03:00  0          0          7          0          7
2020/05/13 15:04:00  0          0          1          1          2
2020/05/13 15:06:00  0          0          3          0          7
2020/05/13 15:07:00  0          0          1          0          0
2020/05/13 15:08:00  0          0          6          0          8
2020/05/13 16:17:00  0          0          1          0          4
2020/05/13 16:19:00  0          0          9          0          36
2020/05/13 16:20:00  0          0          6          0          24
2020/05/13 16:21:00  0          0          3          0          12
```

In the preceding example there are no jobs within the period associated with the time 15:01 and 15:02. For readability the statistics for those intervals are not displayed.

#### 7.7.2.6  The `grid` Command

The `grid` command displays a color-coded visual grid of historic job information in the terminal. Its use is described in section [12.8](/admin/monitoringaccounting#128-the-grid-command-for-job-accounting).

**Example**

The following shows job allocation by user for the last hour, in 5-minute intervals, with values displayed as text:

```bash
[basecm11->wlm[slurm]]% grid --start -1h --end now --interval 5m --mode user --text
```

The output is a color-coded terminal grid showing which users ran jobs on each node during each time interval, along with utilization percentages.

Additional options allow filtering by node, category, rack, or job attributes:

**Example**

```bash
[basecm11->wlm]% grid --start -30d --end now --interval 6h --mode account --text --user alice,bob
```

The help text for the `grid` command (`help grid`) provides further details on all available options.

#### 7.7.2.7  The `trackedjobs` Command Within `jobs` Submode

The `trackedjobs` command shows how many jobs are currently being tracked per node by CMDaemon:

**Example**

```bash
[basecm11->wlm[slurm]->jobs]% trackedjobs
Node     Jobs
-------- --------
node001  15
node002  15
node003  15
node004  16
```

This is useful for verifying that CMDaemon is aware of job activity on each node.

#### 7.7.2.8  The `pidsgpus` Command Within `jobs` Submode

The `pidsgpus` command shows the process IDs (PIDs) and GPU indices detected on each node that is running a particular job. This is useful for inspecting which processes a job has spawned and which GPUs they are using.

**Example**

```bash
[basecm11->wlm[slurm]->jobs]% pidsgpus 10
node001  0, 1, 2, 3  7205 7222 7225 7226 7227 7228 7229 7230 7231 7232 7233
```

Each line shows the node name, the GPU indices assigned to the job, and the PIDs of the job’s processes on that node. For multi-node jobs, one line per node is displayed.

If the job has completed and is no longer tracked, the output indicates this:

**Example**

```bash
[basecm11->wlm[slurm]->jobs]% pidsgpus 3
node003  Job not tracked
node004  Job not tracked
```

#### 7.7.2.9  The `stdout`, `stderr`, And `stdin` Commands Within `jobs` Submode

The `stdout`, `stderr`, and `stdin` commands display the standard output, standard error, and standard input of a job respectively:

**Example**

```bash
[basecm11->wlm[slurm]->jobs]% stdout 10
[Sat Feb 28 13:16:41 2026] start, process 0 of 2 on node001
[Sat Feb 28 13:16:41 2026] sleep, process 0 of 2 for 1 (9)
[Sat Feb 28 13:16:41 2026] start, process 1 of 2 on node001
[Sat Feb 28 13:16:41 2026] sleep, process 1 of 2 for 1 (9)
...
```

These commands retrieve the output files from the node where the job ran. The file paths for `stdout`, `stderr`, and `stdin` are shown in the `info` output for the job (the `Stdout file`, `Stderr file`, and `Stdin file` fields).

#### 7.7.2.10  The `persistent` And `forget` Commands Within `jobs` Submode

The `persistent` command marks a job so that it is not automatically removed from the job information cache. This is useful for keeping a record of important jobs beyond the normal retention period configured by `JobInformationKeepDuration` ([here](/admin/cmdconf#c110-jobinformationkeepduration-directive)) and `JobInformationKeepCount` ([here](/admin/cmdconf#c112-jobinformationkeepcount-directive)):

**Example**

```bash
[basecm11->wlm[slurm]->jobs]% persistent 10
```

The persistent status of a job is shown in the `info` output as the `Persistent` field.

The `forget` command is the opposite: it removes a job from the cache immediately, regardless of whether it is marked as persistent:

**Example**

```bash
[basecm11->wlm[slurm]->jobs]% forget 1
```

#### 7.7.2.11  Job Directives

Job directives configure some of the ways in which CMDaemon manages job information processing.

The administrator can configure the following directives:

* `JobInformationKeepCount`: The maximal number of jobs that are kept in the cache, default 8192, maximal value 65536 ([here](/admin/cmdconf#c112-jobinformationkeepcount-directive)).

* `JobInformationKeepDuration`: How long to keep jobs in the CMDaemon database, default 28 days ([here](/admin/cmdconf#c110-jobinformationkeepduration-directive)).

* `JobInformationMinimalJobDuration`: Minimal duration for jobs to place them in the cache, default 0s ([here](/admin/cmdconf#c114-jobinformationminimaljobduration-directive)).

* `JobInformationFlushInterval`: Over what time period to flush the cache to storage ([here](/admin/cmdconf#c115-jobinformationflushinterval-directive)).

* `JobInformationDisabled`: Disables job information processing ([here](/admin/cmdconf#c109-jobinformationdisabled-directive)).

### 7.7.3  Job Queue Display And Handling In `cmsh`: `jobqueue` Mode

The `jobqueue` submode under the top level `wlm` mode can be used to manage queues for a WLM instance. Queue properties can be viewed and set.

From the top level `wlm` mode, a list of queues can be seen for each WLM instance by descending into the WLM instance with a `foreach`:

**Example**

```bash
[basecm11->wlm]% foreach * (get name; jobqueue; list)
slr
Name (key)   Nodes
------------ ------------------------
defq         node002,node003
uc
Name (key)   Nodes
------------ ------------------------
batch        node005,node006
[basecm11->wlm]%
```

The usual object manipulation commands (`show`, `get`, `set` and others) of section [2.5.3](/admin/clustermanagement#253-working-with-objects) work in the `jobqueue` submode.

#### 7.7.3.1  Job Queue Parameters For Slurm

For example, for a Slurm instance, the `show` command might display the following properties:

```bash
[basecm11->wlm[slr]->jobqueue]% show defq
Parameter                        Value
-------------------------------- ------------------------------------------------
All nodes                        node001..node003
Name                             defq
Revision
Type                             Slurm
WlmCluster                       slr
Ordering                         0
Default                          yes
Hidden                           no
Min nodes                        1
Max nodes                        UNLIMITED
Default time                     UNLIMITED
Max time                         UNLIMITED
Priority Job Factor              1
Priority Tier                    1
OverSubscribe                    NO
Alternate
Grace time                       0
Preemption mode                  OFF
Require reservation              NO
Select Type Parameters
LLN                              no
TRES Billing Weights
Alloc nodes
CPU bindings                     None
QOS
Default memory per CPU           UNLIMITED
Max memory per CPU               UNLIMITED
Default memory per Node          UNLIMITED
Max memory per Node              UNLIMITED
Max CPUs per node                UNLIMITED
Default memory per GPU           UNLIMITED
Default CPU per GPU              UNLIMITED
Disable root                     no
Root only                        no
Allow groups                     ALL
Allow accounts                   ALL
Allow QOS                        ALL
Deny Accounts
Deny QOS
ExclusiveUser                    no
Queue State                      None
Nodesets                         ns1
Overlays
Categories
Nodegroups
Compute nodes
Options
```

### 7.7.4  Nodes Drainage Status And Handling In `cmsh`

Sometimes a node needs to be drained. Draining a node means not allowing new jobs to run on a node, and letting running jobs finish (drain away).

Draining nodes can be for the purpose of:

* planned maintenance

* hardware troubleshooting

* preventing new jobs during system changes

* isolating problematic nodes

Running the `device` mode command `drainstatus` displays if a specified node is in a `Drained` state or not. In a `Drained` state jobs are not allowed to start running on that node.

Running the `device` mode command `drain` puts a specified node in a `Drained` state:

**Example**

```bash
[root@basecm11 ~]# cmsh
[basecm11]% device
[basecm11->device]% drainstatus
Node                     Queue                    Status
------------------------ ------------------------ ----------------
node001                  Slurm/slr/defq
node002                  Slurm/uc/batch
[basecm11->device]% drain node001
Node                     Queue                    Status
------------------------ ------------------------ ----------------
node001                  Slurm/slr/defq           Drained
```

The `undrain` command unsets the `Drained` state so that jobs may start running on the node again.

The `drain`, `undrain`, and `drainstatus` commands have the same grouping options. The grouping options can make the command apply to not just one node, but to a list of nodes, a group of nodes, a category of nodes, a rack, a chassis, an overlay, a role, or a status. Continuing the example:

```bash
[basecm11->device]% drain -c default; !# for a category of nodes
Node                     Queue                    Status
------------------------ ------------------------ ----------------
node001                  Slurm/slr/defq           Drained
node002                  Slurm/uc/batch           Drained
```

The help text for each command indicates the syntax:

**Example**

```bash
[root@basecm11 ~]# cmsh -c "device help drain"
Name:    drain - Drain jobs (not data) on a set of nodes

Usage:   drain [OPTIONS/node]

Options:  -n, --nodes <node>
               List of nodes, e.g.
               node001..node015,node020..node028,node030 or
               ^/some/file/containing/hostnames

          -g, --group <group>
               Include all nodes that belong to the node group, e.g.
               testnodes or test01,test03

          -c, --category <category>
               Include all nodes that belong to the category, e.g. default
               or default,gpu

          -r, --rack <rack>
               Include all nodes that are located in the given rack, e.g
               rack01 or rack01..rack04

          -h, --chassis <chassis>
               Include all nodes that are located in the given chassis, e.g
               chassis01 or chassis03..chassis05

          -e, --overlay <overlay>
               Include all nodes that are part of the given overlay, e.g
               overlay1 or overlayA,overlayC

          -m, --image <image>
               Include all nodes that have the given image, e.g default-image
               or default-image,gpu-image

          -t, --type <type>
               Type of devices, e.g node or virtualnode,cloudnode

          -i, --intersection
               Calculate the intersection of the above selections

          -u, --union
               Calculate the union of the above selections

          -l, --role <role>
               Filter all nodes that have the given
               role

          -s, --status <status>
               Only run command on nodes with specified status, e.g. UP,
               "CLOSED|DOWN", "INST.*"

          --setactions <actions>
               set drain actions, actions already set will be removed
               (comma-separated)

          --appendactions <actions>
               append drain actions to already existing drain actions
               (comma-separated)

          --removeactions <actions>
               remove drain actions

          --listactions
               list all drain actions

          --clearactions
               remove all drain actions

Examples: drain                         Drain the current node
          drain node001                 Drain node001
          drain -r rack01               Drain all nodes in rack01
          drain --setactions reboot     Drain the current node, and reboot when all jobs are completed
```

A useful one-liner to reboot and reprovision a sequence of nodes could be in the following format:

**Example**

```bash
cmsh -c 'device; drain -n  <nodes> --setactions powerreset ; drain -n <nodes> --appendactions undrain'
```

This drains the nodes and does a power reset action, which provisions the nodes. After the nodes are up again, they are undrained so that they are ready to accept jobs again. The command allows the sequence of nodes to be rebooted, for example for the purpose of upgrading a kernel, without needing to schedule a downtime for the cluster.

The cluster administrator should be aware that using the preceding one-liner is not a universal solution. For example, it is not a good solution if the drain takes a long time, because it means that nodes that drain early could be idle for a long time.

## 7.8  Examples Of Workload Management Assignment

### 7.8.1  Setting Up A New Category And A New Queue For It

Suppose a new node with processor optimized to handle Shor’s algorithm is added to a cluster that originally has no such nodes. This merits a new category, `shornodes`, so that administrators can configure more such new nodes efficiently. It also merits a new queue, `shorq`, so that users are aware that they can submit suitably-optimized jobs to this category.

Ways to configure the cluster manager for this are described next.

#### 7.8.1.1  A New Category And A New Queue With Base View For An Existing Workload Manager Cluster

Queues can be added to a WLM cluster by running the WLM wizard (navigation path `HPC > Wlm Wizard`) if the WLM cluster does not yet exist. The wizard provides an option during WLM cluster creation for adding queues.

To create a new queue in an existing WLM cluster, the navigation path:

<code>
  HPC > Workload Management Clusters

   \> Job Queues > + Add
</code>

opens up a pop-up menu that allows queues to be added to the WLM cluster. The properties of the new queue can then be set in the dialog window of the queue (figure [7.33](#fig-base-view-workloadmanagement-queues-main))

At least the queue name, `shorq`, must be set for the queue. The configuration for the queue properties is saved, and then the job queue scheduler configuration is saved.

Next, a new category can be added using\
`Grouping > Categories > + Add`\
Parameters settings in the new category can be set—at least the category name should be set—to suit the new machines The name `shornodes` can therefore be set here and it becomes part of the list of categories (figure [7.35](#fig-base-view-workloadmanager-add-shornodes-category)). .

![A new shornodes category created using Base View](/base-command-manager/product-manuals/_fern-img/b4f9d79152619f5f6c7d1192f7c60f99dd9af1c93c51702347ecea3624ad2f61.webp)

*Figure 7.35: A new shornodes category created using Base View*

Another option within the category is to set a workload manager queue. The queue, `shorq`, is therefore set here for this new category.

Setting a queue for the category means configuring the options of the queue scheduler role, for example the Slurm client role, for the category. So a Slurm client role must be assigned to the category. Continuing from within the `shornodes` category in figure [7.35](#fig-base-view-workloadmanager-add-shornodes-category), the relative navigation path to set a queue is:\
<code> > Settings > Roles  > + Add > SlurmClientRole > Queues > shorq</code>\
The appropriate queue can be selected from the queue scheduler menu option (figure [7.36](#fig-base-view-workloadmanager-category-role-queue)):

![Setting a queue for a new category using Base View](/base-command-manager/product-manuals/_fern-img/2f2aaef7c74513d956a09a548a2cf90f1f3b8b23e9516027ac906ded00bd4a37.webp)

*Figure 7.36: Setting a queue for a new category using Base View*

In this case, the `shorq` created earlier on is presented for selection. After selection, the category configuration is committed.

Nodes that are to use the queue should be members of the `shornodes` category. The final step is then to allocate such nodes to the category. This can be done, for example for a `node001`, by using the navigation path:

<code>
  Devices > All devices > node001

   \> Settings > Category
</code>

and setting the category to `shornodes`.

#### 7.8.1.2  A New Category And A New Queue With `cmsh`

The preceding example can also be configured in `cmsh` as follows:

The new queue can be added from within `jobqueue` mode, for the workload manager. For example, if Slurm is the WLM cluster that is enabled:

```bash
[basecm11]% wlm; use slurm; jobqueue; add shorq
[basecm11->wlm[slurm]->jobqueue*[shorq*]]% commit
```

The new category, `shornodes`, can be created by cloning an old category, such as `default`:

```bash
[basecm11->wlm[slurm]->jobqueue[shorq]]% category
[basecm11->category]% clone default shornodes
[basecm11->category*[shornodes*]]% commit
```

Then, going into the roles submode, appropriate workload manager roles can be assigned, and appropriate queues can be appended and committed for that category:

```bash
[basecm11->category[shornodes]]% roles
[basecm11->category[shornodes]->roles]% assign slurmclient; commit
[basecm11->category[shornodes]->roles[slurmclient]]% append queues shorq
[basecm11->category[shornodes*]->roles*]% commit
```

The nodes belonging to the `shornodes` category can then be placed by going into `device` mode to select the nodes to be placed in that category. For example:

```bash
[basecm11->category[shornodes]->roles]% device use node002
[basecm11->device[node002]]% set category shornodes
[basecm11->device*[node002*]]% commit
```

### 7.8.2  Setting Up A Prejob Or Postjob Check

#### 7.8.2.1  How It Works

Measurables such as health checks (section [10.2.4](/admin/monitoring#1024-health-check)) by default run as scheduled tasks at timed intervals ([here](/admin/monitoring#1041-monitoring-configuration-data-producers)). They can independently be configured to run as prejob or postjob checks.

If a health check is configured as a prejob or postjob check, then its response means the same as that of a health check, that is:

* If the response to a prejob or postjob health check is `PASS`, then it shows that the node is displaying healthy behavior for that particular health check.

* If the response to a prejob or postjob health check is `FAIL`, then it implies that the node is unhealthy at the time of the check, at least for that particular health check.

Sometimes the strain of running a job can itself cause a health issue on the node. If that is the case, then sometimes the issue can be spotted by an immediate check of the node health after a job has completed—which is what the postjob health check does. A postjob health check is otherwise the same as a regular health check.

* If a postjob health check response is `FAIL`, then the node is unhealthy, even though the job completed. What effect the unhealthy node had on the job may need consideration by the cluster administrator.

* If a prejob health check response is `FAIL`, then the node is also unhealthy, but the job is prevented by the WLM from running on that node.

A node that has failed a prejob health check is not allowed to run a job. This is because an unhealthy node means that a job submitted to the node may fail, may not be able to start, or may even vanish outright. The way in which a job can vanish in some cases, without any information beyond the job submission “event horizon” leads to this behavior sometimes being called the *Black Hole Node Syndrome*.

**Draining on a prejob or postjob health check failure:** It can be troublesome for a system administrator to pinpoint the reason for such job failures, since a node may only fail under certain conditions that are hard to reproduce later on. It is therefore a good policy to disallow passing a job to a node which has just been flagged as unhealthy by a health check. Thus, a sensible action (section [10.2.6](/admin/monitoring#1026-action)) taken by a prejob or postbjob health check on receiving a `FAIL` response would be to put the node in a `Drained` state (section [7.7.4](#774-nodes-drainage-status-and-handling-in-cmsh)). The `drain` state means that BCM arranges a rescheduling of the job so that the job runs only on nodes that are believed to be healthy.

A node that has been put in a `Drained` state with a health check is not automatically undrained. The administrator must clear such a state manually.

The `failedprejob` health check ([here](/admin/metricshealthchecksactions#g21-regular-health-checks)) is enabled by default, and logs any prejob health check passes and failures. By default there are no prejob health checks configured, so by default this health check should always pass.

#### 7.8.2.2  Configuration Using `cmsh`

Prejob and postjob health checks can be enabled for a WLM instance:

```bash
[basecm11->wlm[slurm]]% show | grep -i job
Enable pre job                   no
Enable post job                  no
[basecm11->wlm[slurm]]% set enableprejob yes; commit
```

Each health check can then be enabled individually within the `monitoring setup` mode.

**Example**

For example, for the `ib` health check:

```bash
[basecm11->monitoring->setup]% get ib prejob
no
[basecm11->monitoring->setup]% set ib prejob <TAB><TAB>
yes   no
[basecm11->monitoring->setup]% set ib prejob yes
[basecm11->monitoring->setup*]% commit
================================= ib ==========================================
Field                    Message
------------------------ ------------------------------------------------------
when                     warning: Prejob is selected, but no WLM has prejob
```

To allow the healthcheck to run for the prejob with the workload manager, prejob must also be enabled appropriately for the associated workload manager:

**Example**

```bash
[basecm11->wlm[slurm]]% get enableprejob
no
[basecm11->wlm[slurm]]% set enableprejob yes
[basecm11->wlm*[slurm*]]% commit
```

#### 7.8.2.3  Configuration Using Base View

A similar configuration for prejob and postjob checks can be carried out with Base View.

For example, to configure the monitoring of nodes with a prejob check in Base View, the the `Pre job` value can be set for a data producer with the navigation path:

`Monitoring > Data Producers > Monitoring data producers > Edit > Pre job`

Prejob should also be enabled appropriately for the associated workload manager with the navigation path:

`HPC > Workload Management Clusters > Settings > Enable prejob`

#### 7.8.2.4  Configuration Of Prejob Health Checks With `cm-wlm-setup`

To set a prejob health check up via `cm-wlm-setup`, `cm-wlm-setup` is run in step-by-step mode. During one of the steps the administrator is prompted to select, with a tick on a checkbox, which of the available health checks are to run as prejob health checks in BCM (figure [7.37](#fig-cm-wlm-setup-ncurses-prejob-screen)):

![Prejob healthcheck selection in the cm-wlm-setup screen](/base-command-manager/product-manuals/_fern-img/0741f51f1afe11e0212ef7ff9aee9d5bc5a37cbd7307306fd1b2301199409adc.webp)

*Figure 7.37: Prejob healthcheck selection in the cm-wlm-setup screen*

If a selected health check was already set as a prejob—-that is, if the `prejob` parameter within the `monitoring setup` mode for that particular health check is already set to `yes`—then the checkbox is already ticked.

#### 7.8.2.5  Custom Prejob Configuration

For more unusual prejob or postjob checking requirements, further details on how prologs and epilogs are configured are given in section [7.3.4](#734-prolog-and-epilog-scripts).

## 7.9  Power Saving With `cm-scale`

The `cm-scale` service can be used by an administrator to reduce the energy and storage costs of compute nodes by changing their power state, or their existence state, according to workload demands. That is, `cm-scale` automatically scales a cluster up or down, on-demand, by powering up physical nodes, cloud nodes, or virtual nodes. The scaling is carried out according to settings in the `ScaleServer` role which set the nodes that are to use the `cm-scale` service.

The `cm-scale` service is covered extensively in Chapter [8](/admin/cm-scale).

## 7.10  Cgroups

Linux system processes and all their future children can be gathered into sets called process aggregations. These sets can be made into hierarchical groups with specialized behavior using the Control Groups (cgroups) mechanism. The behavior is controlled by different subsystems that are attached to the cgroup. A subsystem may, for example, allow particular CPU cores to be allocated, or it may restrict memory, or it may reduce swap usage by processes that belong to the group, and so on.

Details about Linux cgroups and their subsystems can be found at [https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt](https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt).

As far as workload management is concerned, it makes sense to distinguish between workload manager cgroup settings and system-wide cgroup parameters. The workload manager cgroup settings allow the administrator to configure a workload manager to use cgroups in a particular way, whereas the system-wide cgroup settings allow the administrator to manage cgroups whether a workload manager is used or not.

### 7.10.1  Cgroups Settings For Workload Managers

If the workload manager allows cgroups usage, then BCM provides capabilities to manage the cgroup parameters within the workload manager.

#### 7.10.1.1  Slurm Cgroups

Slurm supports 3 cgroups-related plugins. These are all enabled by default, and are:

1. `proctrack/cgroup`: enables process tracking and suspend/resume capability using cgroups. This plugin is more reliable for tracking and control than the former `proctrack/linux`.

2. `task/cgroup`: provides the ability to

   * confine jobs and steps to their allocated cpuset

   * bind tasks to sockets, cores and threads

   * confine jobs and steps to specific memory resources and gres devices

3. `jobacct_gather/cgroup`: collects accounting statistics for jobs, steps and tasks using the `cpuacct`, `memory`, and `blkio` cgroups subsystems.

Slurm uses configuration files to store the parameters and devices used for cgroup support.

The file `/cm/shared/apps/slurm/etc/` \<*cluster name*>`/cgroup.conf` defines parameters used by Slurm’s Linux cgroup-related plugins. The file contains a section that is autogenerated by CMDaemon, with cgroups-related parameters defined in the SlurmServer role.

For Slurm, the administrator can set cgroups parameters using `cmsh` by going into the `cgroups` submode of the WLM instance.

Parameters that can be managed include:

<table>
  <colgroup>
    <col />

    <col />

    <col />
  </colgroup>

  <tbody>
    <tr>
      <td rowspan="2">
        **Parameter**
      </td>

      <td rowspan="2">
        **Description**
      </td>

      <td>
        **Configuration Parameter**
      </td>
    </tr>

    <tr>
      <td>
        **In `cgroup.conf`**
      </td>
    </tr>

    <tr>
      <td>
        `Auto Mount`

        \*
      </td>

      <td>
        Force Slurm to mount cgroup subsystems if they are not mounted yet
      </td>

      <td>
        `CgroupAutomount`
      </td>
    </tr>

    <tr>
      <td>
        `Mount Point`
      </td>

      <td>
        Where cgroup root is mounted
      </td>

      <td>
        `CgroupMountpoint`
      </td>
    </tr>

    <tr>
      <td>
        `Task Affinity`

        \*
      </td>

      <td>
        Set a default task affinity to bind each step task to a subset of the allocated cores using 

        `sched_setaffinity`
      </td>

      <td>
        `TaskAffinity`
      </td>
    </tr>

    <tr>
      <td>
        `Release Agent Dir`
      </td>

      <td>
        Directory containing Slurm cgroup release_agent files
      </td>

      <td>
        `CgroupReleaseAgentDir`
      </td>
    </tr>

    <tr>
      <td>
        `Constrain Cores`

        \*
      </td>

      <td>
        Constrain allowed cores to the subset of allocated resources
      </td>

      <td>
        `ConstrainCores`
      </td>
    </tr>

    <tr>
      <td>
        `Constrain RAM Space`

        \*
      </td>

      <td>
        Constrain the job’s RAM usage
      </td>

      <td>
        `ConstrainRAMSpace`
      </td>
    </tr>

    <tr>
      <td>
        `Constrain Swap Space`

        \*
      </td>

      <td>
        Constrain the job’s swap space usage
      </td>

      <td>
        `ConstrainSwapSpace`
      </td>
    </tr>

    <tr>
      <td>
        `Constrain Devices`

        \*
      </td>

      <td>
        Constrain the job’s allowed devices (also constrain GPUs) based on GRES allocated resources
      </td>

      <td>
        `ConstrainDevices`
      </td>
    </tr>

    <tr>
      <td>
        `Allowed RAM Space`
      </td>

      <td>
        Percentage memory (default is 100%) out of the allocated RAM allowed for the job cgroup RAM. If this percentage is exceeded, then the job steps will be killed and a warning message will be written to standard error.
      </td>

      <td>
        `AllowedRAMSpace`
      </td>
    </tr>

    <tr>
      <td>
        `Allowed Swap Space`
      </td>

      <td>
        Percent allocated memory allowed for the job cgroup swap space
      </td>

      <td>
        `AllowedSwapSpace`
      </td>
    </tr>

    <tr>
      <td>
        `Max RAM Percent`
      </td>

      <td>
        Maximum percent of total RAM for a job
      </td>

      <td>
        `MaxRAMPercent`
      </td>
    </tr>

    <tr>
      <td>
        `Max Swap Percent`
      </td>

      <td>
        Maximum percent of total RAM for the amount of RAM+Swap that may be used for a job
      </td>

      <td>
        `MaxSwapPercent`
      </td>
    </tr>

    <tr>
      <td>
        `Min RAM Space`
      </td>

      <td>
        Minimum MB for the memory limits defined by 

        `Allowed RAM Space`

         and 

        `Allowed Swap Space`
      </td>

      <td>
        `MinRAMSpace`
      </td>
    </tr>
  </tbody>
</table>

\* Boolean (takes `yes` or `no` as a value)

The options are always written in the `cgroup.conf` file. More details on these options can be found in the man page `man cgroup.conf.5`.

#### 7.10.1.2  LSF

LSF allows resource enforcement to be controlled with the Linux cgroup memory and cpuset subsystems. By default, when LSF is set up with `cm-wlm-setup`, then both subsystems are enabled for LSF jobs. If job processes on a host use more memory than the defined limit, then the job is immediately killed by the Linux cgroup memory subsystem. The cgroups-related configuration options are available in `cmsh` or Base View, and can be found in the `cgroups` submode of the LSF cluster settings:

<table>
  <colgroup>
    <col />

    <col />

    <col />
  </colgroup>

  <tbody>
    <tr>
      <td rowspan="2">
        **Parameter**
      </td>

      <td rowspan="2">
        **Description**
      </td>

      <td>
        **Configuration Parameter**
      </td>
    </tr>

    <tr>
      <td>
        **In `lsf.conf`**
      </td>
    </tr>

    <tr>
      <td>
        `Resource Enforce`
      </td>

      <td>
        Controls resource enforcement through the Linux cgroups memory and cpuset subsystem, on Linux systems with cgroups support. The resource can be either 

        `memory`

         or 

        `cpu`

        , or both 

        `cpu`

         and 

        `memory`

        , in either order (default: 

        `memory cpu`

        )
      </td>

      <td>
        `LSB_RESOURCE_ENFORCE`
      </td>
    </tr>

    <tr>
      <td>
        `Process Tracking`

        \*
      </td>

      <td>
        This parameter, when enabled, has LSF track processes based on job control functions such as termination, suspension, resume, and other signals, on Linux systems which support the cgroups freezer subsystem
      </td>

      <td>
        `LSF_PROCESS_TRACKING`
      </td>
    </tr>

    <tr>
      <td>
        `Linux Cgroup Accounting`

        \*
      </td>

      <td>
        When enabled, processes are tracked based on CPU and memory accounting for Linux systems that support cgroup’s memory and cpuacct subsystems
      </td>

      <td>
        `LSF_LINUX_CGROUP_ACCT`
      </td>
    </tr>
  </tbody>
</table>

\* Boolean (takes `yes` or `no` as a value)

## 7.11  Custom Node Parameters

NVIDIA Base Command Manager 11 allows the administrator to specify the most important node parameters when a node is configured in a workload manager. But sometimes the workload manager allows the configuration of other advanced or user-defined settings for the nodes. When an administrator clones a node in BCM, or creates it from scratch, then those advanced settings may need to be configured manually per node in the workload manager. Sometimes the nodes are created or cloned automatically, for example `cm-scale` (Chapter [8](/admin/cm-scale)), in which case node parameters customization is not possible without manual intervention in the workload manager configuration.

Since NVIDIA Base Command Manager version 8.2, the administrator can configure the advanced node settings in the node customizations mode of `cmsh` or Base View. The customizations are available in the workload manager client roles, so they can be applied at the node, node category or configuration overlay levels.

In order to configure a custom node parameter for the workload manager, the administrator adds the node customization entry and sets its value to `True` or `False`. The entry is enabled by default, that is, an associated parameter `Enabled` is `yes` by default. The workload manager can take a minute to implement the new value.

For example, Slurm’s `BcastExclude` parameter specifies a list of paths to exclude when broadcasting files to nodes with `sbcast`. It is a `NodeName` parameter in `slurm.conf` but is not directly exposed in BCM’s `slurmclient` role, making it a typical candidate for node customizations. To add it as a customization entry, excluding `/dev/shm` from broadcast operations, the following `cmsh` commands can be used:

**Example**

```bash
[basecm11]% configurationoverlay
[basecm11->configurationoverlay]% use slurm-client
[basecm11->configurationoverlay[slurm-client]]% roles
[basecm11->configurationoverlay[slurm-client]->roles]% use slurmclient
...->roles[slurmclient]]% nodecustomizations
...->roles[slurmclient]->nodecustomizations]% list
Key (key)    Value        Enabled
------------ ------------ -------
...->roles[slurmclient]->nodecustomizations]% add BcastExclude
...->roles*[slurmclient*]->nodecustomizations*[BcastExclude*]]% set value /dev/shm
...->roles*[slurmclient*]->nodecustomizations*[BcastExclude*]]% show
Parameter                        Value
-------------------------------- ------------------------------------------------
Key                              BcastExclude
Value                            /dev/shm
Enabled                          yes
Notes                            <0 bytes>
...->roles*[slurmclient*]->nodecustomizations*[BcastExclude*]]% commit
...->roles[slurmclient]->nodecustomizations[BcastExclude]]% quit
```

The change would show up in `slurm.conf` within a minute:

```bash
[root@basecm11 ~]# grep ^NodeName /cm/shared/apps/slurm/etc/slurm/slurm.conf ; \
  sleep 60 ; \
  grep ^NodeName /cm/shared/apps/slurm/etc/slurm/slurm.conf
NodeName=node[001-005] RealMemory=14392 Boards=1 ... Features=location=local
NodeName=node[001-005] BcastExclude=/dev/shm RealMemory=14392 Boards=1 ... Features=location=local
```

Different workload managers allow different kinds of node settings to be set. When the administrator configures node customization entries, BCM configures them differently depending on the workload manager that is used.

Thus if the administrator creates a new customization entry with key name \<KEY> and value \<VALUE>, then this is applied to the workload managers as follows:

* **Slurm**: The node customization entry is appended to the `NodeName` line of the particular nodes in `slurm.conf` in the form \<KEY>=\<VALUE>. If the entry is removed or disabled in the BCM configuration, then the entry \<KEY>=\<VALUE> pair is removed from the `NodeName` line.

* **LSF**: The entry is set in the `lsb.hosts` file, in the `Hosts` section. If the \<KEY> of the entry is defined as one of the section columns, then the parameter value is replaced by BCM to \<VALUE>. When the customization entry is removed or disabled, then its value is replaced by `()` in the section.