Difference between revisions of "Slurm"

From Cncz
Jump to: navigation, search
(Nieuwe pagina aangemaakt met '=== Slurm batch software === The science cluster is switching to slurm for batch management. At the moment the TCM and HEF nodes are all switched to slurm. The oth...')
 
Line 3: Line 3:
 
The science cluster is switching to slurm for batch management. At the moment the TCM and HEF nodes are all switched to slurm.
 
The science cluster is switching to slurm for batch management. At the moment the TCM and HEF nodes are all switched to slurm.
 
The other nodes will follow.  
 
The other nodes will follow.  
 +
 +
==== Partitions ====
 +
 +
Jobs always run within a **partition**. There are currently two partitions. One for the TCM group, called tcm and one for the HEF group, called hef.
 +
There is no default partition so you always have to provide the partition as an option either on the commandline -p partitionname or in the shell script
 +
by including a line
 +
 +
  #SBATCH -p partitionname
  
 
   
 
   
Line 14: Line 22:
  
 
   #! /bin/bash
 
   #! /bin/bash
 +
  #SBATCH -p tcm
 
   echo "Hello world!"
 
   echo "Hello world!"
  
Line 33: Line 42:
 
   $ sbatch hello.sh
 
   $ sbatch hello.sh
  
The scheduler will put your job in the default job //partition// and respond by giving you the //job number// (10 in this example).
+
The scheduler will put your job in the named job //partition// and respond by giving you the //job number// (10 in this example).
  
 
   Submitted batch job 10
 
   Submitted batch job 10

Revision as of 15:08, 6 October 2015

Slurm batch software

The science cluster is switching to slurm for batch management. At the moment the TCM and HEF nodes are all switched to slurm. The other nodes will follow.

Partitions

Jobs always run within a **partition**. There are currently two partitions. One for the TCM group, called tcm and one for the HEF group, called hef. There is no default partition so you always have to provide the partition as an option either on the commandline -p partitionname or in the shell script by including a line

 #SBATCH -p partitionname


Submitting your first job

To execute your job on the cluster you need to write it in the form of a shell script (don't worry this is easier than it sounds). A shell script in its most basic form is just a list of commands that you would otherwise write on the command line. The first line of the script should contain an instruction telling the system which type of shell is supposed to execute it. Unless you really need something else you should always use bash. So without further ado here is your first shell script.

 #! /bin/bash
 #SBATCH -p tcm 
 echo "Hello world!"

Type this into an editor (such as nano or vi) and save it as hello.sh. To execute this on the headnode give it executable permissions (not needed when submitting)

 $ chmod u+x hello.sh

and run it.

 $ ./hello.sh

It will print (//echo//) Hello world to the screen (also called //standard out// or stdout). If anything goes wrong an error message will be send to //standard error// or stderr which in this case is also the screen.

To execute this script as a //job// on one of the compute nodes we submit it to the cluster //scheduler//. This is done with the command sbatch.

 $ sbatch hello.sh

The scheduler will put your job in the named job //partition// and respond by giving you the //job number// (10 in this example).

 Submitted batch job 10

Your job will now wait until a slot on one of the compute nodes becomes available. Then it will be executed and the output is written to a file slurm-10.out in your home directory (unless you specify otherwise as explained later).