Sie befinden sich im Service: RWTH High Performance Computing (Linux)

Example Slurm Job

Example Slurm Job


Here you will find a basic example job script for the Slurm batch system and further links for using the system.


Batch scripts are files that contain the definition of required hardware resources (see #SBATCH lines) and the code you wish to run on an HPC compute node.

These batch scripts are submitted to Slurm using a unix console with the command sbatch. Using the console is required to submit batch scripts using sbatch.

Take the following code and save it to a file on your home directory in the cluster, using a file editor.

Basic example Slurm job script file


### Start of Slurm SBATCH definitions
# Ask for eight tasks (same as 8 cores for this example)
#SBATCH --ntasks=8

# Ask for the maximum memory per core (most CLAIX-2023 nodes: 2.7GB per cpu) 
#SBATCH --mem-per-cpu=2500M

# Ask for up to 15 Minutes of runtime
#SBATCH --time=00:15:00

# Name the job

# Declare a file where the STDOUT/STDERR outputs will be written
#SBATCH --output=output.%J.txt

### end of Slurm SBATCH definitions

### your program goes here (hostname is an example, can be any program)
# `srun` runs `ntasks` instances of your programm `hostname`

srun hostname

After saving this example to a file ~/ you can run the Slurm job by submitting it to Slurm using sbatch :

sbatch ~/

The previous example uses the zsh shell, which is the only officially supported shell at the RWTH HPC Claix Cluster.

​ Zusatzinformation

Basic Slurm doumentation on


zuletzt geändert am 23.02.2024

Wie hat Ihnen dieser Inhalt geholfen?

Creative Commons Lizenzvertrag
Dieses Werk ist lizenziert unter einer Creative Commons Namensnennung - Weitergabe unter gleichen Bedingungen 3.0 Deutschland Lizenz