slurm - Queueing System

On the HC systems we use the queueing system slurm for submitting jobs to the cluster. An overview can be found here.

Frequently used commands:

queue overview

squeue -l

partition overview

sinfo -l

submit job

sbatch <jobscript>

cancel job

scancel <job_id>

job info (short)

squeue --job <job_id>

job info

scontrol show job <job_id>

allocate CPU resources interactively

salloc --partition=<partition_name> --time=<time> --mem=<memory> --cpus-per-task=<cpus>

allocate GPU resources interactively

salloc --partition=<gpu_partition_name> --time=<time> --gres=gpu:<num_gpus> --mem=<memory>

For a comparison of slurm commands towards other scheduling systems see slurm.schedmd.com/rosetta.

magnitUDE

Accessing specific ressources

There are three types of compute nodes at magnitUDE, which differ only in the main memory:

  • Normal Compute Nodes: 64 GB main memory - node[073-564]

  • FAT Compute Nodes: 128 GB main memory - node[001-072]

  • SUPERFAT Compute Nodes: 256 GB main memory - node[565-624]

Nodes type FAT and SUPERFAT are equally available in all partitions, they are just held back until no more Normal resource is available.

The nodes types are requested by a flag in the slurm script:

...
#SBATCH --constraint="FAT"
...
...
#SBATCH --constraint="SUPERFAT"
...

Currently, FAT and SUPERFAT nodes can be requested by all users. However, if the flag is found in too many batchscripts as a ‘default setting’ we reserve the right to introduce additional account requirements in the future.

OmniPath (OPA) is used as the interconnect. Each of the OPA switches has 48 ports. A two-tier network is implemented on the magnitUDE, consisting of:

  • 16 edge switches

  • 5 spine switches

36 compute nodes are connected to each of the edge switches. The remaining ports realize the connection to the spine switches. The 36 compute nodes of a switch can be requested as a network island by slurm. Excerpt from the man pages:

...
#SBATCH --switches=<count>[@<max-time>]
...

When a tree topology is used, this defines the maximum count of switches desired for the job allocation and optionally the maximum time to wait for that number of switches. If slurm finds an allocation containing more switches than the count specified, the job remains pending until it either finds an allocation with desired switch count or the time limit expires.
It there is no switch count limit, there is no delay in starting the job.
Acceptable time formats include:

  • “minutes”,

  • “minutes:seconds”

  • “hours:minutes:seconds”

  • “days-hours”

  • “days-hours:minutes”

  • “days-hours:minutes:seconds”.

For example,

...
#SBATCH -N 36
#SBATCH --switches=1@1-12
...

places the job only contiguously on a network island. I will wait 1.5 days until this is possible, then the job will be started without the switch restriction.

With the command scontrol show topology, you can also show the topology of the switches/nodes.

Example: Job script with MPI

#!/bin/bash

# name of the job
#SBATCH -J test_20
#SBATCH -N 64
#SBATCH --tasks-per-node=24
#SBATCH --cpus-per-task=2

# runtime after which the job will be killed (estimated)
#SBATCH -t 02:00:00

# Change to the directory the job was submitted from
cd $SLURM_SUBMIT_DIR

# gnu openmp
export OMP_NUM_THREADS=1

time mpirun  -np 1536 --report-bindings --bind-to core --rank-by core  ./PsiPhi > log 2>&1

#last line

amplitUDE

amplitUDE has the following node types (hardware details: About amplitUDE):

  • STD CPU nodes: 512 GB main memory — ndstd[001-184]

  • HIM CPU nodes: 1024 GB main memory — ndhim[001-055]

  • SHM CPU nodes: 2048 GB main memory — ndshm[001-013]

  • GPU nodes with 4 × NVIDIA H100 PCIe: 1024 GB main memory — ndgpu[001-009,011-019]

  • GPU node with 2 × NVIDIA H100 PCIe (MIG): 1024 GB main memory — ndgpu010

  • GPU nodes with 8 × NVIDIA H200 SXM5: 1536 GB main memory — ndgh[2001-2004]

Partitions

partition

job time limit

hostname

