Scheduler Overview (Slurm): Difference between revisions

From HPCwiki
Jump to navigation Jump to search
No edit summary
Phase 1 § 4 P1.4.1: trim to overview only — content split into Partitions / Queues, Choosing a node (constraints), Batch Jobs, Interactive Jobs, Cancelling Jobs, Monitoring Jobs (separate pages). This page is now the entry point with QoS overview and topic index. (via update-page on MediaWiki MCP Server)
 
(100 intermediate revisions by 9 users not shown)
Line 1: Line 1:
=== submitting jobs: sbatch ===
The resource allocation and scheduling software on Anunna is [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management SLURM]: '''S'''imple '''L'''inux '''U'''tility for '''R'''esource '''M'''anagement. This page is the entry point — most topics have their own page; below is a short summary plus links.


Consider this simple python3 script that should calculate Pi up to 1 million digits:
== What's on which page ==
<source lang='python'>
from decimal import *
D=Decimal
getcontext().prec=10000000
p=sum(D(1)/16**k*(D(4)/(8*k+1)-D(2)/(8*k+4)-D(1)/(8*k+5)-D(1)/(8*k+6))for k in range(411))
print(str(p)[:10000002])
</source>


In order for this script to run, the first thing that is needed is that Python3, which is not the default Python version on the cluster, is load into your environment. Availability of (different versions of) software can be checked by the following command:
* [[Partitions / Queues]] — list of partitions (<code>main</code>, <code>gpu</code>, <code>gpu_amd</code>) and how to choose one.
  module avail
* [[Choosing a node (constraints)]] — defaults, hardware constraints, GPU selection.
* [[Batch Jobs]] — writing sbatch scripts and submitting them, including multi-job submissions and dependencies.
* [[Interactive Jobs]] — <code>sinteractive</code> and <code>salloc</code> for live shell sessions on a compute node.
* [[Array jobs]] — running the same script many times with a varying parameter.
* [[Monitoring Jobs]] — <code>squeue</code>, <code>scontrol</code>, <code>sstat</code>, <code>sacct</code>, <code>node_usage_graph</code>.
* [[Cancelling Jobs]] — <code>scancel</code>.
* [[Reservations]] — booking nodes in advance for events.


In the list you should note that python3 is indeed available to be loaded, which then can be loaded with the following command:
== Quality of Service ==
  module load python/3.3.3


The following shell/slurm script can then be used to schedule the job using the sbatch command:
When submitting a job, you may optionally assign a different Quality of Service (QoS) to it:
<source lang='bash'>
#!/bin/bash
# #SBATCH --time=100
#SBATCH --ntasks=1
#SBATCH --output=output_%j.txt
#SBATCH --error=error_output_%j.txt
#SBATCH --job-name=calc_pi.py
#SBATCH --partition=research


time python3 calc_pi.py
<syntaxhighlight lang="bash">
</source>
#SBATCH --qos=std
</syntaxhighlight>


The script, assuming it was named 'run_calc_pi.sh', can then be posted using the following command:
The QoS values configured on Anunna:


<source lang='bash'>
* '''std''' (priority 10) — the default. Use this unless you have a specific reason to pick another.
sbatch run_calc_pi.sh
* '''low''' (priority 1) — reduced priority, but limited to 8 hours per job so a flood of low-priority jobs cannot lock up the cluster.
</source>
* '''high''' (priority 20) — higher priority than <code>std</code>. More expensive — see [[Tariffs]].
* '''interactive''' (priority 100) — the highest priority, exclusively for immediate-running interactive jobs. You may not submit many or large jobs at this QoS.


=== monitoring submitted jobs: squeue ===
Jobs can in principle be restarted and rescheduled if a higher-priority job needs cluster resources, but at the time of writing this preemption is not actually configured.
Once a job is submitted, the status can be monitored using the 'squeue' command:
  squeue


You should then get a list of jobs that are running at that time on the cluster, for the example on how to submit using the 'sbatch' command, it may look like so:
== Running MPI jobs ==
  JOBID PARTITION    NAME    USER  ST      TIME  NODES NODELIST(REASON)
  3347  research calc_pi. megen002  R      0:03      1 node049


=== removing jobs from a list: scancel ===
For multi-node MPI workloads see [[MPI on B4F cluster | MPI on Anunna]].
If for some reason you want to delete a job that is either in the queue or already running, you can remove it using the 'scancel' command. The 'scancel' command takes the jobid as a parameter. The  For the example above, this would be done using the following code:
<source lang='bash'>
scancel 3347
</source>


=== allocating resources interactively: sallocate ===
== See also ==


=== running MPI jobs on B4F cluster ===
* [[Partitions / Queues]]
* [[Choosing a node (constraints)]]
* [[Batch Jobs]]
* [[Interactive Jobs]]
* [[Array jobs]]
* [[Monitoring Jobs]]
* [[Cancelling Jobs]]
* [[Reservations]]
* [[Tariffs | Costs associated with resource usage]]


=== Understanding which resources are available to you: sinfo ===
== External links ==
By using the 'sinfo' command you can retrieve information on which 'Partitions' are available to you. A 'Partition' using SLURM is similar to the 'queue' when submitting using the Sun Grid Engine ('qsub'). The different Partitions grant different levels of resource allocation. Not all defined Partitions will be available to any given person. E.g., Master students will only have the Student Partition available, researchers at the ABGC will have 'student', 'research', and 'ABGC' partitions available. The higher the level of  resource allocation, though, the higher the cost per compute-hour. The default Partition is the 'student' partition. A full list of Partitions can be found from the Bright Cluster Manager webpage.


<source lang='bash'>
sinfo
</source>
  PARTITION AVAIL  TIMELIMIT  NODES  STATE NODELIST
  student*    up  infinite    12  down* node[043-048,055-060]
  student*    up  infinite    50  idle fat[001-002],node[001-042,049-054]
  research    up  infinite    12  down* node[043-048,055-060]
  research    up  infinite    50  idle fat[001-002],node[001-042,049-054]
  ABGC        up  infinite    12  down* node[043-048,055-060]
  ABGC        up  infinite    50  idle fat[001-002],node[001-042,049-054]
=== See also ===
=== External links ===
* [http://slurm.schedmd.com Slurm official documentation]
* [http://slurm.schedmd.com Slurm official documentation]
* [http://www.youtube.com/watch?v=axWffyrk3aY Slurm Tutorial on Youtube]
* [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management Slurm on Wikipedia]

Latest revision as of 09:48, 16 June 2026

The resource allocation and scheduling software on Anunna is SLURM: Simple Linux Utility for Resource Management. This page is the entry point — most topics have their own page; below is a short summary plus links.

What's on which page

Quality of Service

When submitting a job, you may optionally assign a different Quality of Service (QoS) to it:

#SBATCH --qos=std

The QoS values configured on Anunna:

  • std (priority 10) — the default. Use this unless you have a specific reason to pick another.
  • low (priority 1) — reduced priority, but limited to 8 hours per job so a flood of low-priority jobs cannot lock up the cluster.
  • high (priority 20) — higher priority than std. More expensive — see Tariffs.
  • interactive (priority 100) — the highest priority, exclusively for immediate-running interactive jobs. You may not submit many or large jobs at this QoS.

Jobs can in principle be restarted and rescheduled if a higher-priority job needs cluster resources, but at the time of writing this preemption is not actually configured.

Running MPI jobs

For multi-node MPI workloads see MPI on Anunna.

See also