Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

The job scripts have to have a shebang line at the top, followed by the #SBATCH options. These #SBATCH  comments have to be at the top, as Slurm stops scanning for them after the first non-comment non-whitespace line (e.g. an echo or variable declaration).

...

Important slurm commands

The commands normally used for job control and management are:

...

Erweitern
titleExample Job for the shared partition

This is an example for a job script using 10 cores. As this is not a MPI job, srun/mpirun is not needed. This jobs memory usage should not exceed

Mb

Codeblock
#!/bin/bash
#SBATCH -p large96:shared
#SBATCH -t 1-0 #one day
#SBATCH -n 10
#SBATCH -N 1

python postprocessing.py


Advanced Options

Slurm offers a lot of options for job allocation, process placement, job dependencies and arrays and much more. We cannot exhaustively cover all topics here. As mentioned at the top of the page, please consult the official documentation and the man pages for an in depth description of all parameters.

Job Arrays

If you need to submit a large number of similar jobs, please do use for loops to submet them, but instead use job arrays (this lessens the burden on the scheduler). Arrays can be defined using the -a <number of jobs> option. To divide your workload on to the different jobs within your jobscript, there are several environment variables that can be used:

Erweitern
SLURM_ARRAY_TASK_COUNTTotal number of tasks in a job array. SLURM_ARRAY_TASK_IDJob array ID (index) number. SLURM_ARRAY_TASK_MAXJob array's maximum ID (index) number. SLURM_ARRAY_TASK_MINJob array's minimum ID (index) number. SLURM_ARRAY_TASK_STEPJob array's index step size. SLURM_ARRAY_JOB_IDJob array's master job ID number.


Codeblock
#!/bin/bash
#SBATCH -p standard96
#SBATCH -t 12:00:00 #one day
#SBATCH -N 16
#SBATCH --tasks-per-node 96
#SBATCH -a 0-3
#SBATCH -o arrayjob-%A_%a #"%A" is replaced by the job ID and "%a" with the array index.

[...]


Job Dependencies