max. RAM allocation per node

num. of allocatable nodes

STD-s-96h*

4-00:00:00

ndstd[009-184]
ndhim[001-055]
ndshm[001-013]

512 GB

1 - 45

STD-m-48h

2-00:00:00

ndstd[009-184]
ndhim[001-055]
ndshm[001-013]

512 GB

46 - 92

STD-l-12h

0-12:00:00

ndstd[009-184]
ndhim[001-055]
ndshm[001-013]

512 GB

93 - 248

HIM-s-96h

4-00:00:00

ndhim[001-055]

1024 GB

1 - 11

HIM-m-48h

2-00:00:00

ndhim[001-055]

1024 GB

12 - 25

HIM-l-12h

0-12:00:00

ndhim[001-055]

1024 GB

26 - 55

SHM-s-96h

4-00:00:00

ndshm[001-013]

2048 GB

1 - 6

SHM-l-24h

1-00:00:00

ndshm[001-013]

2048 GB

7 - 13

GPU-big

2-00:00:00

ndgpu[001-009,011-019]

1024 GB

1

GPU-small

2-00:00:00

ndgpu010

1024 GB

1

GPU-H200

2-00:00:00

ndgh[2001-2004]

1536 GB

1 - 2

Usage of GPUs in computations

GPUs are requested with --gres. The environment variable $CUDA_VISIBLE_DEVICES is set accordingly during the job.

Partition

GPUs per node

Request example

GPU-big

4 × H100 PCIe (80 GB)

#SBATCH --gres=gpu:2

GPU-small

14 MIG instances of type 1g.10gb (10 GB each)

#SBATCH --gres=gpu:h100_pcie_1g.10gb:1

GPU-H200

8 × H200 SXM5 (141 GB)

#SBATCH --gres=gpu:h200:1

A MIG instance on GPU-small provides about 1/7 of an H100’s compute and 10 GB of GPU memory. It is suitable for small jobs, notebooks, teaching and testing, but not for performance benchmarks or large models.

Within a GPU job, use srun --pty bash to get a shell on the allocated node. Logging in with ssh does not inherit your job’s environment.

Example: Job script with MPI

Define the number of MPI processes that should be started via the number of nodes --nodes and the number of MPI processes per node --ntasks-per-node.

In this example, the executable will be run on 2 nodes with 72 MPI processes per node.

#!/bin/bash

#SBATCH -J jobname                         # name of the job
#SBATCH --nodes=2                          # number of compute nodes
#SBATCH --ntasks-per-node=72               # number of MPI processes per compute node
#SBATCH --time=2:00:00                     # max. run-time
#SBATCH --mail-type=ALL                    # all events are reported via e-mail
#SBATCH --mail-user=your-email@uni-due.de  # user's e-mail adress

# Change to the directory the job was submitted from
cd $SLURM_SUBMIT_DIR

# Starting parallel application using MPI
mpirun ./application

Interactive Jobs

salloc is used to allocate resources for an interactive job in SLURM. It requests a set of resources (like CPU cores, memory, GPUs, etc.) from the cluster for the user to run commands interactively. It allocates the requested resources and provides the user with a shell to interact with those resources. It is used for tasks like debugging, testing code, or working with a program that requires real-time interaction. Once you run salloc, you are given a shell session on the allocated node(s), where you can run commands interactively. Example:

salloc --partition=<partition_name> --time=<time_limit> --mem=<memory> --cpus-per-task=<cpus>

Allocate CPU Resources Interactively

salloc --partition=GPU-big --time=00:20:00 --mem=5G --cpus-per-task=2

Allocate GPU Resources Interactively

salloc --partition=GPU-big --gres=gpu:1 --time=00:20:00 --mem=5G

Running Commands After Allocation

Once the resources are allocated, you can run commands interactively. For example, to run Python script

salloc --partition=GPU-big --gres=gpu:1 --time=00:20:00 --mem=5G
srun --pty python

Notes:

•	salloc is for interactive resource allocation, not job submission.

•	For job submissions, use sbatch instead.

•	The allocation is active until the specified time limit is reached or the session is terminated.