Table of Contents

Guide to SLURM Resource Management and Job Submission

This guide provides an advanced overview of the SLURM (Simple Linux Utility for Resource Management) workload manager and the underlying physical architecture of the UNITE HPC cluster. It covers theoretical network topologies, inter-node communication, deep hardware utilization mechanics, user workflows, and best practices for parallel execution.

1. Theoretical Overview & Cluster Architecture

An HPC cluster is a massive parallel computing instrument built from a collection of individual commodity servers called Nodes, interconnected by an ultra-fast, low-latency network fabric. Slurm isolates users from this underlying hardware complexity while ensuring optimal resource distribution.

Slurm operates under a master-worker orchestration framework managed by three primary daemons:

Resource Hierarchies

When submitting a workload to Slurm, it is crucial to understand how resource requests translate into physical hardware allocations:

Deep Dive: CPU and Memory Architecture (NUMA)

Modern compute nodes are not monolithic. A single node typically contains two or more CPU sockets (physical chips). Memory (RAM) is physically divided and attached directly to specific sockets. This is known as NUMA (Non-Uniform Memory Access).

Why this matters for Slurm: When you request resources, Slurm attempts to bind your tasks to specific cores and local memory banks (CPU affinity/pinning) to avoid crossing NUMA boundaries. Requesting scattered resources loosely can result in your application constantly fetching data across the motherboard, severely degrading performance.

2. Advanced Cluster Topology and Inter-Node Communication

To write optimal code for an HPC cluster, developers must account for how components talk to one another. Communication speeds and delays (latency) change drastically based on where your data sits and where it needs to go.

Memory and Communication Layout

Execution Scope Communication Medium Relative Bandwidth Latency Complexity
Intra-Core (Same CPU) L1 / L2 / L3 Processor Cache Ultra-High (Terabytes/sec) Lowest (Nanoseconds)
Intra-Node (Same Server) Physical RAM & PCIe Bus / NVLink Very High (Hundreds of GB/s) Low
Inter-Node (Across Servers) InfiniBand Network Fabric / Switches High (Hundreds of Gbps) Microseconds (Fabric Transit)

Network Topologies: Fat-Tree Architecture

HPC networks like the one powering the UNITE cluster avoid standard corporate network setups (which bottleneck under heavy loads) in favor of a specialized Fat-Tree Topology.

Deep Dive: InfiniBand & OS Kernel Bypass

When your code spans across multiple physical nodes (e.g., an MPI job), it bypasses standard slow Ethernet connections. Ethernet requires the operating system's kernel (TCP/IP stack) to package, verify, and route every single byte, which consumes massive CPU cycles and creates latency.

The UNITE cluster utilizes InfiniBand Architecture (IBA) and RDMA (Remote Direct Memory Access):

On GPU partitions (like the a40 pool), how GPUs talk to each other is critical.

3. Scheduler Theory: How Slurm Assigns Resources

Slurm does not simply process jobs sequentially. It uses complex algorithms to maximize cluster utilization and ensure fairness.

4. Crucial Cluster Etiquette: The Shared Environment

WARNING: NEVER RUN COMPUTATIONS ON THE LOGIN NODE!
When you connect to the UNITE cluster via SSH, you land directly on the Login Node. This node's sole purpose is file management, code editing, and checking job queues. Heavy processes like compilation, heavy Python tasks, or model training will slow down the login node for everyone on the cluster. Running intensive code here may result in administrators forcefully terminating your session.

To execute code, you must pass your workloads over to a dedicated compute node using either Interactive Sessions or Batch Job Submissions.

5. Key Slurm Commands Workflow

Interact with the scheduler fabric using these primary terminal operations:

Command Action Description Typical Use Case
sinfo Queries the state of partitions and available physical cluster hardware nodes. Checking which queues are free or down.
srun Allocates and runs parallel tasks. Can open an active interactive terminal session. Step-by-step code testing and compilation.
sbatch Enqueues a non-interactive shell script to run autonomously in the background. Production training and massive compute jobs.
squeue Inspects current active allocations and waiting jobs in the scheduler pipelines. Checking your queue position or job status.
scancel <ID> Immediately terminates a queued or running job matching the specific ID. Aborting an infinite loop or mistaken setup.

6. Interactive Development vs. Non-Interactive Batch

Workflow A: Interactive Sessions (Testing & Compilation)

To compile libraries, debug scripts line-by-line, or test packages safely on a real compute node, use an interactive resource request via srun.

For a standard multi-purpose compute slice:

$ srun --partition=unite --cpus-per-task=4 --time=00:30:00 --pty bash

For a dedicated deep learning workspace utilizing NVIDIA graphics hardware:

$ srun --partition=a40 --gres=gpu:1 --cpus-per-task=4 --time=00:30:00 --pty bash

Once executed, Slurm places your terminal directly onto a secure, isolated compute shell. When your testing is complete, type exit to release the resources back to the queue pool.

Workflow B: Batch Processing (Production Runs)

For heavy workloads that take hours or days, write a batch script and submit it using sbatch. Once submitted, you can disconnect your computer safely; Slurm handles execution and records outputs into text files on the storage array.

Here is a template structure for a production batch file (run_job.sh):

run_job.sh
#!/bin/bash
#SBATCH --job-name=unite_production_job
#SBATCH --partition=unite           # Target partition queue (e.g., unite, a40)
#SBATCH --output=logs_%j.out        # Output log text file (%j replaces with unique Job ID)
#SBATCH --error=logs_%j.err         # Error tracking text file
#SBATCH --nodes=1                   # Number of distinct physical hardware nodes
#SBATCH --ntasks=1                  # Number of execution application instances
#SBATCH --cpus-per-task=4           # CPU worker core threads assigned to this task
#SBATCH --mem=16G                   # Safe RAM allocation limit request
#SBATCH --time=02:00:00             # Maximum safety runtime allowance (HH:MM:SS)
 
# 1. Clean the inherited terminal environment states
module purge
 
# 2. Execute target execution logic or launch binaries
echo "Starting production workload execution on node: $(hostname)"
# Run your commands here...

To place this file into the cluster scheduler pipeline, execute:

$ sbatch run_job.sh

7. Reference Guides and Real-World Examples

To see how to apply these Slurm parameters across different compiler systems, runtime environments, and compute nodes, follow our language-specific reference documentation pages:

8. Troubleshooting Common Queue States

If you run squeue -u $USER and see your job sitting in a PD (Pending) state, look closely at the NODELIST(REASON) column: