User Tools

Site Tools


1slurm

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
1slurm [2020/05/07 08:11] admin1slurm [2020/05/09 15:11] admin
Line 75: Line 75:
 </code> </code>
  
-=== Scripts (used with **sbatch**) ===+=== Scripts (used with sbatch) ===
  
-It is convenient to write the job script in a file not only because in this way the script can be reused, but also because it is also possible to set ''sbatch'' options directly inside the script as in the following example:+It is convenient to write the job script in a file not only because in this way the script can be reused, but also because it is also possible to set ''sbatch'' options directly inside the script as in the following example (that shows the content of the file sheepit.slurm):
 <code> <code>
 $ cat sheepit.slurm  $ cat sheepit.slurm 
Line 105: Line 105:
 </code> </code>
  
 +<note>
 +At the beginning of the file you can read the line ''#!/bin/bash'' that is not strictly necessary. It turns out that it's common practice to identify the slurm script as bash scripts so they can be executed also outside of the cluster. in this case the '#SBATCH' lines are interpreted as comments.
 +</note>
 Inside a script, all the line that starts with the '#' char are comment, but the lines that start with the '#SBATCH' string, are directives for the queuing system. Inside a script, all the line that starts with the '#' char are comment, but the lines that start with the '#SBATCH' string, are directives for the queuing system.
 The example above instruct the queuing system to: The example above instruct the queuing system to:
Line 116: Line 119:
   * ''#SBATCH --partition'' indicate the partition that must be used to run the program   * ''#SBATCH --partition'' indicate the partition that must be used to run the program
   * ''#SBATCH --gres=gpu:1'' this parameter inform the cluster that the program must be run only inside nodes that provides the "gpu" resource and that **1** of these resources is needed.   * ''#SBATCH --gres=gpu:1'' this parameter inform the cluster that the program must be run only inside nodes that provides the "gpu" resource and that **1** of these resources is needed.
-  * ''#SBATCH --constraint='' this directive indicate the the program must be run **only** on those nodes that provide this property+  * ''#SBATCH --constraint='' this directive indicate the the program must be run **only** on those nodes that provide this property. constraints can be combined using AND, OR or combinations (as in --constraint="intel&gpu" or --constraint="intel|amd"). it's better to refer to the {{https://slurm.schedmd.com/sbatch.html|sbatch manual}} to better understand the possibilities.
  
 At the moment we have defined these resources: At the moment we have defined these resources:
Line 136: Line 139:
  
 <note important> <note important>
-It is **mandatory** to specify at least the estimated run time of the job and the memory needed by so that the scheduler can optimize the machines usage and the overall cluster throughput. If your job will pass the limits you fixed, it will be automatically killed by the cluster manager.+It is **mandatory** to specify at least the estimated run time of the job and the memory neededso the scheduler can optimize the machines/cores/memory usage and the overall cluster throughput. If your job will pass the limits you fixed, it will be automatically killed by the cluster manager.
  
 Please keep in mind that longer jobs are less likely to enter the queue when the cluster load is high. Therefore, don't be lazy and do not always ask for //infinite// run time because your job will remain stuck in the queue. Please keep in mind that longer jobs are less likely to enter the queue when the cluster load is high. Therefore, don't be lazy and do not always ask for //infinite// run time because your job will remain stuck in the queue.
1slurm.txt · Last modified: 2020/06/26 10:38 by admin