meta data for this page
  •  

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
general:computerenvironment:slurm [2021/10/26 07:45] – [Creating a script file] felixgeneral:computerenvironment:slurm [2023/10/16 12:04] (current) – [sview] ingo
Line 18: Line 18:
 The script file tells SLURM what should be done. The example below serves as a general guideline. Please do not simply copy it, but instead try to understand what information is provided to SLURM, and then modify the information to match your requirements. This applies, in particular, to the options ''–cpu-per-task'' and ''–mem-per-cpu''. If you set the values for these options too high, your job will either remain pending until the requested resources are free on the cluster, or alternatively, your job will run and will then block the requested resources although they will not be used. The script file tells SLURM what should be done. The example below serves as a general guideline. Please do not simply copy it, but instead try to understand what information is provided to SLURM, and then modify the information to match your requirements. This applies, in particular, to the options ''–cpu-per-task'' and ''–mem-per-cpu''. If you set the values for these options too high, your job will either remain pending until the requested resources are free on the cluster, or alternatively, your job will run and will then block the requested resources although they will not be used.
  
-You can use any text editor like 'nano' to create a file, you can then paste the contents of the example file below into that file. Exchange the example command with the actual command you want to use.+
  
 ==== Example ==== ==== Example ====
  
-This example uses a simple seed file that provides input for the program calls, e.g. file names, parameter values and the like.+This example uses a simple seed file that provides input for the program calls, e.g. file names, parameter values and the like 
 + 
 +You can use any text editor like ''nano'' to create a file, you can then paste the contents of the example file below into that file. Exchange the example command with the actual command you want to use and don't forget to modify the CPU and memory requests.
  
 <code> <code>
Line 38: Line 40:
 ===== Job submission ===== ===== Job submission =====
  
-Use the command //[[https://slurm.schedmd.com/sbatch.html|sbatch]]// to submit the job to SLURM+Use the command //[[https://slurm.schedmd.com/sbatch.html|sbatch]]// to submit the job to SLURM. You simply use the path to the script you just created for this
  
 <code> <code>
-sbatch /path/to/script.slurm+sbatch /path/to/<slurm_script>.sh
 </code> </code>
  
-After your script was send to the cluster, SLURM will automatically create a file in the directory from which you issued the ''sbatch'' command. This file will contain all information that would be printed to the terminal when calling your command in the local terminal. +After your script was send to the cluster, SLURM will automatically create a file in the directory from which you issued the ''sbatch'' command. This file will contain all information that would be printed to the terminal when calling your command in the local terminal. This directory will also be used as the current directory for all relative paths in your slurm script. 
 + 
 +Your script will run using your current (Anaconda) environment meaning that you can use all programs which are in the environment from which you issue the ''sbatch'' command.
 ===== Job status ===== ===== Job status =====
  
Line 70: Line 74:
 sinfo sinfo
 </code> </code>
 +
 +===== More info of what is going on ===== 
 +To open a window with a whole array of informations about the cluster like current running jobs/partitions/reservations/available resources and more run
 +<code> sview</code>
 ===== Common mistakes ===== ===== Common mistakes =====
 This is a non-exhaustive list of issues and mistakes in the context of SLURM This is a non-exhaustive list of issues and mistakes in the context of SLURM