Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
infra:howto:slurm_sample [2025/02/27 12:54] – created remiinfra:howto:slurm_sample [2025/05/16 11:55] (current) – [Example using GPUs] remi
Line 1: Line 1:
 ====== How-to create a simple SLURM job ====== ====== How-to create a simple SLURM job ======
  
-Now that you have your container ready in the Apptainer file format : for example application.sif+**Make sure you already have an Apptainer container ready to use at this stage**
  
-To run your job via SLURM you need to create a sbatch script : +You should have your container ready in the Apptainer file format : for examples here, application.sif 
 + 
 +To run your job via SLURM, it is best to create a **sbatch script** 
  
 (Note: for now we don't have Modules or LMod installed, we might add it later : hence the module commands commented) (Note: for now we don't have Modules or LMod installed, we might add it later : hence the module commands commented)
Line 43: Line 45:
  
  
-==== Example using GPUs ====+==== Example using a full GPU ====
  
 <code> <code>
Line 101: Line 103:
 srun -G 1 --cpus-per-task=12 --time=3:00:00 --mem=24G --pty apptainer shell --nv /home/user.name/example_apptainer.sif srun -G 1 --cpus-per-task=12 --time=3:00:00 --mem=24G --pty apptainer shell --nv /home/user.name/example_apptainer.sif
 </code> </code>
 +
 +==== Example requesting a specific node ====
 +
 +**NOTE : This is to be avoided : SLURM already chooses the best node matching your requirements if you correctly wrote them in your sbatch : you might just wait in the job queue instead of running directly on another node**
 +
 +If for some specific reasons you want to request a specific node, you can add this parameter to your sbatch :
 +
 +<code>
 +#SBATCH --nodelist=disco                # nodes to use
 +</code>
 +
 +
 ==== Execute your batch file ==== ==== Execute your batch file ====
  
Back to top