Skip to main content
⚠ INFORMATION
This page was translated by an AI (LLM) with a cursory human check and is awaiting full review.

Running a sequential job in batch

Jobs are managed across all nodes by the Slurm software.

To submit a sequential job in batch on Jean Zay, you need to:

  1. Create a submission script:
seq.slurm
#!/bin/bash
#SBATCH --job-name=Seq # nom du job
#SBATCH --nodes=1 # nombre de noeuds
#SBATCH --ntasks-per-node=1 # nombre de taches MPI par noeud
#SBATCH --hint=nomultithread # réservation des cœurs physiques (pas d'hyperthreading)
#SBATCH --time=00:01:00 # temps d execution maximum demande (HH:MM:SS)
#SBATCH --output=Seq%j.out # nom du fichier de sortie (%j est remplacé par le numéro du travail)
#SBATCH --error=Seq%j.out # nom du fichier d'erreur (ici en commun avec la sortie)

# on se place dans le repertoire de soumission
cd ${SLURM_SUBMIT_DIR}

# nettoyage des modules charges en interactif et herites par defaut
module purge

# chargement des modules
module load ...

# echo des commandes lancees
set -x

# execution
./seq.exe
  1. Submit this script using the sbatch command:
sbatch mon_script.slurm

Notes:

  • We recommend compiling and running your code in the same software environment by loading the same modules.
  • The --hint=nomultithread option ensures the reservation of physical cores (no hyperthreading).
  • The memory allocated for the job is proportional to the number of CPU cores requested. For example, if you request 1/4 of the physical CPU cores of a node, you will have access to 1/4 of its RAM memory. It is important to be consistent with the configuration of the nodes used to avoid overcharging of hours while benefiting from the memory you are entitled to. You can consult our documentation on this subject: Memory allocation with Slurm.
  • In these examples, it is assumed that the executable or Python script used is located in the submission directory, i.e., the directory in which you are located when using the sbatch command: the $SLURM_SUBMIT_DIR variable is automatically set by Slurm.
  • The output file of the calculation will also be located in the submission directory. It is created at the beginning of the job execution; editing or modifying it during the job execution may disrupt it.
  • The module purge is made necessary by Slurm's default behaviour: the modules you have loaded in your environment at the time you run sbatch are taken into account in the submitted job.
  • All jobs have resources defined by a partition and a "Quality of Service" QoS set by default in Slurm. You can modify these limits by specifying a partition and/or a QoS as indicated in our documentation detailing the partitions and QoS for CPU and GPU.
  • For multi-project accounts and those with CPU and GPU hours, it is essential to specify the hour allocation on which to deduct the computing hours of the job as indicated in our documentation detailing the management of computing hours to ensure that the hours consumed by your jobs are deducted from the correct allocation.

Your opinion matters!

To give your feedback, report an error, or suggest an improvement, click here:

quick anonymous questionnaire

This questionnaire is temporary and will take less than a minute, so take the opportunity!