Batch system¶
A batch system queues user-submitted jobs and schedules their execution on compute nodes, ensuring fair and efficient distribution of shared resources among all users. On HoreKa 2, users have direct access to the login nodes only; all compute nodes are accessible exclusively through the batch system Slurm.
Slurm is an open-source, fault-tolerant, and highly scalable job scheduler for Linux clusters. It serves three key functions:
- Allocating exclusive and/or shared access to compute nodes for a defined duration.
- Providing a framework for launching, executing, and monitoring work on allocated nodes.
- Managing a queue of pending jobs to resolve competing resource requests fairly.
All compute access on HoreKa 2 goes through Slurm — whether as a batch job (a script with commands and resource requirements, run asynchronously) or as an interactive job (a live session on allocated compute nodes).
The amount of available resources is tied to the respective compute project; Slurm enforces these limits and handles the accounting of consumed resources.
Member of multiple compute time projects
If you are a member of more than one compute project — for example multiple NHR projects or a combination of NHR and HAICORE projects — you must actively switch between them to ensure the correct $PROJECT directory is used and that compute time is billed to the correct Slurm account. See Switching Between Projects for details.
HoreKa 2 partitions¶
Slurm organizes compute nodes into partitions (informally also called queues) that group similar hardware and enforce different access policies and resource limits. You must specify the appropriate partition when submitting a job to target the desired hardware.
Regular partitions¶
| Partition | Compute Hardware | Access policy | Minimum resources | Default resources | Maximum resources |
|---|---|---|---|---|---|
cpu |
HoreKa Onyx Standard CPU |
Exclusive | nodes=1, ntasks=1 | ntasks=1, mem-per-cpu=2000mb | time=3-00:00:00, nodes=161, ntasks=384, mem=768000mb |
large |
HoreKa Blue Extra Large Memory |
Shared | nodes=1, ntasks=1 | ntasks=1, mem-per-cpu=27106mb | time=2-00:00:00, nodes=8, ntasks=152, mem=4120112mb |
gpu-b200 |
HoreKa Jade 4x B200 |
Shared | nodes=1, ntasks=1, gres=gpu:1 | ntasks=1, mem-per-gpu=186000, cpu-per-gpu=36 | time=2-00:00:00, nodes=74, ntasks=288, gres=gpu:4, mem=983040mb |
gpu-h100 |
HoreKa Teal 4x H100 |
Shared | nodes=1, ntasks=1, gres=gpu:1 | ntasks=1, mem-per-gpu=192000, cpu-per-gpu=32 | time=2-00:00:00, nodes=21, ntasks=128, gres=gpu:4, mem=768000mb |
gpu-h200-8 |
HoreKa Teal 8x H200 |
Shared | nodes=1, ntasks=1, gres=gpu:1 | ntasks=1, mem-per-gpu=257500, cpu-per-gpu=24 | time=2-00:00:00, nodes=1, ntasks=192, gres=gpu:8, mem=2060000mb |
gpu-h200 |
HoreKa Ruby 4x H200 |
Shared | nodes=1, ntasks=1, gres=gpu:1 | ntasks=1, mem-per-gpu=192000, cpu-per-gpu=48 | time=2-00:00:00, nodes=13, ntasks=192, gres=gpu:4, mem=768000mb |
SMT is enabled on all CPU nodes. Your application may benefit from it, but using more threads than physical cores can significantly impact performance depending on the workload.
The large partition is intended for memory-intensive workloads that cannot fit on standard nodes.
As compute intensive tasks must not run on login nodes, development partitions exist to provide fast, usually interactive access to compute nodes — ideal for compiling software, testing workflows, or any short task that requires real compute resources.
Development partitions¶
| Partition | Compute Hardware | Access policy | Minimum resources | Default resources | Maximum resources |
|---|---|---|---|---|---|
dev-cpu |
HoreKa Onyx | Shared | nodes=1, ntasks=1 | ntasks=1, mem-per-cpu=2000mb | time=01:00:00, nodes=2, ntasks=384, mem=768000mb |
dev-gpu-b200 |
HoreKa Jade 4x B200 |
Shared | nodes=1, ntasks=1, gres=gpu:1 | ntasks=1, mem-per-gpu=186000, cpu-per-gpu=36 | time=1:00:00, nodes=1, ntasks=288, gres=gpu:4, mem=983040mb |
dev-gpu-h100 |
HoreKa Teal 4x H100 |
Shared | nodes=1, ntasks=1, gres=gpu:1 | ntasks=1, mem-per-gpu=192000, cpu-per-gpu=32 | time=1:00:00, nodes=1, ntasks=128, gres=gpu:4, mem=768000mb |
The dev- partitions are intended for short, interactive sessions — developing, compiling, and testing code — where immediate resource access matters. Use them for quick compute tasks that would be disruptive on the login nodes.
Development partitions
Do not misuse these partitions for regular, short-running jobs or chain jobs! Only one job is allowed to run at a time.
Agent partition¶
| Partition | Compute Hardware | Access policy | Minimum resources | Default resources | Maximum resources |
|---|---|---|---|---|---|
agent |
HoreKa Onyx | Shared | nodes=1, ntasks=1 | ntasks=1, mem-per-cpu=2000mb | time=3-00:00:00, nodes=1, ntasks=1 |
The agent partition is a dedicated single-node single-core partition for AI agent workloads. It provides access to one HoreKa Onyx node and is intended for agentic AI workflows that require direct, persistent compute access — for example by connecting an IDE or AI coding assistant via an SSH tunnel to the allocated node (see Code Editors). Jobs are limited to a single task and may run for up to three days.
Slurm Usage¶
A typical workflow looks like this:
- Check available resources — use
sinfo_t_idleto see which nodes are currently idle, andscontrol show partition <name>to inspect partition limits and configuration. - Submit a job — for quick tests or interactive development, start an interactive session with
sallocon adev-partition. For production runs, write a job script and submit it withsbatch. - Monitor your jobs — track the status of your jobs in the queue with
squeue -u $USER. Usesqueue --start -j <jobid>to see when a pending job is expected to start. - Inspect and cancel — if something looks wrong, use
scontrol show job <jobid>for details orscancel <jobid>to cancel the job. - Review completed jobs — after a job finishes,
sacct -j <jobid>shows runtime, exit status, and resource usage.
The official Slurm documentation is quite exhaustive, so this page focuses on the most important commands and use cases. All commands are also available as manpages on the cluster, e.g. man sbatch.
Quick Reference¶
| Category | Command | Description |
|---|---|---|
| Submit jobs | sbatch <script> |
Submit a batch job script |
salloc |
Allocate resources for an interactive job | |
| Monitor & manage jobs | squeue -u $USER |
List your running and pending jobs |
squeue --start -j <jobid> |
Show estimated start time for a job | |
scontrol show job <jobid> |
Show detailed job information | |
sacct -j <jobid> |
Show accounting information for a completed job | |
scancel <jobid> |
Cancel a job | |
srun --jobid=<jobid> --pty bash |
Enter a running job | |
| Explore resources | sinfo_t_idle |
Show currently idle nodes |
scontrol show partition <name> |
Show partition configuration and limits |
Submit Jobs¶
Submitting a job means requesting resources — such as CPUs, GPUs, or memory — from the cluster, so that Slurm can schedule and run your computation on the appropriate compute nodes.
Two commands are used to submit and run jobs in Slurm.
sbatchsubmits a batch job script: the job is queued and runs asynchronously once resources are available, with output written to a file — this is the standard way to run production jobs.sallocallocates compute resources interactively, giving you a shell on the allocated nodes for development and testing.
Command Parameters¶
These options apply to both sbatch and salloc. They can be specified as command-line parameters or, for sbatch, as #SBATCH pragmas inside the job script.
On HoreKa 2, two parameters are mandatory — all others have sensible default values:
--partition— selects the target hardware (see partitions above).--time— sets the maximum wall clock time; the job is cancelled if it exceeds this limit.
The following parameters are available, grouped by category. Most have a short form (e.g. -t) and a long form (e.g. --time) — both are equivalent. Command-line parameters always take precedence over #SBATCH pragmas in the script.
Required
| Command | Script | Purpose |
|---|---|---|
-p <name> / --partition=<name> |
#SBATCH --partition=<name> |
Target partition (hardware). See partitions above. |
-t <time> / --time=<time> |
#SBATCH --time=<time> |
Maximum wall clock time. Format: HH:MM:SS or D-HH:MM:SS. The job is cancelled when the limit is reached. |
Resources
| Command | Script | Purpose |
|---|---|---|
-N <count> / --nodes=<count> |
#SBATCH --nodes=<count> |
Number of nodes to allocate. |
-n <count> / --ntasks=<count> |
#SBATCH --ntasks=<count> |
Total number of tasks (e.g. MPI ranks) to launch. |
--ntasks-per-node=<count> |
#SBATCH --ntasks-per-node=<count> |
Number of tasks per node. |
-c <count> / --cpus-per-task=<count> |
#SBATCH --cpus-per-task=<count> |
CPU cores per task (use for multi-threaded jobs). |
--gres=gpu:<count> |
#SBATCH --gres=gpu:<count> |
Number of GPUs to allocate per node. |
-G <count> / --gpus=<count> |
#SBATCH --gpus=<count> |
Number of GPUs to allocate in total. |
--mem=<MB> |
#SBATCH --mem=<MB> |
Memory per node in MB. In most cases the default is sufficient — only set this if your job has specific memory requirements. |
--mem-per-cpu=<MB> |
#SBATCH --mem-per-cpu=<MB> |
Memory per CPU core in MB. Alternative to --mem; useful for MPI jobs where the per-task memory is known. |
--exclusive |
#SBATCH --exclusive |
Reserve the full node exclusively; no other jobs will share it. |
Job metadata
| Command | Script | Purpose |
|---|---|---|
-J <name> / --job-name=<name> |
#SBATCH --job-name=<name> |
Human-readable job name, shown in squeue. |
-A <project> / --account=<project> |
#SBATCH --account=<project> |
Billing account. Required if you belong to more than one project. |
Output
| Command | Script | Purpose |
|---|---|---|
--output=<file> |
#SBATCH --output=<file> |
File for standard output. Default: slurm-<jobid>.out. |
--error=<file> |
#SBATCH --error=<file> |
File for standard error. If omitted, merged into --output. |
--mail-type=<events> |
#SBATCH --mail-type=<events> |
Send email on job events. Values: BEGIN, END, FAIL, ALL. |
--mail-user=<address> |
#SBATCH --mail-user=<address> |
Email address for notifications (requires --mail-type). |
Environment
Command |
Script |
Purpose |
|---|---|---|
--export=<vars> |
#SBATCH --export=<vars> |
Controls which environment variables are passed to the job. Default is ALL (entire submission environment). Use --export=ALL,VAR=value to add variables, or list specific names to restrict forwarding. |
Special constraints
| Command | Script | Purpose |
|---|---|---|
--constraint=LSDF |
#SBATCH --constraint=LSDF |
Enable access to the LSDF file system. |
--constraint=BEEOND |
#SBATCH --constraint=BEEOND |
Request a BeeOND on-demand file system. |
Examples¶
Please see Slurm Examples.
Monitor and Manage Jobs¶
Use squeue to inspect the job queue, scontrol for detailed job state, sacct for completed job accounting, and scancel to cancel a job.
Using the watch squeue command
Each request to the Slurm workload manager generates a load.
Do not use time intervals smaller than 30 seconds. Use watch -n 30 squeue instead.
Any violation of this rule will result in the task being terminated without notice.
Enter a running job¶
In some cases, you might want to access the resources of an existing allocation, e.g. in order to when troubleshoot a non-interactive job. SSH into the node with the running job is not possible. Instead, accessing the node can be done using Slurm's srun command. After allocating resources, e.g. with sbatch or salloc, you can access the resources of this allocation with
It creates a new job step and executes bash in pseudo terminal mode on task zero of this job step, i.e. it gives you an interactive bash on the previously allocated job.
The job id is printed immediately after a job allocation and can be retrieved later with the squeue command.
If all the allocated CPU resources are already used, srun will prohibit the new job step the access to the resources.
However, the argument --overlap can be passed to srun to allow job steps to overlap on the resources.
In case you need to access specific nodes within the job allocation, you can do so with the argument --nodelist=<NODELIST>.
Example:
executes a bash on nodehk2n1132, that is currently allocated by the job with the id 11748 and overlaps with already running tasks.
In order to get the nodelist of a certain job, just type squeue -j <jobid> -o "%N"
Accessing GPU jobs
Accessing GPU jobs with the --pty method requires the --gres=gpu:<count> or --gpus=<count> hint.
Keep in mind, that your subsequent job will be cancelled if the original allocation is released. That can happen if a task running in the allocation is finished or cancelled.
If you plan to debug and develop code on compute nodes via an IDE such as VS Code or similar, use the SSH tunnel to compute nodes instead.
Explore Resources¶
Use sinfo_t_idle to see which nodes are currently idle, and scontrol show partition <name> to see the configured limits for a specific partition.
sinfo not available
The sinfo command is restricted to administrators and is not available to regular users. Use the sinfo_t_idle helper script instead.
Environment variables¶
When Slurm starts a job, it automatically sets a number of environment variables inside the job environment. They give your job script access to runtime information — such as the assigned job ID, the list of allocated nodes, or the number of tasks.
The following environment variables are available within batch jobs while they are running:
| Environment | Brief explanation |
|---|---|
SLURM_JOB_CPUS_PER_NODE |
Number of processes per node dedicated to the job |
SLURM_JOB_NODELIST |
List of nodes dedicated to the job |
SLURM_JOB_NUM_NODES |
Number of nodes dedicated to the job |
SLURM_MEM_PER_NODE |
Memory per node dedicated to the job |
SLURM_NPROCS |
Total number of processes dedicated to the job |
SLURM_CLUSTER_NAME |
Name of the cluster executing the job |
SLURM_CPUS_PER_TASK |
Number of CPUs requested per task |
SLURM_JOB_ACCOUNT |
Account name |
SLURM_JOB_ID |
Job ID |
SLURM_JOB_NAME |
Job Name |
SLURM_JOB_PARTITION |
Partition/queue running the job |
SLURM_JOB_UID |
User ID of the job's owner |
SLURM_SUBMIT_DIR |
Job submit folder (the directory from which sbatch was invoked) |
SLURM_JOB_USER |
User name of the job's owner |
SLURM_RESTART_COUNT |
Number of times job has restarted |
SLURM_PROCID |
Task ID (MPI rank) |
SLURM_NTASKS |
The total number of tasks available for the job |
SLURM_STEP_ID |
Job step ID |
SLURM_STEP_NUM_TASKS |
Task count (number of PI ranks) |
SLURM_JOB_CONSTRAINT |
Job constraints |
Energy measurement¶
Slurm allows for the measurement of consumed energy on a job basis. This is automatically done for every job startet on HoreKa.
The energy consumed can be checked after a job has finished with either scontrol show job in the energy field or with sacct using the --format option and the field ConsumedEnergy e.g.:
Furthermore a job feedback is appended to every job outputfile. Here both energy consumed in Joule / Watthours and the average node power draw are displayed.
To display the energy consumed during a running job sstat can be used e.g.:
Energy Measurement
The energy is measured on the node level, meaning only in case of exclusive job allocation the energy consumption measurements will reflect the job's real consumption. The values show the amount of consumed energy of all involved nodes but not the interconnect/filesystem.
Further Reading¶
Switching Between Projects¶
If you are a member of more than one compute project, you must actively switch between them. On HoreKa 2, $PROJECT is derived from the Slurm default account — changing the default account is therefore sufficient to update both.
Your current default account is printed on the login screen or can be checked via:
To see all accounts available to you:
The recommended way to switch the project is:
For all changes to take full effect, you need to log out and log in again.
To bill an individual job to a different project without changing your default account, use the -A / --account option:
This overrides the default account for that job only and does not affect $PROJECT or your Slurm default account.
Group ownership of files
The active Unix group affects the group ownership of newly created files and directories. Make sure you have the correct group active before creating shared files.