<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://biohpc.deib.polimi.it/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=GiulioFontana</id>
	<title>Mufasa (BioHPC) - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://biohpc.deib.polimi.it/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=GiulioFontana"/>
	<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=Special:Contributions/GiulioFontana"/>
	<updated>2026-05-09T11:38:47Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.2</generator>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=User_Jobs&amp;diff=2376</id>
		<title>User Jobs</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=User_Jobs&amp;diff=2376"/>
		<updated>2026-05-07T14:48:57Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* How to know if your shell is a SLURM job */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Running jobs with SLURM =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must&amp;#039;&amp;#039;&amp;#039; use SLURM to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM.&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa. This is a key difference between Mufasa 1.0 and [[System#Mufasa 2.0|Mufasa 2.0]].&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
SLURM provides two commands to run jobs, called [https://slurm.schedmd.com/srun.html srun] and [https://slurm.schedmd.com/sbatch.html sbatch]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun [options] &amp;lt;command_to_be_run_via_SLURM&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch [options] &amp;lt;command_to_be_run_via_SLURM&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; can be any Linux program (including shell scripts). By using &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;, the  command or script specified by &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; (including any programs launched by it) are added to SLURM&amp;#039;s execution queues.&lt;br /&gt;
&lt;br /&gt;
The main difference between &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; is that the first locks the shell from which it has been launched, so it is only really suitable for &amp;#039;&amp;#039;&amp;#039;interactive jobs&amp;#039;&amp;#039;&amp;#039;: i.e., processes that use the console to interact with their user during job execution. &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;, on the other side, does not lock the shell and simply adds the job to the queue, but does not allow the user to interact with the process while it is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; provides an additional possibility: &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; can in fact be an [[#Using execution scripts to run jobs|&amp;#039;&amp;#039;&amp;#039;execution script&amp;#039;&amp;#039;&amp;#039;]], i.e. a special (and SLURM-specific) type of Linux shell script that includes &amp;#039;&amp;#039;&amp;#039;SBATCH directives&amp;#039;&amp;#039;&amp;#039;. SBATCH directives can be used to specify the values of some of the parameters that would otherwise have to be set using the &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; part of the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command. This is handy because it allows to write down the parameters in an execution script instead of having to write them in the command line while launching a job, which greatly reduces the possibility of mistakes. Also, an execution script is easy to keep and reuse.&lt;br /&gt;
&lt;br /&gt;
Immediately after a &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command is launched by a user, SLURM outputs a message informing the user that the job has been queued. The output is similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun: job 10849 queued and waiting for resources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The shell is now locked while SLURM prepares the execution of the user program ([[#Detaching from a running job with screen|if you are using &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; you can detach from that shell and come back later]]). &lt;br /&gt;
&lt;br /&gt;
When SLURM is ready to run the program, it prints a message similar to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun: job 10849 has been allocated resources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and then executes the program.&lt;br /&gt;
&lt;br /&gt;
=== Options of &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; part of &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; commands is used to tell SLURM what resources the job needs to be executed the job and how much time it will need to complete its execution.&lt;br /&gt;
&lt;br /&gt;
For what concerns resources, the most important option is &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt;, specifying which SLURM [[#SLURM Quality of Service (QOS)|SLURM QOS]] the job will use. A job run with a given QOS has access to all and only the resources available to that QOS. As a consequence, all options that define how many resources to assign the job will only be able to provide the job with resources that are available to the chosen QOS. Jobs that require resources that are not available to the chosen QOS do not get executed. &lt;br /&gt;
&lt;br /&gt;
If the user forgets to use option &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt;, the job is run on the &amp;#039;&amp;#039;default qos&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt;) which has access to &amp;#039;&amp;#039;zero&amp;#039;&amp;#039; resources. Therefore it is always necessary to specify option &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt; when launching a SLURM job on Mufasa.&lt;br /&gt;
&lt;br /&gt;
More generally, the most relevant among the &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; are:&lt;br /&gt;
&lt;br /&gt;
:;‑-qos=&amp;lt;qos__name&amp;gt;&lt;br /&gt;
:: specifies the [[SLURM#SLURM Quality of Service (QOS)|SLURM QOS]] that the job will use. It is mandatory to specify one.&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! The chosen QOS limits the resources that can be requested, since it is not allowed to request resources (type or quantity) that exceed what is available to the chosen QOS.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! If &amp;lt;code&amp;gt;‑‑qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt; is used and options that specify how many resources to assign to the job (such as &amp;lt;code&amp;gt;‑‑mem=&amp;lt;mem_resources&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;‑‑cpus‑per‑task=&amp;lt;cpu_amount&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;‑‑time=&amp;lt;duration&amp;gt;&amp;lt;/code&amp;gt;) are omitted, the job is assigned the default amount of the resource (as defined by the chosen QOS. A notable exception concerns option &amp;lt;code&amp;gt;‑‑gres=&amp;lt;gpu_resources&amp;gt;&amp;lt;/code&amp;gt;, which is always required (see below) if the job uses a QOS with access to GPUs.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; --job-name=&amp;lt;jobname&amp;gt;&lt;br /&gt;
:: Specifies a name for the job. The specified name will appear along with the JOBID number when querying running jobs on the system with &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;. The default job name (i.e., the one assigned to the job when &amp;lt;code&amp;gt;--job-name&amp;lt;/code&amp;gt; is not used) is the executable program&amp;#039;s name.&lt;br /&gt;
&lt;br /&gt;
:;‑‑gres=&amp;lt;gpu_resources&amp;gt;&lt;br /&gt;
:: specifies what GPUs to assign to the job. &amp;lt;code&amp;gt;gpu_resources&amp;lt;/code&amp;gt; is a comma-delimited list where each element has the form &amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;amount&amp;gt;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;&amp;lt;Type&amp;gt;&amp;lt;/code&amp;gt; is one of the types of GPU available on Mufasa (see [[SLURM#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) and &amp;lt;code&amp;gt;&amp;lt;amount&amp;gt;&amp;lt;/code&amp;gt; is an integer between 1 and the number of GPUs of such type available to the partition. For instance, &amp;lt;code&amp;gt;&amp;lt;gpu_resources&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;gpu:40gb:1,gpu:3g.20gb:1&amp;lt;/code&amp;gt;, corresponding to asking for one &amp;quot;full&amp;quot; GPU and 1 &amp;quot;small&amp;quot; GPU.&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! The &amp;lt;code&amp;gt;‑‑gres&amp;lt;/code&amp;gt; parameter is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039; if the job is run with a QOS that allows access to the system&amp;#039;s GPUs. Differently from other resources (where unspecified requests lead to the assignment of a default amount), GPUs must always be explicitly requested.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:;‑‑mem=&amp;lt;mem_resources&amp;gt;&lt;br /&gt;
:: specifies the amount of RAM to assign to the job; for instance, &amp;lt;code&amp;gt;&amp;lt;mem_resources&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;200G&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:;‑‑cpus-per-task=&amp;lt;cpu_amount&amp;gt;&lt;br /&gt;
:: specifies how many CPUs to assign to the job; for instance, &amp;lt;code&amp;gt;&amp;lt;cpu_amount&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;nowiki&amp;gt;‑‑time=&amp;lt;duration&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:: specifies the maximum time allowed to the job to complete, in the format &amp;lt;code&amp;gt;days-hours:minutes:seconds&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; is optional; for instance, &amp;lt;code&amp;gt;&amp;lt;d-hh:mm:ss&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;72:00:00&amp;lt;/code&amp;gt;. When the time expires, the job (if still running) gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
:;‑‑pty&lt;br /&gt;
:: specifies that the job will be interactive (this is necessary when &amp;lt;code&amp;gt;&amp;lt;command_to_run_within_container&amp;gt;&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;/bin/bash&amp;lt;/code&amp;gt;: see [[#Interactive jobs|Interactive jobs]])&lt;br /&gt;
&lt;br /&gt;
Note that GPU resources (if needed) must always be requested explicitly. For instance, in order to execute program &amp;lt;code&amp;gt;./my_program&amp;lt;/code&amp;gt; which needs one GPU of type &amp;lt;code&amp;gt;3g.20gb&amp;lt;/code&amp;gt; with QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; we can use the SLURM command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun --qos=gpulight --gres=gpu:3g.20gb:1 ./my_program&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interactive jobs ==&lt;br /&gt;
&lt;br /&gt;
An &amp;#039;&amp;#039;&amp;#039;interactive job&amp;#039;&amp;#039;&amp;#039; is a process that use the console to interact with their user during job execution. Such a process is manually run by the user from a &amp;#039;&amp;#039;bash shell&amp;#039;&amp;#039; (i.e. a terminal session) provided by SLURM. &lt;br /&gt;
&lt;br /&gt;
In order to ask SLURM to schedule the execution of a shell where the user can subsequently run the interactive job, it is necessary to use option &amp;lt;code&amp;gt;--pty&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instance, to ask SLURM to run a shell with QOS &amp;lt;code&amp;gt;nogpu&amp;lt;/code&amp;gt;, the user should use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun --qos=nogpu --pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By not specifying any other options, the user is telling SLURM that they want the shell spawned by SLURM to be provided with the default amount of resources associated to QOS &amp;lt;code&amp;gt;nogpu&amp;lt;/code&amp;gt;. More generally, any combination of the other [[#Options of srun and sbatch|options of srun]] can be used together with &amp;lt;code&amp;gt;--pty&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As every other job request to SLURM, the request to run a shell must be done from the [[System#Login server|login server]]. As soon as possible (i.e., as soon as the necessary resources are available) SLURM will open (in the same terminal that the user used to launch the &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command) a bash shell, where the user will be able to run their interactive programs. &lt;br /&gt;
&lt;br /&gt;
To the user, this corresponds to the fact that the shell they were using to interact with the login server changes into a shell opened &amp;#039;&amp;#039;directly on Mufasa&amp;#039;&amp;#039;. This corresponds to the command prompt changing from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;username&amp;gt;@mufasa2-login:~$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;username&amp;gt;@mufasa2:~$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another way to know if the current shell is the “base” shell or one run via SLURM is to execute command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
echo $SLURM_JOB_ID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no number gets printed, this means that the shell is the “base” one. If a number is printed, it is the SLURM job ID of the /bin/bash process.&lt;br /&gt;
&lt;br /&gt;
When the user does not need the SLURM-spawned shell anymore, they should close it with command (the same used for any other Linux shell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to make the resources reserved for the interactive shell free again.&lt;br /&gt;
&lt;br /&gt;
== Non-interactive jobs ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands are very complex, and it&amp;#039;s easy to forget some option or make mistakes while using them. For non-interactive jobs, there is a solution to this problem.&lt;br /&gt;
&lt;br /&gt;
When the user job is non-interactive, in fact, the &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command can be substituted with a much simpler &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command&amp;#039;&amp;#039;&amp;#039;. As [[#Running jobs with SLURM|already explained]], &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; can make use of an &amp;#039;&amp;#039;&amp;#039;execution script&amp;#039;&amp;#039;&amp;#039; to specify all the parts of the command to be run via SLURM. So the command becomes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch &amp;lt;execution_script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An execution script is a special type of Linux script that includes &amp;#039;&amp;#039;&amp;#039;SBATCH directives&amp;#039;&amp;#039;&amp;#039;. SBATCH directives are used to specify the values of the parameters that are otherwise set in the [options] part of an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Note on Linux shell scripts&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;A shell script is a text file that will be run by the bash shell. In order to be acceptable as a bash script, a text file must:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;have the “executable” flag set&amp;#039;&amp;#039; (see [[System#Changing file/directory ownership and permissions|here]] for details)&lt;br /&gt;
* &amp;#039;&amp;#039;have&amp;#039;&amp;#039; &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;as its very first line&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Usually, a Linux shell script is given a name ending in &amp;#039;&amp;#039;.sh,&amp;#039;&amp;#039; such as &amp;#039;&amp;#039;my_execution_script.sh&amp;#039;&amp;#039;, but this is not mandatory.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Within any shell script, lines preceded by &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; are comments (with the notable exception of the initial&amp;#039;&amp;#039; &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;line)&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Use of blank lines as spacers is allowed.&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An execution script is a Linux shell script composed of two parts:&lt;br /&gt;
&lt;br /&gt;
# a &amp;#039;&amp;#039;&amp;#039;preamble&amp;#039;&amp;#039;&amp;#039;,  composed of directives using which the user specifies the values to be given to parameters, each preceded by the keyword &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt;&lt;br /&gt;
# [optionally] one or more &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands&amp;#039;&amp;#039;&amp;#039; that launch jobs with SLURM using the parameter values specified in the preamble&lt;br /&gt;
&lt;br /&gt;
Below is an &amp;#039;&amp;#039;&amp;#039;execution script template&amp;#039;&amp;#039;&amp;#039; to be copied and pasted into your own execution script text file. &lt;br /&gt;
&lt;br /&gt;
The template includes all the options [[#Using SLURM to run a container|already described above]], plus a few additional useful ones (for instance, those that enable SLURM to send email messages to the user in correspondence to events in the lifecycle of their job). Information about all the possible options can be found in [SLURM&amp;#039;s own documentation].&lt;br /&gt;
&lt;br /&gt;
In the template below, &amp;#039;&amp;#039;&amp;#039;#SBATCH directives&amp;#039;&amp;#039;&amp;#039; are requests made to SLURM. Notice that, though #SBATCH directives have a leading &amp;quot;#&amp;quot;, that does &amp;#039;&amp;#039;not&amp;#039;&amp;#039; mean that they are comments: exactly as the &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; at the beginning of a shell script, while starting with &amp;quot;#&amp;quot;, is not a comment as well.&lt;br /&gt;
&lt;br /&gt;
Other lines in the script that begin with &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; not followed by SBATCH are comments.&lt;br /&gt;
&lt;br /&gt;
For what concerns directive that ask for a given amount of a resource (including time), if they are missing from the execution script (or commented out) the job will be assigned the default amount of the resource.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;!/bin/bash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------start of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-nodes=1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑ntasks=1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-partition=jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-qos=&amp;lt;qos_name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑gres=&amp;lt;gpu_resources&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑mem=&amp;lt;mem_resources&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑cpus-per-task=&amp;lt;cpu_amount&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑time=&amp;lt;d-hh:mm:ss&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑output=./&amp;lt;filename&amp;gt;-%j.out&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; the text file where the output of the job gets written (i.e., standard output gets redirected onto the file). &amp;quot;%j&amp;quot; is the current time.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑error=./&amp;lt;filename&amp;gt;-error-%j.out&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; the text file where any error messages generated by the job gets written (i.e., standard error gets redirected onto the file). &amp;quot;%j&amp;quot; is the current time.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH --job-name=&amp;lt;name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------end of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Executing jobs on Mufasa =&lt;br /&gt;
&lt;br /&gt;
== Key concept ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The key concept about executing jobs on Mufasa is that [[System#Containers|all computation on Mufasa must occur within containers]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A container is a “sandbox” containing the environment where the user&amp;#039;s application operates. Parts of Mufasa&amp;#039;s filesystem can be made visible (and writable, if the user has writing permission on them: e.g., the user&amp;#039;s &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory) to the environment of the container. This allows the containerized user application to read from, and write to, Mufasa&amp;#039;s filesystem: for instance, to read data and write results.&lt;br /&gt;
&lt;br /&gt;
The system used by Mufasa to create and execute containers is &amp;#039;&amp;#039;&amp;#039;[[System#Singularity|Singularity]]&amp;#039;&amp;#039;&amp;#039;. This wiki includes [[Singularity|directions]] on preparing containers with Singularity.&lt;br /&gt;
&lt;br /&gt;
The container where a user job runs must contain all the libraries needed by the job. In fact (for maintainability and safety reasons) &amp;#039;&amp;#039;&amp;#039;no software and no libraries are installed on Mufasa 2.0&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Interactive and non-interactive user jobs ==&lt;br /&gt;
&lt;br /&gt;
This section explains how to execute a user job contained in a container. It considers two types of user jobs, i.e.:&lt;br /&gt;
;: Interactive user jobs&lt;br /&gt;
::: as [[#Interactive jobs|already explained]], these are jobs that require interaction with the user while they are running, via a bash shell running within the container. The shell is used to receive commands from the user and/or print output messages. For interactive user jobs, the job is usually launched manually by the user (with a command issued via the shell) after the container is in execution.&lt;br /&gt;
&lt;br /&gt;
;: Non-interactive user jobs&lt;br /&gt;
::: are the most common variety. The user prepares the container in such a way that, when in execution, the container autonomously puts the user&amp;#039;s jobs into execution. The user does not have any communication with the container while it is in execution. Executing the container and running the required programs within the container&amp;#039;s environment is done via [[#Interactive jobs|execution scripts]].&lt;br /&gt;
&lt;br /&gt;
== Using SLURM to run an interactive job on Mufasa ==&lt;br /&gt;
&lt;br /&gt;
The first step to run an interactive user job on Mufasa is to run the [[System#Containers|container]] where the job will take place. Each user is in charge of preparing the container(s) where the user&amp;#039;s jobs will be executed.&lt;br /&gt;
&lt;br /&gt;
In order to run a container via SLURM by hand, i.e. via an interactive shell, a user must first open the shell with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun [general_SLURM_options] ‑‑pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where [general_SLURM_options] are those [[#Options of srun and sbatch|already described above]].&lt;br /&gt;
&lt;br /&gt;
Then the user must run the container: this is done as follows.&lt;br /&gt;
&lt;br /&gt;
First, it is necessary to load the Singularity software module with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
module load amd/singularity&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(if needed, the list of software modules available in the system can be obtained with command &amp;lt;code&amp;gt;module av&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then, the user must use Singularity to run the container with command (see the [[Singularity|section about Singularity]] for further details)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity run &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which pulls the container from the specified repository and executes it. Possible values for &amp;lt;code&amp;gt;&amp;lt;repository&amp;gt;&amp;lt;/code&amp;gt; are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;docker&amp;lt;/code&amp;gt; (Docker Hub)&lt;br /&gt;
:: &amp;lt;code&amp;gt;library&amp;lt;/code&amp;gt; (Singularityhub)&lt;br /&gt;
:: &amp;lt;code&amp;gt;path/to/container&amp;lt;/code&amp;gt; if the container is local, i.e. located in the filesystem of Mufasa&lt;br /&gt;
&lt;br /&gt;
As soon as the container is in execution, the terminal window used, so far, to interact with Mufasa becomes a shell &amp;#039;&amp;#039;in the container&amp;#039;&amp;#039;. This shell belongs to the software environment of the container, and the user can use it to interact with the container&amp;#039;s own software environment and filesystem. &lt;br /&gt;
&lt;br /&gt;
It is easy to understand if a shell is open to Mufasa or to the container because in a container shell the system prompt becomes &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interaction between container filesystem and local filesystem === &lt;br /&gt;
&lt;br /&gt;
The filesystem inside the container and the local one, i.e. Mufasa&amp;#039;s, can interact. This means that the container can access the local filesystem to read and/or write files. However, the only parts of Mufasa&amp;#039;s filesystem that can be accessed by the container are those that the user running the container has access rights to.&lt;br /&gt;
&lt;br /&gt;
As a default, the user&amp;#039;s &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; directory on Mufasa is automatically mapped onto &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; into the filesystem of the container. Whatever is done to that container directory, the changes are actually applied to the local &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; directory on Mufasa. &lt;br /&gt;
&lt;br /&gt;
The mapping of the home directory does not need to be explicitly requested. However, if the user needs (in addition to the home directory) other parts of the local filesystem of Mufasa to be mapped onto the container&amp;#039;s filesystem, this is possible by using this modified version of the &amp;lt;code&amp;gt;singularity run&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity run --bind &amp;lt;/path/to/local/directory&amp;gt;:&amp;lt;path/to/container/directory&amp;gt; &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;&amp;lt;path/to/container/directory&amp;gt;&amp;lt;/code&amp;gt; does not exist in the container&amp;#039;s filesystem, it gets created by Singularity.&lt;br /&gt;
&lt;br /&gt;
=== How to know if your shell is a SLURM job ===&lt;br /&gt;
To know if the shell you are using is being run via SLURM or not (becoming confused is easy...), use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
echo $SLURM_JOB_ID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it provides an output, your shell is a SLURM job and the output is the ID of the job. &lt;br /&gt;
&lt;br /&gt;
If it doesn&amp;#039;t provide any output, your shell is not a SLURM job.&lt;br /&gt;
&lt;br /&gt;
== Using SLURM to run a non-interactive job on Mufasa ==&lt;br /&gt;
&lt;br /&gt;
When the user job to be executed into a container is non-interactive, the mechanism based on an &amp;#039;&amp;#039;execution script&amp;#039;&amp;#039; already described in [[#Non-interactive jobs|Non-interactive jobs]] is employed. The command to run the script which in turn will run the container where the user job takes place is therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch &amp;lt;execution_script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The general features of a SLURM execution script and the SBATCH directives used for generic jobs have [[#Non-interactive jobs|already been described]]. Here we focus, therefore, on the SBATCH directives specifically used when SLURM is used to run a non-interactive job within a container.&lt;br /&gt;
&lt;br /&gt;
Below is an &amp;#039;&amp;#039;&amp;#039;execution script template&amp;#039;&amp;#039;&amp;#039; to be copied and pasted into your own execution script text file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;!/bin/bash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------start of preamble----------------&lt;br /&gt;
&lt;br /&gt;
[[#Non-interactive jobs|#SBATCH directives already described above]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------end of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;module load amd/singularity&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;singularity run &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt; &amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the last line of the script, &amp;lt;code&amp;gt;&amp;lt;command_to_run&amp;gt;&amp;lt;/code&amp;gt; is the command (e.g., the name of an executable script), complete with path within the container&amp;#039;s filesystem, of the program to be run into the container. Please refer to the [[Singularity|section about Singularity]] for details about its commands.&lt;br /&gt;
&lt;br /&gt;
The interactions between container filesystem and local filesystem in non-interactive jobs are exactly the same [[#Interaction between container filesystem and local filesystem|already described]] for interactive jobs. In particular, the user&amp;#039;s home directory is mapped by default onto the filesystem of the container.&lt;br /&gt;
&lt;br /&gt;
If, in addition to that, the user needs another part of the filesystem of Mufasa are to be mapped onto the container&amp;#039;s filesystem, this is possible using this modified version of the &amp;lt;code&amp;gt;singularity run&amp;lt;/code&amp;gt; command at the end of the script:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;singularity run --bind &amp;lt;/path/to/local/directory&amp;gt;:&amp;lt;path/to/container/directory&amp;gt; &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;&amp;lt;path/to/container/directory&amp;gt;&amp;lt;/code&amp;gt; does not exist in the container&amp;#039;s filesystem, it gets created by Singularity.&lt;br /&gt;
&lt;br /&gt;
== Job output ==&lt;br /&gt;
&lt;br /&gt;
The whole point of running a user job is to collect its output. Usually, such output takes the form of one or more files generated within the filesystem of Mufasa by the container where the computation takes place. &lt;br /&gt;
&lt;br /&gt;
As [[#Using SLURM to run a container|explained below]], SLURM includes a mechanism to mount a part of Mufasa&amp;#039;s own filesystem onto the container&amp;#039;s filesystem: so when the job running within the container writes to this mounted part, it actually writes to Mufasa&amp;#039;s filesystem. This means that when the container ends its execution, its output files persist in Mufasa&amp;#039;s filesystem (usually in a subdirectory of the user&amp;#039;s own &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory) and can be retrieved by the user at a later time.&lt;br /&gt;
&lt;br /&gt;
The same mechanism can be used to allow user jobs running into a container to read their input data from Mufasa&amp;#039;s filesystem (usually a subdirectory of the user&amp;#039;s own &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory).&lt;br /&gt;
&lt;br /&gt;
== Cancelling completed jobs ==&lt;br /&gt;
&lt;br /&gt;
When a user process run via SLURM has completed its execution and is not needed anymore, it is important to [[User_Jobs#Canceling_a_job_with_scancel|close it with scancel]]. Especially if much time remains to the end of the execution time requested by the job.&lt;br /&gt;
&lt;br /&gt;
Cancelling a SLURM job makes the resources reserved by SLURM free again for other users, and thus speeds up the execution of the jobs still queued.&lt;br /&gt;
&lt;br /&gt;
Typically, one doesn&amp;#039;t know how long a piece of code will take to complete its work. So please make sure to check from time to time if that happened, and -if there&amp;#039;s still time before the duration of your SLURM job ends- just &amp;#039;&amp;#039;scancel&amp;#039;&amp;#039; the job. Other users will be grateful :-)&lt;br /&gt;
&lt;br /&gt;
Please note that [[System#Job priority|job priority]] for your user depends (also) on the overall duration of the jobs that you ran on Mufasa. Therefore, &amp;#039;&amp;#039;&amp;#039;cancelling jobs that are not needed anymore improves your future jobs&amp;#039; priority&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
= Detaching from a running job with &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
A consequence of the way &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; operates is that if you launch an [[#Interactive and non-interactive user jobs|interactive user job]], the shell where the command is running must remain open: if it closes, the job terminates. That shell runs in the terminal of your own PC where the [[System#Accessing Mufasa|SSH connection to Mufasa]] exists.&lt;br /&gt;
&lt;br /&gt;
If you do not plan to keep the SSH connection to Mufasa open (for instance because you have to turn off or suspend your PC), there is a way to keep your interactive job alive. Namely, you should use command &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; inside a &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (often simply called &amp;quot;a screen&amp;quot;), then &amp;#039;&amp;#039;detach&amp;#039;&amp;#039; from the &amp;#039;&amp;#039;screen&amp;#039;&amp;#039; ([https://linuxize.com/post/how-to-use-linux-screen/ here] is one of many tutorials about &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; available online). &lt;br /&gt;
&lt;br /&gt;
Once you have detached from the screen session, you can close the SSH connection to Mufasa without damage. When you need to reach your (still running) job again, you can can open a new SSH connection to Mufasa and then &amp;#039;&amp;#039;reattach&amp;#039;&amp;#039; to the &amp;#039;&amp;#039;screen&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A use case for screen is writing your program in such a way that it prints progress advancement messages as it goes on with its work. Then, you can check its advancement by periodically reconnecting to the screen where the program is running and reading the messages it printed.&lt;br /&gt;
&lt;br /&gt;
Basic usage of &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; is explained below.&lt;br /&gt;
&lt;br /&gt;
== Creating a screen session, running a job in it, detaching from it ==&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]] with SSH&lt;br /&gt;
# From the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
# In the &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (&amp;quot;screen&amp;quot;) thus created (it has the look of an empty shell), launch your job with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;#039;&amp;#039;Detach&amp;#039;&amp;#039; from the screen by pressing &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;: you will come back to the original login server shell, while your process will go on running in the screen&lt;br /&gt;
# You can now close the SSH connection to the login server without damaging your running job&lt;br /&gt;
&lt;br /&gt;
== Reattaching to an active screen session ==&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]] with SSH&lt;br /&gt;
# In the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You are now back to the screen where you launched your job&lt;br /&gt;
&lt;br /&gt;
== Closing (i.e. destroying) a screen session ==&lt;br /&gt;
&lt;br /&gt;
When you do not need a screen session anymore:&lt;br /&gt;
&lt;br /&gt;
# reattach to the active screen session as explained [[#Reattaching to an active screen session|above]]&lt;br /&gt;
# destroy the screen by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash), then confirming that you really want to proceed&lt;br /&gt;
&lt;br /&gt;
Of course, any program (including SLURM jobs) running within the screen gets terminated when the screen is destroyed.&lt;br /&gt;
&lt;br /&gt;
= Using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; to reserve resources =&lt;br /&gt;
&lt;br /&gt;
== What is &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
[https://slurm.schedmd.com/salloc.html &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;] is a SLURM command that allows a user to reserve a set of resources (e.g., a 40 GB GPU) for a given time in the future.&lt;br /&gt;
&lt;br /&gt;
The typical use of &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; is to &amp;quot;book&amp;quot; an interactive session where the user enjoys &amp;#039;&amp;#039;&amp;#039;complete control of a set of resources&amp;#039;&amp;#039;&amp;#039;. The resources that are part of this set are chosen by the user. Within the &amp;quot;booked&amp;quot; session, any job run by the user that relies on the reserved resources is immediately put into execution by SLURM.&lt;br /&gt;
&lt;br /&gt;
More precisely:&lt;br /&gt;
* the user, using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, specifies what resources they need and the time when they will need them;&lt;br /&gt;
* when the delivery comes, SLURM creates an interactive shell session for the user;&lt;br /&gt;
* within such session, the user can use &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; to run programs, enjoying full (i.e. not shared with anyone else) and instantaneous access to the resources.&lt;br /&gt;
&lt;br /&gt;
Resource reservation using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; is only possible if the request is done in advance wrt the delivery time. The more the resources that the user wants to reserve are in high demand, the more anticipated the request should be to ensure that SLURM is able to fulfill it.&lt;br /&gt;
&lt;br /&gt;
When a user makes a request for resources with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, the request (called an &amp;#039;&amp;#039;&amp;#039;allocation&amp;#039;&amp;#039;&amp;#039;) gets added to the job queue of SLURM of the requisite partition as a job in &amp;lt;code&amp;gt;pending&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;) state (job states are described [[User_Jobs#Interpreting Job state as provided by squeue|here]]). Indeed, resource allocation is the first part of SLURM&amp;#039;s process of executing a user job, while the second part is running the program and letting it use the allocated resources. Using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; actually corresponds to having SLURM perform the first part of the process (resource allocation) while leaving the second part (running programs) to the user.&lt;br /&gt;
&lt;br /&gt;
Until the delivery time specified by the user comes, the allocation remains in state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;, and other jobs requesting the same resources, even if submitted later, are executed. While the request waits for the delivery time, however, it accumulates a priority that increases over time. The longer the allocation stays in the &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt; state, the stronger this accumulation of priority: so, by requesting resources with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;&amp;#039;well in advance of the delivery time&amp;#039;&amp;#039;&amp;#039;, users can ensure that the resources they need will be ready for them at the requested delivery time, even if these resources are highly contended.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; commands ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; commands use a similar syntax to &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands. In particular, &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; lets a user specify what resources they need and -importantly- a &amp;#039;&amp;#039;&amp;#039;delivery time&amp;#039;&amp;#039;&amp;#039; for the requested resources (delivery time can also be specified with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt;, but in that case it is not very useful). &lt;br /&gt;
&lt;br /&gt;
The typical &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command has this form:&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
salloc [general_SLURM_options] --begin=&amp;lt;time&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
:; [general_SLURM_options]&lt;br /&gt;
:: represents the options already described in [[#Options of srun and sbatch|Options of srun and sbatch]]&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;nowiki&amp;gt;--begin=&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:: specifies the delivery time of the resources reserved with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, according to the syntax described below. The delivery time must be a future time.&lt;br /&gt;
&lt;br /&gt;
=== Syntax of parameter &amp;lt;code&amp;gt;--begin&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
If the allocation is for the current day, you can specify &amp;lt;nowiki&amp;gt;&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt; as hours and minutes in the form&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;HH:MM&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to specify a time of a different day, the form for &amp;lt;time&amp;gt; is &amp;lt;code&amp;gt;YYYY-MM-DDTHH:MM&amp;lt;/code&amp;gt;, where the uppercase &amp;#039;T&amp;#039; separates date from time. &lt;br /&gt;
&lt;br /&gt;
It is also possible to specify &amp;lt;time&amp;gt; as relative to the current time, in one of the following forms:&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Kminutes&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Khours&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Kdays&amp;lt;/code&amp;gt;&lt;br /&gt;
where K is a (positive) integer.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=16:00&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=now+1hours&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=now+1days&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=2030-01-20T12:34:00&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that Mufasa&amp;#039;s time zone is GMT, so &amp;lt;nowiki&amp;gt;&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt; must be expressed in GMT as well. If you want to know Mufasa&amp;#039;s current time, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
date&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Thu Nov 10 16:43:30 UTC 2022&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In the typical scenario, the user of &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; will make use of [[User_Jobs#Detaching from a running job with screen|screen]]. Command &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; creates a shell session (called &amp;quot;a screen&amp;quot;) that it is possible to abandon without closing it ([[#Creating_a_screen_session.2C_running_a_job_in_it.2C_detaching_from_it|detaching from the screen]]). It is then possible to reach again the screen at a later time ([[#Reattaching_to_an_active_screen_session|reattaching to the screen]]). This means that a user can create a screen, run &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; within it to create an allocation for time X, detach from the screen and reattach to it just before time X to use the reserved resources from the interactive session created by &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
More precisely, the operations needed to do this are the following:&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]].&lt;br /&gt;
# From the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
# In the &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (&amp;quot;screen&amp;quot;) thus created run the [[#salloc commands|&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command]], specifying via its options the resources you need and the time at which you want them delivered.&lt;br /&gt;
# SLURM will respond with a message similar to &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;salloc: Pending job allocation XXXX&amp;lt;/pre&amp;gt;&lt;br /&gt;
# &amp;#039;&amp;#039;Detach&amp;#039;&amp;#039; from the screen by pressing &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;: you will come back to the original login server shell.&lt;br /&gt;
# You can now close the SSH connection to the login server without damaging your resource allocation request.&lt;br /&gt;
# At the delivery time you specified in the [[#salloc commands|&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command]], connect to the login server with SSH.&lt;br /&gt;
# Once you are in the login server shell, reattach to the screen with command &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You are now back to the screen where you used &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;; as soon as SLURM provides to you with the resources you reserved, message &amp;quot;&amp;#039;&amp;#039;salloc: Pending job allocation XXXX&amp;#039;&amp;#039;&amp;quot; changes to the shell prompt.&lt;br /&gt;
# You are now in the interactive shell session you booked with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;. From here, you can run any programs you want, including &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;. For the whole duration of the allocation, your programs have unrestricted use of all the resources you reserved with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;Important!&amp;#039;&amp;#039;&amp;#039; Any job run within the shell session is subject to the time limit (i.e., maximum duration) imposed by the partition it is running on! Therefore, if the job reaches the time limit, it gets &amp;#039;&amp;#039;&amp;#039;forcibly terminated&amp;#039;&amp;#039;&amp;#039; by SLURM. Termination depends exclusively from the time limit: so it occurs even if the end time for the allocation has not been reached yet. (Of course, the job also gets terminated if the allocation ends.)&lt;br /&gt;
# Once the interactive shell session is not needed anymore, cancel it by exiting from the session with &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;exit&amp;lt;/pre&amp;gt; (Note that if you get to the end of the time period you specified in your request without closing the shell session, SLURM does it for you, killing any programs still running.)&lt;br /&gt;
# You are now back to your screen. Destroy it by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash) to get back to the login server shell.&lt;br /&gt;
&lt;br /&gt;
== Cancelling a resource request made with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
To cancel a request for resources made as explained in [[#How to use salloc|How to use &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;]], follow these steps:&lt;br /&gt;
&lt;br /&gt;
# Connect to the the [[System#Login server|login server]] with SSH.&lt;br /&gt;
# Once you are in the login server shell, reattach to the screen where you used command &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; with command &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You should see the message &amp;quot;&amp;#039;&amp;#039;salloc: Pending job allocation XXXX&amp;#039;&amp;#039;&amp;quot; (if the allocation is still pending) or &amp;quot;&amp;quot;&amp;#039;&amp;#039;salloc: job XXXX queued and waiting for resources&amp;#039;&amp;#039;&amp;quot; (if the allocation is done and waiting for its start time). Now just press &amp;#039;&amp;#039;&amp;#039;Ctrl + C&amp;#039;&amp;#039;&amp;#039;. This communicates to SLURM your intention to cancel your request for resources.&lt;br /&gt;
# SLURM will communicate the cancellation with message &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;salloc: Job allocation XXXX has been revoked.&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Destroy the screen by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash) to get back to the login server shell.&lt;br /&gt;
&lt;br /&gt;
= Monitoring and managing jobs =&lt;br /&gt;
&lt;br /&gt;
SLURM provides Job Users with tools to inspect and manage jobs. While a [[Roles|Job User]] is able to see all users&amp;#039; jobs, they are only allowed to interact with their own.&lt;br /&gt;
&lt;br /&gt;
The main commands used to interact with jobs are &amp;#039;&amp;#039;&amp;#039;[https://slurm.schedmd.com/squeue.html &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]&amp;#039;&amp;#039;&amp;#039; to inspect the scheduling queues and &amp;#039;&amp;#039;&amp;#039;[https://slurm.schedmd.com/scancel.html &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;]&amp;#039;&amp;#039;&amp;#039; to terminate queued or running jobs.&lt;br /&gt;
&lt;br /&gt;
== Inspecting jobs with &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Running command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
  520       fat     bash acasella  R 2-04:10:25      1 gn01&lt;br /&gt;
  523       fat     bash amarzull  R    1:30:35      1 gn01&lt;br /&gt;
  522       gpu     bash    clena  R   20:51:16      1 gn01&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This output comprises the following information:&lt;br /&gt;
&lt;br /&gt;
:; JOBID&lt;br /&gt;
:: Numerical identifier of the job assigned by SLURM&lt;br /&gt;
:: This identifier is used to intervene on the job, for instance with &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: the partition that the job is run on&lt;br /&gt;
&lt;br /&gt;
:; NAME&lt;br /&gt;
:: the name assigned to the job; can be personalised using the &amp;lt;code&amp;gt;--job-name&amp;lt;/code&amp;gt; option&lt;br /&gt;
&lt;br /&gt;
:; USER&lt;br /&gt;
:: username of the user who launched the job&lt;br /&gt;
	&lt;br /&gt;
:; ST&lt;br /&gt;
:: job state (see [[SLURM#Job state|Job state]] for further information)&lt;br /&gt;
&lt;br /&gt;
:; TIME&lt;br /&gt;
:: time that has passed since the beginning of job execution&lt;br /&gt;
&lt;br /&gt;
:; NODES&lt;br /&gt;
:: number of nodes where the job is being executed (for Mufasa, this is always 1 as it is a single machine)&lt;br /&gt;
&lt;br /&gt;
:; NODELIST (REASON)&lt;br /&gt;
:: name of the nodes where the job is being executed: for Mufasa it is always &amp;lt;code&amp;gt;gn01&amp;lt;/code&amp;gt;, which is the name of the node corresponding to Mufasa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To limit the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; to the jobs owned by user &amp;lt;code&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/code&amp;gt;, it can be used like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue -u &amp;lt;username&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Job state as provided by &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Jobs typically pass through several states in the course of their execution. Job state is shown in column &amp;quot;ST&amp;quot; of the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; as an abbreviated code (e.g., &amp;quot;R&amp;quot; for RUNNING).&lt;br /&gt;
&lt;br /&gt;
The most relevant codes and states are the following:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; PENDING&lt;br /&gt;
:: Job is awaiting resource allocation. &lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; RUNNING&lt;br /&gt;
:: Job currently has an allocation.&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; SUSPENDED&lt;br /&gt;
:: Job has an allocation, but execution has been suspended and CPUs have been released for other jobs. &lt;br /&gt;
 &lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;CG&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; COMPLETING&lt;br /&gt;
:: Job is in the process of completing. Some processes on some nodes may still be active. &lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;CD&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; COMPLETED&lt;br /&gt;
:: Job has terminated all processes on all nodes with an exit code of zero. &lt;br /&gt;
&lt;br /&gt;
Beyond these, there are other (less frequent) job states. [https://slurm.schedmd.com/squeue.html The SLURM doc page for &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;] provides a complete list of them.&lt;br /&gt;
&lt;br /&gt;
== Knowing when jobs are expected to end or start ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in understanding when jobs are expected to start or end, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue -o &amp;quot;%5i %8u %10P %.2t |%19S |%.11L|&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output is similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID USER     PARTITION  ST |START_TIME          |  TIME_LEFT|&lt;br /&gt;
5307  thuynh   fat        PD |2022-11-11T17:55:54 | 3-00:00:00|&lt;br /&gt;
5308  thuynh   fat        PD |2022-11-11T17:55:54 | 3-00:00:00|&lt;br /&gt;
5296  cziyang  fat         R |2022-11-08T16:58:03 | 1-00:48:14|&lt;br /&gt;
5306  thuynh   fat         R |2022-11-10T08:13:30 | 2-16:03:41|&lt;br /&gt;
5297  gnannini fat         R |2022-11-08T17:55:54 | 1-01:46:05|&lt;br /&gt;
5336  ssaitta  gpu         R |2022-11-10T08:13:00 |    6:03:11|&lt;br /&gt;
5358  dmilesi  gpulong     R |2022-11-10T15:11:32 | 2-23:01:43|&lt;br /&gt;
5338  cziyang  gpulong     R |2022-11-10T09:45:01 | 1-17:35:12|&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;:For running jobs (state &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt;):&lt;br /&gt;
::column &amp;quot;START_TIME&amp;quot; tells you when the job started its execution&lt;br /&gt;
::column &amp;quot;TIME_LEFT&amp;quot; tells you how much remains of the running time requested by the job&lt;br /&gt;
&lt;br /&gt;
;:For pending jobs (state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;):&lt;br /&gt;
::column &amp;quot;START_TIME&amp;quot; tells you when the job is expected to start its execution&lt;br /&gt;
::column &amp;quot;TIME_LEFT&amp;quot; tells you how much running time has been requested by the job&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Important!&amp;#039;&amp;#039;&amp;#039; Start and end times are forecasts based on the features of current jobs in the queues, and may change if running jobs end prematurely and/or if new jobs with higher priority are added to the queues. So these times should never be considered as certain.&lt;br /&gt;
&lt;br /&gt;
If you simply want to know when pending jobs (state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;) are expected to begin execution, use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue --start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which lists pending jobs in order of increasing START_TIME (the job on top is the one which will be run first). For each pending job the command provides an output similar to the example below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID PARTITION     NAME     USER ST          START_TIME  NODES SCHEDNODES           NODELIST(REASON)&lt;br /&gt;
 5090       fat training   thuynh PD 2022-10-27T09:28:01      1 (null)               (Resources)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting detailed information about a job ==&lt;br /&gt;
&lt;br /&gt;
If needed, complete information about a job (either pending or running) can be obtained using command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show job &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; is the number from the first column of the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;. The output of this command is similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JobId=65 JobName=test_script.sh&lt;br /&gt;
   UserId=gfontana(10003) GroupId=gfontana(10004) MCS_label=N/A&lt;br /&gt;
   Priority=14208 Nice=0 Account=admin QOS=nogpu&lt;br /&gt;
   JobState=RUNNING Reason=None Dependency=(null)&lt;br /&gt;
   Requeue=0 Restarts=0 BatchFlag=0 Reboot=0 ExitCode=0:0&lt;br /&gt;
   RunTime=00:00:55 TimeLimit=01:00:00 TimeMin=N/A&lt;br /&gt;
   SubmitTime=2025-11-06T10:31:10 EligibleTime=2025-11-06T10:31:10&lt;br /&gt;
   AccrueTime=2025-11-06T10:31:10&lt;br /&gt;
   StartTime=2025-11-06T10:31:10 EndTime=2025-11-06T11:31:10 Deadline=N/A&lt;br /&gt;
   SuspendTime=None SecsPreSuspend=0 LastSchedEval=2025-11-06T10:31:10 Scheduler=Main&lt;br /&gt;
   Partition=jobs AllocNode:Sid=mufasa2-login:42020&lt;br /&gt;
   ReqNodeList=(null) ExcNodeList=(null)&lt;br /&gt;
   NodeList=gn01&lt;br /&gt;
   BatchHost=gn01&lt;br /&gt;
   NumNodes=1 NumCPUs=1 NumTasks=1 CPUs/Task=1 ReqB:S:C:T=0:0:*:*&lt;br /&gt;
   ReqTRES=cpu=1,mem=4G,node=1,billing=1&lt;br /&gt;
   AllocTRES=cpu=1,mem=4G,node=1,billing=1&lt;br /&gt;
   Socks/Node=* NtasksPerN:B:S:C=0:0:*:* CoreSpec=*&lt;br /&gt;
   MinCPUsNode=1 MinMemoryNode=4G MinTmpDiskNode=0&lt;br /&gt;
   Features=(null) DelayBoot=00:00:00&lt;br /&gt;
   OverSubscribe=OK Contiguous=0 Licenses=(null) LicensesAlloc=(null) Network=(null)&lt;br /&gt;
   Command=./test_script.sh&lt;br /&gt;
   WorkDir=/home/gfontana&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In particular, the line beginning with &amp;#039;&amp;#039;&amp;quot;StartTime=&amp;quot;&amp;#039;&amp;#039; provides expected times for the start and end of job execution. As explained in [[User_Jobs#Knowing_when_jobs_are_expected_to_end_or_start|Knowing when jobs are expected to end or start]], start time is only a prediction and subject to change.&lt;br /&gt;
&lt;br /&gt;
== Cancelling a job with &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
It is possible to cancel a job using command &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;, either while it is waiting for execution or when it is in execution (in this case you can choose what system signal to send the process in order to terminate it). &lt;br /&gt;
&lt;br /&gt;
Please note that [[System#Job priority|job priority]] for your user depends (also) on the overall duration of the jobs that you ran on Mufasa. Therefore, &amp;#039;&amp;#039;&amp;#039;cancelling jobs that are not needed anymore improves your future jobs&amp;#039; priority&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The following are some examples of use of &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt; adapted from [https://slurm.schedmd.com/scancel.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
removes queued job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; from the execution queue.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --signal=TERM &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
terminates execution of job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; with signal SIGTERM (request to stop).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --signal=KILL &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
terminates execution of job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; with signal SIGKILL (force stop).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --state=PENDING --user=&amp;lt;username&amp;gt; --partition=&amp;lt;partition_name&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
cancels all pending jobs belonging to user &amp;lt;code&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/code&amp;gt; in partition &amp;lt;code&amp;gt;&amp;lt;partition_name&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Knowing what jobs you ran today ==&lt;br /&gt;
&lt;br /&gt;
Command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacct -X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a list of all jobs run today by your user.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=User_Jobs&amp;diff=2375</id>
		<title>User Jobs</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=User_Jobs&amp;diff=2375"/>
		<updated>2026-05-07T14:48:33Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* How to know if your shell is a SLURM job */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Running jobs with SLURM =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must&amp;#039;&amp;#039;&amp;#039; use SLURM to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM.&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa. This is a key difference between Mufasa 1.0 and [[System#Mufasa 2.0|Mufasa 2.0]].&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
SLURM provides two commands to run jobs, called [https://slurm.schedmd.com/srun.html srun] and [https://slurm.schedmd.com/sbatch.html sbatch]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun [options] &amp;lt;command_to_be_run_via_SLURM&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch [options] &amp;lt;command_to_be_run_via_SLURM&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; can be any Linux program (including shell scripts). By using &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;, the  command or script specified by &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; (including any programs launched by it) are added to SLURM&amp;#039;s execution queues.&lt;br /&gt;
&lt;br /&gt;
The main difference between &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; is that the first locks the shell from which it has been launched, so it is only really suitable for &amp;#039;&amp;#039;&amp;#039;interactive jobs&amp;#039;&amp;#039;&amp;#039;: i.e., processes that use the console to interact with their user during job execution. &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;, on the other side, does not lock the shell and simply adds the job to the queue, but does not allow the user to interact with the process while it is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; provides an additional possibility: &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; can in fact be an [[#Using execution scripts to run jobs|&amp;#039;&amp;#039;&amp;#039;execution script&amp;#039;&amp;#039;&amp;#039;]], i.e. a special (and SLURM-specific) type of Linux shell script that includes &amp;#039;&amp;#039;&amp;#039;SBATCH directives&amp;#039;&amp;#039;&amp;#039;. SBATCH directives can be used to specify the values of some of the parameters that would otherwise have to be set using the &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; part of the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command. This is handy because it allows to write down the parameters in an execution script instead of having to write them in the command line while launching a job, which greatly reduces the possibility of mistakes. Also, an execution script is easy to keep and reuse.&lt;br /&gt;
&lt;br /&gt;
Immediately after a &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command is launched by a user, SLURM outputs a message informing the user that the job has been queued. The output is similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun: job 10849 queued and waiting for resources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The shell is now locked while SLURM prepares the execution of the user program ([[#Detaching from a running job with screen|if you are using &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; you can detach from that shell and come back later]]). &lt;br /&gt;
&lt;br /&gt;
When SLURM is ready to run the program, it prints a message similar to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun: job 10849 has been allocated resources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and then executes the program.&lt;br /&gt;
&lt;br /&gt;
=== Options of &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; part of &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; commands is used to tell SLURM what resources the job needs to be executed the job and how much time it will need to complete its execution.&lt;br /&gt;
&lt;br /&gt;
For what concerns resources, the most important option is &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt;, specifying which SLURM [[#SLURM Quality of Service (QOS)|SLURM QOS]] the job will use. A job run with a given QOS has access to all and only the resources available to that QOS. As a consequence, all options that define how many resources to assign the job will only be able to provide the job with resources that are available to the chosen QOS. Jobs that require resources that are not available to the chosen QOS do not get executed. &lt;br /&gt;
&lt;br /&gt;
If the user forgets to use option &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt;, the job is run on the &amp;#039;&amp;#039;default qos&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt;) which has access to &amp;#039;&amp;#039;zero&amp;#039;&amp;#039; resources. Therefore it is always necessary to specify option &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt; when launching a SLURM job on Mufasa.&lt;br /&gt;
&lt;br /&gt;
More generally, the most relevant among the &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; are:&lt;br /&gt;
&lt;br /&gt;
:;‑-qos=&amp;lt;qos__name&amp;gt;&lt;br /&gt;
:: specifies the [[SLURM#SLURM Quality of Service (QOS)|SLURM QOS]] that the job will use. It is mandatory to specify one.&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! The chosen QOS limits the resources that can be requested, since it is not allowed to request resources (type or quantity) that exceed what is available to the chosen QOS.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! If &amp;lt;code&amp;gt;‑‑qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt; is used and options that specify how many resources to assign to the job (such as &amp;lt;code&amp;gt;‑‑mem=&amp;lt;mem_resources&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;‑‑cpus‑per‑task=&amp;lt;cpu_amount&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;‑‑time=&amp;lt;duration&amp;gt;&amp;lt;/code&amp;gt;) are omitted, the job is assigned the default amount of the resource (as defined by the chosen QOS. A notable exception concerns option &amp;lt;code&amp;gt;‑‑gres=&amp;lt;gpu_resources&amp;gt;&amp;lt;/code&amp;gt;, which is always required (see below) if the job uses a QOS with access to GPUs.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; --job-name=&amp;lt;jobname&amp;gt;&lt;br /&gt;
:: Specifies a name for the job. The specified name will appear along with the JOBID number when querying running jobs on the system with &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;. The default job name (i.e., the one assigned to the job when &amp;lt;code&amp;gt;--job-name&amp;lt;/code&amp;gt; is not used) is the executable program&amp;#039;s name.&lt;br /&gt;
&lt;br /&gt;
:;‑‑gres=&amp;lt;gpu_resources&amp;gt;&lt;br /&gt;
:: specifies what GPUs to assign to the job. &amp;lt;code&amp;gt;gpu_resources&amp;lt;/code&amp;gt; is a comma-delimited list where each element has the form &amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;amount&amp;gt;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;&amp;lt;Type&amp;gt;&amp;lt;/code&amp;gt; is one of the types of GPU available on Mufasa (see [[SLURM#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) and &amp;lt;code&amp;gt;&amp;lt;amount&amp;gt;&amp;lt;/code&amp;gt; is an integer between 1 and the number of GPUs of such type available to the partition. For instance, &amp;lt;code&amp;gt;&amp;lt;gpu_resources&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;gpu:40gb:1,gpu:3g.20gb:1&amp;lt;/code&amp;gt;, corresponding to asking for one &amp;quot;full&amp;quot; GPU and 1 &amp;quot;small&amp;quot; GPU.&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! The &amp;lt;code&amp;gt;‑‑gres&amp;lt;/code&amp;gt; parameter is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039; if the job is run with a QOS that allows access to the system&amp;#039;s GPUs. Differently from other resources (where unspecified requests lead to the assignment of a default amount), GPUs must always be explicitly requested.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:;‑‑mem=&amp;lt;mem_resources&amp;gt;&lt;br /&gt;
:: specifies the amount of RAM to assign to the job; for instance, &amp;lt;code&amp;gt;&amp;lt;mem_resources&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;200G&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:;‑‑cpus-per-task=&amp;lt;cpu_amount&amp;gt;&lt;br /&gt;
:: specifies how many CPUs to assign to the job; for instance, &amp;lt;code&amp;gt;&amp;lt;cpu_amount&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;nowiki&amp;gt;‑‑time=&amp;lt;duration&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:: specifies the maximum time allowed to the job to complete, in the format &amp;lt;code&amp;gt;days-hours:minutes:seconds&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; is optional; for instance, &amp;lt;code&amp;gt;&amp;lt;d-hh:mm:ss&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;72:00:00&amp;lt;/code&amp;gt;. When the time expires, the job (if still running) gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
:;‑‑pty&lt;br /&gt;
:: specifies that the job will be interactive (this is necessary when &amp;lt;code&amp;gt;&amp;lt;command_to_run_within_container&amp;gt;&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;/bin/bash&amp;lt;/code&amp;gt;: see [[#Interactive jobs|Interactive jobs]])&lt;br /&gt;
&lt;br /&gt;
Note that GPU resources (if needed) must always be requested explicitly. For instance, in order to execute program &amp;lt;code&amp;gt;./my_program&amp;lt;/code&amp;gt; which needs one GPU of type &amp;lt;code&amp;gt;3g.20gb&amp;lt;/code&amp;gt; with QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; we can use the SLURM command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun --qos=gpulight --gres=gpu:3g.20gb:1 ./my_program&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interactive jobs ==&lt;br /&gt;
&lt;br /&gt;
An &amp;#039;&amp;#039;&amp;#039;interactive job&amp;#039;&amp;#039;&amp;#039; is a process that use the console to interact with their user during job execution. Such a process is manually run by the user from a &amp;#039;&amp;#039;bash shell&amp;#039;&amp;#039; (i.e. a terminal session) provided by SLURM. &lt;br /&gt;
&lt;br /&gt;
In order to ask SLURM to schedule the execution of a shell where the user can subsequently run the interactive job, it is necessary to use option &amp;lt;code&amp;gt;--pty&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instance, to ask SLURM to run a shell with QOS &amp;lt;code&amp;gt;nogpu&amp;lt;/code&amp;gt;, the user should use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun --qos=nogpu --pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By not specifying any other options, the user is telling SLURM that they want the shell spawned by SLURM to be provided with the default amount of resources associated to QOS &amp;lt;code&amp;gt;nogpu&amp;lt;/code&amp;gt;. More generally, any combination of the other [[#Options of srun and sbatch|options of srun]] can be used together with &amp;lt;code&amp;gt;--pty&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As every other job request to SLURM, the request to run a shell must be done from the [[System#Login server|login server]]. As soon as possible (i.e., as soon as the necessary resources are available) SLURM will open (in the same terminal that the user used to launch the &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command) a bash shell, where the user will be able to run their interactive programs. &lt;br /&gt;
&lt;br /&gt;
To the user, this corresponds to the fact that the shell they were using to interact with the login server changes into a shell opened &amp;#039;&amp;#039;directly on Mufasa&amp;#039;&amp;#039;. This corresponds to the command prompt changing from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;username&amp;gt;@mufasa2-login:~$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;username&amp;gt;@mufasa2:~$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another way to know if the current shell is the “base” shell or one run via SLURM is to execute command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
echo $SLURM_JOB_ID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no number gets printed, this means that the shell is the “base” one. If a number is printed, it is the SLURM job ID of the /bin/bash process.&lt;br /&gt;
&lt;br /&gt;
When the user does not need the SLURM-spawned shell anymore, they should close it with command (the same used for any other Linux shell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to make the resources reserved for the interactive shell free again.&lt;br /&gt;
&lt;br /&gt;
== Non-interactive jobs ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands are very complex, and it&amp;#039;s easy to forget some option or make mistakes while using them. For non-interactive jobs, there is a solution to this problem.&lt;br /&gt;
&lt;br /&gt;
When the user job is non-interactive, in fact, the &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command can be substituted with a much simpler &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command&amp;#039;&amp;#039;&amp;#039;. As [[#Running jobs with SLURM|already explained]], &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; can make use of an &amp;#039;&amp;#039;&amp;#039;execution script&amp;#039;&amp;#039;&amp;#039; to specify all the parts of the command to be run via SLURM. So the command becomes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch &amp;lt;execution_script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An execution script is a special type of Linux script that includes &amp;#039;&amp;#039;&amp;#039;SBATCH directives&amp;#039;&amp;#039;&amp;#039;. SBATCH directives are used to specify the values of the parameters that are otherwise set in the [options] part of an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Note on Linux shell scripts&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;A shell script is a text file that will be run by the bash shell. In order to be acceptable as a bash script, a text file must:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;have the “executable” flag set&amp;#039;&amp;#039; (see [[System#Changing file/directory ownership and permissions|here]] for details)&lt;br /&gt;
* &amp;#039;&amp;#039;have&amp;#039;&amp;#039; &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;as its very first line&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Usually, a Linux shell script is given a name ending in &amp;#039;&amp;#039;.sh,&amp;#039;&amp;#039; such as &amp;#039;&amp;#039;my_execution_script.sh&amp;#039;&amp;#039;, but this is not mandatory.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Within any shell script, lines preceded by &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; are comments (with the notable exception of the initial&amp;#039;&amp;#039; &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;line)&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Use of blank lines as spacers is allowed.&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An execution script is a Linux shell script composed of two parts:&lt;br /&gt;
&lt;br /&gt;
# a &amp;#039;&amp;#039;&amp;#039;preamble&amp;#039;&amp;#039;&amp;#039;,  composed of directives using which the user specifies the values to be given to parameters, each preceded by the keyword &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt;&lt;br /&gt;
# [optionally] one or more &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands&amp;#039;&amp;#039;&amp;#039; that launch jobs with SLURM using the parameter values specified in the preamble&lt;br /&gt;
&lt;br /&gt;
Below is an &amp;#039;&amp;#039;&amp;#039;execution script template&amp;#039;&amp;#039;&amp;#039; to be copied and pasted into your own execution script text file. &lt;br /&gt;
&lt;br /&gt;
The template includes all the options [[#Using SLURM to run a container|already described above]], plus a few additional useful ones (for instance, those that enable SLURM to send email messages to the user in correspondence to events in the lifecycle of their job). Information about all the possible options can be found in [SLURM&amp;#039;s own documentation].&lt;br /&gt;
&lt;br /&gt;
In the template below, &amp;#039;&amp;#039;&amp;#039;#SBATCH directives&amp;#039;&amp;#039;&amp;#039; are requests made to SLURM. Notice that, though #SBATCH directives have a leading &amp;quot;#&amp;quot;, that does &amp;#039;&amp;#039;not&amp;#039;&amp;#039; mean that they are comments: exactly as the &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; at the beginning of a shell script, while starting with &amp;quot;#&amp;quot;, is not a comment as well.&lt;br /&gt;
&lt;br /&gt;
Other lines in the script that begin with &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; not followed by SBATCH are comments.&lt;br /&gt;
&lt;br /&gt;
For what concerns directive that ask for a given amount of a resource (including time), if they are missing from the execution script (or commented out) the job will be assigned the default amount of the resource.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;!/bin/bash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------start of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-nodes=1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑ntasks=1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-partition=jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-qos=&amp;lt;qos_name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑gres=&amp;lt;gpu_resources&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑mem=&amp;lt;mem_resources&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑cpus-per-task=&amp;lt;cpu_amount&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑time=&amp;lt;d-hh:mm:ss&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑output=./&amp;lt;filename&amp;gt;-%j.out&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; the text file where the output of the job gets written (i.e., standard output gets redirected onto the file). &amp;quot;%j&amp;quot; is the current time.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑error=./&amp;lt;filename&amp;gt;-error-%j.out&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; the text file where any error messages generated by the job gets written (i.e., standard error gets redirected onto the file). &amp;quot;%j&amp;quot; is the current time.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH --job-name=&amp;lt;name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------end of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Executing jobs on Mufasa =&lt;br /&gt;
&lt;br /&gt;
== Key concept ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The key concept about executing jobs on Mufasa is that [[System#Containers|all computation on Mufasa must occur within containers]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A container is a “sandbox” containing the environment where the user&amp;#039;s application operates. Parts of Mufasa&amp;#039;s filesystem can be made visible (and writable, if the user has writing permission on them: e.g., the user&amp;#039;s &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory) to the environment of the container. This allows the containerized user application to read from, and write to, Mufasa&amp;#039;s filesystem: for instance, to read data and write results.&lt;br /&gt;
&lt;br /&gt;
The system used by Mufasa to create and execute containers is &amp;#039;&amp;#039;&amp;#039;[[System#Singularity|Singularity]]&amp;#039;&amp;#039;&amp;#039;. This wiki includes [[Singularity|directions]] on preparing containers with Singularity.&lt;br /&gt;
&lt;br /&gt;
The container where a user job runs must contain all the libraries needed by the job. In fact (for maintainability and safety reasons) &amp;#039;&amp;#039;&amp;#039;no software and no libraries are installed on Mufasa 2.0&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Interactive and non-interactive user jobs ==&lt;br /&gt;
&lt;br /&gt;
This section explains how to execute a user job contained in a container. It considers two types of user jobs, i.e.:&lt;br /&gt;
;: Interactive user jobs&lt;br /&gt;
::: as [[#Interactive jobs|already explained]], these are jobs that require interaction with the user while they are running, via a bash shell running within the container. The shell is used to receive commands from the user and/or print output messages. For interactive user jobs, the job is usually launched manually by the user (with a command issued via the shell) after the container is in execution.&lt;br /&gt;
&lt;br /&gt;
;: Non-interactive user jobs&lt;br /&gt;
::: are the most common variety. The user prepares the container in such a way that, when in execution, the container autonomously puts the user&amp;#039;s jobs into execution. The user does not have any communication with the container while it is in execution. Executing the container and running the required programs within the container&amp;#039;s environment is done via [[#Interactive jobs|execution scripts]].&lt;br /&gt;
&lt;br /&gt;
== Using SLURM to run an interactive job on Mufasa ==&lt;br /&gt;
&lt;br /&gt;
The first step to run an interactive user job on Mufasa is to run the [[System#Containers|container]] where the job will take place. Each user is in charge of preparing the container(s) where the user&amp;#039;s jobs will be executed.&lt;br /&gt;
&lt;br /&gt;
In order to run a container via SLURM by hand, i.e. via an interactive shell, a user must first open the shell with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun [general_SLURM_options] ‑‑pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where [general_SLURM_options] are those [[#Options of srun and sbatch|already described above]].&lt;br /&gt;
&lt;br /&gt;
Then the user must run the container: this is done as follows.&lt;br /&gt;
&lt;br /&gt;
First, it is necessary to load the Singularity software module with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
module load amd/singularity&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(if needed, the list of software modules available in the system can be obtained with command &amp;lt;code&amp;gt;module av&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then, the user must use Singularity to run the container with command (see the [[Singularity|section about Singularity]] for further details)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity run &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which pulls the container from the specified repository and executes it. Possible values for &amp;lt;code&amp;gt;&amp;lt;repository&amp;gt;&amp;lt;/code&amp;gt; are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;docker&amp;lt;/code&amp;gt; (Docker Hub)&lt;br /&gt;
:: &amp;lt;code&amp;gt;library&amp;lt;/code&amp;gt; (Singularityhub)&lt;br /&gt;
:: &amp;lt;code&amp;gt;path/to/container&amp;lt;/code&amp;gt; if the container is local, i.e. located in the filesystem of Mufasa&lt;br /&gt;
&lt;br /&gt;
As soon as the container is in execution, the terminal window used, so far, to interact with Mufasa becomes a shell &amp;#039;&amp;#039;in the container&amp;#039;&amp;#039;. This shell belongs to the software environment of the container, and the user can use it to interact with the container&amp;#039;s own software environment and filesystem. &lt;br /&gt;
&lt;br /&gt;
It is easy to understand if a shell is open to Mufasa or to the container because in a container shell the system prompt becomes &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interaction between container filesystem and local filesystem === &lt;br /&gt;
&lt;br /&gt;
The filesystem inside the container and the local one, i.e. Mufasa&amp;#039;s, can interact. This means that the container can access the local filesystem to read and/or write files. However, the only parts of Mufasa&amp;#039;s filesystem that can be accessed by the container are those that the user running the container has access rights to.&lt;br /&gt;
&lt;br /&gt;
As a default, the user&amp;#039;s &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; directory on Mufasa is automatically mapped onto &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; into the filesystem of the container. Whatever is done to that container directory, the changes are actually applied to the local &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; directory on Mufasa. &lt;br /&gt;
&lt;br /&gt;
The mapping of the home directory does not need to be explicitly requested. However, if the user needs (in addition to the home directory) other parts of the local filesystem of Mufasa to be mapped onto the container&amp;#039;s filesystem, this is possible by using this modified version of the &amp;lt;code&amp;gt;singularity run&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity run --bind &amp;lt;/path/to/local/directory&amp;gt;:&amp;lt;path/to/container/directory&amp;gt; &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;&amp;lt;path/to/container/directory&amp;gt;&amp;lt;/code&amp;gt; does not exist in the container&amp;#039;s filesystem, it gets created by Singularity.&lt;br /&gt;
&lt;br /&gt;
=== How to know if your shell is a SLURM job ===&lt;br /&gt;
To know if the shell you are using is being run via SLURM or not (becoming confused is easy...), use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
echo $SLURM_JOB_ID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it provides an output, your shell is a SLURM job and the output is the ID of the job. &lt;br /&gt;
If it doesn&amp;#039;t provide any output, your shell is not a SLURM job.&lt;br /&gt;
&lt;br /&gt;
== Using SLURM to run a non-interactive job on Mufasa ==&lt;br /&gt;
&lt;br /&gt;
When the user job to be executed into a container is non-interactive, the mechanism based on an &amp;#039;&amp;#039;execution script&amp;#039;&amp;#039; already described in [[#Non-interactive jobs|Non-interactive jobs]] is employed. The command to run the script which in turn will run the container where the user job takes place is therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch &amp;lt;execution_script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The general features of a SLURM execution script and the SBATCH directives used for generic jobs have [[#Non-interactive jobs|already been described]]. Here we focus, therefore, on the SBATCH directives specifically used when SLURM is used to run a non-interactive job within a container.&lt;br /&gt;
&lt;br /&gt;
Below is an &amp;#039;&amp;#039;&amp;#039;execution script template&amp;#039;&amp;#039;&amp;#039; to be copied and pasted into your own execution script text file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;!/bin/bash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------start of preamble----------------&lt;br /&gt;
&lt;br /&gt;
[[#Non-interactive jobs|#SBATCH directives already described above]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------end of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;module load amd/singularity&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;singularity run &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt; &amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the last line of the script, &amp;lt;code&amp;gt;&amp;lt;command_to_run&amp;gt;&amp;lt;/code&amp;gt; is the command (e.g., the name of an executable script), complete with path within the container&amp;#039;s filesystem, of the program to be run into the container. Please refer to the [[Singularity|section about Singularity]] for details about its commands.&lt;br /&gt;
&lt;br /&gt;
The interactions between container filesystem and local filesystem in non-interactive jobs are exactly the same [[#Interaction between container filesystem and local filesystem|already described]] for interactive jobs. In particular, the user&amp;#039;s home directory is mapped by default onto the filesystem of the container.&lt;br /&gt;
&lt;br /&gt;
If, in addition to that, the user needs another part of the filesystem of Mufasa are to be mapped onto the container&amp;#039;s filesystem, this is possible using this modified version of the &amp;lt;code&amp;gt;singularity run&amp;lt;/code&amp;gt; command at the end of the script:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;singularity run --bind &amp;lt;/path/to/local/directory&amp;gt;:&amp;lt;path/to/container/directory&amp;gt; &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;&amp;lt;path/to/container/directory&amp;gt;&amp;lt;/code&amp;gt; does not exist in the container&amp;#039;s filesystem, it gets created by Singularity.&lt;br /&gt;
&lt;br /&gt;
== Job output ==&lt;br /&gt;
&lt;br /&gt;
The whole point of running a user job is to collect its output. Usually, such output takes the form of one or more files generated within the filesystem of Mufasa by the container where the computation takes place. &lt;br /&gt;
&lt;br /&gt;
As [[#Using SLURM to run a container|explained below]], SLURM includes a mechanism to mount a part of Mufasa&amp;#039;s own filesystem onto the container&amp;#039;s filesystem: so when the job running within the container writes to this mounted part, it actually writes to Mufasa&amp;#039;s filesystem. This means that when the container ends its execution, its output files persist in Mufasa&amp;#039;s filesystem (usually in a subdirectory of the user&amp;#039;s own &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory) and can be retrieved by the user at a later time.&lt;br /&gt;
&lt;br /&gt;
The same mechanism can be used to allow user jobs running into a container to read their input data from Mufasa&amp;#039;s filesystem (usually a subdirectory of the user&amp;#039;s own &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory).&lt;br /&gt;
&lt;br /&gt;
== Cancelling completed jobs ==&lt;br /&gt;
&lt;br /&gt;
When a user process run via SLURM has completed its execution and is not needed anymore, it is important to [[User_Jobs#Canceling_a_job_with_scancel|close it with scancel]]. Especially if much time remains to the end of the execution time requested by the job.&lt;br /&gt;
&lt;br /&gt;
Cancelling a SLURM job makes the resources reserved by SLURM free again for other users, and thus speeds up the execution of the jobs still queued.&lt;br /&gt;
&lt;br /&gt;
Typically, one doesn&amp;#039;t know how long a piece of code will take to complete its work. So please make sure to check from time to time if that happened, and -if there&amp;#039;s still time before the duration of your SLURM job ends- just &amp;#039;&amp;#039;scancel&amp;#039;&amp;#039; the job. Other users will be grateful :-)&lt;br /&gt;
&lt;br /&gt;
Please note that [[System#Job priority|job priority]] for your user depends (also) on the overall duration of the jobs that you ran on Mufasa. Therefore, &amp;#039;&amp;#039;&amp;#039;cancelling jobs that are not needed anymore improves your future jobs&amp;#039; priority&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
= Detaching from a running job with &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
A consequence of the way &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; operates is that if you launch an [[#Interactive and non-interactive user jobs|interactive user job]], the shell where the command is running must remain open: if it closes, the job terminates. That shell runs in the terminal of your own PC where the [[System#Accessing Mufasa|SSH connection to Mufasa]] exists.&lt;br /&gt;
&lt;br /&gt;
If you do not plan to keep the SSH connection to Mufasa open (for instance because you have to turn off or suspend your PC), there is a way to keep your interactive job alive. Namely, you should use command &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; inside a &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (often simply called &amp;quot;a screen&amp;quot;), then &amp;#039;&amp;#039;detach&amp;#039;&amp;#039; from the &amp;#039;&amp;#039;screen&amp;#039;&amp;#039; ([https://linuxize.com/post/how-to-use-linux-screen/ here] is one of many tutorials about &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; available online). &lt;br /&gt;
&lt;br /&gt;
Once you have detached from the screen session, you can close the SSH connection to Mufasa without damage. When you need to reach your (still running) job again, you can can open a new SSH connection to Mufasa and then &amp;#039;&amp;#039;reattach&amp;#039;&amp;#039; to the &amp;#039;&amp;#039;screen&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A use case for screen is writing your program in such a way that it prints progress advancement messages as it goes on with its work. Then, you can check its advancement by periodically reconnecting to the screen where the program is running and reading the messages it printed.&lt;br /&gt;
&lt;br /&gt;
Basic usage of &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; is explained below.&lt;br /&gt;
&lt;br /&gt;
== Creating a screen session, running a job in it, detaching from it ==&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]] with SSH&lt;br /&gt;
# From the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
# In the &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (&amp;quot;screen&amp;quot;) thus created (it has the look of an empty shell), launch your job with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;#039;&amp;#039;Detach&amp;#039;&amp;#039; from the screen by pressing &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;: you will come back to the original login server shell, while your process will go on running in the screen&lt;br /&gt;
# You can now close the SSH connection to the login server without damaging your running job&lt;br /&gt;
&lt;br /&gt;
== Reattaching to an active screen session ==&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]] with SSH&lt;br /&gt;
# In the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You are now back to the screen where you launched your job&lt;br /&gt;
&lt;br /&gt;
== Closing (i.e. destroying) a screen session ==&lt;br /&gt;
&lt;br /&gt;
When you do not need a screen session anymore:&lt;br /&gt;
&lt;br /&gt;
# reattach to the active screen session as explained [[#Reattaching to an active screen session|above]]&lt;br /&gt;
# destroy the screen by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash), then confirming that you really want to proceed&lt;br /&gt;
&lt;br /&gt;
Of course, any program (including SLURM jobs) running within the screen gets terminated when the screen is destroyed.&lt;br /&gt;
&lt;br /&gt;
= Using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; to reserve resources =&lt;br /&gt;
&lt;br /&gt;
== What is &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
[https://slurm.schedmd.com/salloc.html &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;] is a SLURM command that allows a user to reserve a set of resources (e.g., a 40 GB GPU) for a given time in the future.&lt;br /&gt;
&lt;br /&gt;
The typical use of &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; is to &amp;quot;book&amp;quot; an interactive session where the user enjoys &amp;#039;&amp;#039;&amp;#039;complete control of a set of resources&amp;#039;&amp;#039;&amp;#039;. The resources that are part of this set are chosen by the user. Within the &amp;quot;booked&amp;quot; session, any job run by the user that relies on the reserved resources is immediately put into execution by SLURM.&lt;br /&gt;
&lt;br /&gt;
More precisely:&lt;br /&gt;
* the user, using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, specifies what resources they need and the time when they will need them;&lt;br /&gt;
* when the delivery comes, SLURM creates an interactive shell session for the user;&lt;br /&gt;
* within such session, the user can use &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; to run programs, enjoying full (i.e. not shared with anyone else) and instantaneous access to the resources.&lt;br /&gt;
&lt;br /&gt;
Resource reservation using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; is only possible if the request is done in advance wrt the delivery time. The more the resources that the user wants to reserve are in high demand, the more anticipated the request should be to ensure that SLURM is able to fulfill it.&lt;br /&gt;
&lt;br /&gt;
When a user makes a request for resources with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, the request (called an &amp;#039;&amp;#039;&amp;#039;allocation&amp;#039;&amp;#039;&amp;#039;) gets added to the job queue of SLURM of the requisite partition as a job in &amp;lt;code&amp;gt;pending&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;) state (job states are described [[User_Jobs#Interpreting Job state as provided by squeue|here]]). Indeed, resource allocation is the first part of SLURM&amp;#039;s process of executing a user job, while the second part is running the program and letting it use the allocated resources. Using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; actually corresponds to having SLURM perform the first part of the process (resource allocation) while leaving the second part (running programs) to the user.&lt;br /&gt;
&lt;br /&gt;
Until the delivery time specified by the user comes, the allocation remains in state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;, and other jobs requesting the same resources, even if submitted later, are executed. While the request waits for the delivery time, however, it accumulates a priority that increases over time. The longer the allocation stays in the &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt; state, the stronger this accumulation of priority: so, by requesting resources with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;&amp;#039;well in advance of the delivery time&amp;#039;&amp;#039;&amp;#039;, users can ensure that the resources they need will be ready for them at the requested delivery time, even if these resources are highly contended.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; commands ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; commands use a similar syntax to &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands. In particular, &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; lets a user specify what resources they need and -importantly- a &amp;#039;&amp;#039;&amp;#039;delivery time&amp;#039;&amp;#039;&amp;#039; for the requested resources (delivery time can also be specified with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt;, but in that case it is not very useful). &lt;br /&gt;
&lt;br /&gt;
The typical &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command has this form:&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
salloc [general_SLURM_options] --begin=&amp;lt;time&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
:; [general_SLURM_options]&lt;br /&gt;
:: represents the options already described in [[#Options of srun and sbatch|Options of srun and sbatch]]&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;nowiki&amp;gt;--begin=&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:: specifies the delivery time of the resources reserved with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, according to the syntax described below. The delivery time must be a future time.&lt;br /&gt;
&lt;br /&gt;
=== Syntax of parameter &amp;lt;code&amp;gt;--begin&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
If the allocation is for the current day, you can specify &amp;lt;nowiki&amp;gt;&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt; as hours and minutes in the form&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;HH:MM&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to specify a time of a different day, the form for &amp;lt;time&amp;gt; is &amp;lt;code&amp;gt;YYYY-MM-DDTHH:MM&amp;lt;/code&amp;gt;, where the uppercase &amp;#039;T&amp;#039; separates date from time. &lt;br /&gt;
&lt;br /&gt;
It is also possible to specify &amp;lt;time&amp;gt; as relative to the current time, in one of the following forms:&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Kminutes&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Khours&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Kdays&amp;lt;/code&amp;gt;&lt;br /&gt;
where K is a (positive) integer.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=16:00&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=now+1hours&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=now+1days&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=2030-01-20T12:34:00&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that Mufasa&amp;#039;s time zone is GMT, so &amp;lt;nowiki&amp;gt;&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt; must be expressed in GMT as well. If you want to know Mufasa&amp;#039;s current time, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
date&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Thu Nov 10 16:43:30 UTC 2022&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In the typical scenario, the user of &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; will make use of [[User_Jobs#Detaching from a running job with screen|screen]]. Command &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; creates a shell session (called &amp;quot;a screen&amp;quot;) that it is possible to abandon without closing it ([[#Creating_a_screen_session.2C_running_a_job_in_it.2C_detaching_from_it|detaching from the screen]]). It is then possible to reach again the screen at a later time ([[#Reattaching_to_an_active_screen_session|reattaching to the screen]]). This means that a user can create a screen, run &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; within it to create an allocation for time X, detach from the screen and reattach to it just before time X to use the reserved resources from the interactive session created by &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
More precisely, the operations needed to do this are the following:&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]].&lt;br /&gt;
# From the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
# In the &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (&amp;quot;screen&amp;quot;) thus created run the [[#salloc commands|&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command]], specifying via its options the resources you need and the time at which you want them delivered.&lt;br /&gt;
# SLURM will respond with a message similar to &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;salloc: Pending job allocation XXXX&amp;lt;/pre&amp;gt;&lt;br /&gt;
# &amp;#039;&amp;#039;Detach&amp;#039;&amp;#039; from the screen by pressing &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;: you will come back to the original login server shell.&lt;br /&gt;
# You can now close the SSH connection to the login server without damaging your resource allocation request.&lt;br /&gt;
# At the delivery time you specified in the [[#salloc commands|&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command]], connect to the login server with SSH.&lt;br /&gt;
# Once you are in the login server shell, reattach to the screen with command &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You are now back to the screen where you used &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;; as soon as SLURM provides to you with the resources you reserved, message &amp;quot;&amp;#039;&amp;#039;salloc: Pending job allocation XXXX&amp;#039;&amp;#039;&amp;quot; changes to the shell prompt.&lt;br /&gt;
# You are now in the interactive shell session you booked with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;. From here, you can run any programs you want, including &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;. For the whole duration of the allocation, your programs have unrestricted use of all the resources you reserved with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;Important!&amp;#039;&amp;#039;&amp;#039; Any job run within the shell session is subject to the time limit (i.e., maximum duration) imposed by the partition it is running on! Therefore, if the job reaches the time limit, it gets &amp;#039;&amp;#039;&amp;#039;forcibly terminated&amp;#039;&amp;#039;&amp;#039; by SLURM. Termination depends exclusively from the time limit: so it occurs even if the end time for the allocation has not been reached yet. (Of course, the job also gets terminated if the allocation ends.)&lt;br /&gt;
# Once the interactive shell session is not needed anymore, cancel it by exiting from the session with &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;exit&amp;lt;/pre&amp;gt; (Note that if you get to the end of the time period you specified in your request without closing the shell session, SLURM does it for you, killing any programs still running.)&lt;br /&gt;
# You are now back to your screen. Destroy it by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash) to get back to the login server shell.&lt;br /&gt;
&lt;br /&gt;
== Cancelling a resource request made with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
To cancel a request for resources made as explained in [[#How to use salloc|How to use &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;]], follow these steps:&lt;br /&gt;
&lt;br /&gt;
# Connect to the the [[System#Login server|login server]] with SSH.&lt;br /&gt;
# Once you are in the login server shell, reattach to the screen where you used command &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; with command &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You should see the message &amp;quot;&amp;#039;&amp;#039;salloc: Pending job allocation XXXX&amp;#039;&amp;#039;&amp;quot; (if the allocation is still pending) or &amp;quot;&amp;quot;&amp;#039;&amp;#039;salloc: job XXXX queued and waiting for resources&amp;#039;&amp;#039;&amp;quot; (if the allocation is done and waiting for its start time). Now just press &amp;#039;&amp;#039;&amp;#039;Ctrl + C&amp;#039;&amp;#039;&amp;#039;. This communicates to SLURM your intention to cancel your request for resources.&lt;br /&gt;
# SLURM will communicate the cancellation with message &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;salloc: Job allocation XXXX has been revoked.&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Destroy the screen by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash) to get back to the login server shell.&lt;br /&gt;
&lt;br /&gt;
= Monitoring and managing jobs =&lt;br /&gt;
&lt;br /&gt;
SLURM provides Job Users with tools to inspect and manage jobs. While a [[Roles|Job User]] is able to see all users&amp;#039; jobs, they are only allowed to interact with their own.&lt;br /&gt;
&lt;br /&gt;
The main commands used to interact with jobs are &amp;#039;&amp;#039;&amp;#039;[https://slurm.schedmd.com/squeue.html &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]&amp;#039;&amp;#039;&amp;#039; to inspect the scheduling queues and &amp;#039;&amp;#039;&amp;#039;[https://slurm.schedmd.com/scancel.html &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;]&amp;#039;&amp;#039;&amp;#039; to terminate queued or running jobs.&lt;br /&gt;
&lt;br /&gt;
== Inspecting jobs with &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Running command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
  520       fat     bash acasella  R 2-04:10:25      1 gn01&lt;br /&gt;
  523       fat     bash amarzull  R    1:30:35      1 gn01&lt;br /&gt;
  522       gpu     bash    clena  R   20:51:16      1 gn01&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This output comprises the following information:&lt;br /&gt;
&lt;br /&gt;
:; JOBID&lt;br /&gt;
:: Numerical identifier of the job assigned by SLURM&lt;br /&gt;
:: This identifier is used to intervene on the job, for instance with &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: the partition that the job is run on&lt;br /&gt;
&lt;br /&gt;
:; NAME&lt;br /&gt;
:: the name assigned to the job; can be personalised using the &amp;lt;code&amp;gt;--job-name&amp;lt;/code&amp;gt; option&lt;br /&gt;
&lt;br /&gt;
:; USER&lt;br /&gt;
:: username of the user who launched the job&lt;br /&gt;
	&lt;br /&gt;
:; ST&lt;br /&gt;
:: job state (see [[SLURM#Job state|Job state]] for further information)&lt;br /&gt;
&lt;br /&gt;
:; TIME&lt;br /&gt;
:: time that has passed since the beginning of job execution&lt;br /&gt;
&lt;br /&gt;
:; NODES&lt;br /&gt;
:: number of nodes where the job is being executed (for Mufasa, this is always 1 as it is a single machine)&lt;br /&gt;
&lt;br /&gt;
:; NODELIST (REASON)&lt;br /&gt;
:: name of the nodes where the job is being executed: for Mufasa it is always &amp;lt;code&amp;gt;gn01&amp;lt;/code&amp;gt;, which is the name of the node corresponding to Mufasa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To limit the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; to the jobs owned by user &amp;lt;code&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/code&amp;gt;, it can be used like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue -u &amp;lt;username&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Job state as provided by &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Jobs typically pass through several states in the course of their execution. Job state is shown in column &amp;quot;ST&amp;quot; of the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; as an abbreviated code (e.g., &amp;quot;R&amp;quot; for RUNNING).&lt;br /&gt;
&lt;br /&gt;
The most relevant codes and states are the following:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; PENDING&lt;br /&gt;
:: Job is awaiting resource allocation. &lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; RUNNING&lt;br /&gt;
:: Job currently has an allocation.&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; SUSPENDED&lt;br /&gt;
:: Job has an allocation, but execution has been suspended and CPUs have been released for other jobs. &lt;br /&gt;
 &lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;CG&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; COMPLETING&lt;br /&gt;
:: Job is in the process of completing. Some processes on some nodes may still be active. &lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;CD&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; COMPLETED&lt;br /&gt;
:: Job has terminated all processes on all nodes with an exit code of zero. &lt;br /&gt;
&lt;br /&gt;
Beyond these, there are other (less frequent) job states. [https://slurm.schedmd.com/squeue.html The SLURM doc page for &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;] provides a complete list of them.&lt;br /&gt;
&lt;br /&gt;
== Knowing when jobs are expected to end or start ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in understanding when jobs are expected to start or end, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue -o &amp;quot;%5i %8u %10P %.2t |%19S |%.11L|&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output is similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID USER     PARTITION  ST |START_TIME          |  TIME_LEFT|&lt;br /&gt;
5307  thuynh   fat        PD |2022-11-11T17:55:54 | 3-00:00:00|&lt;br /&gt;
5308  thuynh   fat        PD |2022-11-11T17:55:54 | 3-00:00:00|&lt;br /&gt;
5296  cziyang  fat         R |2022-11-08T16:58:03 | 1-00:48:14|&lt;br /&gt;
5306  thuynh   fat         R |2022-11-10T08:13:30 | 2-16:03:41|&lt;br /&gt;
5297  gnannini fat         R |2022-11-08T17:55:54 | 1-01:46:05|&lt;br /&gt;
5336  ssaitta  gpu         R |2022-11-10T08:13:00 |    6:03:11|&lt;br /&gt;
5358  dmilesi  gpulong     R |2022-11-10T15:11:32 | 2-23:01:43|&lt;br /&gt;
5338  cziyang  gpulong     R |2022-11-10T09:45:01 | 1-17:35:12|&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;:For running jobs (state &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt;):&lt;br /&gt;
::column &amp;quot;START_TIME&amp;quot; tells you when the job started its execution&lt;br /&gt;
::column &amp;quot;TIME_LEFT&amp;quot; tells you how much remains of the running time requested by the job&lt;br /&gt;
&lt;br /&gt;
;:For pending jobs (state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;):&lt;br /&gt;
::column &amp;quot;START_TIME&amp;quot; tells you when the job is expected to start its execution&lt;br /&gt;
::column &amp;quot;TIME_LEFT&amp;quot; tells you how much running time has been requested by the job&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Important!&amp;#039;&amp;#039;&amp;#039; Start and end times are forecasts based on the features of current jobs in the queues, and may change if running jobs end prematurely and/or if new jobs with higher priority are added to the queues. So these times should never be considered as certain.&lt;br /&gt;
&lt;br /&gt;
If you simply want to know when pending jobs (state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;) are expected to begin execution, use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue --start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which lists pending jobs in order of increasing START_TIME (the job on top is the one which will be run first). For each pending job the command provides an output similar to the example below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID PARTITION     NAME     USER ST          START_TIME  NODES SCHEDNODES           NODELIST(REASON)&lt;br /&gt;
 5090       fat training   thuynh PD 2022-10-27T09:28:01      1 (null)               (Resources)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting detailed information about a job ==&lt;br /&gt;
&lt;br /&gt;
If needed, complete information about a job (either pending or running) can be obtained using command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show job &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; is the number from the first column of the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;. The output of this command is similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JobId=65 JobName=test_script.sh&lt;br /&gt;
   UserId=gfontana(10003) GroupId=gfontana(10004) MCS_label=N/A&lt;br /&gt;
   Priority=14208 Nice=0 Account=admin QOS=nogpu&lt;br /&gt;
   JobState=RUNNING Reason=None Dependency=(null)&lt;br /&gt;
   Requeue=0 Restarts=0 BatchFlag=0 Reboot=0 ExitCode=0:0&lt;br /&gt;
   RunTime=00:00:55 TimeLimit=01:00:00 TimeMin=N/A&lt;br /&gt;
   SubmitTime=2025-11-06T10:31:10 EligibleTime=2025-11-06T10:31:10&lt;br /&gt;
   AccrueTime=2025-11-06T10:31:10&lt;br /&gt;
   StartTime=2025-11-06T10:31:10 EndTime=2025-11-06T11:31:10 Deadline=N/A&lt;br /&gt;
   SuspendTime=None SecsPreSuspend=0 LastSchedEval=2025-11-06T10:31:10 Scheduler=Main&lt;br /&gt;
   Partition=jobs AllocNode:Sid=mufasa2-login:42020&lt;br /&gt;
   ReqNodeList=(null) ExcNodeList=(null)&lt;br /&gt;
   NodeList=gn01&lt;br /&gt;
   BatchHost=gn01&lt;br /&gt;
   NumNodes=1 NumCPUs=1 NumTasks=1 CPUs/Task=1 ReqB:S:C:T=0:0:*:*&lt;br /&gt;
   ReqTRES=cpu=1,mem=4G,node=1,billing=1&lt;br /&gt;
   AllocTRES=cpu=1,mem=4G,node=1,billing=1&lt;br /&gt;
   Socks/Node=* NtasksPerN:B:S:C=0:0:*:* CoreSpec=*&lt;br /&gt;
   MinCPUsNode=1 MinMemoryNode=4G MinTmpDiskNode=0&lt;br /&gt;
   Features=(null) DelayBoot=00:00:00&lt;br /&gt;
   OverSubscribe=OK Contiguous=0 Licenses=(null) LicensesAlloc=(null) Network=(null)&lt;br /&gt;
   Command=./test_script.sh&lt;br /&gt;
   WorkDir=/home/gfontana&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In particular, the line beginning with &amp;#039;&amp;#039;&amp;quot;StartTime=&amp;quot;&amp;#039;&amp;#039; provides expected times for the start and end of job execution. As explained in [[User_Jobs#Knowing_when_jobs_are_expected_to_end_or_start|Knowing when jobs are expected to end or start]], start time is only a prediction and subject to change.&lt;br /&gt;
&lt;br /&gt;
== Cancelling a job with &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
It is possible to cancel a job using command &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;, either while it is waiting for execution or when it is in execution (in this case you can choose what system signal to send the process in order to terminate it). &lt;br /&gt;
&lt;br /&gt;
Please note that [[System#Job priority|job priority]] for your user depends (also) on the overall duration of the jobs that you ran on Mufasa. Therefore, &amp;#039;&amp;#039;&amp;#039;cancelling jobs that are not needed anymore improves your future jobs&amp;#039; priority&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The following are some examples of use of &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt; adapted from [https://slurm.schedmd.com/scancel.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
removes queued job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; from the execution queue.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --signal=TERM &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
terminates execution of job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; with signal SIGTERM (request to stop).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --signal=KILL &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
terminates execution of job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; with signal SIGKILL (force stop).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --state=PENDING --user=&amp;lt;username&amp;gt; --partition=&amp;lt;partition_name&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
cancels all pending jobs belonging to user &amp;lt;code&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/code&amp;gt; in partition &amp;lt;code&amp;gt;&amp;lt;partition_name&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Knowing what jobs you ran today ==&lt;br /&gt;
&lt;br /&gt;
Command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacct -X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a list of all jobs run today by your user.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=User_Jobs&amp;diff=2374</id>
		<title>User Jobs</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=User_Jobs&amp;diff=2374"/>
		<updated>2026-05-07T14:48:11Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* How to know if your shell is a SLURM job */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Running jobs with SLURM =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must&amp;#039;&amp;#039;&amp;#039; use SLURM to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM.&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa. This is a key difference between Mufasa 1.0 and [[System#Mufasa 2.0|Mufasa 2.0]].&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
SLURM provides two commands to run jobs, called [https://slurm.schedmd.com/srun.html srun] and [https://slurm.schedmd.com/sbatch.html sbatch]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun [options] &amp;lt;command_to_be_run_via_SLURM&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch [options] &amp;lt;command_to_be_run_via_SLURM&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; can be any Linux program (including shell scripts). By using &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;, the  command or script specified by &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; (including any programs launched by it) are added to SLURM&amp;#039;s execution queues.&lt;br /&gt;
&lt;br /&gt;
The main difference between &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; is that the first locks the shell from which it has been launched, so it is only really suitable for &amp;#039;&amp;#039;&amp;#039;interactive jobs&amp;#039;&amp;#039;&amp;#039;: i.e., processes that use the console to interact with their user during job execution. &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;, on the other side, does not lock the shell and simply adds the job to the queue, but does not allow the user to interact with the process while it is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; provides an additional possibility: &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; can in fact be an [[#Using execution scripts to run jobs|&amp;#039;&amp;#039;&amp;#039;execution script&amp;#039;&amp;#039;&amp;#039;]], i.e. a special (and SLURM-specific) type of Linux shell script that includes &amp;#039;&amp;#039;&amp;#039;SBATCH directives&amp;#039;&amp;#039;&amp;#039;. SBATCH directives can be used to specify the values of some of the parameters that would otherwise have to be set using the &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; part of the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command. This is handy because it allows to write down the parameters in an execution script instead of having to write them in the command line while launching a job, which greatly reduces the possibility of mistakes. Also, an execution script is easy to keep and reuse.&lt;br /&gt;
&lt;br /&gt;
Immediately after a &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command is launched by a user, SLURM outputs a message informing the user that the job has been queued. The output is similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun: job 10849 queued and waiting for resources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The shell is now locked while SLURM prepares the execution of the user program ([[#Detaching from a running job with screen|if you are using &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; you can detach from that shell and come back later]]). &lt;br /&gt;
&lt;br /&gt;
When SLURM is ready to run the program, it prints a message similar to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun: job 10849 has been allocated resources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and then executes the program.&lt;br /&gt;
&lt;br /&gt;
=== Options of &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; part of &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; commands is used to tell SLURM what resources the job needs to be executed the job and how much time it will need to complete its execution.&lt;br /&gt;
&lt;br /&gt;
For what concerns resources, the most important option is &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt;, specifying which SLURM [[#SLURM Quality of Service (QOS)|SLURM QOS]] the job will use. A job run with a given QOS has access to all and only the resources available to that QOS. As a consequence, all options that define how many resources to assign the job will only be able to provide the job with resources that are available to the chosen QOS. Jobs that require resources that are not available to the chosen QOS do not get executed. &lt;br /&gt;
&lt;br /&gt;
If the user forgets to use option &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt;, the job is run on the &amp;#039;&amp;#039;default qos&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt;) which has access to &amp;#039;&amp;#039;zero&amp;#039;&amp;#039; resources. Therefore it is always necessary to specify option &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt; when launching a SLURM job on Mufasa.&lt;br /&gt;
&lt;br /&gt;
More generally, the most relevant among the &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; are:&lt;br /&gt;
&lt;br /&gt;
:;‑-qos=&amp;lt;qos__name&amp;gt;&lt;br /&gt;
:: specifies the [[SLURM#SLURM Quality of Service (QOS)|SLURM QOS]] that the job will use. It is mandatory to specify one.&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! The chosen QOS limits the resources that can be requested, since it is not allowed to request resources (type or quantity) that exceed what is available to the chosen QOS.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! If &amp;lt;code&amp;gt;‑‑qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt; is used and options that specify how many resources to assign to the job (such as &amp;lt;code&amp;gt;‑‑mem=&amp;lt;mem_resources&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;‑‑cpus‑per‑task=&amp;lt;cpu_amount&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;‑‑time=&amp;lt;duration&amp;gt;&amp;lt;/code&amp;gt;) are omitted, the job is assigned the default amount of the resource (as defined by the chosen QOS. A notable exception concerns option &amp;lt;code&amp;gt;‑‑gres=&amp;lt;gpu_resources&amp;gt;&amp;lt;/code&amp;gt;, which is always required (see below) if the job uses a QOS with access to GPUs.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; --job-name=&amp;lt;jobname&amp;gt;&lt;br /&gt;
:: Specifies a name for the job. The specified name will appear along with the JOBID number when querying running jobs on the system with &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;. The default job name (i.e., the one assigned to the job when &amp;lt;code&amp;gt;--job-name&amp;lt;/code&amp;gt; is not used) is the executable program&amp;#039;s name.&lt;br /&gt;
&lt;br /&gt;
:;‑‑gres=&amp;lt;gpu_resources&amp;gt;&lt;br /&gt;
:: specifies what GPUs to assign to the job. &amp;lt;code&amp;gt;gpu_resources&amp;lt;/code&amp;gt; is a comma-delimited list where each element has the form &amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;amount&amp;gt;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;&amp;lt;Type&amp;gt;&amp;lt;/code&amp;gt; is one of the types of GPU available on Mufasa (see [[SLURM#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) and &amp;lt;code&amp;gt;&amp;lt;amount&amp;gt;&amp;lt;/code&amp;gt; is an integer between 1 and the number of GPUs of such type available to the partition. For instance, &amp;lt;code&amp;gt;&amp;lt;gpu_resources&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;gpu:40gb:1,gpu:3g.20gb:1&amp;lt;/code&amp;gt;, corresponding to asking for one &amp;quot;full&amp;quot; GPU and 1 &amp;quot;small&amp;quot; GPU.&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! The &amp;lt;code&amp;gt;‑‑gres&amp;lt;/code&amp;gt; parameter is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039; if the job is run with a QOS that allows access to the system&amp;#039;s GPUs. Differently from other resources (where unspecified requests lead to the assignment of a default amount), GPUs must always be explicitly requested.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:;‑‑mem=&amp;lt;mem_resources&amp;gt;&lt;br /&gt;
:: specifies the amount of RAM to assign to the job; for instance, &amp;lt;code&amp;gt;&amp;lt;mem_resources&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;200G&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:;‑‑cpus-per-task=&amp;lt;cpu_amount&amp;gt;&lt;br /&gt;
:: specifies how many CPUs to assign to the job; for instance, &amp;lt;code&amp;gt;&amp;lt;cpu_amount&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;nowiki&amp;gt;‑‑time=&amp;lt;duration&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:: specifies the maximum time allowed to the job to complete, in the format &amp;lt;code&amp;gt;days-hours:minutes:seconds&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; is optional; for instance, &amp;lt;code&amp;gt;&amp;lt;d-hh:mm:ss&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;72:00:00&amp;lt;/code&amp;gt;. When the time expires, the job (if still running) gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
:;‑‑pty&lt;br /&gt;
:: specifies that the job will be interactive (this is necessary when &amp;lt;code&amp;gt;&amp;lt;command_to_run_within_container&amp;gt;&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;/bin/bash&amp;lt;/code&amp;gt;: see [[#Interactive jobs|Interactive jobs]])&lt;br /&gt;
&lt;br /&gt;
Note that GPU resources (if needed) must always be requested explicitly. For instance, in order to execute program &amp;lt;code&amp;gt;./my_program&amp;lt;/code&amp;gt; which needs one GPU of type &amp;lt;code&amp;gt;3g.20gb&amp;lt;/code&amp;gt; with QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; we can use the SLURM command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun --qos=gpulight --gres=gpu:3g.20gb:1 ./my_program&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interactive jobs ==&lt;br /&gt;
&lt;br /&gt;
An &amp;#039;&amp;#039;&amp;#039;interactive job&amp;#039;&amp;#039;&amp;#039; is a process that use the console to interact with their user during job execution. Such a process is manually run by the user from a &amp;#039;&amp;#039;bash shell&amp;#039;&amp;#039; (i.e. a terminal session) provided by SLURM. &lt;br /&gt;
&lt;br /&gt;
In order to ask SLURM to schedule the execution of a shell where the user can subsequently run the interactive job, it is necessary to use option &amp;lt;code&amp;gt;--pty&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instance, to ask SLURM to run a shell with QOS &amp;lt;code&amp;gt;nogpu&amp;lt;/code&amp;gt;, the user should use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun --qos=nogpu --pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By not specifying any other options, the user is telling SLURM that they want the shell spawned by SLURM to be provided with the default amount of resources associated to QOS &amp;lt;code&amp;gt;nogpu&amp;lt;/code&amp;gt;. More generally, any combination of the other [[#Options of srun and sbatch|options of srun]] can be used together with &amp;lt;code&amp;gt;--pty&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As every other job request to SLURM, the request to run a shell must be done from the [[System#Login server|login server]]. As soon as possible (i.e., as soon as the necessary resources are available) SLURM will open (in the same terminal that the user used to launch the &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command) a bash shell, where the user will be able to run their interactive programs. &lt;br /&gt;
&lt;br /&gt;
To the user, this corresponds to the fact that the shell they were using to interact with the login server changes into a shell opened &amp;#039;&amp;#039;directly on Mufasa&amp;#039;&amp;#039;. This corresponds to the command prompt changing from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;username&amp;gt;@mufasa2-login:~$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;username&amp;gt;@mufasa2:~$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another way to know if the current shell is the “base” shell or one run via SLURM is to execute command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
echo $SLURM_JOB_ID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no number gets printed, this means that the shell is the “base” one. If a number is printed, it is the SLURM job ID of the /bin/bash process.&lt;br /&gt;
&lt;br /&gt;
When the user does not need the SLURM-spawned shell anymore, they should close it with command (the same used for any other Linux shell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to make the resources reserved for the interactive shell free again.&lt;br /&gt;
&lt;br /&gt;
== Non-interactive jobs ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands are very complex, and it&amp;#039;s easy to forget some option or make mistakes while using them. For non-interactive jobs, there is a solution to this problem.&lt;br /&gt;
&lt;br /&gt;
When the user job is non-interactive, in fact, the &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command can be substituted with a much simpler &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command&amp;#039;&amp;#039;&amp;#039;. As [[#Running jobs with SLURM|already explained]], &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; can make use of an &amp;#039;&amp;#039;&amp;#039;execution script&amp;#039;&amp;#039;&amp;#039; to specify all the parts of the command to be run via SLURM. So the command becomes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch &amp;lt;execution_script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An execution script is a special type of Linux script that includes &amp;#039;&amp;#039;&amp;#039;SBATCH directives&amp;#039;&amp;#039;&amp;#039;. SBATCH directives are used to specify the values of the parameters that are otherwise set in the [options] part of an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Note on Linux shell scripts&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;A shell script is a text file that will be run by the bash shell. In order to be acceptable as a bash script, a text file must:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;have the “executable” flag set&amp;#039;&amp;#039; (see [[System#Changing file/directory ownership and permissions|here]] for details)&lt;br /&gt;
* &amp;#039;&amp;#039;have&amp;#039;&amp;#039; &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;as its very first line&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Usually, a Linux shell script is given a name ending in &amp;#039;&amp;#039;.sh,&amp;#039;&amp;#039; such as &amp;#039;&amp;#039;my_execution_script.sh&amp;#039;&amp;#039;, but this is not mandatory.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Within any shell script, lines preceded by &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; are comments (with the notable exception of the initial&amp;#039;&amp;#039; &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;line)&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Use of blank lines as spacers is allowed.&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An execution script is a Linux shell script composed of two parts:&lt;br /&gt;
&lt;br /&gt;
# a &amp;#039;&amp;#039;&amp;#039;preamble&amp;#039;&amp;#039;&amp;#039;,  composed of directives using which the user specifies the values to be given to parameters, each preceded by the keyword &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt;&lt;br /&gt;
# [optionally] one or more &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands&amp;#039;&amp;#039;&amp;#039; that launch jobs with SLURM using the parameter values specified in the preamble&lt;br /&gt;
&lt;br /&gt;
Below is an &amp;#039;&amp;#039;&amp;#039;execution script template&amp;#039;&amp;#039;&amp;#039; to be copied and pasted into your own execution script text file. &lt;br /&gt;
&lt;br /&gt;
The template includes all the options [[#Using SLURM to run a container|already described above]], plus a few additional useful ones (for instance, those that enable SLURM to send email messages to the user in correspondence to events in the lifecycle of their job). Information about all the possible options can be found in [SLURM&amp;#039;s own documentation].&lt;br /&gt;
&lt;br /&gt;
In the template below, &amp;#039;&amp;#039;&amp;#039;#SBATCH directives&amp;#039;&amp;#039;&amp;#039; are requests made to SLURM. Notice that, though #SBATCH directives have a leading &amp;quot;#&amp;quot;, that does &amp;#039;&amp;#039;not&amp;#039;&amp;#039; mean that they are comments: exactly as the &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; at the beginning of a shell script, while starting with &amp;quot;#&amp;quot;, is not a comment as well.&lt;br /&gt;
&lt;br /&gt;
Other lines in the script that begin with &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; not followed by SBATCH are comments.&lt;br /&gt;
&lt;br /&gt;
For what concerns directive that ask for a given amount of a resource (including time), if they are missing from the execution script (or commented out) the job will be assigned the default amount of the resource.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;!/bin/bash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------start of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-nodes=1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑ntasks=1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-partition=jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-qos=&amp;lt;qos_name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑gres=&amp;lt;gpu_resources&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑mem=&amp;lt;mem_resources&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑cpus-per-task=&amp;lt;cpu_amount&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑time=&amp;lt;d-hh:mm:ss&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑output=./&amp;lt;filename&amp;gt;-%j.out&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; the text file where the output of the job gets written (i.e., standard output gets redirected onto the file). &amp;quot;%j&amp;quot; is the current time.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑error=./&amp;lt;filename&amp;gt;-error-%j.out&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; the text file where any error messages generated by the job gets written (i.e., standard error gets redirected onto the file). &amp;quot;%j&amp;quot; is the current time.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH --job-name=&amp;lt;name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------end of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Executing jobs on Mufasa =&lt;br /&gt;
&lt;br /&gt;
== Key concept ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The key concept about executing jobs on Mufasa is that [[System#Containers|all computation on Mufasa must occur within containers]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A container is a “sandbox” containing the environment where the user&amp;#039;s application operates. Parts of Mufasa&amp;#039;s filesystem can be made visible (and writable, if the user has writing permission on them: e.g., the user&amp;#039;s &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory) to the environment of the container. This allows the containerized user application to read from, and write to, Mufasa&amp;#039;s filesystem: for instance, to read data and write results.&lt;br /&gt;
&lt;br /&gt;
The system used by Mufasa to create and execute containers is &amp;#039;&amp;#039;&amp;#039;[[System#Singularity|Singularity]]&amp;#039;&amp;#039;&amp;#039;. This wiki includes [[Singularity|directions]] on preparing containers with Singularity.&lt;br /&gt;
&lt;br /&gt;
The container where a user job runs must contain all the libraries needed by the job. In fact (for maintainability and safety reasons) &amp;#039;&amp;#039;&amp;#039;no software and no libraries are installed on Mufasa 2.0&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Interactive and non-interactive user jobs ==&lt;br /&gt;
&lt;br /&gt;
This section explains how to execute a user job contained in a container. It considers two types of user jobs, i.e.:&lt;br /&gt;
;: Interactive user jobs&lt;br /&gt;
::: as [[#Interactive jobs|already explained]], these are jobs that require interaction with the user while they are running, via a bash shell running within the container. The shell is used to receive commands from the user and/or print output messages. For interactive user jobs, the job is usually launched manually by the user (with a command issued via the shell) after the container is in execution.&lt;br /&gt;
&lt;br /&gt;
;: Non-interactive user jobs&lt;br /&gt;
::: are the most common variety. The user prepares the container in such a way that, when in execution, the container autonomously puts the user&amp;#039;s jobs into execution. The user does not have any communication with the container while it is in execution. Executing the container and running the required programs within the container&amp;#039;s environment is done via [[#Interactive jobs|execution scripts]].&lt;br /&gt;
&lt;br /&gt;
== Using SLURM to run an interactive job on Mufasa ==&lt;br /&gt;
&lt;br /&gt;
The first step to run an interactive user job on Mufasa is to run the [[System#Containers|container]] where the job will take place. Each user is in charge of preparing the container(s) where the user&amp;#039;s jobs will be executed.&lt;br /&gt;
&lt;br /&gt;
In order to run a container via SLURM by hand, i.e. via an interactive shell, a user must first open the shell with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun [general_SLURM_options] ‑‑pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where [general_SLURM_options] are those [[#Options of srun and sbatch|already described above]].&lt;br /&gt;
&lt;br /&gt;
Then the user must run the container: this is done as follows.&lt;br /&gt;
&lt;br /&gt;
First, it is necessary to load the Singularity software module with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
module load amd/singularity&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(if needed, the list of software modules available in the system can be obtained with command &amp;lt;code&amp;gt;module av&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then, the user must use Singularity to run the container with command (see the [[Singularity|section about Singularity]] for further details)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity run &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which pulls the container from the specified repository and executes it. Possible values for &amp;lt;code&amp;gt;&amp;lt;repository&amp;gt;&amp;lt;/code&amp;gt; are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;docker&amp;lt;/code&amp;gt; (Docker Hub)&lt;br /&gt;
:: &amp;lt;code&amp;gt;library&amp;lt;/code&amp;gt; (Singularityhub)&lt;br /&gt;
:: &amp;lt;code&amp;gt;path/to/container&amp;lt;/code&amp;gt; if the container is local, i.e. located in the filesystem of Mufasa&lt;br /&gt;
&lt;br /&gt;
As soon as the container is in execution, the terminal window used, so far, to interact with Mufasa becomes a shell &amp;#039;&amp;#039;in the container&amp;#039;&amp;#039;. This shell belongs to the software environment of the container, and the user can use it to interact with the container&amp;#039;s own software environment and filesystem. &lt;br /&gt;
&lt;br /&gt;
It is easy to understand if a shell is open to Mufasa or to the container because in a container shell the system prompt becomes &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interaction between container filesystem and local filesystem === &lt;br /&gt;
&lt;br /&gt;
The filesystem inside the container and the local one, i.e. Mufasa&amp;#039;s, can interact. This means that the container can access the local filesystem to read and/or write files. However, the only parts of Mufasa&amp;#039;s filesystem that can be accessed by the container are those that the user running the container has access rights to.&lt;br /&gt;
&lt;br /&gt;
As a default, the user&amp;#039;s &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; directory on Mufasa is automatically mapped onto &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; into the filesystem of the container. Whatever is done to that container directory, the changes are actually applied to the local &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; directory on Mufasa. &lt;br /&gt;
&lt;br /&gt;
The mapping of the home directory does not need to be explicitly requested. However, if the user needs (in addition to the home directory) other parts of the local filesystem of Mufasa to be mapped onto the container&amp;#039;s filesystem, this is possible by using this modified version of the &amp;lt;code&amp;gt;singularity run&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity run --bind &amp;lt;/path/to/local/directory&amp;gt;:&amp;lt;path/to/container/directory&amp;gt; &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;&amp;lt;path/to/container/directory&amp;gt;&amp;lt;/code&amp;gt; does not exist in the container&amp;#039;s filesystem, it gets created by Singularity.&lt;br /&gt;
&lt;br /&gt;
=== How to know if your shell is a SLURM job ===&lt;br /&gt;
To know if the shell you are using is being run via SLURM or not (becoming confused is easy), use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
echo $SLURM_JOB_ID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it provides an output, your shell is a SLURM job and the output is the ID of the job. &lt;br /&gt;
If it doesn&amp;#039;t provide any output, your shell is not a SLURM job.&lt;br /&gt;
&lt;br /&gt;
== Using SLURM to run a non-interactive job on Mufasa ==&lt;br /&gt;
&lt;br /&gt;
When the user job to be executed into a container is non-interactive, the mechanism based on an &amp;#039;&amp;#039;execution script&amp;#039;&amp;#039; already described in [[#Non-interactive jobs|Non-interactive jobs]] is employed. The command to run the script which in turn will run the container where the user job takes place is therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch &amp;lt;execution_script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The general features of a SLURM execution script and the SBATCH directives used for generic jobs have [[#Non-interactive jobs|already been described]]. Here we focus, therefore, on the SBATCH directives specifically used when SLURM is used to run a non-interactive job within a container.&lt;br /&gt;
&lt;br /&gt;
Below is an &amp;#039;&amp;#039;&amp;#039;execution script template&amp;#039;&amp;#039;&amp;#039; to be copied and pasted into your own execution script text file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;!/bin/bash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------start of preamble----------------&lt;br /&gt;
&lt;br /&gt;
[[#Non-interactive jobs|#SBATCH directives already described above]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------end of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;module load amd/singularity&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;singularity run &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt; &amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the last line of the script, &amp;lt;code&amp;gt;&amp;lt;command_to_run&amp;gt;&amp;lt;/code&amp;gt; is the command (e.g., the name of an executable script), complete with path within the container&amp;#039;s filesystem, of the program to be run into the container. Please refer to the [[Singularity|section about Singularity]] for details about its commands.&lt;br /&gt;
&lt;br /&gt;
The interactions between container filesystem and local filesystem in non-interactive jobs are exactly the same [[#Interaction between container filesystem and local filesystem|already described]] for interactive jobs. In particular, the user&amp;#039;s home directory is mapped by default onto the filesystem of the container.&lt;br /&gt;
&lt;br /&gt;
If, in addition to that, the user needs another part of the filesystem of Mufasa are to be mapped onto the container&amp;#039;s filesystem, this is possible using this modified version of the &amp;lt;code&amp;gt;singularity run&amp;lt;/code&amp;gt; command at the end of the script:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;singularity run --bind &amp;lt;/path/to/local/directory&amp;gt;:&amp;lt;path/to/container/directory&amp;gt; &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;&amp;lt;path/to/container/directory&amp;gt;&amp;lt;/code&amp;gt; does not exist in the container&amp;#039;s filesystem, it gets created by Singularity.&lt;br /&gt;
&lt;br /&gt;
== Job output ==&lt;br /&gt;
&lt;br /&gt;
The whole point of running a user job is to collect its output. Usually, such output takes the form of one or more files generated within the filesystem of Mufasa by the container where the computation takes place. &lt;br /&gt;
&lt;br /&gt;
As [[#Using SLURM to run a container|explained below]], SLURM includes a mechanism to mount a part of Mufasa&amp;#039;s own filesystem onto the container&amp;#039;s filesystem: so when the job running within the container writes to this mounted part, it actually writes to Mufasa&amp;#039;s filesystem. This means that when the container ends its execution, its output files persist in Mufasa&amp;#039;s filesystem (usually in a subdirectory of the user&amp;#039;s own &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory) and can be retrieved by the user at a later time.&lt;br /&gt;
&lt;br /&gt;
The same mechanism can be used to allow user jobs running into a container to read their input data from Mufasa&amp;#039;s filesystem (usually a subdirectory of the user&amp;#039;s own &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory).&lt;br /&gt;
&lt;br /&gt;
== Cancelling completed jobs ==&lt;br /&gt;
&lt;br /&gt;
When a user process run via SLURM has completed its execution and is not needed anymore, it is important to [[User_Jobs#Canceling_a_job_with_scancel|close it with scancel]]. Especially if much time remains to the end of the execution time requested by the job.&lt;br /&gt;
&lt;br /&gt;
Cancelling a SLURM job makes the resources reserved by SLURM free again for other users, and thus speeds up the execution of the jobs still queued.&lt;br /&gt;
&lt;br /&gt;
Typically, one doesn&amp;#039;t know how long a piece of code will take to complete its work. So please make sure to check from time to time if that happened, and -if there&amp;#039;s still time before the duration of your SLURM job ends- just &amp;#039;&amp;#039;scancel&amp;#039;&amp;#039; the job. Other users will be grateful :-)&lt;br /&gt;
&lt;br /&gt;
Please note that [[System#Job priority|job priority]] for your user depends (also) on the overall duration of the jobs that you ran on Mufasa. Therefore, &amp;#039;&amp;#039;&amp;#039;cancelling jobs that are not needed anymore improves your future jobs&amp;#039; priority&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
= Detaching from a running job with &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
A consequence of the way &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; operates is that if you launch an [[#Interactive and non-interactive user jobs|interactive user job]], the shell where the command is running must remain open: if it closes, the job terminates. That shell runs in the terminal of your own PC where the [[System#Accessing Mufasa|SSH connection to Mufasa]] exists.&lt;br /&gt;
&lt;br /&gt;
If you do not plan to keep the SSH connection to Mufasa open (for instance because you have to turn off or suspend your PC), there is a way to keep your interactive job alive. Namely, you should use command &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; inside a &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (often simply called &amp;quot;a screen&amp;quot;), then &amp;#039;&amp;#039;detach&amp;#039;&amp;#039; from the &amp;#039;&amp;#039;screen&amp;#039;&amp;#039; ([https://linuxize.com/post/how-to-use-linux-screen/ here] is one of many tutorials about &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; available online). &lt;br /&gt;
&lt;br /&gt;
Once you have detached from the screen session, you can close the SSH connection to Mufasa without damage. When you need to reach your (still running) job again, you can can open a new SSH connection to Mufasa and then &amp;#039;&amp;#039;reattach&amp;#039;&amp;#039; to the &amp;#039;&amp;#039;screen&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A use case for screen is writing your program in such a way that it prints progress advancement messages as it goes on with its work. Then, you can check its advancement by periodically reconnecting to the screen where the program is running and reading the messages it printed.&lt;br /&gt;
&lt;br /&gt;
Basic usage of &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; is explained below.&lt;br /&gt;
&lt;br /&gt;
== Creating a screen session, running a job in it, detaching from it ==&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]] with SSH&lt;br /&gt;
# From the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
# In the &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (&amp;quot;screen&amp;quot;) thus created (it has the look of an empty shell), launch your job with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;#039;&amp;#039;Detach&amp;#039;&amp;#039; from the screen by pressing &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;: you will come back to the original login server shell, while your process will go on running in the screen&lt;br /&gt;
# You can now close the SSH connection to the login server without damaging your running job&lt;br /&gt;
&lt;br /&gt;
== Reattaching to an active screen session ==&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]] with SSH&lt;br /&gt;
# In the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You are now back to the screen where you launched your job&lt;br /&gt;
&lt;br /&gt;
== Closing (i.e. destroying) a screen session ==&lt;br /&gt;
&lt;br /&gt;
When you do not need a screen session anymore:&lt;br /&gt;
&lt;br /&gt;
# reattach to the active screen session as explained [[#Reattaching to an active screen session|above]]&lt;br /&gt;
# destroy the screen by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash), then confirming that you really want to proceed&lt;br /&gt;
&lt;br /&gt;
Of course, any program (including SLURM jobs) running within the screen gets terminated when the screen is destroyed.&lt;br /&gt;
&lt;br /&gt;
= Using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; to reserve resources =&lt;br /&gt;
&lt;br /&gt;
== What is &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
[https://slurm.schedmd.com/salloc.html &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;] is a SLURM command that allows a user to reserve a set of resources (e.g., a 40 GB GPU) for a given time in the future.&lt;br /&gt;
&lt;br /&gt;
The typical use of &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; is to &amp;quot;book&amp;quot; an interactive session where the user enjoys &amp;#039;&amp;#039;&amp;#039;complete control of a set of resources&amp;#039;&amp;#039;&amp;#039;. The resources that are part of this set are chosen by the user. Within the &amp;quot;booked&amp;quot; session, any job run by the user that relies on the reserved resources is immediately put into execution by SLURM.&lt;br /&gt;
&lt;br /&gt;
More precisely:&lt;br /&gt;
* the user, using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, specifies what resources they need and the time when they will need them;&lt;br /&gt;
* when the delivery comes, SLURM creates an interactive shell session for the user;&lt;br /&gt;
* within such session, the user can use &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; to run programs, enjoying full (i.e. not shared with anyone else) and instantaneous access to the resources.&lt;br /&gt;
&lt;br /&gt;
Resource reservation using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; is only possible if the request is done in advance wrt the delivery time. The more the resources that the user wants to reserve are in high demand, the more anticipated the request should be to ensure that SLURM is able to fulfill it.&lt;br /&gt;
&lt;br /&gt;
When a user makes a request for resources with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, the request (called an &amp;#039;&amp;#039;&amp;#039;allocation&amp;#039;&amp;#039;&amp;#039;) gets added to the job queue of SLURM of the requisite partition as a job in &amp;lt;code&amp;gt;pending&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;) state (job states are described [[User_Jobs#Interpreting Job state as provided by squeue|here]]). Indeed, resource allocation is the first part of SLURM&amp;#039;s process of executing a user job, while the second part is running the program and letting it use the allocated resources. Using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; actually corresponds to having SLURM perform the first part of the process (resource allocation) while leaving the second part (running programs) to the user.&lt;br /&gt;
&lt;br /&gt;
Until the delivery time specified by the user comes, the allocation remains in state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;, and other jobs requesting the same resources, even if submitted later, are executed. While the request waits for the delivery time, however, it accumulates a priority that increases over time. The longer the allocation stays in the &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt; state, the stronger this accumulation of priority: so, by requesting resources with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;&amp;#039;well in advance of the delivery time&amp;#039;&amp;#039;&amp;#039;, users can ensure that the resources they need will be ready for them at the requested delivery time, even if these resources are highly contended.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; commands ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; commands use a similar syntax to &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands. In particular, &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; lets a user specify what resources they need and -importantly- a &amp;#039;&amp;#039;&amp;#039;delivery time&amp;#039;&amp;#039;&amp;#039; for the requested resources (delivery time can also be specified with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt;, but in that case it is not very useful). &lt;br /&gt;
&lt;br /&gt;
The typical &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command has this form:&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
salloc [general_SLURM_options] --begin=&amp;lt;time&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
:; [general_SLURM_options]&lt;br /&gt;
:: represents the options already described in [[#Options of srun and sbatch|Options of srun and sbatch]]&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;nowiki&amp;gt;--begin=&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:: specifies the delivery time of the resources reserved with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, according to the syntax described below. The delivery time must be a future time.&lt;br /&gt;
&lt;br /&gt;
=== Syntax of parameter &amp;lt;code&amp;gt;--begin&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
If the allocation is for the current day, you can specify &amp;lt;nowiki&amp;gt;&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt; as hours and minutes in the form&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;HH:MM&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to specify a time of a different day, the form for &amp;lt;time&amp;gt; is &amp;lt;code&amp;gt;YYYY-MM-DDTHH:MM&amp;lt;/code&amp;gt;, where the uppercase &amp;#039;T&amp;#039; separates date from time. &lt;br /&gt;
&lt;br /&gt;
It is also possible to specify &amp;lt;time&amp;gt; as relative to the current time, in one of the following forms:&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Kminutes&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Khours&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Kdays&amp;lt;/code&amp;gt;&lt;br /&gt;
where K is a (positive) integer.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=16:00&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=now+1hours&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=now+1days&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=2030-01-20T12:34:00&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that Mufasa&amp;#039;s time zone is GMT, so &amp;lt;nowiki&amp;gt;&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt; must be expressed in GMT as well. If you want to know Mufasa&amp;#039;s current time, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
date&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Thu Nov 10 16:43:30 UTC 2022&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In the typical scenario, the user of &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; will make use of [[User_Jobs#Detaching from a running job with screen|screen]]. Command &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; creates a shell session (called &amp;quot;a screen&amp;quot;) that it is possible to abandon without closing it ([[#Creating_a_screen_session.2C_running_a_job_in_it.2C_detaching_from_it|detaching from the screen]]). It is then possible to reach again the screen at a later time ([[#Reattaching_to_an_active_screen_session|reattaching to the screen]]). This means that a user can create a screen, run &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; within it to create an allocation for time X, detach from the screen and reattach to it just before time X to use the reserved resources from the interactive session created by &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
More precisely, the operations needed to do this are the following:&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]].&lt;br /&gt;
# From the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
# In the &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (&amp;quot;screen&amp;quot;) thus created run the [[#salloc commands|&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command]], specifying via its options the resources you need and the time at which you want them delivered.&lt;br /&gt;
# SLURM will respond with a message similar to &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;salloc: Pending job allocation XXXX&amp;lt;/pre&amp;gt;&lt;br /&gt;
# &amp;#039;&amp;#039;Detach&amp;#039;&amp;#039; from the screen by pressing &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;: you will come back to the original login server shell.&lt;br /&gt;
# You can now close the SSH connection to the login server without damaging your resource allocation request.&lt;br /&gt;
# At the delivery time you specified in the [[#salloc commands|&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command]], connect to the login server with SSH.&lt;br /&gt;
# Once you are in the login server shell, reattach to the screen with command &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You are now back to the screen where you used &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;; as soon as SLURM provides to you with the resources you reserved, message &amp;quot;&amp;#039;&amp;#039;salloc: Pending job allocation XXXX&amp;#039;&amp;#039;&amp;quot; changes to the shell prompt.&lt;br /&gt;
# You are now in the interactive shell session you booked with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;. From here, you can run any programs you want, including &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;. For the whole duration of the allocation, your programs have unrestricted use of all the resources you reserved with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;Important!&amp;#039;&amp;#039;&amp;#039; Any job run within the shell session is subject to the time limit (i.e., maximum duration) imposed by the partition it is running on! Therefore, if the job reaches the time limit, it gets &amp;#039;&amp;#039;&amp;#039;forcibly terminated&amp;#039;&amp;#039;&amp;#039; by SLURM. Termination depends exclusively from the time limit: so it occurs even if the end time for the allocation has not been reached yet. (Of course, the job also gets terminated if the allocation ends.)&lt;br /&gt;
# Once the interactive shell session is not needed anymore, cancel it by exiting from the session with &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;exit&amp;lt;/pre&amp;gt; (Note that if you get to the end of the time period you specified in your request without closing the shell session, SLURM does it for you, killing any programs still running.)&lt;br /&gt;
# You are now back to your screen. Destroy it by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash) to get back to the login server shell.&lt;br /&gt;
&lt;br /&gt;
== Cancelling a resource request made with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
To cancel a request for resources made as explained in [[#How to use salloc|How to use &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;]], follow these steps:&lt;br /&gt;
&lt;br /&gt;
# Connect to the the [[System#Login server|login server]] with SSH.&lt;br /&gt;
# Once you are in the login server shell, reattach to the screen where you used command &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; with command &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You should see the message &amp;quot;&amp;#039;&amp;#039;salloc: Pending job allocation XXXX&amp;#039;&amp;#039;&amp;quot; (if the allocation is still pending) or &amp;quot;&amp;quot;&amp;#039;&amp;#039;salloc: job XXXX queued and waiting for resources&amp;#039;&amp;#039;&amp;quot; (if the allocation is done and waiting for its start time). Now just press &amp;#039;&amp;#039;&amp;#039;Ctrl + C&amp;#039;&amp;#039;&amp;#039;. This communicates to SLURM your intention to cancel your request for resources.&lt;br /&gt;
# SLURM will communicate the cancellation with message &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;salloc: Job allocation XXXX has been revoked.&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Destroy the screen by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash) to get back to the login server shell.&lt;br /&gt;
&lt;br /&gt;
= Monitoring and managing jobs =&lt;br /&gt;
&lt;br /&gt;
SLURM provides Job Users with tools to inspect and manage jobs. While a [[Roles|Job User]] is able to see all users&amp;#039; jobs, they are only allowed to interact with their own.&lt;br /&gt;
&lt;br /&gt;
The main commands used to interact with jobs are &amp;#039;&amp;#039;&amp;#039;[https://slurm.schedmd.com/squeue.html &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]&amp;#039;&amp;#039;&amp;#039; to inspect the scheduling queues and &amp;#039;&amp;#039;&amp;#039;[https://slurm.schedmd.com/scancel.html &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;]&amp;#039;&amp;#039;&amp;#039; to terminate queued or running jobs.&lt;br /&gt;
&lt;br /&gt;
== Inspecting jobs with &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Running command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
  520       fat     bash acasella  R 2-04:10:25      1 gn01&lt;br /&gt;
  523       fat     bash amarzull  R    1:30:35      1 gn01&lt;br /&gt;
  522       gpu     bash    clena  R   20:51:16      1 gn01&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This output comprises the following information:&lt;br /&gt;
&lt;br /&gt;
:; JOBID&lt;br /&gt;
:: Numerical identifier of the job assigned by SLURM&lt;br /&gt;
:: This identifier is used to intervene on the job, for instance with &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: the partition that the job is run on&lt;br /&gt;
&lt;br /&gt;
:; NAME&lt;br /&gt;
:: the name assigned to the job; can be personalised using the &amp;lt;code&amp;gt;--job-name&amp;lt;/code&amp;gt; option&lt;br /&gt;
&lt;br /&gt;
:; USER&lt;br /&gt;
:: username of the user who launched the job&lt;br /&gt;
	&lt;br /&gt;
:; ST&lt;br /&gt;
:: job state (see [[SLURM#Job state|Job state]] for further information)&lt;br /&gt;
&lt;br /&gt;
:; TIME&lt;br /&gt;
:: time that has passed since the beginning of job execution&lt;br /&gt;
&lt;br /&gt;
:; NODES&lt;br /&gt;
:: number of nodes where the job is being executed (for Mufasa, this is always 1 as it is a single machine)&lt;br /&gt;
&lt;br /&gt;
:; NODELIST (REASON)&lt;br /&gt;
:: name of the nodes where the job is being executed: for Mufasa it is always &amp;lt;code&amp;gt;gn01&amp;lt;/code&amp;gt;, which is the name of the node corresponding to Mufasa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To limit the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; to the jobs owned by user &amp;lt;code&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/code&amp;gt;, it can be used like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue -u &amp;lt;username&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Job state as provided by &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Jobs typically pass through several states in the course of their execution. Job state is shown in column &amp;quot;ST&amp;quot; of the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; as an abbreviated code (e.g., &amp;quot;R&amp;quot; for RUNNING).&lt;br /&gt;
&lt;br /&gt;
The most relevant codes and states are the following:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; PENDING&lt;br /&gt;
:: Job is awaiting resource allocation. &lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; RUNNING&lt;br /&gt;
:: Job currently has an allocation.&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; SUSPENDED&lt;br /&gt;
:: Job has an allocation, but execution has been suspended and CPUs have been released for other jobs. &lt;br /&gt;
 &lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;CG&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; COMPLETING&lt;br /&gt;
:: Job is in the process of completing. Some processes on some nodes may still be active. &lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;CD&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; COMPLETED&lt;br /&gt;
:: Job has terminated all processes on all nodes with an exit code of zero. &lt;br /&gt;
&lt;br /&gt;
Beyond these, there are other (less frequent) job states. [https://slurm.schedmd.com/squeue.html The SLURM doc page for &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;] provides a complete list of them.&lt;br /&gt;
&lt;br /&gt;
== Knowing when jobs are expected to end or start ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in understanding when jobs are expected to start or end, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue -o &amp;quot;%5i %8u %10P %.2t |%19S |%.11L|&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output is similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID USER     PARTITION  ST |START_TIME          |  TIME_LEFT|&lt;br /&gt;
5307  thuynh   fat        PD |2022-11-11T17:55:54 | 3-00:00:00|&lt;br /&gt;
5308  thuynh   fat        PD |2022-11-11T17:55:54 | 3-00:00:00|&lt;br /&gt;
5296  cziyang  fat         R |2022-11-08T16:58:03 | 1-00:48:14|&lt;br /&gt;
5306  thuynh   fat         R |2022-11-10T08:13:30 | 2-16:03:41|&lt;br /&gt;
5297  gnannini fat         R |2022-11-08T17:55:54 | 1-01:46:05|&lt;br /&gt;
5336  ssaitta  gpu         R |2022-11-10T08:13:00 |    6:03:11|&lt;br /&gt;
5358  dmilesi  gpulong     R |2022-11-10T15:11:32 | 2-23:01:43|&lt;br /&gt;
5338  cziyang  gpulong     R |2022-11-10T09:45:01 | 1-17:35:12|&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;:For running jobs (state &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt;):&lt;br /&gt;
::column &amp;quot;START_TIME&amp;quot; tells you when the job started its execution&lt;br /&gt;
::column &amp;quot;TIME_LEFT&amp;quot; tells you how much remains of the running time requested by the job&lt;br /&gt;
&lt;br /&gt;
;:For pending jobs (state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;):&lt;br /&gt;
::column &amp;quot;START_TIME&amp;quot; tells you when the job is expected to start its execution&lt;br /&gt;
::column &amp;quot;TIME_LEFT&amp;quot; tells you how much running time has been requested by the job&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Important!&amp;#039;&amp;#039;&amp;#039; Start and end times are forecasts based on the features of current jobs in the queues, and may change if running jobs end prematurely and/or if new jobs with higher priority are added to the queues. So these times should never be considered as certain.&lt;br /&gt;
&lt;br /&gt;
If you simply want to know when pending jobs (state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;) are expected to begin execution, use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue --start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which lists pending jobs in order of increasing START_TIME (the job on top is the one which will be run first). For each pending job the command provides an output similar to the example below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID PARTITION     NAME     USER ST          START_TIME  NODES SCHEDNODES           NODELIST(REASON)&lt;br /&gt;
 5090       fat training   thuynh PD 2022-10-27T09:28:01      1 (null)               (Resources)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting detailed information about a job ==&lt;br /&gt;
&lt;br /&gt;
If needed, complete information about a job (either pending or running) can be obtained using command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show job &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; is the number from the first column of the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;. The output of this command is similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JobId=65 JobName=test_script.sh&lt;br /&gt;
   UserId=gfontana(10003) GroupId=gfontana(10004) MCS_label=N/A&lt;br /&gt;
   Priority=14208 Nice=0 Account=admin QOS=nogpu&lt;br /&gt;
   JobState=RUNNING Reason=None Dependency=(null)&lt;br /&gt;
   Requeue=0 Restarts=0 BatchFlag=0 Reboot=0 ExitCode=0:0&lt;br /&gt;
   RunTime=00:00:55 TimeLimit=01:00:00 TimeMin=N/A&lt;br /&gt;
   SubmitTime=2025-11-06T10:31:10 EligibleTime=2025-11-06T10:31:10&lt;br /&gt;
   AccrueTime=2025-11-06T10:31:10&lt;br /&gt;
   StartTime=2025-11-06T10:31:10 EndTime=2025-11-06T11:31:10 Deadline=N/A&lt;br /&gt;
   SuspendTime=None SecsPreSuspend=0 LastSchedEval=2025-11-06T10:31:10 Scheduler=Main&lt;br /&gt;
   Partition=jobs AllocNode:Sid=mufasa2-login:42020&lt;br /&gt;
   ReqNodeList=(null) ExcNodeList=(null)&lt;br /&gt;
   NodeList=gn01&lt;br /&gt;
   BatchHost=gn01&lt;br /&gt;
   NumNodes=1 NumCPUs=1 NumTasks=1 CPUs/Task=1 ReqB:S:C:T=0:0:*:*&lt;br /&gt;
   ReqTRES=cpu=1,mem=4G,node=1,billing=1&lt;br /&gt;
   AllocTRES=cpu=1,mem=4G,node=1,billing=1&lt;br /&gt;
   Socks/Node=* NtasksPerN:B:S:C=0:0:*:* CoreSpec=*&lt;br /&gt;
   MinCPUsNode=1 MinMemoryNode=4G MinTmpDiskNode=0&lt;br /&gt;
   Features=(null) DelayBoot=00:00:00&lt;br /&gt;
   OverSubscribe=OK Contiguous=0 Licenses=(null) LicensesAlloc=(null) Network=(null)&lt;br /&gt;
   Command=./test_script.sh&lt;br /&gt;
   WorkDir=/home/gfontana&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In particular, the line beginning with &amp;#039;&amp;#039;&amp;quot;StartTime=&amp;quot;&amp;#039;&amp;#039; provides expected times for the start and end of job execution. As explained in [[User_Jobs#Knowing_when_jobs_are_expected_to_end_or_start|Knowing when jobs are expected to end or start]], start time is only a prediction and subject to change.&lt;br /&gt;
&lt;br /&gt;
== Cancelling a job with &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
It is possible to cancel a job using command &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;, either while it is waiting for execution or when it is in execution (in this case you can choose what system signal to send the process in order to terminate it). &lt;br /&gt;
&lt;br /&gt;
Please note that [[System#Job priority|job priority]] for your user depends (also) on the overall duration of the jobs that you ran on Mufasa. Therefore, &amp;#039;&amp;#039;&amp;#039;cancelling jobs that are not needed anymore improves your future jobs&amp;#039; priority&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The following are some examples of use of &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt; adapted from [https://slurm.schedmd.com/scancel.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
removes queued job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; from the execution queue.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --signal=TERM &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
terminates execution of job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; with signal SIGTERM (request to stop).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --signal=KILL &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
terminates execution of job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; with signal SIGKILL (force stop).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --state=PENDING --user=&amp;lt;username&amp;gt; --partition=&amp;lt;partition_name&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
cancels all pending jobs belonging to user &amp;lt;code&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/code&amp;gt; in partition &amp;lt;code&amp;gt;&amp;lt;partition_name&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Knowing what jobs you ran today ==&lt;br /&gt;
&lt;br /&gt;
Command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacct -X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a list of all jobs run today by your user.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=User_Jobs&amp;diff=2373</id>
		<title>User Jobs</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=User_Jobs&amp;diff=2373"/>
		<updated>2026-05-07T14:46:14Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* How to know if your shell is running within SLURM */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Running jobs with SLURM =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must&amp;#039;&amp;#039;&amp;#039; use SLURM to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM.&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa. This is a key difference between Mufasa 1.0 and [[System#Mufasa 2.0|Mufasa 2.0]].&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
SLURM provides two commands to run jobs, called [https://slurm.schedmd.com/srun.html srun] and [https://slurm.schedmd.com/sbatch.html sbatch]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun [options] &amp;lt;command_to_be_run_via_SLURM&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch [options] &amp;lt;command_to_be_run_via_SLURM&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; can be any Linux program (including shell scripts). By using &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;, the  command or script specified by &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; (including any programs launched by it) are added to SLURM&amp;#039;s execution queues.&lt;br /&gt;
&lt;br /&gt;
The main difference between &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; is that the first locks the shell from which it has been launched, so it is only really suitable for &amp;#039;&amp;#039;&amp;#039;interactive jobs&amp;#039;&amp;#039;&amp;#039;: i.e., processes that use the console to interact with their user during job execution. &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;, on the other side, does not lock the shell and simply adds the job to the queue, but does not allow the user to interact with the process while it is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; provides an additional possibility: &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; can in fact be an [[#Using execution scripts to run jobs|&amp;#039;&amp;#039;&amp;#039;execution script&amp;#039;&amp;#039;&amp;#039;]], i.e. a special (and SLURM-specific) type of Linux shell script that includes &amp;#039;&amp;#039;&amp;#039;SBATCH directives&amp;#039;&amp;#039;&amp;#039;. SBATCH directives can be used to specify the values of some of the parameters that would otherwise have to be set using the &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; part of the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command. This is handy because it allows to write down the parameters in an execution script instead of having to write them in the command line while launching a job, which greatly reduces the possibility of mistakes. Also, an execution script is easy to keep and reuse.&lt;br /&gt;
&lt;br /&gt;
Immediately after a &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command is launched by a user, SLURM outputs a message informing the user that the job has been queued. The output is similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun: job 10849 queued and waiting for resources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The shell is now locked while SLURM prepares the execution of the user program ([[#Detaching from a running job with screen|if you are using &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; you can detach from that shell and come back later]]). &lt;br /&gt;
&lt;br /&gt;
When SLURM is ready to run the program, it prints a message similar to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun: job 10849 has been allocated resources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and then executes the program.&lt;br /&gt;
&lt;br /&gt;
=== Options of &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; part of &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; commands is used to tell SLURM what resources the job needs to be executed the job and how much time it will need to complete its execution.&lt;br /&gt;
&lt;br /&gt;
For what concerns resources, the most important option is &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt;, specifying which SLURM [[#SLURM Quality of Service (QOS)|SLURM QOS]] the job will use. A job run with a given QOS has access to all and only the resources available to that QOS. As a consequence, all options that define how many resources to assign the job will only be able to provide the job with resources that are available to the chosen QOS. Jobs that require resources that are not available to the chosen QOS do not get executed. &lt;br /&gt;
&lt;br /&gt;
If the user forgets to use option &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt;, the job is run on the &amp;#039;&amp;#039;default qos&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt;) which has access to &amp;#039;&amp;#039;zero&amp;#039;&amp;#039; resources. Therefore it is always necessary to specify option &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt; when launching a SLURM job on Mufasa.&lt;br /&gt;
&lt;br /&gt;
More generally, the most relevant among the &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; are:&lt;br /&gt;
&lt;br /&gt;
:;‑-qos=&amp;lt;qos__name&amp;gt;&lt;br /&gt;
:: specifies the [[SLURM#SLURM Quality of Service (QOS)|SLURM QOS]] that the job will use. It is mandatory to specify one.&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! The chosen QOS limits the resources that can be requested, since it is not allowed to request resources (type or quantity) that exceed what is available to the chosen QOS.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! If &amp;lt;code&amp;gt;‑‑qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt; is used and options that specify how many resources to assign to the job (such as &amp;lt;code&amp;gt;‑‑mem=&amp;lt;mem_resources&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;‑‑cpus‑per‑task=&amp;lt;cpu_amount&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;‑‑time=&amp;lt;duration&amp;gt;&amp;lt;/code&amp;gt;) are omitted, the job is assigned the default amount of the resource (as defined by the chosen QOS. A notable exception concerns option &amp;lt;code&amp;gt;‑‑gres=&amp;lt;gpu_resources&amp;gt;&amp;lt;/code&amp;gt;, which is always required (see below) if the job uses a QOS with access to GPUs.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; --job-name=&amp;lt;jobname&amp;gt;&lt;br /&gt;
:: Specifies a name for the job. The specified name will appear along with the JOBID number when querying running jobs on the system with &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;. The default job name (i.e., the one assigned to the job when &amp;lt;code&amp;gt;--job-name&amp;lt;/code&amp;gt; is not used) is the executable program&amp;#039;s name.&lt;br /&gt;
&lt;br /&gt;
:;‑‑gres=&amp;lt;gpu_resources&amp;gt;&lt;br /&gt;
:: specifies what GPUs to assign to the job. &amp;lt;code&amp;gt;gpu_resources&amp;lt;/code&amp;gt; is a comma-delimited list where each element has the form &amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;amount&amp;gt;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;&amp;lt;Type&amp;gt;&amp;lt;/code&amp;gt; is one of the types of GPU available on Mufasa (see [[SLURM#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) and &amp;lt;code&amp;gt;&amp;lt;amount&amp;gt;&amp;lt;/code&amp;gt; is an integer between 1 and the number of GPUs of such type available to the partition. For instance, &amp;lt;code&amp;gt;&amp;lt;gpu_resources&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;gpu:40gb:1,gpu:3g.20gb:1&amp;lt;/code&amp;gt;, corresponding to asking for one &amp;quot;full&amp;quot; GPU and 1 &amp;quot;small&amp;quot; GPU.&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! The &amp;lt;code&amp;gt;‑‑gres&amp;lt;/code&amp;gt; parameter is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039; if the job is run with a QOS that allows access to the system&amp;#039;s GPUs. Differently from other resources (where unspecified requests lead to the assignment of a default amount), GPUs must always be explicitly requested.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:;‑‑mem=&amp;lt;mem_resources&amp;gt;&lt;br /&gt;
:: specifies the amount of RAM to assign to the job; for instance, &amp;lt;code&amp;gt;&amp;lt;mem_resources&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;200G&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:;‑‑cpus-per-task=&amp;lt;cpu_amount&amp;gt;&lt;br /&gt;
:: specifies how many CPUs to assign to the job; for instance, &amp;lt;code&amp;gt;&amp;lt;cpu_amount&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;nowiki&amp;gt;‑‑time=&amp;lt;duration&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:: specifies the maximum time allowed to the job to complete, in the format &amp;lt;code&amp;gt;days-hours:minutes:seconds&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; is optional; for instance, &amp;lt;code&amp;gt;&amp;lt;d-hh:mm:ss&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;72:00:00&amp;lt;/code&amp;gt;. When the time expires, the job (if still running) gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
:;‑‑pty&lt;br /&gt;
:: specifies that the job will be interactive (this is necessary when &amp;lt;code&amp;gt;&amp;lt;command_to_run_within_container&amp;gt;&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;/bin/bash&amp;lt;/code&amp;gt;: see [[#Interactive jobs|Interactive jobs]])&lt;br /&gt;
&lt;br /&gt;
Note that GPU resources (if needed) must always be requested explicitly. For instance, in order to execute program &amp;lt;code&amp;gt;./my_program&amp;lt;/code&amp;gt; which needs one GPU of type &amp;lt;code&amp;gt;3g.20gb&amp;lt;/code&amp;gt; with QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; we can use the SLURM command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun --qos=gpulight --gres=gpu:3g.20gb:1 ./my_program&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interactive jobs ==&lt;br /&gt;
&lt;br /&gt;
An &amp;#039;&amp;#039;&amp;#039;interactive job&amp;#039;&amp;#039;&amp;#039; is a process that use the console to interact with their user during job execution. Such a process is manually run by the user from a &amp;#039;&amp;#039;bash shell&amp;#039;&amp;#039; (i.e. a terminal session) provided by SLURM. &lt;br /&gt;
&lt;br /&gt;
In order to ask SLURM to schedule the execution of a shell where the user can subsequently run the interactive job, it is necessary to use option &amp;lt;code&amp;gt;--pty&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instance, to ask SLURM to run a shell with QOS &amp;lt;code&amp;gt;nogpu&amp;lt;/code&amp;gt;, the user should use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun --qos=nogpu --pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By not specifying any other options, the user is telling SLURM that they want the shell spawned by SLURM to be provided with the default amount of resources associated to QOS &amp;lt;code&amp;gt;nogpu&amp;lt;/code&amp;gt;. More generally, any combination of the other [[#Options of srun and sbatch|options of srun]] can be used together with &amp;lt;code&amp;gt;--pty&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As every other job request to SLURM, the request to run a shell must be done from the [[System#Login server|login server]]. As soon as possible (i.e., as soon as the necessary resources are available) SLURM will open (in the same terminal that the user used to launch the &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command) a bash shell, where the user will be able to run their interactive programs. &lt;br /&gt;
&lt;br /&gt;
To the user, this corresponds to the fact that the shell they were using to interact with the login server changes into a shell opened &amp;#039;&amp;#039;directly on Mufasa&amp;#039;&amp;#039;. This corresponds to the command prompt changing from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;username&amp;gt;@mufasa2-login:~$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;username&amp;gt;@mufasa2:~$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another way to know if the current shell is the “base” shell or one run via SLURM is to execute command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
echo $SLURM_JOB_ID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no number gets printed, this means that the shell is the “base” one. If a number is printed, it is the SLURM job ID of the /bin/bash process.&lt;br /&gt;
&lt;br /&gt;
When the user does not need the SLURM-spawned shell anymore, they should close it with command (the same used for any other Linux shell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to make the resources reserved for the interactive shell free again.&lt;br /&gt;
&lt;br /&gt;
== Non-interactive jobs ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands are very complex, and it&amp;#039;s easy to forget some option or make mistakes while using them. For non-interactive jobs, there is a solution to this problem.&lt;br /&gt;
&lt;br /&gt;
When the user job is non-interactive, in fact, the &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command can be substituted with a much simpler &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command&amp;#039;&amp;#039;&amp;#039;. As [[#Running jobs with SLURM|already explained]], &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; can make use of an &amp;#039;&amp;#039;&amp;#039;execution script&amp;#039;&amp;#039;&amp;#039; to specify all the parts of the command to be run via SLURM. So the command becomes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch &amp;lt;execution_script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An execution script is a special type of Linux script that includes &amp;#039;&amp;#039;&amp;#039;SBATCH directives&amp;#039;&amp;#039;&amp;#039;. SBATCH directives are used to specify the values of the parameters that are otherwise set in the [options] part of an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Note on Linux shell scripts&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;A shell script is a text file that will be run by the bash shell. In order to be acceptable as a bash script, a text file must:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;have the “executable” flag set&amp;#039;&amp;#039; (see [[System#Changing file/directory ownership and permissions|here]] for details)&lt;br /&gt;
* &amp;#039;&amp;#039;have&amp;#039;&amp;#039; &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;as its very first line&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Usually, a Linux shell script is given a name ending in &amp;#039;&amp;#039;.sh,&amp;#039;&amp;#039; such as &amp;#039;&amp;#039;my_execution_script.sh&amp;#039;&amp;#039;, but this is not mandatory.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Within any shell script, lines preceded by &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; are comments (with the notable exception of the initial&amp;#039;&amp;#039; &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;line)&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Use of blank lines as spacers is allowed.&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An execution script is a Linux shell script composed of two parts:&lt;br /&gt;
&lt;br /&gt;
# a &amp;#039;&amp;#039;&amp;#039;preamble&amp;#039;&amp;#039;&amp;#039;,  composed of directives using which the user specifies the values to be given to parameters, each preceded by the keyword &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt;&lt;br /&gt;
# [optionally] one or more &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands&amp;#039;&amp;#039;&amp;#039; that launch jobs with SLURM using the parameter values specified in the preamble&lt;br /&gt;
&lt;br /&gt;
Below is an &amp;#039;&amp;#039;&amp;#039;execution script template&amp;#039;&amp;#039;&amp;#039; to be copied and pasted into your own execution script text file. &lt;br /&gt;
&lt;br /&gt;
The template includes all the options [[#Using SLURM to run a container|already described above]], plus a few additional useful ones (for instance, those that enable SLURM to send email messages to the user in correspondence to events in the lifecycle of their job). Information about all the possible options can be found in [SLURM&amp;#039;s own documentation].&lt;br /&gt;
&lt;br /&gt;
In the template below, &amp;#039;&amp;#039;&amp;#039;#SBATCH directives&amp;#039;&amp;#039;&amp;#039; are requests made to SLURM. Notice that, though #SBATCH directives have a leading &amp;quot;#&amp;quot;, that does &amp;#039;&amp;#039;not&amp;#039;&amp;#039; mean that they are comments: exactly as the &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; at the beginning of a shell script, while starting with &amp;quot;#&amp;quot;, is not a comment as well.&lt;br /&gt;
&lt;br /&gt;
Other lines in the script that begin with &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; not followed by SBATCH are comments.&lt;br /&gt;
&lt;br /&gt;
For what concerns directive that ask for a given amount of a resource (including time), if they are missing from the execution script (or commented out) the job will be assigned the default amount of the resource.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;!/bin/bash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------start of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-nodes=1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑ntasks=1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-partition=jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-qos=&amp;lt;qos_name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑gres=&amp;lt;gpu_resources&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑mem=&amp;lt;mem_resources&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑cpus-per-task=&amp;lt;cpu_amount&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑time=&amp;lt;d-hh:mm:ss&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑output=./&amp;lt;filename&amp;gt;-%j.out&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; the text file where the output of the job gets written (i.e., standard output gets redirected onto the file). &amp;quot;%j&amp;quot; is the current time.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑error=./&amp;lt;filename&amp;gt;-error-%j.out&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; the text file where any error messages generated by the job gets written (i.e., standard error gets redirected onto the file). &amp;quot;%j&amp;quot; is the current time.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH --job-name=&amp;lt;name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------end of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Executing jobs on Mufasa =&lt;br /&gt;
&lt;br /&gt;
== Key concept ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The key concept about executing jobs on Mufasa is that [[System#Containers|all computation on Mufasa must occur within containers]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A container is a “sandbox” containing the environment where the user&amp;#039;s application operates. Parts of Mufasa&amp;#039;s filesystem can be made visible (and writable, if the user has writing permission on them: e.g., the user&amp;#039;s &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory) to the environment of the container. This allows the containerized user application to read from, and write to, Mufasa&amp;#039;s filesystem: for instance, to read data and write results.&lt;br /&gt;
&lt;br /&gt;
The system used by Mufasa to create and execute containers is &amp;#039;&amp;#039;&amp;#039;[[System#Singularity|Singularity]]&amp;#039;&amp;#039;&amp;#039;. This wiki includes [[Singularity|directions]] on preparing containers with Singularity.&lt;br /&gt;
&lt;br /&gt;
The container where a user job runs must contain all the libraries needed by the job. In fact (for maintainability and safety reasons) &amp;#039;&amp;#039;&amp;#039;no software and no libraries are installed on Mufasa 2.0&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Interactive and non-interactive user jobs ==&lt;br /&gt;
&lt;br /&gt;
This section explains how to execute a user job contained in a container. It considers two types of user jobs, i.e.:&lt;br /&gt;
;: Interactive user jobs&lt;br /&gt;
::: as [[#Interactive jobs|already explained]], these are jobs that require interaction with the user while they are running, via a bash shell running within the container. The shell is used to receive commands from the user and/or print output messages. For interactive user jobs, the job is usually launched manually by the user (with a command issued via the shell) after the container is in execution.&lt;br /&gt;
&lt;br /&gt;
;: Non-interactive user jobs&lt;br /&gt;
::: are the most common variety. The user prepares the container in such a way that, when in execution, the container autonomously puts the user&amp;#039;s jobs into execution. The user does not have any communication with the container while it is in execution. Executing the container and running the required programs within the container&amp;#039;s environment is done via [[#Interactive jobs|execution scripts]].&lt;br /&gt;
&lt;br /&gt;
== Using SLURM to run an interactive job on Mufasa ==&lt;br /&gt;
&lt;br /&gt;
The first step to run an interactive user job on Mufasa is to run the [[System#Containers|container]] where the job will take place. Each user is in charge of preparing the container(s) where the user&amp;#039;s jobs will be executed.&lt;br /&gt;
&lt;br /&gt;
In order to run a container via SLURM by hand, i.e. via an interactive shell, a user must first open the shell with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun [general_SLURM_options] ‑‑pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where [general_SLURM_options] are those [[#Options of srun and sbatch|already described above]].&lt;br /&gt;
&lt;br /&gt;
Then the user must run the container: this is done as follows.&lt;br /&gt;
&lt;br /&gt;
First, it is necessary to load the Singularity software module with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
module load amd/singularity&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(if needed, the list of software modules available in the system can be obtained with command &amp;lt;code&amp;gt;module av&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then, the user must use Singularity to run the container with command (see the [[Singularity|section about Singularity]] for further details)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity run &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which pulls the container from the specified repository and executes it. Possible values for &amp;lt;code&amp;gt;&amp;lt;repository&amp;gt;&amp;lt;/code&amp;gt; are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;docker&amp;lt;/code&amp;gt; (Docker Hub)&lt;br /&gt;
:: &amp;lt;code&amp;gt;library&amp;lt;/code&amp;gt; (Singularityhub)&lt;br /&gt;
:: &amp;lt;code&amp;gt;path/to/container&amp;lt;/code&amp;gt; if the container is local, i.e. located in the filesystem of Mufasa&lt;br /&gt;
&lt;br /&gt;
As soon as the container is in execution, the terminal window used, so far, to interact with Mufasa becomes a shell &amp;#039;&amp;#039;in the container&amp;#039;&amp;#039;. This shell belongs to the software environment of the container, and the user can use it to interact with the container&amp;#039;s own software environment and filesystem. &lt;br /&gt;
&lt;br /&gt;
It is easy to understand if a shell is open to Mufasa or to the container because in a container shell the system prompt becomes &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interaction between container filesystem and local filesystem === &lt;br /&gt;
&lt;br /&gt;
The filesystem inside the container and the local one, i.e. Mufasa&amp;#039;s, can interact. This means that the container can access the local filesystem to read and/or write files. However, the only parts of Mufasa&amp;#039;s filesystem that can be accessed by the container are those that the user running the container has access rights to.&lt;br /&gt;
&lt;br /&gt;
As a default, the user&amp;#039;s &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; directory on Mufasa is automatically mapped onto &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; into the filesystem of the container. Whatever is done to that container directory, the changes are actually applied to the local &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; directory on Mufasa. &lt;br /&gt;
&lt;br /&gt;
The mapping of the home directory does not need to be explicitly requested. However, if the user needs (in addition to the home directory) other parts of the local filesystem of Mufasa to be mapped onto the container&amp;#039;s filesystem, this is possible by using this modified version of the &amp;lt;code&amp;gt;singularity run&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity run --bind &amp;lt;/path/to/local/directory&amp;gt;:&amp;lt;path/to/container/directory&amp;gt; &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;&amp;lt;path/to/container/directory&amp;gt;&amp;lt;/code&amp;gt; does not exist in the container&amp;#039;s filesystem, it gets created by Singularity.&lt;br /&gt;
&lt;br /&gt;
=== How to know if your shell is a SLURM job ===&lt;br /&gt;
To know if your shell is being run via SLURM, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
echo $SLURM_JOB_ID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it provides an output, your shell is a SLURM job and the output is the ID of the job. If it doesn&amp;#039;t provide any output, your shell is not running via SLURM.&lt;br /&gt;
&lt;br /&gt;
== Using SLURM to run a non-interactive job on Mufasa ==&lt;br /&gt;
&lt;br /&gt;
When the user job to be executed into a container is non-interactive, the mechanism based on an &amp;#039;&amp;#039;execution script&amp;#039;&amp;#039; already described in [[#Non-interactive jobs|Non-interactive jobs]] is employed. The command to run the script which in turn will run the container where the user job takes place is therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch &amp;lt;execution_script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The general features of a SLURM execution script and the SBATCH directives used for generic jobs have [[#Non-interactive jobs|already been described]]. Here we focus, therefore, on the SBATCH directives specifically used when SLURM is used to run a non-interactive job within a container.&lt;br /&gt;
&lt;br /&gt;
Below is an &amp;#039;&amp;#039;&amp;#039;execution script template&amp;#039;&amp;#039;&amp;#039; to be copied and pasted into your own execution script text file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;!/bin/bash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------start of preamble----------------&lt;br /&gt;
&lt;br /&gt;
[[#Non-interactive jobs|#SBATCH directives already described above]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------end of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;module load amd/singularity&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;singularity run &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt; &amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the last line of the script, &amp;lt;code&amp;gt;&amp;lt;command_to_run&amp;gt;&amp;lt;/code&amp;gt; is the command (e.g., the name of an executable script), complete with path within the container&amp;#039;s filesystem, of the program to be run into the container. Please refer to the [[Singularity|section about Singularity]] for details about its commands.&lt;br /&gt;
&lt;br /&gt;
The interactions between container filesystem and local filesystem in non-interactive jobs are exactly the same [[#Interaction between container filesystem and local filesystem|already described]] for interactive jobs. In particular, the user&amp;#039;s home directory is mapped by default onto the filesystem of the container.&lt;br /&gt;
&lt;br /&gt;
If, in addition to that, the user needs another part of the filesystem of Mufasa are to be mapped onto the container&amp;#039;s filesystem, this is possible using this modified version of the &amp;lt;code&amp;gt;singularity run&amp;lt;/code&amp;gt; command at the end of the script:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;singularity run --bind &amp;lt;/path/to/local/directory&amp;gt;:&amp;lt;path/to/container/directory&amp;gt; &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;&amp;lt;path/to/container/directory&amp;gt;&amp;lt;/code&amp;gt; does not exist in the container&amp;#039;s filesystem, it gets created by Singularity.&lt;br /&gt;
&lt;br /&gt;
== Job output ==&lt;br /&gt;
&lt;br /&gt;
The whole point of running a user job is to collect its output. Usually, such output takes the form of one or more files generated within the filesystem of Mufasa by the container where the computation takes place. &lt;br /&gt;
&lt;br /&gt;
As [[#Using SLURM to run a container|explained below]], SLURM includes a mechanism to mount a part of Mufasa&amp;#039;s own filesystem onto the container&amp;#039;s filesystem: so when the job running within the container writes to this mounted part, it actually writes to Mufasa&amp;#039;s filesystem. This means that when the container ends its execution, its output files persist in Mufasa&amp;#039;s filesystem (usually in a subdirectory of the user&amp;#039;s own &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory) and can be retrieved by the user at a later time.&lt;br /&gt;
&lt;br /&gt;
The same mechanism can be used to allow user jobs running into a container to read their input data from Mufasa&amp;#039;s filesystem (usually a subdirectory of the user&amp;#039;s own &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory).&lt;br /&gt;
&lt;br /&gt;
== Cancelling completed jobs ==&lt;br /&gt;
&lt;br /&gt;
When a user process run via SLURM has completed its execution and is not needed anymore, it is important to [[User_Jobs#Canceling_a_job_with_scancel|close it with scancel]]. Especially if much time remains to the end of the execution time requested by the job.&lt;br /&gt;
&lt;br /&gt;
Cancelling a SLURM job makes the resources reserved by SLURM free again for other users, and thus speeds up the execution of the jobs still queued.&lt;br /&gt;
&lt;br /&gt;
Typically, one doesn&amp;#039;t know how long a piece of code will take to complete its work. So please make sure to check from time to time if that happened, and -if there&amp;#039;s still time before the duration of your SLURM job ends- just &amp;#039;&amp;#039;scancel&amp;#039;&amp;#039; the job. Other users will be grateful :-)&lt;br /&gt;
&lt;br /&gt;
Please note that [[System#Job priority|job priority]] for your user depends (also) on the overall duration of the jobs that you ran on Mufasa. Therefore, &amp;#039;&amp;#039;&amp;#039;cancelling jobs that are not needed anymore improves your future jobs&amp;#039; priority&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
= Detaching from a running job with &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
A consequence of the way &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; operates is that if you launch an [[#Interactive and non-interactive user jobs|interactive user job]], the shell where the command is running must remain open: if it closes, the job terminates. That shell runs in the terminal of your own PC where the [[System#Accessing Mufasa|SSH connection to Mufasa]] exists.&lt;br /&gt;
&lt;br /&gt;
If you do not plan to keep the SSH connection to Mufasa open (for instance because you have to turn off or suspend your PC), there is a way to keep your interactive job alive. Namely, you should use command &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; inside a &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (often simply called &amp;quot;a screen&amp;quot;), then &amp;#039;&amp;#039;detach&amp;#039;&amp;#039; from the &amp;#039;&amp;#039;screen&amp;#039;&amp;#039; ([https://linuxize.com/post/how-to-use-linux-screen/ here] is one of many tutorials about &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; available online). &lt;br /&gt;
&lt;br /&gt;
Once you have detached from the screen session, you can close the SSH connection to Mufasa without damage. When you need to reach your (still running) job again, you can can open a new SSH connection to Mufasa and then &amp;#039;&amp;#039;reattach&amp;#039;&amp;#039; to the &amp;#039;&amp;#039;screen&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A use case for screen is writing your program in such a way that it prints progress advancement messages as it goes on with its work. Then, you can check its advancement by periodically reconnecting to the screen where the program is running and reading the messages it printed.&lt;br /&gt;
&lt;br /&gt;
Basic usage of &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; is explained below.&lt;br /&gt;
&lt;br /&gt;
== Creating a screen session, running a job in it, detaching from it ==&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]] with SSH&lt;br /&gt;
# From the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
# In the &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (&amp;quot;screen&amp;quot;) thus created (it has the look of an empty shell), launch your job with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;#039;&amp;#039;Detach&amp;#039;&amp;#039; from the screen by pressing &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;: you will come back to the original login server shell, while your process will go on running in the screen&lt;br /&gt;
# You can now close the SSH connection to the login server without damaging your running job&lt;br /&gt;
&lt;br /&gt;
== Reattaching to an active screen session ==&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]] with SSH&lt;br /&gt;
# In the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You are now back to the screen where you launched your job&lt;br /&gt;
&lt;br /&gt;
== Closing (i.e. destroying) a screen session ==&lt;br /&gt;
&lt;br /&gt;
When you do not need a screen session anymore:&lt;br /&gt;
&lt;br /&gt;
# reattach to the active screen session as explained [[#Reattaching to an active screen session|above]]&lt;br /&gt;
# destroy the screen by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash), then confirming that you really want to proceed&lt;br /&gt;
&lt;br /&gt;
Of course, any program (including SLURM jobs) running within the screen gets terminated when the screen is destroyed.&lt;br /&gt;
&lt;br /&gt;
= Using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; to reserve resources =&lt;br /&gt;
&lt;br /&gt;
== What is &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
[https://slurm.schedmd.com/salloc.html &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;] is a SLURM command that allows a user to reserve a set of resources (e.g., a 40 GB GPU) for a given time in the future.&lt;br /&gt;
&lt;br /&gt;
The typical use of &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; is to &amp;quot;book&amp;quot; an interactive session where the user enjoys &amp;#039;&amp;#039;&amp;#039;complete control of a set of resources&amp;#039;&amp;#039;&amp;#039;. The resources that are part of this set are chosen by the user. Within the &amp;quot;booked&amp;quot; session, any job run by the user that relies on the reserved resources is immediately put into execution by SLURM.&lt;br /&gt;
&lt;br /&gt;
More precisely:&lt;br /&gt;
* the user, using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, specifies what resources they need and the time when they will need them;&lt;br /&gt;
* when the delivery comes, SLURM creates an interactive shell session for the user;&lt;br /&gt;
* within such session, the user can use &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; to run programs, enjoying full (i.e. not shared with anyone else) and instantaneous access to the resources.&lt;br /&gt;
&lt;br /&gt;
Resource reservation using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; is only possible if the request is done in advance wrt the delivery time. The more the resources that the user wants to reserve are in high demand, the more anticipated the request should be to ensure that SLURM is able to fulfill it.&lt;br /&gt;
&lt;br /&gt;
When a user makes a request for resources with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, the request (called an &amp;#039;&amp;#039;&amp;#039;allocation&amp;#039;&amp;#039;&amp;#039;) gets added to the job queue of SLURM of the requisite partition as a job in &amp;lt;code&amp;gt;pending&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;) state (job states are described [[User_Jobs#Interpreting Job state as provided by squeue|here]]). Indeed, resource allocation is the first part of SLURM&amp;#039;s process of executing a user job, while the second part is running the program and letting it use the allocated resources. Using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; actually corresponds to having SLURM perform the first part of the process (resource allocation) while leaving the second part (running programs) to the user.&lt;br /&gt;
&lt;br /&gt;
Until the delivery time specified by the user comes, the allocation remains in state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;, and other jobs requesting the same resources, even if submitted later, are executed. While the request waits for the delivery time, however, it accumulates a priority that increases over time. The longer the allocation stays in the &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt; state, the stronger this accumulation of priority: so, by requesting resources with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;&amp;#039;well in advance of the delivery time&amp;#039;&amp;#039;&amp;#039;, users can ensure that the resources they need will be ready for them at the requested delivery time, even if these resources are highly contended.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; commands ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; commands use a similar syntax to &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands. In particular, &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; lets a user specify what resources they need and -importantly- a &amp;#039;&amp;#039;&amp;#039;delivery time&amp;#039;&amp;#039;&amp;#039; for the requested resources (delivery time can also be specified with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt;, but in that case it is not very useful). &lt;br /&gt;
&lt;br /&gt;
The typical &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command has this form:&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
salloc [general_SLURM_options] --begin=&amp;lt;time&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
:; [general_SLURM_options]&lt;br /&gt;
:: represents the options already described in [[#Options of srun and sbatch|Options of srun and sbatch]]&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;nowiki&amp;gt;--begin=&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:: specifies the delivery time of the resources reserved with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, according to the syntax described below. The delivery time must be a future time.&lt;br /&gt;
&lt;br /&gt;
=== Syntax of parameter &amp;lt;code&amp;gt;--begin&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
If the allocation is for the current day, you can specify &amp;lt;nowiki&amp;gt;&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt; as hours and minutes in the form&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;HH:MM&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to specify a time of a different day, the form for &amp;lt;time&amp;gt; is &amp;lt;code&amp;gt;YYYY-MM-DDTHH:MM&amp;lt;/code&amp;gt;, where the uppercase &amp;#039;T&amp;#039; separates date from time. &lt;br /&gt;
&lt;br /&gt;
It is also possible to specify &amp;lt;time&amp;gt; as relative to the current time, in one of the following forms:&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Kminutes&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Khours&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Kdays&amp;lt;/code&amp;gt;&lt;br /&gt;
where K is a (positive) integer.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=16:00&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=now+1hours&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=now+1days&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=2030-01-20T12:34:00&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that Mufasa&amp;#039;s time zone is GMT, so &amp;lt;nowiki&amp;gt;&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt; must be expressed in GMT as well. If you want to know Mufasa&amp;#039;s current time, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
date&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Thu Nov 10 16:43:30 UTC 2022&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In the typical scenario, the user of &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; will make use of [[User_Jobs#Detaching from a running job with screen|screen]]. Command &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; creates a shell session (called &amp;quot;a screen&amp;quot;) that it is possible to abandon without closing it ([[#Creating_a_screen_session.2C_running_a_job_in_it.2C_detaching_from_it|detaching from the screen]]). It is then possible to reach again the screen at a later time ([[#Reattaching_to_an_active_screen_session|reattaching to the screen]]). This means that a user can create a screen, run &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; within it to create an allocation for time X, detach from the screen and reattach to it just before time X to use the reserved resources from the interactive session created by &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
More precisely, the operations needed to do this are the following:&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]].&lt;br /&gt;
# From the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
# In the &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (&amp;quot;screen&amp;quot;) thus created run the [[#salloc commands|&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command]], specifying via its options the resources you need and the time at which you want them delivered.&lt;br /&gt;
# SLURM will respond with a message similar to &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;salloc: Pending job allocation XXXX&amp;lt;/pre&amp;gt;&lt;br /&gt;
# &amp;#039;&amp;#039;Detach&amp;#039;&amp;#039; from the screen by pressing &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;: you will come back to the original login server shell.&lt;br /&gt;
# You can now close the SSH connection to the login server without damaging your resource allocation request.&lt;br /&gt;
# At the delivery time you specified in the [[#salloc commands|&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command]], connect to the login server with SSH.&lt;br /&gt;
# Once you are in the login server shell, reattach to the screen with command &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You are now back to the screen where you used &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;; as soon as SLURM provides to you with the resources you reserved, message &amp;quot;&amp;#039;&amp;#039;salloc: Pending job allocation XXXX&amp;#039;&amp;#039;&amp;quot; changes to the shell prompt.&lt;br /&gt;
# You are now in the interactive shell session you booked with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;. From here, you can run any programs you want, including &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;. For the whole duration of the allocation, your programs have unrestricted use of all the resources you reserved with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;Important!&amp;#039;&amp;#039;&amp;#039; Any job run within the shell session is subject to the time limit (i.e., maximum duration) imposed by the partition it is running on! Therefore, if the job reaches the time limit, it gets &amp;#039;&amp;#039;&amp;#039;forcibly terminated&amp;#039;&amp;#039;&amp;#039; by SLURM. Termination depends exclusively from the time limit: so it occurs even if the end time for the allocation has not been reached yet. (Of course, the job also gets terminated if the allocation ends.)&lt;br /&gt;
# Once the interactive shell session is not needed anymore, cancel it by exiting from the session with &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;exit&amp;lt;/pre&amp;gt; (Note that if you get to the end of the time period you specified in your request without closing the shell session, SLURM does it for you, killing any programs still running.)&lt;br /&gt;
# You are now back to your screen. Destroy it by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash) to get back to the login server shell.&lt;br /&gt;
&lt;br /&gt;
== Cancelling a resource request made with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
To cancel a request for resources made as explained in [[#How to use salloc|How to use &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;]], follow these steps:&lt;br /&gt;
&lt;br /&gt;
# Connect to the the [[System#Login server|login server]] with SSH.&lt;br /&gt;
# Once you are in the login server shell, reattach to the screen where you used command &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; with command &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You should see the message &amp;quot;&amp;#039;&amp;#039;salloc: Pending job allocation XXXX&amp;#039;&amp;#039;&amp;quot; (if the allocation is still pending) or &amp;quot;&amp;quot;&amp;#039;&amp;#039;salloc: job XXXX queued and waiting for resources&amp;#039;&amp;#039;&amp;quot; (if the allocation is done and waiting for its start time). Now just press &amp;#039;&amp;#039;&amp;#039;Ctrl + C&amp;#039;&amp;#039;&amp;#039;. This communicates to SLURM your intention to cancel your request for resources.&lt;br /&gt;
# SLURM will communicate the cancellation with message &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;salloc: Job allocation XXXX has been revoked.&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Destroy the screen by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash) to get back to the login server shell.&lt;br /&gt;
&lt;br /&gt;
= Monitoring and managing jobs =&lt;br /&gt;
&lt;br /&gt;
SLURM provides Job Users with tools to inspect and manage jobs. While a [[Roles|Job User]] is able to see all users&amp;#039; jobs, they are only allowed to interact with their own.&lt;br /&gt;
&lt;br /&gt;
The main commands used to interact with jobs are &amp;#039;&amp;#039;&amp;#039;[https://slurm.schedmd.com/squeue.html &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]&amp;#039;&amp;#039;&amp;#039; to inspect the scheduling queues and &amp;#039;&amp;#039;&amp;#039;[https://slurm.schedmd.com/scancel.html &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;]&amp;#039;&amp;#039;&amp;#039; to terminate queued or running jobs.&lt;br /&gt;
&lt;br /&gt;
== Inspecting jobs with &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Running command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
  520       fat     bash acasella  R 2-04:10:25      1 gn01&lt;br /&gt;
  523       fat     bash amarzull  R    1:30:35      1 gn01&lt;br /&gt;
  522       gpu     bash    clena  R   20:51:16      1 gn01&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This output comprises the following information:&lt;br /&gt;
&lt;br /&gt;
:; JOBID&lt;br /&gt;
:: Numerical identifier of the job assigned by SLURM&lt;br /&gt;
:: This identifier is used to intervene on the job, for instance with &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: the partition that the job is run on&lt;br /&gt;
&lt;br /&gt;
:; NAME&lt;br /&gt;
:: the name assigned to the job; can be personalised using the &amp;lt;code&amp;gt;--job-name&amp;lt;/code&amp;gt; option&lt;br /&gt;
&lt;br /&gt;
:; USER&lt;br /&gt;
:: username of the user who launched the job&lt;br /&gt;
	&lt;br /&gt;
:; ST&lt;br /&gt;
:: job state (see [[SLURM#Job state|Job state]] for further information)&lt;br /&gt;
&lt;br /&gt;
:; TIME&lt;br /&gt;
:: time that has passed since the beginning of job execution&lt;br /&gt;
&lt;br /&gt;
:; NODES&lt;br /&gt;
:: number of nodes where the job is being executed (for Mufasa, this is always 1 as it is a single machine)&lt;br /&gt;
&lt;br /&gt;
:; NODELIST (REASON)&lt;br /&gt;
:: name of the nodes where the job is being executed: for Mufasa it is always &amp;lt;code&amp;gt;gn01&amp;lt;/code&amp;gt;, which is the name of the node corresponding to Mufasa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To limit the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; to the jobs owned by user &amp;lt;code&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/code&amp;gt;, it can be used like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue -u &amp;lt;username&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Job state as provided by &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Jobs typically pass through several states in the course of their execution. Job state is shown in column &amp;quot;ST&amp;quot; of the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; as an abbreviated code (e.g., &amp;quot;R&amp;quot; for RUNNING).&lt;br /&gt;
&lt;br /&gt;
The most relevant codes and states are the following:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; PENDING&lt;br /&gt;
:: Job is awaiting resource allocation. &lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; RUNNING&lt;br /&gt;
:: Job currently has an allocation.&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; SUSPENDED&lt;br /&gt;
:: Job has an allocation, but execution has been suspended and CPUs have been released for other jobs. &lt;br /&gt;
 &lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;CG&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; COMPLETING&lt;br /&gt;
:: Job is in the process of completing. Some processes on some nodes may still be active. &lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;CD&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; COMPLETED&lt;br /&gt;
:: Job has terminated all processes on all nodes with an exit code of zero. &lt;br /&gt;
&lt;br /&gt;
Beyond these, there are other (less frequent) job states. [https://slurm.schedmd.com/squeue.html The SLURM doc page for &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;] provides a complete list of them.&lt;br /&gt;
&lt;br /&gt;
== Knowing when jobs are expected to end or start ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in understanding when jobs are expected to start or end, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue -o &amp;quot;%5i %8u %10P %.2t |%19S |%.11L|&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output is similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID USER     PARTITION  ST |START_TIME          |  TIME_LEFT|&lt;br /&gt;
5307  thuynh   fat        PD |2022-11-11T17:55:54 | 3-00:00:00|&lt;br /&gt;
5308  thuynh   fat        PD |2022-11-11T17:55:54 | 3-00:00:00|&lt;br /&gt;
5296  cziyang  fat         R |2022-11-08T16:58:03 | 1-00:48:14|&lt;br /&gt;
5306  thuynh   fat         R |2022-11-10T08:13:30 | 2-16:03:41|&lt;br /&gt;
5297  gnannini fat         R |2022-11-08T17:55:54 | 1-01:46:05|&lt;br /&gt;
5336  ssaitta  gpu         R |2022-11-10T08:13:00 |    6:03:11|&lt;br /&gt;
5358  dmilesi  gpulong     R |2022-11-10T15:11:32 | 2-23:01:43|&lt;br /&gt;
5338  cziyang  gpulong     R |2022-11-10T09:45:01 | 1-17:35:12|&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;:For running jobs (state &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt;):&lt;br /&gt;
::column &amp;quot;START_TIME&amp;quot; tells you when the job started its execution&lt;br /&gt;
::column &amp;quot;TIME_LEFT&amp;quot; tells you how much remains of the running time requested by the job&lt;br /&gt;
&lt;br /&gt;
;:For pending jobs (state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;):&lt;br /&gt;
::column &amp;quot;START_TIME&amp;quot; tells you when the job is expected to start its execution&lt;br /&gt;
::column &amp;quot;TIME_LEFT&amp;quot; tells you how much running time has been requested by the job&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Important!&amp;#039;&amp;#039;&amp;#039; Start and end times are forecasts based on the features of current jobs in the queues, and may change if running jobs end prematurely and/or if new jobs with higher priority are added to the queues. So these times should never be considered as certain.&lt;br /&gt;
&lt;br /&gt;
If you simply want to know when pending jobs (state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;) are expected to begin execution, use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue --start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which lists pending jobs in order of increasing START_TIME (the job on top is the one which will be run first). For each pending job the command provides an output similar to the example below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID PARTITION     NAME     USER ST          START_TIME  NODES SCHEDNODES           NODELIST(REASON)&lt;br /&gt;
 5090       fat training   thuynh PD 2022-10-27T09:28:01      1 (null)               (Resources)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting detailed information about a job ==&lt;br /&gt;
&lt;br /&gt;
If needed, complete information about a job (either pending or running) can be obtained using command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show job &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; is the number from the first column of the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;. The output of this command is similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JobId=65 JobName=test_script.sh&lt;br /&gt;
   UserId=gfontana(10003) GroupId=gfontana(10004) MCS_label=N/A&lt;br /&gt;
   Priority=14208 Nice=0 Account=admin QOS=nogpu&lt;br /&gt;
   JobState=RUNNING Reason=None Dependency=(null)&lt;br /&gt;
   Requeue=0 Restarts=0 BatchFlag=0 Reboot=0 ExitCode=0:0&lt;br /&gt;
   RunTime=00:00:55 TimeLimit=01:00:00 TimeMin=N/A&lt;br /&gt;
   SubmitTime=2025-11-06T10:31:10 EligibleTime=2025-11-06T10:31:10&lt;br /&gt;
   AccrueTime=2025-11-06T10:31:10&lt;br /&gt;
   StartTime=2025-11-06T10:31:10 EndTime=2025-11-06T11:31:10 Deadline=N/A&lt;br /&gt;
   SuspendTime=None SecsPreSuspend=0 LastSchedEval=2025-11-06T10:31:10 Scheduler=Main&lt;br /&gt;
   Partition=jobs AllocNode:Sid=mufasa2-login:42020&lt;br /&gt;
   ReqNodeList=(null) ExcNodeList=(null)&lt;br /&gt;
   NodeList=gn01&lt;br /&gt;
   BatchHost=gn01&lt;br /&gt;
   NumNodes=1 NumCPUs=1 NumTasks=1 CPUs/Task=1 ReqB:S:C:T=0:0:*:*&lt;br /&gt;
   ReqTRES=cpu=1,mem=4G,node=1,billing=1&lt;br /&gt;
   AllocTRES=cpu=1,mem=4G,node=1,billing=1&lt;br /&gt;
   Socks/Node=* NtasksPerN:B:S:C=0:0:*:* CoreSpec=*&lt;br /&gt;
   MinCPUsNode=1 MinMemoryNode=4G MinTmpDiskNode=0&lt;br /&gt;
   Features=(null) DelayBoot=00:00:00&lt;br /&gt;
   OverSubscribe=OK Contiguous=0 Licenses=(null) LicensesAlloc=(null) Network=(null)&lt;br /&gt;
   Command=./test_script.sh&lt;br /&gt;
   WorkDir=/home/gfontana&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In particular, the line beginning with &amp;#039;&amp;#039;&amp;quot;StartTime=&amp;quot;&amp;#039;&amp;#039; provides expected times for the start and end of job execution. As explained in [[User_Jobs#Knowing_when_jobs_are_expected_to_end_or_start|Knowing when jobs are expected to end or start]], start time is only a prediction and subject to change.&lt;br /&gt;
&lt;br /&gt;
== Cancelling a job with &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
It is possible to cancel a job using command &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;, either while it is waiting for execution or when it is in execution (in this case you can choose what system signal to send the process in order to terminate it). &lt;br /&gt;
&lt;br /&gt;
Please note that [[System#Job priority|job priority]] for your user depends (also) on the overall duration of the jobs that you ran on Mufasa. Therefore, &amp;#039;&amp;#039;&amp;#039;cancelling jobs that are not needed anymore improves your future jobs&amp;#039; priority&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The following are some examples of use of &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt; adapted from [https://slurm.schedmd.com/scancel.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
removes queued job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; from the execution queue.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --signal=TERM &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
terminates execution of job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; with signal SIGTERM (request to stop).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --signal=KILL &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
terminates execution of job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; with signal SIGKILL (force stop).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --state=PENDING --user=&amp;lt;username&amp;gt; --partition=&amp;lt;partition_name&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
cancels all pending jobs belonging to user &amp;lt;code&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/code&amp;gt; in partition &amp;lt;code&amp;gt;&amp;lt;partition_name&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Knowing what jobs you ran today ==&lt;br /&gt;
&lt;br /&gt;
Command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacct -X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a list of all jobs run today by your user.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=User_Jobs&amp;diff=2372</id>
		<title>User Jobs</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=User_Jobs&amp;diff=2372"/>
		<updated>2026-05-07T14:45:34Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Using SLURM to run an interactive job on Mufasa */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Running jobs with SLURM =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must&amp;#039;&amp;#039;&amp;#039; use SLURM to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM.&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa. This is a key difference between Mufasa 1.0 and [[System#Mufasa 2.0|Mufasa 2.0]].&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
SLURM provides two commands to run jobs, called [https://slurm.schedmd.com/srun.html srun] and [https://slurm.schedmd.com/sbatch.html sbatch]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun [options] &amp;lt;command_to_be_run_via_SLURM&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch [options] &amp;lt;command_to_be_run_via_SLURM&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; can be any Linux program (including shell scripts). By using &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;, the  command or script specified by &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; (including any programs launched by it) are added to SLURM&amp;#039;s execution queues.&lt;br /&gt;
&lt;br /&gt;
The main difference between &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; is that the first locks the shell from which it has been launched, so it is only really suitable for &amp;#039;&amp;#039;&amp;#039;interactive jobs&amp;#039;&amp;#039;&amp;#039;: i.e., processes that use the console to interact with their user during job execution. &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;, on the other side, does not lock the shell and simply adds the job to the queue, but does not allow the user to interact with the process while it is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; provides an additional possibility: &amp;lt;code&amp;gt;&amp;lt;command_to_be_run_via_SLURM&amp;gt;&amp;lt;/code&amp;gt; can in fact be an [[#Using execution scripts to run jobs|&amp;#039;&amp;#039;&amp;#039;execution script&amp;#039;&amp;#039;&amp;#039;]], i.e. a special (and SLURM-specific) type of Linux shell script that includes &amp;#039;&amp;#039;&amp;#039;SBATCH directives&amp;#039;&amp;#039;&amp;#039;. SBATCH directives can be used to specify the values of some of the parameters that would otherwise have to be set using the &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; part of the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command. This is handy because it allows to write down the parameters in an execution script instead of having to write them in the command line while launching a job, which greatly reduces the possibility of mistakes. Also, an execution script is easy to keep and reuse.&lt;br /&gt;
&lt;br /&gt;
Immediately after a &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command is launched by a user, SLURM outputs a message informing the user that the job has been queued. The output is similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun: job 10849 queued and waiting for resources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The shell is now locked while SLURM prepares the execution of the user program ([[#Detaching from a running job with screen|if you are using &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; you can detach from that shell and come back later]]). &lt;br /&gt;
&lt;br /&gt;
When SLURM is ready to run the program, it prints a message similar to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun: job 10849 has been allocated resources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and then executes the program.&lt;br /&gt;
&lt;br /&gt;
=== Options of &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; part of &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; commands is used to tell SLURM what resources the job needs to be executed the job and how much time it will need to complete its execution.&lt;br /&gt;
&lt;br /&gt;
For what concerns resources, the most important option is &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt;, specifying which SLURM [[#SLURM Quality of Service (QOS)|SLURM QOS]] the job will use. A job run with a given QOS has access to all and only the resources available to that QOS. As a consequence, all options that define how many resources to assign the job will only be able to provide the job with resources that are available to the chosen QOS. Jobs that require resources that are not available to the chosen QOS do not get executed. &lt;br /&gt;
&lt;br /&gt;
If the user forgets to use option &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt;, the job is run on the &amp;#039;&amp;#039;default qos&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt;) which has access to &amp;#039;&amp;#039;zero&amp;#039;&amp;#039; resources. Therefore it is always necessary to specify option &amp;lt;code&amp;gt;--qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt; when launching a SLURM job on Mufasa.&lt;br /&gt;
&lt;br /&gt;
More generally, the most relevant among the &amp;lt;code&amp;gt;[options]&amp;lt;/code&amp;gt; are:&lt;br /&gt;
&lt;br /&gt;
:;‑-qos=&amp;lt;qos__name&amp;gt;&lt;br /&gt;
:: specifies the [[SLURM#SLURM Quality of Service (QOS)|SLURM QOS]] that the job will use. It is mandatory to specify one.&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! The chosen QOS limits the resources that can be requested, since it is not allowed to request resources (type or quantity) that exceed what is available to the chosen QOS.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! If &amp;lt;code&amp;gt;‑‑qos &amp;lt;qos_name&amp;gt;&amp;lt;/code&amp;gt; is used and options that specify how many resources to assign to the job (such as &amp;lt;code&amp;gt;‑‑mem=&amp;lt;mem_resources&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;‑‑cpus‑per‑task=&amp;lt;cpu_amount&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;‑‑time=&amp;lt;duration&amp;gt;&amp;lt;/code&amp;gt;) are omitted, the job is assigned the default amount of the resource (as defined by the chosen QOS. A notable exception concerns option &amp;lt;code&amp;gt;‑‑gres=&amp;lt;gpu_resources&amp;gt;&amp;lt;/code&amp;gt;, which is always required (see below) if the job uses a QOS with access to GPUs.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; --job-name=&amp;lt;jobname&amp;gt;&lt;br /&gt;
:: Specifies a name for the job. The specified name will appear along with the JOBID number when querying running jobs on the system with &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;. The default job name (i.e., the one assigned to the job when &amp;lt;code&amp;gt;--job-name&amp;lt;/code&amp;gt; is not used) is the executable program&amp;#039;s name.&lt;br /&gt;
&lt;br /&gt;
:;‑‑gres=&amp;lt;gpu_resources&amp;gt;&lt;br /&gt;
:: specifies what GPUs to assign to the job. &amp;lt;code&amp;gt;gpu_resources&amp;lt;/code&amp;gt; is a comma-delimited list where each element has the form &amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;amount&amp;gt;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;&amp;lt;Type&amp;gt;&amp;lt;/code&amp;gt; is one of the types of GPU available on Mufasa (see [[SLURM#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) and &amp;lt;code&amp;gt;&amp;lt;amount&amp;gt;&amp;lt;/code&amp;gt; is an integer between 1 and the number of GPUs of such type available to the partition. For instance, &amp;lt;code&amp;gt;&amp;lt;gpu_resources&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;gpu:40gb:1,gpu:3g.20gb:1&amp;lt;/code&amp;gt;, corresponding to asking for one &amp;quot;full&amp;quot; GPU and 1 &amp;quot;small&amp;quot; GPU.&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;Important! The &amp;lt;code&amp;gt;‑‑gres&amp;lt;/code&amp;gt; parameter is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039; if the job is run with a QOS that allows access to the system&amp;#039;s GPUs. Differently from other resources (where unspecified requests lead to the assignment of a default amount), GPUs must always be explicitly requested.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:;‑‑mem=&amp;lt;mem_resources&amp;gt;&lt;br /&gt;
:: specifies the amount of RAM to assign to the job; for instance, &amp;lt;code&amp;gt;&amp;lt;mem_resources&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;200G&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:;‑‑cpus-per-task=&amp;lt;cpu_amount&amp;gt;&lt;br /&gt;
:: specifies how many CPUs to assign to the job; for instance, &amp;lt;code&amp;gt;&amp;lt;cpu_amount&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;nowiki&amp;gt;‑‑time=&amp;lt;duration&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:: specifies the maximum time allowed to the job to complete, in the format &amp;lt;code&amp;gt;days-hours:minutes:seconds&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; is optional; for instance, &amp;lt;code&amp;gt;&amp;lt;d-hh:mm:ss&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;72:00:00&amp;lt;/code&amp;gt;. When the time expires, the job (if still running) gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
:;‑‑pty&lt;br /&gt;
:: specifies that the job will be interactive (this is necessary when &amp;lt;code&amp;gt;&amp;lt;command_to_run_within_container&amp;gt;&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;/bin/bash&amp;lt;/code&amp;gt;: see [[#Interactive jobs|Interactive jobs]])&lt;br /&gt;
&lt;br /&gt;
Note that GPU resources (if needed) must always be requested explicitly. For instance, in order to execute program &amp;lt;code&amp;gt;./my_program&amp;lt;/code&amp;gt; which needs one GPU of type &amp;lt;code&amp;gt;3g.20gb&amp;lt;/code&amp;gt; with QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; we can use the SLURM command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun --qos=gpulight --gres=gpu:3g.20gb:1 ./my_program&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interactive jobs ==&lt;br /&gt;
&lt;br /&gt;
An &amp;#039;&amp;#039;&amp;#039;interactive job&amp;#039;&amp;#039;&amp;#039; is a process that use the console to interact with their user during job execution. Such a process is manually run by the user from a &amp;#039;&amp;#039;bash shell&amp;#039;&amp;#039; (i.e. a terminal session) provided by SLURM. &lt;br /&gt;
&lt;br /&gt;
In order to ask SLURM to schedule the execution of a shell where the user can subsequently run the interactive job, it is necessary to use option &amp;lt;code&amp;gt;--pty&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instance, to ask SLURM to run a shell with QOS &amp;lt;code&amp;gt;nogpu&amp;lt;/code&amp;gt;, the user should use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun --qos=nogpu --pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By not specifying any other options, the user is telling SLURM that they want the shell spawned by SLURM to be provided with the default amount of resources associated to QOS &amp;lt;code&amp;gt;nogpu&amp;lt;/code&amp;gt;. More generally, any combination of the other [[#Options of srun and sbatch|options of srun]] can be used together with &amp;lt;code&amp;gt;--pty&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As every other job request to SLURM, the request to run a shell must be done from the [[System#Login server|login server]]. As soon as possible (i.e., as soon as the necessary resources are available) SLURM will open (in the same terminal that the user used to launch the &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command) a bash shell, where the user will be able to run their interactive programs. &lt;br /&gt;
&lt;br /&gt;
To the user, this corresponds to the fact that the shell they were using to interact with the login server changes into a shell opened &amp;#039;&amp;#039;directly on Mufasa&amp;#039;&amp;#039;. This corresponds to the command prompt changing from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;username&amp;gt;@mufasa2-login:~$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;username&amp;gt;@mufasa2:~$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another way to know if the current shell is the “base” shell or one run via SLURM is to execute command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
echo $SLURM_JOB_ID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no number gets printed, this means that the shell is the “base” one. If a number is printed, it is the SLURM job ID of the /bin/bash process.&lt;br /&gt;
&lt;br /&gt;
When the user does not need the SLURM-spawned shell anymore, they should close it with command (the same used for any other Linux shell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to make the resources reserved for the interactive shell free again.&lt;br /&gt;
&lt;br /&gt;
== Non-interactive jobs ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands are very complex, and it&amp;#039;s easy to forget some option or make mistakes while using them. For non-interactive jobs, there is a solution to this problem.&lt;br /&gt;
&lt;br /&gt;
When the user job is non-interactive, in fact, the &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command can be substituted with a much simpler &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command&amp;#039;&amp;#039;&amp;#039;. As [[#Running jobs with SLURM|already explained]], &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; can make use of an &amp;#039;&amp;#039;&amp;#039;execution script&amp;#039;&amp;#039;&amp;#039; to specify all the parts of the command to be run via SLURM. So the command becomes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch &amp;lt;execution_script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An execution script is a special type of Linux script that includes &amp;#039;&amp;#039;&amp;#039;SBATCH directives&amp;#039;&amp;#039;&amp;#039;. SBATCH directives are used to specify the values of the parameters that are otherwise set in the [options] part of an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Note on Linux shell scripts&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;A shell script is a text file that will be run by the bash shell. In order to be acceptable as a bash script, a text file must:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;have the “executable” flag set&amp;#039;&amp;#039; (see [[System#Changing file/directory ownership and permissions|here]] for details)&lt;br /&gt;
* &amp;#039;&amp;#039;have&amp;#039;&amp;#039; &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;as its very first line&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Usually, a Linux shell script is given a name ending in &amp;#039;&amp;#039;.sh,&amp;#039;&amp;#039; such as &amp;#039;&amp;#039;my_execution_script.sh&amp;#039;&amp;#039;, but this is not mandatory.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Within any shell script, lines preceded by &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; are comments (with the notable exception of the initial&amp;#039;&amp;#039; &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;line)&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Use of blank lines as spacers is allowed.&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An execution script is a Linux shell script composed of two parts:&lt;br /&gt;
&lt;br /&gt;
# a &amp;#039;&amp;#039;&amp;#039;preamble&amp;#039;&amp;#039;&amp;#039;,  composed of directives using which the user specifies the values to be given to parameters, each preceded by the keyword &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt;&lt;br /&gt;
# [optionally] one or more &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands&amp;#039;&amp;#039;&amp;#039; that launch jobs with SLURM using the parameter values specified in the preamble&lt;br /&gt;
&lt;br /&gt;
Below is an &amp;#039;&amp;#039;&amp;#039;execution script template&amp;#039;&amp;#039;&amp;#039; to be copied and pasted into your own execution script text file. &lt;br /&gt;
&lt;br /&gt;
The template includes all the options [[#Using SLURM to run a container|already described above]], plus a few additional useful ones (for instance, those that enable SLURM to send email messages to the user in correspondence to events in the lifecycle of their job). Information about all the possible options can be found in [SLURM&amp;#039;s own documentation].&lt;br /&gt;
&lt;br /&gt;
In the template below, &amp;#039;&amp;#039;&amp;#039;#SBATCH directives&amp;#039;&amp;#039;&amp;#039; are requests made to SLURM. Notice that, though #SBATCH directives have a leading &amp;quot;#&amp;quot;, that does &amp;#039;&amp;#039;not&amp;#039;&amp;#039; mean that they are comments: exactly as the &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; at the beginning of a shell script, while starting with &amp;quot;#&amp;quot;, is not a comment as well.&lt;br /&gt;
&lt;br /&gt;
Other lines in the script that begin with &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; not followed by SBATCH are comments.&lt;br /&gt;
&lt;br /&gt;
For what concerns directive that ask for a given amount of a resource (including time), if they are missing from the execution script (or commented out) the job will be assigned the default amount of the resource.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;!/bin/bash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------start of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-nodes=1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑ntasks=1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-partition=jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑-qos=&amp;lt;qos_name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑gres=&amp;lt;gpu_resources&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑mem=&amp;lt;mem_resources&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑cpus-per-task=&amp;lt;cpu_amount&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑time=&amp;lt;d-hh:mm:ss&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑output=./&amp;lt;filename&amp;gt;-%j.out&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; the text file where the output of the job gets written (i.e., standard output gets redirected onto the file). &amp;quot;%j&amp;quot; is the current time.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH ‑‑error=./&amp;lt;filename&amp;gt;-error-%j.out&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; the text file where any error messages generated by the job gets written (i.e., standard error gets redirected onto the file). &amp;quot;%j&amp;quot; is the current time.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH --job-name=&amp;lt;name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------end of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Executing jobs on Mufasa =&lt;br /&gt;
&lt;br /&gt;
== Key concept ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The key concept about executing jobs on Mufasa is that [[System#Containers|all computation on Mufasa must occur within containers]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A container is a “sandbox” containing the environment where the user&amp;#039;s application operates. Parts of Mufasa&amp;#039;s filesystem can be made visible (and writable, if the user has writing permission on them: e.g., the user&amp;#039;s &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory) to the environment of the container. This allows the containerized user application to read from, and write to, Mufasa&amp;#039;s filesystem: for instance, to read data and write results.&lt;br /&gt;
&lt;br /&gt;
The system used by Mufasa to create and execute containers is &amp;#039;&amp;#039;&amp;#039;[[System#Singularity|Singularity]]&amp;#039;&amp;#039;&amp;#039;. This wiki includes [[Singularity|directions]] on preparing containers with Singularity.&lt;br /&gt;
&lt;br /&gt;
The container where a user job runs must contain all the libraries needed by the job. In fact (for maintainability and safety reasons) &amp;#039;&amp;#039;&amp;#039;no software and no libraries are installed on Mufasa 2.0&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Interactive and non-interactive user jobs ==&lt;br /&gt;
&lt;br /&gt;
This section explains how to execute a user job contained in a container. It considers two types of user jobs, i.e.:&lt;br /&gt;
;: Interactive user jobs&lt;br /&gt;
::: as [[#Interactive jobs|already explained]], these are jobs that require interaction with the user while they are running, via a bash shell running within the container. The shell is used to receive commands from the user and/or print output messages. For interactive user jobs, the job is usually launched manually by the user (with a command issued via the shell) after the container is in execution.&lt;br /&gt;
&lt;br /&gt;
;: Non-interactive user jobs&lt;br /&gt;
::: are the most common variety. The user prepares the container in such a way that, when in execution, the container autonomously puts the user&amp;#039;s jobs into execution. The user does not have any communication with the container while it is in execution. Executing the container and running the required programs within the container&amp;#039;s environment is done via [[#Interactive jobs|execution scripts]].&lt;br /&gt;
&lt;br /&gt;
== Using SLURM to run an interactive job on Mufasa ==&lt;br /&gt;
&lt;br /&gt;
The first step to run an interactive user job on Mufasa is to run the [[System#Containers|container]] where the job will take place. Each user is in charge of preparing the container(s) where the user&amp;#039;s jobs will be executed.&lt;br /&gt;
&lt;br /&gt;
In order to run a container via SLURM by hand, i.e. via an interactive shell, a user must first open the shell with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun [general_SLURM_options] ‑‑pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where [general_SLURM_options] are those [[#Options of srun and sbatch|already described above]].&lt;br /&gt;
&lt;br /&gt;
Then the user must run the container: this is done as follows.&lt;br /&gt;
&lt;br /&gt;
First, it is necessary to load the Singularity software module with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
module load amd/singularity&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(if needed, the list of software modules available in the system can be obtained with command &amp;lt;code&amp;gt;module av&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then, the user must use Singularity to run the container with command (see the [[Singularity|section about Singularity]] for further details)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity run &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which pulls the container from the specified repository and executes it. Possible values for &amp;lt;code&amp;gt;&amp;lt;repository&amp;gt;&amp;lt;/code&amp;gt; are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;docker&amp;lt;/code&amp;gt; (Docker Hub)&lt;br /&gt;
:: &amp;lt;code&amp;gt;library&amp;lt;/code&amp;gt; (Singularityhub)&lt;br /&gt;
:: &amp;lt;code&amp;gt;path/to/container&amp;lt;/code&amp;gt; if the container is local, i.e. located in the filesystem of Mufasa&lt;br /&gt;
&lt;br /&gt;
As soon as the container is in execution, the terminal window used, so far, to interact with Mufasa becomes a shell &amp;#039;&amp;#039;in the container&amp;#039;&amp;#039;. This shell belongs to the software environment of the container, and the user can use it to interact with the container&amp;#039;s own software environment and filesystem. &lt;br /&gt;
&lt;br /&gt;
It is easy to understand if a shell is open to Mufasa or to the container because in a container shell the system prompt becomes &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interaction between container filesystem and local filesystem === &lt;br /&gt;
&lt;br /&gt;
The filesystem inside the container and the local one, i.e. Mufasa&amp;#039;s, can interact. This means that the container can access the local filesystem to read and/or write files. However, the only parts of Mufasa&amp;#039;s filesystem that can be accessed by the container are those that the user running the container has access rights to.&lt;br /&gt;
&lt;br /&gt;
As a default, the user&amp;#039;s &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; directory on Mufasa is automatically mapped onto &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; into the filesystem of the container. Whatever is done to that container directory, the changes are actually applied to the local &amp;lt;code&amp;gt;/home/username&amp;lt;/code&amp;gt; directory on Mufasa. &lt;br /&gt;
&lt;br /&gt;
The mapping of the home directory does not need to be explicitly requested. However, if the user needs (in addition to the home directory) other parts of the local filesystem of Mufasa to be mapped onto the container&amp;#039;s filesystem, this is possible by using this modified version of the &amp;lt;code&amp;gt;singularity run&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
singularity run --bind &amp;lt;/path/to/local/directory&amp;gt;:&amp;lt;path/to/container/directory&amp;gt; &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;&amp;lt;path/to/container/directory&amp;gt;&amp;lt;/code&amp;gt; does not exist in the container&amp;#039;s filesystem, it gets created by Singularity.&lt;br /&gt;
&lt;br /&gt;
=== How to know if your shell is running within SLURM ===&lt;br /&gt;
To know if your shell is a SLURM job and (if it is) the ID of the job, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
echo $SLURM_JOB_ID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it provides an output, your shell is a SLURM job and the output is the ID of the job. If it doesn&amp;#039;t provide any output, your shell is not running via SLURM.&lt;br /&gt;
&lt;br /&gt;
== Using SLURM to run a non-interactive job on Mufasa ==&lt;br /&gt;
&lt;br /&gt;
When the user job to be executed into a container is non-interactive, the mechanism based on an &amp;#039;&amp;#039;execution script&amp;#039;&amp;#039; already described in [[#Non-interactive jobs|Non-interactive jobs]] is employed. The command to run the script which in turn will run the container where the user job takes place is therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sbatch &amp;lt;execution_script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The general features of a SLURM execution script and the SBATCH directives used for generic jobs have [[#Non-interactive jobs|already been described]]. Here we focus, therefore, on the SBATCH directives specifically used when SLURM is used to run a non-interactive job within a container.&lt;br /&gt;
&lt;br /&gt;
Below is an &amp;#039;&amp;#039;&amp;#039;execution script template&amp;#039;&amp;#039;&amp;#039; to be copied and pasted into your own execution script text file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;!/bin/bash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------start of preamble----------------&lt;br /&gt;
&lt;br /&gt;
[[#Non-interactive jobs|#SBATCH directives already described above]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;----------------end of preamble----------------&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;module load amd/singularity&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;singularity run &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt; &amp;lt;command_to_run&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the last line of the script, &amp;lt;code&amp;gt;&amp;lt;command_to_run&amp;gt;&amp;lt;/code&amp;gt; is the command (e.g., the name of an executable script), complete with path within the container&amp;#039;s filesystem, of the program to be run into the container. Please refer to the [[Singularity|section about Singularity]] for details about its commands.&lt;br /&gt;
&lt;br /&gt;
The interactions between container filesystem and local filesystem in non-interactive jobs are exactly the same [[#Interaction between container filesystem and local filesystem|already described]] for interactive jobs. In particular, the user&amp;#039;s home directory is mapped by default onto the filesystem of the container.&lt;br /&gt;
&lt;br /&gt;
If, in addition to that, the user needs another part of the filesystem of Mufasa are to be mapped onto the container&amp;#039;s filesystem, this is possible using this modified version of the &amp;lt;code&amp;gt;singularity run&amp;lt;/code&amp;gt; command at the end of the script:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;singularity run --bind &amp;lt;/path/to/local/directory&amp;gt;:&amp;lt;path/to/container/directory&amp;gt; &amp;lt;repository&amp;gt;://&amp;lt;name_of_container&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;&amp;lt;path/to/container/directory&amp;gt;&amp;lt;/code&amp;gt; does not exist in the container&amp;#039;s filesystem, it gets created by Singularity.&lt;br /&gt;
&lt;br /&gt;
== Job output ==&lt;br /&gt;
&lt;br /&gt;
The whole point of running a user job is to collect its output. Usually, such output takes the form of one or more files generated within the filesystem of Mufasa by the container where the computation takes place. &lt;br /&gt;
&lt;br /&gt;
As [[#Using SLURM to run a container|explained below]], SLURM includes a mechanism to mount a part of Mufasa&amp;#039;s own filesystem onto the container&amp;#039;s filesystem: so when the job running within the container writes to this mounted part, it actually writes to Mufasa&amp;#039;s filesystem. This means that when the container ends its execution, its output files persist in Mufasa&amp;#039;s filesystem (usually in a subdirectory of the user&amp;#039;s own &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory) and can be retrieved by the user at a later time.&lt;br /&gt;
&lt;br /&gt;
The same mechanism can be used to allow user jobs running into a container to read their input data from Mufasa&amp;#039;s filesystem (usually a subdirectory of the user&amp;#039;s own &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory).&lt;br /&gt;
&lt;br /&gt;
== Cancelling completed jobs ==&lt;br /&gt;
&lt;br /&gt;
When a user process run via SLURM has completed its execution and is not needed anymore, it is important to [[User_Jobs#Canceling_a_job_with_scancel|close it with scancel]]. Especially if much time remains to the end of the execution time requested by the job.&lt;br /&gt;
&lt;br /&gt;
Cancelling a SLURM job makes the resources reserved by SLURM free again for other users, and thus speeds up the execution of the jobs still queued.&lt;br /&gt;
&lt;br /&gt;
Typically, one doesn&amp;#039;t know how long a piece of code will take to complete its work. So please make sure to check from time to time if that happened, and -if there&amp;#039;s still time before the duration of your SLURM job ends- just &amp;#039;&amp;#039;scancel&amp;#039;&amp;#039; the job. Other users will be grateful :-)&lt;br /&gt;
&lt;br /&gt;
Please note that [[System#Job priority|job priority]] for your user depends (also) on the overall duration of the jobs that you ran on Mufasa. Therefore, &amp;#039;&amp;#039;&amp;#039;cancelling jobs that are not needed anymore improves your future jobs&amp;#039; priority&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
= Detaching from a running job with &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
A consequence of the way &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; operates is that if you launch an [[#Interactive and non-interactive user jobs|interactive user job]], the shell where the command is running must remain open: if it closes, the job terminates. That shell runs in the terminal of your own PC where the [[System#Accessing Mufasa|SSH connection to Mufasa]] exists.&lt;br /&gt;
&lt;br /&gt;
If you do not plan to keep the SSH connection to Mufasa open (for instance because you have to turn off or suspend your PC), there is a way to keep your interactive job alive. Namely, you should use command &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; inside a &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (often simply called &amp;quot;a screen&amp;quot;), then &amp;#039;&amp;#039;detach&amp;#039;&amp;#039; from the &amp;#039;&amp;#039;screen&amp;#039;&amp;#039; ([https://linuxize.com/post/how-to-use-linux-screen/ here] is one of many tutorials about &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; available online). &lt;br /&gt;
&lt;br /&gt;
Once you have detached from the screen session, you can close the SSH connection to Mufasa without damage. When you need to reach your (still running) job again, you can can open a new SSH connection to Mufasa and then &amp;#039;&amp;#039;reattach&amp;#039;&amp;#039; to the &amp;#039;&amp;#039;screen&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A use case for screen is writing your program in such a way that it prints progress advancement messages as it goes on with its work. Then, you can check its advancement by periodically reconnecting to the screen where the program is running and reading the messages it printed.&lt;br /&gt;
&lt;br /&gt;
Basic usage of &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; is explained below.&lt;br /&gt;
&lt;br /&gt;
== Creating a screen session, running a job in it, detaching from it ==&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]] with SSH&lt;br /&gt;
# From the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
# In the &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (&amp;quot;screen&amp;quot;) thus created (it has the look of an empty shell), launch your job with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;#039;&amp;#039;Detach&amp;#039;&amp;#039; from the screen by pressing &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;: you will come back to the original login server shell, while your process will go on running in the screen&lt;br /&gt;
# You can now close the SSH connection to the login server without damaging your running job&lt;br /&gt;
&lt;br /&gt;
== Reattaching to an active screen session ==&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]] with SSH&lt;br /&gt;
# In the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You are now back to the screen where you launched your job&lt;br /&gt;
&lt;br /&gt;
== Closing (i.e. destroying) a screen session ==&lt;br /&gt;
&lt;br /&gt;
When you do not need a screen session anymore:&lt;br /&gt;
&lt;br /&gt;
# reattach to the active screen session as explained [[#Reattaching to an active screen session|above]]&lt;br /&gt;
# destroy the screen by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash), then confirming that you really want to proceed&lt;br /&gt;
&lt;br /&gt;
Of course, any program (including SLURM jobs) running within the screen gets terminated when the screen is destroyed.&lt;br /&gt;
&lt;br /&gt;
= Using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; to reserve resources =&lt;br /&gt;
&lt;br /&gt;
== What is &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
[https://slurm.schedmd.com/salloc.html &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;] is a SLURM command that allows a user to reserve a set of resources (e.g., a 40 GB GPU) for a given time in the future.&lt;br /&gt;
&lt;br /&gt;
The typical use of &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; is to &amp;quot;book&amp;quot; an interactive session where the user enjoys &amp;#039;&amp;#039;&amp;#039;complete control of a set of resources&amp;#039;&amp;#039;&amp;#039;. The resources that are part of this set are chosen by the user. Within the &amp;quot;booked&amp;quot; session, any job run by the user that relies on the reserved resources is immediately put into execution by SLURM.&lt;br /&gt;
&lt;br /&gt;
More precisely:&lt;br /&gt;
* the user, using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, specifies what resources they need and the time when they will need them;&lt;br /&gt;
* when the delivery comes, SLURM creates an interactive shell session for the user;&lt;br /&gt;
* within such session, the user can use &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; to run programs, enjoying full (i.e. not shared with anyone else) and instantaneous access to the resources.&lt;br /&gt;
&lt;br /&gt;
Resource reservation using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; is only possible if the request is done in advance wrt the delivery time. The more the resources that the user wants to reserve are in high demand, the more anticipated the request should be to ensure that SLURM is able to fulfill it.&lt;br /&gt;
&lt;br /&gt;
When a user makes a request for resources with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, the request (called an &amp;#039;&amp;#039;&amp;#039;allocation&amp;#039;&amp;#039;&amp;#039;) gets added to the job queue of SLURM of the requisite partition as a job in &amp;lt;code&amp;gt;pending&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;) state (job states are described [[User_Jobs#Interpreting Job state as provided by squeue|here]]). Indeed, resource allocation is the first part of SLURM&amp;#039;s process of executing a user job, while the second part is running the program and letting it use the allocated resources. Using &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; actually corresponds to having SLURM perform the first part of the process (resource allocation) while leaving the second part (running programs) to the user.&lt;br /&gt;
&lt;br /&gt;
Until the delivery time specified by the user comes, the allocation remains in state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;, and other jobs requesting the same resources, even if submitted later, are executed. While the request waits for the delivery time, however, it accumulates a priority that increases over time. The longer the allocation stays in the &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt; state, the stronger this accumulation of priority: so, by requesting resources with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;&amp;#039;well in advance of the delivery time&amp;#039;&amp;#039;&amp;#039;, users can ensure that the resources they need will be ready for them at the requested delivery time, even if these resources are highly contended.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; commands ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; commands use a similar syntax to &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands. In particular, &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; lets a user specify what resources they need and -importantly- a &amp;#039;&amp;#039;&amp;#039;delivery time&amp;#039;&amp;#039;&amp;#039; for the requested resources (delivery time can also be specified with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt;, but in that case it is not very useful). &lt;br /&gt;
&lt;br /&gt;
The typical &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command has this form:&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
salloc [general_SLURM_options] --begin=&amp;lt;time&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
:; [general_SLURM_options]&lt;br /&gt;
:: represents the options already described in [[#Options of srun and sbatch|Options of srun and sbatch]]&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;nowiki&amp;gt;--begin=&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:: specifies the delivery time of the resources reserved with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;, according to the syntax described below. The delivery time must be a future time.&lt;br /&gt;
&lt;br /&gt;
=== Syntax of parameter &amp;lt;code&amp;gt;--begin&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
If the allocation is for the current day, you can specify &amp;lt;nowiki&amp;gt;&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt; as hours and minutes in the form&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;HH:MM&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to specify a time of a different day, the form for &amp;lt;time&amp;gt; is &amp;lt;code&amp;gt;YYYY-MM-DDTHH:MM&amp;lt;/code&amp;gt;, where the uppercase &amp;#039;T&amp;#039; separates date from time. &lt;br /&gt;
&lt;br /&gt;
It is also possible to specify &amp;lt;time&amp;gt; as relative to the current time, in one of the following forms:&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Kminutes&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Khours&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;now+Kdays&amp;lt;/code&amp;gt;&lt;br /&gt;
where K is a (positive) integer.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=16:00&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=now+1hours&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=now+1days&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;--begin=2030-01-20T12:34:00&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that Mufasa&amp;#039;s time zone is GMT, so &amp;lt;nowiki&amp;gt;&amp;lt;time&amp;gt;&amp;lt;/nowiki&amp;gt; must be expressed in GMT as well. If you want to know Mufasa&amp;#039;s current time, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
date&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Thu Nov 10 16:43:30 UTC 2022&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In the typical scenario, the user of &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; will make use of [[User_Jobs#Detaching from a running job with screen|screen]]. Command &amp;lt;code&amp;gt;screen&amp;lt;/code&amp;gt; creates a shell session (called &amp;quot;a screen&amp;quot;) that it is possible to abandon without closing it ([[#Creating_a_screen_session.2C_running_a_job_in_it.2C_detaching_from_it|detaching from the screen]]). It is then possible to reach again the screen at a later time ([[#Reattaching_to_an_active_screen_session|reattaching to the screen]]). This means that a user can create a screen, run &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; within it to create an allocation for time X, detach from the screen and reattach to it just before time X to use the reserved resources from the interactive session created by &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
More precisely, the operations needed to do this are the following:&lt;br /&gt;
&lt;br /&gt;
# Connect to the [[System#Login server|login server]].&lt;br /&gt;
# From the login server shell, run &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
# In the &amp;#039;&amp;#039;screen session&amp;#039;&amp;#039; (&amp;quot;screen&amp;quot;) thus created run the [[#salloc commands|&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command]], specifying via its options the resources you need and the time at which you want them delivered.&lt;br /&gt;
# SLURM will respond with a message similar to &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;salloc: Pending job allocation XXXX&amp;lt;/pre&amp;gt;&lt;br /&gt;
# &amp;#039;&amp;#039;Detach&amp;#039;&amp;#039; from the screen by pressing &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;: you will come back to the original login server shell.&lt;br /&gt;
# You can now close the SSH connection to the login server without damaging your resource allocation request.&lt;br /&gt;
# At the delivery time you specified in the [[#salloc commands|&amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; command]], connect to the login server with SSH.&lt;br /&gt;
# Once you are in the login server shell, reattach to the screen with command &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You are now back to the screen where you used &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;; as soon as SLURM provides to you with the resources you reserved, message &amp;quot;&amp;#039;&amp;#039;salloc: Pending job allocation XXXX&amp;#039;&amp;#039;&amp;quot; changes to the shell prompt.&lt;br /&gt;
# You are now in the interactive shell session you booked with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;. From here, you can run any programs you want, including &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;. For the whole duration of the allocation, your programs have unrestricted use of all the resources you reserved with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;Important!&amp;#039;&amp;#039;&amp;#039; Any job run within the shell session is subject to the time limit (i.e., maximum duration) imposed by the partition it is running on! Therefore, if the job reaches the time limit, it gets &amp;#039;&amp;#039;&amp;#039;forcibly terminated&amp;#039;&amp;#039;&amp;#039; by SLURM. Termination depends exclusively from the time limit: so it occurs even if the end time for the allocation has not been reached yet. (Of course, the job also gets terminated if the allocation ends.)&lt;br /&gt;
# Once the interactive shell session is not needed anymore, cancel it by exiting from the session with &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;exit&amp;lt;/pre&amp;gt; (Note that if you get to the end of the time period you specified in your request without closing the shell session, SLURM does it for you, killing any programs still running.)&lt;br /&gt;
# You are now back to your screen. Destroy it by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash) to get back to the login server shell.&lt;br /&gt;
&lt;br /&gt;
== Cancelling a resource request made with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
To cancel a request for resources made as explained in [[#How to use salloc|How to use &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt;]], follow these steps:&lt;br /&gt;
&lt;br /&gt;
# Connect to the the [[System#Login server|login server]] with SSH.&lt;br /&gt;
# Once you are in the login server shell, reattach to the screen where you used command &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; with command &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;screen -r&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You should see the message &amp;quot;&amp;#039;&amp;#039;salloc: Pending job allocation XXXX&amp;#039;&amp;#039;&amp;quot; (if the allocation is still pending) or &amp;quot;&amp;quot;&amp;#039;&amp;#039;salloc: job XXXX queued and waiting for resources&amp;#039;&amp;#039;&amp;quot; (if the allocation is done and waiting for its start time). Now just press &amp;#039;&amp;#039;&amp;#039;Ctrl + C&amp;#039;&amp;#039;&amp;#039;. This communicates to SLURM your intention to cancel your request for resources.&lt;br /&gt;
# SLURM will communicate the cancellation with message &amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;salloc: Job allocation XXXX has been revoked.&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Destroy the screen by pressing &amp;#039;&amp;#039;&amp;#039;ctrl + A&amp;#039;&amp;#039;&amp;#039; followed by &amp;#039;&amp;#039;&amp;#039;\&amp;#039;&amp;#039;&amp;#039; (i.e., backslash) to get back to the login server shell.&lt;br /&gt;
&lt;br /&gt;
= Monitoring and managing jobs =&lt;br /&gt;
&lt;br /&gt;
SLURM provides Job Users with tools to inspect and manage jobs. While a [[Roles|Job User]] is able to see all users&amp;#039; jobs, they are only allowed to interact with their own.&lt;br /&gt;
&lt;br /&gt;
The main commands used to interact with jobs are &amp;#039;&amp;#039;&amp;#039;[https://slurm.schedmd.com/squeue.html &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]&amp;#039;&amp;#039;&amp;#039; to inspect the scheduling queues and &amp;#039;&amp;#039;&amp;#039;[https://slurm.schedmd.com/scancel.html &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;]&amp;#039;&amp;#039;&amp;#039; to terminate queued or running jobs.&lt;br /&gt;
&lt;br /&gt;
== Inspecting jobs with &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Running command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
  520       fat     bash acasella  R 2-04:10:25      1 gn01&lt;br /&gt;
  523       fat     bash amarzull  R    1:30:35      1 gn01&lt;br /&gt;
  522       gpu     bash    clena  R   20:51:16      1 gn01&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This output comprises the following information:&lt;br /&gt;
&lt;br /&gt;
:; JOBID&lt;br /&gt;
:: Numerical identifier of the job assigned by SLURM&lt;br /&gt;
:: This identifier is used to intervene on the job, for instance with &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: the partition that the job is run on&lt;br /&gt;
&lt;br /&gt;
:; NAME&lt;br /&gt;
:: the name assigned to the job; can be personalised using the &amp;lt;code&amp;gt;--job-name&amp;lt;/code&amp;gt; option&lt;br /&gt;
&lt;br /&gt;
:; USER&lt;br /&gt;
:: username of the user who launched the job&lt;br /&gt;
	&lt;br /&gt;
:; ST&lt;br /&gt;
:: job state (see [[SLURM#Job state|Job state]] for further information)&lt;br /&gt;
&lt;br /&gt;
:; TIME&lt;br /&gt;
:: time that has passed since the beginning of job execution&lt;br /&gt;
&lt;br /&gt;
:; NODES&lt;br /&gt;
:: number of nodes where the job is being executed (for Mufasa, this is always 1 as it is a single machine)&lt;br /&gt;
&lt;br /&gt;
:; NODELIST (REASON)&lt;br /&gt;
:: name of the nodes where the job is being executed: for Mufasa it is always &amp;lt;code&amp;gt;gn01&amp;lt;/code&amp;gt;, which is the name of the node corresponding to Mufasa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To limit the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; to the jobs owned by user &amp;lt;code&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/code&amp;gt;, it can be used like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue -u &amp;lt;username&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Job state as provided by &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Jobs typically pass through several states in the course of their execution. Job state is shown in column &amp;quot;ST&amp;quot; of the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; as an abbreviated code (e.g., &amp;quot;R&amp;quot; for RUNNING).&lt;br /&gt;
&lt;br /&gt;
The most relevant codes and states are the following:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; PENDING&lt;br /&gt;
:: Job is awaiting resource allocation. &lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; RUNNING&lt;br /&gt;
:: Job currently has an allocation.&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; SUSPENDED&lt;br /&gt;
:: Job has an allocation, but execution has been suspended and CPUs have been released for other jobs. &lt;br /&gt;
 &lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;CG&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; COMPLETING&lt;br /&gt;
:: Job is in the process of completing. Some processes on some nodes may still be active. &lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;CD&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; COMPLETED&lt;br /&gt;
:: Job has terminated all processes on all nodes with an exit code of zero. &lt;br /&gt;
&lt;br /&gt;
Beyond these, there are other (less frequent) job states. [https://slurm.schedmd.com/squeue.html The SLURM doc page for &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;] provides a complete list of them.&lt;br /&gt;
&lt;br /&gt;
== Knowing when jobs are expected to end or start ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in understanding when jobs are expected to start or end, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue -o &amp;quot;%5i %8u %10P %.2t |%19S |%.11L|&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output is similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID USER     PARTITION  ST |START_TIME          |  TIME_LEFT|&lt;br /&gt;
5307  thuynh   fat        PD |2022-11-11T17:55:54 | 3-00:00:00|&lt;br /&gt;
5308  thuynh   fat        PD |2022-11-11T17:55:54 | 3-00:00:00|&lt;br /&gt;
5296  cziyang  fat         R |2022-11-08T16:58:03 | 1-00:48:14|&lt;br /&gt;
5306  thuynh   fat         R |2022-11-10T08:13:30 | 2-16:03:41|&lt;br /&gt;
5297  gnannini fat         R |2022-11-08T17:55:54 | 1-01:46:05|&lt;br /&gt;
5336  ssaitta  gpu         R |2022-11-10T08:13:00 |    6:03:11|&lt;br /&gt;
5358  dmilesi  gpulong     R |2022-11-10T15:11:32 | 2-23:01:43|&lt;br /&gt;
5338  cziyang  gpulong     R |2022-11-10T09:45:01 | 1-17:35:12|&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;:For running jobs (state &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt;):&lt;br /&gt;
::column &amp;quot;START_TIME&amp;quot; tells you when the job started its execution&lt;br /&gt;
::column &amp;quot;TIME_LEFT&amp;quot; tells you how much remains of the running time requested by the job&lt;br /&gt;
&lt;br /&gt;
;:For pending jobs (state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;):&lt;br /&gt;
::column &amp;quot;START_TIME&amp;quot; tells you when the job is expected to start its execution&lt;br /&gt;
::column &amp;quot;TIME_LEFT&amp;quot; tells you how much running time has been requested by the job&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Important!&amp;#039;&amp;#039;&amp;#039; Start and end times are forecasts based on the features of current jobs in the queues, and may change if running jobs end prematurely and/or if new jobs with higher priority are added to the queues. So these times should never be considered as certain.&lt;br /&gt;
&lt;br /&gt;
If you simply want to know when pending jobs (state &amp;lt;code&amp;gt;PD&amp;lt;/code&amp;gt;) are expected to begin execution, use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
squeue --start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which lists pending jobs in order of increasing START_TIME (the job on top is the one which will be run first). For each pending job the command provides an output similar to the example below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JOBID PARTITION     NAME     USER ST          START_TIME  NODES SCHEDNODES           NODELIST(REASON)&lt;br /&gt;
 5090       fat training   thuynh PD 2022-10-27T09:28:01      1 (null)               (Resources)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting detailed information about a job ==&lt;br /&gt;
&lt;br /&gt;
If needed, complete information about a job (either pending or running) can be obtained using command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show job &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; is the number from the first column of the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;. The output of this command is similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
JobId=65 JobName=test_script.sh&lt;br /&gt;
   UserId=gfontana(10003) GroupId=gfontana(10004) MCS_label=N/A&lt;br /&gt;
   Priority=14208 Nice=0 Account=admin QOS=nogpu&lt;br /&gt;
   JobState=RUNNING Reason=None Dependency=(null)&lt;br /&gt;
   Requeue=0 Restarts=0 BatchFlag=0 Reboot=0 ExitCode=0:0&lt;br /&gt;
   RunTime=00:00:55 TimeLimit=01:00:00 TimeMin=N/A&lt;br /&gt;
   SubmitTime=2025-11-06T10:31:10 EligibleTime=2025-11-06T10:31:10&lt;br /&gt;
   AccrueTime=2025-11-06T10:31:10&lt;br /&gt;
   StartTime=2025-11-06T10:31:10 EndTime=2025-11-06T11:31:10 Deadline=N/A&lt;br /&gt;
   SuspendTime=None SecsPreSuspend=0 LastSchedEval=2025-11-06T10:31:10 Scheduler=Main&lt;br /&gt;
   Partition=jobs AllocNode:Sid=mufasa2-login:42020&lt;br /&gt;
   ReqNodeList=(null) ExcNodeList=(null)&lt;br /&gt;
   NodeList=gn01&lt;br /&gt;
   BatchHost=gn01&lt;br /&gt;
   NumNodes=1 NumCPUs=1 NumTasks=1 CPUs/Task=1 ReqB:S:C:T=0:0:*:*&lt;br /&gt;
   ReqTRES=cpu=1,mem=4G,node=1,billing=1&lt;br /&gt;
   AllocTRES=cpu=1,mem=4G,node=1,billing=1&lt;br /&gt;
   Socks/Node=* NtasksPerN:B:S:C=0:0:*:* CoreSpec=*&lt;br /&gt;
   MinCPUsNode=1 MinMemoryNode=4G MinTmpDiskNode=0&lt;br /&gt;
   Features=(null) DelayBoot=00:00:00&lt;br /&gt;
   OverSubscribe=OK Contiguous=0 Licenses=(null) LicensesAlloc=(null) Network=(null)&lt;br /&gt;
   Command=./test_script.sh&lt;br /&gt;
   WorkDir=/home/gfontana&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In particular, the line beginning with &amp;#039;&amp;#039;&amp;quot;StartTime=&amp;quot;&amp;#039;&amp;#039; provides expected times for the start and end of job execution. As explained in [[User_Jobs#Knowing_when_jobs_are_expected_to_end_or_start|Knowing when jobs are expected to end or start]], start time is only a prediction and subject to change.&lt;br /&gt;
&lt;br /&gt;
== Cancelling a job with &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
It is possible to cancel a job using command &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt;, either while it is waiting for execution or when it is in execution (in this case you can choose what system signal to send the process in order to terminate it). &lt;br /&gt;
&lt;br /&gt;
Please note that [[System#Job priority|job priority]] for your user depends (also) on the overall duration of the jobs that you ran on Mufasa. Therefore, &amp;#039;&amp;#039;&amp;#039;cancelling jobs that are not needed anymore improves your future jobs&amp;#039; priority&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The following are some examples of use of &amp;lt;code&amp;gt;scancel&amp;lt;/code&amp;gt; adapted from [https://slurm.schedmd.com/scancel.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
removes queued job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; from the execution queue.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --signal=TERM &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
terminates execution of job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; with signal SIGTERM (request to stop).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --signal=KILL &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
terminates execution of job &amp;lt;code&amp;gt;&amp;lt;JOBID&amp;gt;&amp;lt;/code&amp;gt; with signal SIGKILL (force stop).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel --state=PENDING --user=&amp;lt;username&amp;gt; --partition=&amp;lt;partition_name&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
cancels all pending jobs belonging to user &amp;lt;code&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/code&amp;gt; in partition &amp;lt;code&amp;gt;&amp;lt;partition_name&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Knowing what jobs you ran today ==&lt;br /&gt;
&lt;br /&gt;
Command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacct -X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a list of all jobs run today by your user.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2371</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2371"/>
		<updated>2026-05-04T14:34:11Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM Quality of Service (QOS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** max 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Suggestion: if you&amp;#039;re going to run a job, it&amp;#039;s a good idea to [[#Looking for unused GPUs|look for unused GPUs]] before choosing what GPU to request. Choosing a GPU that is currently idle should help your job get run sooner.&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. (This is one of the main differences between Mufasa 1.0 and Mufasa 2.0.)&lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The state of &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt; can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
Command &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; does not tell you about the &amp;#039;&amp;#039;jobs&amp;#039;&amp;#039; submitted to a partition. This information is obtained, instead, with [[User Jobs#Inspecting jobs with squeue|command &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;&amp;#039;state&amp;#039;&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state: see below)&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. In a normally functioning SLURM system, the passage from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; happens only when no jobs are running on the partition. If (e.g., due to a malfunction) the passage happens with jobs still running, they get killed.&lt;br /&gt;
&lt;br /&gt;
A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions, including the &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests, can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
=&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
=&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;=&amp;gt;&amp;quot; the most relevant default values for Mufasa users, i.e.:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2370</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2370"/>
		<updated>2026-05-04T14:33:35Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Default values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Suggestion: if you&amp;#039;re going to run a job, it&amp;#039;s a good idea to [[#Looking for unused GPUs|look for unused GPUs]] before choosing what GPU to request. Choosing a GPU that is currently idle should help your job get run sooner.&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. (This is one of the main differences between Mufasa 1.0 and Mufasa 2.0.)&lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The state of &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt; can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
Command &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; does not tell you about the &amp;#039;&amp;#039;jobs&amp;#039;&amp;#039; submitted to a partition. This information is obtained, instead, with [[User Jobs#Inspecting jobs with squeue|command &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;&amp;#039;state&amp;#039;&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state: see below)&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. In a normally functioning SLURM system, the passage from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; happens only when no jobs are running on the partition. If (e.g., due to a malfunction) the passage happens with jobs still running, they get killed.&lt;br /&gt;
&lt;br /&gt;
A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions, including the &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests, can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
=&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
=&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;=&amp;gt;&amp;quot; the most relevant default values for Mufasa users, i.e.:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2369</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2369"/>
		<updated>2026-05-04T14:32:06Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Partition availability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Suggestion: if you&amp;#039;re going to run a job, it&amp;#039;s a good idea to [[#Looking for unused GPUs|look for unused GPUs]] before choosing what GPU to request. Choosing a GPU that is currently idle should help your job get run sooner.&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. (This is one of the main differences between Mufasa 1.0 and Mufasa 2.0.)&lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The state of &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt; can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
Command &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; does not tell you about the &amp;#039;&amp;#039;jobs&amp;#039;&amp;#039; submitted to a partition. This information is obtained, instead, with [[User Jobs#Inspecting jobs with squeue|command &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;&amp;#039;state&amp;#039;&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state: see below)&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. In a normally functioning SLURM system, the passage from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; happens only when no jobs are running on the partition. If (e.g., due to a malfunction) the passage happens with jobs still running, they get killed.&lt;br /&gt;
&lt;br /&gt;
A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2368</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2368"/>
		<updated>2026-05-04T14:28:02Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Partition availability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Suggestion: if you&amp;#039;re going to run a job, it&amp;#039;s a good idea to [[#Looking for unused GPUs|look for unused GPUs]] before choosing what GPU to request. Choosing a GPU that is currently idle should help your job get run sooner.&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. (This is one of the main differences between Mufasa 1.0 and Mufasa 2.0.)&lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The state of &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt; can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
Command &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; does not tell you about the &amp;#039;&amp;#039;jobs&amp;#039;&amp;#039; submitted to a partition. This information is obtained, instead, with [[User Jobs#Inspecting jobs with squeue|command &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;&amp;#039;state&amp;#039;&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state: see below)&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2367</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2367"/>
		<updated>2026-05-04T14:27:25Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Partition availability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Suggestion: if you&amp;#039;re going to run a job, it&amp;#039;s a good idea to [[#Looking for unused GPUs|look for unused GPUs]] before choosing what GPU to request. Choosing a GPU that is currently idle should help your job get run sooner.&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. (This is one of the main differences between Mufasa 1.0 and Mufasa 2.0.)&lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The state of &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt; can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
Command &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; does not tell you about the &amp;#039;&amp;#039;jobs&amp;#039;&amp;#039; submitted to a partition. This information is obtained, instead, with [[User Jobs#Inspecting jobs with squeue|command &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;&amp;#039;state&amp;#039;&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state: see below)&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2366</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2366"/>
		<updated>2026-05-04T14:26:14Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Partition availability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Suggestion: if you&amp;#039;re going to run a job, it&amp;#039;s a good idea to [[#Looking for unused GPUs|look for unused GPUs]] before choosing what GPU to request. Choosing a GPU that is currently idle should help your job get run sooner.&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. (This is one of the main differences between Mufasa 1.0 and Mufasa 2.0.)&lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The state of &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt; can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
Command &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; does not tell you about the &amp;#039;&amp;#039;jobs&amp;#039;&amp;#039; submitted to a partition. This information is obtained, instead, with [[User Jobs#Inspecting jobs with squeue|command &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;&amp;#039;state&amp;#039;&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2365</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2365"/>
		<updated>2026-05-04T14:25:20Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM partitions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Suggestion: if you&amp;#039;re going to run a job, it&amp;#039;s a good idea to [[#Looking for unused GPUs|look for unused GPUs]] before choosing what GPU to request. Choosing a GPU that is currently idle should help your job get run sooner.&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. (This is one of the main differences between Mufasa 1.0 and Mufasa 2.0.)&lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The state of &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt; can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
Command &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; does not tell you about the &amp;#039;&amp;#039;jobs&amp;#039;&amp;#039; submitted to a partition. This information is obtained, instead, with [[User Jobs#Inspecting jobs with squeue|command &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2364</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2364"/>
		<updated>2026-05-04T14:25:08Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM partitions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Suggestion: if you&amp;#039;re going to run a job, it&amp;#039;s a good idea to [[#Looking for unused GPUs|look for unused GPUs]] before choosing what GPU to request. Choosing a GPU that is currently idle should help your job get run sooner.&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. (This is one of the main differences between Mufasa 1.0 and Mufasa 2.0.)&lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The state of &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt; can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
Command &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; does not tell you about the &amp;#039;&amp;#039;jobs&amp;#039;&amp;#039; submitted to a partition. This information is obtained, instead, with [[User Jobs#Inspecting jobs with squeue|command &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2363</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2363"/>
		<updated>2026-05-04T14:24:19Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM partitions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Suggestion: if you&amp;#039;re going to run a job, it&amp;#039;s a good idea to [[#Looking for unused GPUs|look for unused GPUs]] before choosing what GPU to request. Choosing a GPU that is currently idle should help your job get run sooner.&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. (This is one of the main differences between Mufasa 1.0 and Mufasa 2.0.)&lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The state of &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt; can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
Command &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; does not tell you about the &amp;#039;&amp;#039;jobs&amp;#039;&amp;#039; submitted to a partition. This information can be obtained via [[User Jobs#Inspecting jobs with squeue|command &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2362</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2362"/>
		<updated>2026-05-04T14:23:03Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM partitions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Suggestion: if you&amp;#039;re going to run a job, it&amp;#039;s a good idea to [[#Looking for unused GPUs|look for unused GPUs]] before choosing what GPU to request. Choosing a GPU that is currently idle should help your job get run sooner.&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. (This is one of the main differences between Mufasa 1.0 and Mufasa 2.0.)&lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The state of &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt; can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
Note that to inspect the &amp;#039;&amp;#039;jobs&amp;#039;&amp;#039; submitted to partition &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt; you should use [[User Jobs#Inspecting jobs with squeue|command &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2361</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2361"/>
		<updated>2026-05-04T14:19:46Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM partitions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Suggestion: if you&amp;#039;re going to run a job, it&amp;#039;s a good idea to [[#Looking for unused GPUs|look for unused GPUs]] before choosing what GPU to request. Choosing a GPU that is currently idle should help your job get run sooner.&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. (This is one of the main differences between Mufasa 1.0 and Mufasa 2.0.)&lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The state of &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt; can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2360</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2360"/>
		<updated>2026-05-04T14:18:37Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM partitions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Suggestion: if you&amp;#039;re going to run a job, it&amp;#039;s a good idea to [[#Looking for unused GPUs|look for unused GPUs]] before choosing what GPU to request. Choosing a GPU that is currently idle should help your job get run sooner.&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. (This is one of the main differences between Mufasa 1.0 and Mufasa 2.0.)&lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2359</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2359"/>
		<updated>2026-05-04T14:17:22Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* How to maximise the priority of your jobs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Suggestion: if you&amp;#039;re going to run a job, it&amp;#039;s a good idea to [[#Looking for unused GPUs|look for unused GPUs]] before choosing what GPU to request. Choosing a GPU that is currently idle should help your job get run sooner.&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2358</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2358"/>
		<updated>2026-05-04T14:17:12Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* How to maximise the priority of your jobs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Suggestion: if you&amp;#039;re going to run a job, it&amp;#039;s a good idea to [[#Looking for unused GPUs|Look for unused GPUs]] before choosing what GPU to request. Choosing a GPU that is currently idle should help your job get run sooner.&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2357</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2357"/>
		<updated>2026-05-04T14:14:10Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Elements determining job priority */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use has more impact on it if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2356</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2356"/>
		<updated>2026-05-04T14:13:37Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Elements determining job priority */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main features of FairShare are:&lt;br /&gt;
* the Fairshare value is higher for users whose jobs used less CPUs, GPUs, RAM, execution time.&lt;br /&gt;
* the FairShare mechanism has a &amp;quot;fading memory&amp;quot;, i.e. resource use weighs more if recent, less if farther in the past&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2355</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2355"/>
		<updated>2026-05-04T14:06:02Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Job priority */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue in order of descending priority.&lt;br /&gt;
&lt;br /&gt;
The goal of SLURM is to maximise resource availability: i.e., to ensure the shorter possible wait time before job execution. To achieve this goal, in Mufasa SLURM is configured to &amp;#039;&amp;#039;&amp;#039;encourage users not to ask for resources or execution time that their job doesn&amp;#039;t need&amp;#039;&amp;#039;&amp;#039;. This is done via the priority mechanism: the more resources and/or time a job requests, the lower its priority will be; and the later it will be executed.&lt;br /&gt;
&lt;br /&gt;
Priority management in Mufasa is designed to set up a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039; where users, by carefully choosing what to ask for, obtain two results:&lt;br /&gt;
* they ensure that their job is executed as soon as possible;&lt;br /&gt;
* they leave as much as possible of Mufasa&amp;#039;s resources free for other users&amp;#039;s jobs.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2354</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2354"/>
		<updated>2026-05-04T13:56:14Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Job priority */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. &lt;br /&gt;
&lt;br /&gt;
The order of the items in the job queue depends on their &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039;. The job with the highest priority is put by SLURM on top of the queue, while all other jobs are put in the queue according to descending priorities.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2353</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2353"/>
		<updated>2026-05-04T13:54:42Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Job priority */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution. The job with the highest priority is put by SLURM on top of the queue; all other jobs are queued according to their (descending) priorities.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2352</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2352"/>
		<updated>2026-05-04T13:53:08Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Limits on jobs by the same user */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QOSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QOSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2351</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2351"/>
		<updated>2026-05-04T13:52:30Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Limits on jobs by the same user */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and apply to:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QoS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2350</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2350"/>
		<updated>2026-05-04T13:52:08Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QoS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2349</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2349"/>
		<updated>2026-05-04T13:50:51Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Limits on jobs by the same user */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
 Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QoS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2348</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2348"/>
		<updated>2026-05-04T13:50:29Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Limits on jobs by the same user */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;2 for&amp;#039;&amp;#039; &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;QoS&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2347</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2347"/>
		<updated>2026-05-04T13:48:24Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Limits on jobs by the same user */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits&amp;lt;br/&amp;gt;(system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2346</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2346"/>
		<updated>2026-05-04T13:47:54Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Limits on jobs by the same user */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user asked SLURM to execute, each of which may currently be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are currently in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2345</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2345"/>
		<updated>2026-05-04T13:46:49Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Limits on jobs by the same user */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs from a single user. Such limits aim at preventing users from &amp;quot;hoarding&amp;quot; system resources, and involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2344</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2344"/>
		<updated>2026-05-04T13:43:58Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* research users and students users */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. The idea behind these categories is to provide researchers with more access to Mufasa&amp;#039;s resources, without preventing students from using the server.&lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2343</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2343"/>
		<updated>2026-05-04T13:43:02Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* research users and students users */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * have access to a restricted set of [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2342</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2342"/>
		<updated>2026-05-04T13:41:59Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* researcher users and students users */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2341</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2341"/>
		<updated>2026-05-04T13:41:48Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2340</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2340"/>
		<updated>2026-05-04T13:40:12Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Research users and students users */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#Research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#Research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#Research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2339</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2339"/>
		<updated>2026-05-04T13:39:29Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* Restricted QOSes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
In Mufasa, the most powerful QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#Research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= Research users and students users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#Research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#Research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2338</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2338"/>
		<updated>2026-05-04T13:38:37Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* QOS restrictions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== Restricted QOSes ==&lt;br /&gt;
&lt;br /&gt;
Some of the QOSes are reserved to researchers (including Ph.D. students), and not available to M.Sc. students.&lt;br /&gt;
&lt;br /&gt;
See [[#Research users and students users|below]] to understand the differences between &amp;lt;code&amp;gt;researcher&amp;lt;/code&amp;gt; users and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users.&lt;br /&gt;
&lt;br /&gt;
= Research users and students users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#Research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#Research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2337</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2337"/>
		<updated>2026-05-04T13:36:38Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* The build QOS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== QOS restrictions ==&lt;br /&gt;
&lt;br /&gt;
Some of the QOSes are not available to M.Sc. students. See [[#Research users and students users|Research users and students users]] to understand the differences between the two categories of users of Mufasa and to find out what access you have to resources.&lt;br /&gt;
&lt;br /&gt;
= Research users and students users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#Research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#Research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2336</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2336"/>
		<updated>2026-05-04T13:36:13Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* The build QOS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, so  SLURM jobs launched using this QOS are executed quickly. &lt;br /&gt;
&lt;br /&gt;
This QOS, though, has resources that are strictly limited to those needed for building operations; additionally, it has no access to GPUs and a short maximum duration for jobs. This makes it unsuitable for computing activities different from building containers.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== QOS restrictions ==&lt;br /&gt;
&lt;br /&gt;
Some of the QOSes are not available to M.Sc. students. See [[#Research users and students users|Research users and students users]] to understand the differences between the two categories of users of Mufasa and to find out what access you have to resources.&lt;br /&gt;
&lt;br /&gt;
= Research users and students users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#Research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#Research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2335</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2335"/>
		<updated>2026-05-04T13:34:19Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM Quality of Service (QOS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, a job run using this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, to allow SLURM jobs launched using this QOS to be executed quickly. On the other side, this QOS has very limited (but fully sufficient for building operations) resources, no access to GPUs and a short maximum duration for jobs: so it is not suitable for other computing activities.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== QOS restrictions ==&lt;br /&gt;
&lt;br /&gt;
Some of the QOSes are not available to M.Sc. students. See [[#Research users and students users|Research users and students users]] to understand the differences between the two categories of users of Mufasa and to find out what access you have to resources.&lt;br /&gt;
&lt;br /&gt;
= Research users and students users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#Research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#Research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2334</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2334"/>
		<updated>2026-05-04T13:33:01Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM Quality of Service (QOS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to encourage users to use the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Less powerful QOSes increase the priority of the jobs that use them, so these jobs tend to be executed sooner.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, any job run with this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, to allow SLURM jobs launched using this QOS to be executed quickly. On the other side, this QOS has very limited (but fully sufficient for building operations) resources, no access to GPUs and a short maximum duration for jobs: so it is not suitable for other computing activities.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== QOS restrictions ==&lt;br /&gt;
&lt;br /&gt;
Some of the QOSes are not available to M.Sc. students. See [[#Research users and students users|Research users and students users]] to understand the differences between the two categories of users of Mufasa and to find out what access you have to resources.&lt;br /&gt;
&lt;br /&gt;
= Research users and students users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#Research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#Research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2333</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2333"/>
		<updated>2026-05-04T13:30:42Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM Quality of Service (QOS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** maximum 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to steer users towards using the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Powerful QOSes lower the priority of the jobs that use them, to encourage users to prefer less powerful QOSes.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, any job run with this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, to allow SLURM jobs launched using this QOS to be executed quickly. On the other side, this QOS has very limited (but fully sufficient for building operations) resources, no access to GPUs and a short maximum duration for jobs: so it is not suitable for other computing activities.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== QOS restrictions ==&lt;br /&gt;
&lt;br /&gt;
Some of the QOSes are not available to M.Sc. students. See [[#Research users and students users|Research users and students users]] to understand the differences between the two categories of users of Mufasa and to find out what access you have to resources.&lt;br /&gt;
&lt;br /&gt;
= Research users and students users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#Research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#Research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2332</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2332"/>
		<updated>2026-05-04T13:30:04Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM Quality of Service (QOS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* this access to GPUs:&lt;br /&gt;
** access to a maximum of 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
** no access to GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
** no access to GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to steer users towards using the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Powerful QOSes lower the priority of the jobs that use them, to encourage users to prefer less powerful QOSes.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, any job run with this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, to allow SLURM jobs launched using this QOS to be executed quickly. On the other side, this QOS has very limited (but fully sufficient for building operations) resources, no access to GPUs and a short maximum duration for jobs: so it is not suitable for other computing activities.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== QOS restrictions ==&lt;br /&gt;
&lt;br /&gt;
Some of the QOSes are not available to M.Sc. students. See [[#Research users and students users|Research users and students users]] to understand the differences between the two categories of users of Mufasa and to find out what access you have to resources.&lt;br /&gt;
&lt;br /&gt;
= Research users and students users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#Research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#Research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2331</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2331"/>
		<updated>2026-05-04T13:27:38Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM Quality of Service (QOS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always &amp;#039;&amp;#039;&amp;#039;specify the QOS&amp;#039;&amp;#039;&amp;#039; that their job will use: this choice, in turn, determines what resources the job is able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* access to a maximum of 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
* no access to GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
* no access to GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to steer users towards using the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Powerful QOSes lower the priority of the jobs that use them, to encourage users to prefer less powerful QOSes.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, any job run with this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, to allow SLURM jobs launched using this QOS to be executed quickly. On the other side, this QOS has very limited (but fully sufficient for building operations) resources, no access to GPUs and a short maximum duration for jobs: so it is not suitable for other computing activities.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== QOS restrictions ==&lt;br /&gt;
&lt;br /&gt;
Some of the QOSes are not available to M.Sc. students. See [[#Research users and students users|Research users and students users]] to understand the differences between the two categories of users of Mufasa and to find out what access you have to resources.&lt;br /&gt;
&lt;br /&gt;
= Research users and students users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#Research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#Research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2330</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2330"/>
		<updated>2026-05-04T13:26:53Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM Quality of Service (QOS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
Through &amp;#039;&amp;#039;&amp;#039;Quality of Services&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOSes&amp;#039;&amp;#039;&amp;#039;), SLURM lets system configurators assign a name to a set of related constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always specify the QOS that they want to use: this choice, in turn, determines what resources the job will be able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* access to a maximum of 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
* no access to GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
* no access to GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to steer users towards using the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Powerful QOSes lower the priority of the jobs that use them, to encourage users to prefer less powerful QOSes.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, any job run with this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, to allow SLURM jobs launched using this QOS to be executed quickly. On the other side, this QOS has very limited (but fully sufficient for building operations) resources, no access to GPUs and a short maximum duration for jobs: so it is not suitable for other computing activities.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== QOS restrictions ==&lt;br /&gt;
&lt;br /&gt;
Some of the QOSes are not available to M.Sc. students. See [[#Research users and students users|Research users and students users]] to understand the differences between the two categories of users of Mufasa and to find out what access you have to resources.&lt;br /&gt;
&lt;br /&gt;
= Research users and students users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#Research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#Research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2329</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2329"/>
		<updated>2026-05-04T13:26:08Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM Quality of Service (QOS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
SLURM provides a tool called &amp;#039;&amp;#039;&amp;#039;Quality of Service&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;QOS&amp;#039;&amp;#039;&amp;#039;) to let system configurators give a name to a set of constraints.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, QOSes are used to define different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always specify the QOS that they want to use: this choice, in turn, determines what resources the job will be able to access and influences the [[#Job priority|priority]] of the job.&lt;br /&gt;
&lt;br /&gt;
Mufasa&amp;#039;s QOSes and their features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* access to a maximum of 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
* no access to GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
* no access to GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to steer users towards using the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Powerful QOSes lower the priority of the jobs that use them, to encourage users to prefer less powerful QOSes.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, any job run with this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, to allow SLURM jobs launched using this QOS to be executed quickly. On the other side, this QOS has very limited (but fully sufficient for building operations) resources, no access to GPUs and a short maximum duration for jobs: so it is not suitable for other computing activities.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== QOS restrictions ==&lt;br /&gt;
&lt;br /&gt;
Some of the QOSes are not available to M.Sc. students. See [[#Research users and students users|Research users and students users]] to understand the differences between the two categories of users of Mufasa and to find out what access you have to resources.&lt;br /&gt;
&lt;br /&gt;
= Research users and students users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#Research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#Research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2328</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2328"/>
		<updated>2026-05-04T13:21:08Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM in a nutshell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits to the number of jobs by the same user. This page includes a [[#Limits on jobs by the same user|table summarising such limits]].&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, the different Quality of Services (QOSes) defined by SLURM correspond to different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always specify the QOS that they want to use: this choice, in turn determines what resources the job will be able to access.&lt;br /&gt;
&lt;br /&gt;
The list of Mufasa&amp;#039;s QOSes and their main features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* access to a maximum of 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
* no access to GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
* no access to GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to steer users towards using the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Powerful QOSes lower the priority of the jobs that use them, to encourage users to prefer less powerful QOSes.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, any job run with this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, to allow SLURM jobs launched using this QOS to be executed quickly. On the other side, this QOS has very limited (but fully sufficient for building operations) resources, no access to GPUs and a short maximum duration for jobs: so it is not suitable for other computing activities.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== QOS restrictions ==&lt;br /&gt;
&lt;br /&gt;
Some of the QOSes are not available to M.Sc. students. See [[#Research users and students users|Research users and students users]] to understand the differences between the two categories of users of Mufasa and to find out what access you have to resources.&lt;br /&gt;
&lt;br /&gt;
= Research users and students users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#Research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#Research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2327</id>
		<title>SLURM</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=SLURM&amp;diff=2327"/>
		<updated>2026-05-04T13:19:03Z</updated>

		<summary type="html">&lt;p&gt;GiulioFontana: /* SLURM in a nutshell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of SLURM that are most relevant to Mufasa&amp;#039;s [[Roles|Job Users]]. Job Users can submit jobs for execution, cancel their own jobs, and see other users&amp;#039; jobs (but not intervene on them).&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa &amp;#039;&amp;#039;&amp;#039;must use SLURM&amp;#039;&amp;#039;&amp;#039; to run resource-heavy processes, i.e. computing jobs that require one or more of the following:&lt;br /&gt;
* GPUs&lt;br /&gt;
* multiple CPUs&lt;br /&gt;
* powerful CPUs&lt;br /&gt;
* a significant amount of RAM&lt;br /&gt;
&lt;br /&gt;
In fact, only processes run via SLURM have access to all the resources of Mufasa. Processes run outside SLURM are executed by the [[System#Login server|login server]] virtual machine, which has minimal resources and no GPUs. Using SLURM is therefore the only way to execute resource-heavy jobs on Mufasa (this is a key difference between Mufasa 1.0 and Mufasa 2.0).&lt;br /&gt;
&lt;br /&gt;
= SLURM in a nutshell =&lt;br /&gt;
&lt;br /&gt;
Computation jobs on Mufasa needs to be launched via [[System#The SLURM job scheduling system|SLURM]]. SLURM provides jobs with access to the [[#System resources subjected to limitations|physical resources]] of Mufasa, such as CPUs, GPUs and RAM. Thanks to SLURM, processing jobs share system resources, optimising their occupation and availability. &lt;br /&gt;
&lt;br /&gt;
When a user runs a job, the job does not get executed immediately and is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039;. SLURM executes jobs according to their order in the queue: the top job in the queue gets executed as soon as the necessary resources are available, while jobs lower in the queue wait longer. The position of a job in the queue is due to the &amp;#039;&amp;#039;&amp;#039;[[#Job priority|priority]]&amp;#039;&amp;#039;&amp;#039; assigned to it by SLURM, with higher-priority jobs closer to the top. As a general rule:&lt;br /&gt;
&lt;br /&gt;
;: &amp;#039;&amp;#039;&amp;#039;the greater the fraction of Mufasa&amp;#039;s overall resources that a job asks for, the lower the job&amp;#039;s priority will be&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The priority mechanism is used to encourage users to use Mufasa&amp;#039;s resources in an effective and equitable manner. This page includes a [[#How_to_maximise_the_priority_of_your_jobs|chart explaining how to maximise the priority of your jobs]].&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;time&amp;#039;&amp;#039;&amp;#039; available to a job for its execution is controlled by SLURM. When a user requests execution of a job, they must specify the duration of the time slot that the job needs. The job must complete its execution before the end of the requested time slot, otherwise it gets killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0 access to system resources is managed via SLURM&amp;#039;s &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|Quality of Service (QOS)]]&amp;#039;&amp;#039;&amp;#039; mechanism (Mufasa 1.0 used [[#SLURM_partitions|partitions]] instead). To launch a processing job via SLURM, the user must always specify the chosen QOS. QOSes differ in the set of resources that they provide access to because each of them is designed to fit a given type of job.&lt;br /&gt;
&lt;br /&gt;
= SLURM Quality of Service (QOS) =&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, the different Quality of Services (QOSes) defined by SLURM correspond to different levels of access to the server&amp;#039;s resources. When [[User Jobs|executing a job with SLURM]], a user must always specify the QOS that they want to use: this choice, in turn determines what resources the job will be able to access.&lt;br /&gt;
&lt;br /&gt;
The list of Mufasa&amp;#039;s QOSes and their main features can be inspected with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list qos format=name%-11,priority,MaxSubmit,maxwall,maxtres%-80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
Name          Priority MaxSubmit     MaxWall MaxTRES                                                                          &lt;br /&gt;
----------- ---------- --------- ----------- -------------------------------------------------------------------------------- &lt;br /&gt;
normal               0                                                                                                        &lt;br /&gt;
nogpu                4         1  3-00:00:00 cpu=16,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=128G &lt;br /&gt;
gpuheavy-20          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=2,mem=128G             &lt;br /&gt;
gpuheavy-40          1         1             cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=1,gres/gpu:4g.20gb=0,mem=128G             &lt;br /&gt;
gpulight             8         1    12:00:00 cpu=2,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpu                  2         1  1-00:00:00 cpu=8,gres/gpu:3g.20gb=1,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,mem=64G              &lt;br /&gt;
gpuwide              2         2  1-00:00:00 cpu=8,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=1,mem=64G              &lt;br /&gt;
build               32         1    02:00:00 cpu=2,gres/gpu:3g.20gb=0,gres/gpu:40gb=0,gres/gpu:4g.20gb=0,gres/gpu=0,mem=16G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns of this output are the following:&lt;br /&gt;
&lt;br /&gt;
:; Name&lt;br /&gt;
:: name of the QOS&lt;br /&gt;
&lt;br /&gt;
:; Priority&lt;br /&gt;
:: priority tier associated to the QOS (higher value = higher priority): see [[#Job priority|Job priority]] for details&lt;br /&gt;
&lt;br /&gt;
:; MaxSubmit&lt;br /&gt;
:: maximum number of jobs from a single user that can be submitted to SLURM with this QOS; submitted jobs include both running and queued jobs&lt;br /&gt;
:: See [[#Limits on jobs by the same user|Limits on jobs by the same user]] for an overview of the limits on jobs set by Mufasa.&lt;br /&gt;
&lt;br /&gt;
:; MaxWall&lt;br /&gt;
:: maximum wall clock duration of the jobs using the QOS (after which they are killed by SLURM), in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
:: For some QOSes these are not set: it means that they are determined by the [[#SLURM partitions|partition]]. Partitions also define the [[#Default values|default duration]] of jobs.&lt;br /&gt;
&lt;br /&gt;
:; MaxTRES&lt;br /&gt;
:: amount of [[#System resources subjected to limitations|resources subjected to limitations]] (&amp;quot;&amp;#039;&amp;#039;Trackable RESources&amp;#039;&amp;#039;&amp;quot;) available to a job using the QOS, where&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;cpu=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of CPUs (i.e., processor cores) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of CPUs specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;gres/&amp;#039;&amp;#039;gpu:Type&amp;#039;&amp;#039;=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum number of GPUs of class &amp;lt;code&amp;gt;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; (see [[User Jobs#gres syntax|&amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax]]) is &amp;#039;&amp;#039;K&amp;#039;&amp;#039;&lt;br /&gt;
::: --&amp;gt; (for QOSes that allow access to GPUs) if not specified, the job cannot be launched&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;mem=&amp;#039;&amp;#039;K&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; means that the maximum amount of system RAM is &amp;#039;&amp;#039;K&amp;#039;&amp;#039; GBytes&lt;br /&gt;
::: --&amp;gt; if not specified, the job gets the default amount of RAM specified by the [[#SLURM partitions|partition]]&lt;br /&gt;
&lt;br /&gt;
For instance, QOS &amp;lt;code&amp;gt;gpulight&amp;lt;/code&amp;gt; provides jobs that use it with:&lt;br /&gt;
* priority tier equal to 8&lt;br /&gt;
* a maximum of 1 submitted job per user&lt;br /&gt;
* a maximum of 12 hours of duration&lt;br /&gt;
* a maximum of 2 CPUs&lt;br /&gt;
* a maximum of 64 GB of RAM&lt;br /&gt;
* access to a maximum of 1 GPU of type &amp;#039;&amp;#039;gpu:3g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
* no access to GPUs of type &amp;#039;&amp;#039;gpu:40gb=0&amp;#039;&amp;#039;&lt;br /&gt;
* no access to GPUs of type &amp;#039;&amp;#039;gpu:4g.20gb&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As seen in the example output from &amp;lt;code&amp;gt;sacctmgr list qos&amp;lt;/code&amp;gt; above, each QOS has an associated &amp;#039;&amp;#039;&amp;#039;priority tier&amp;#039;&amp;#039;&amp;#039;. In Mufasa 2.0, priority tiers are used to steer users towards using the &amp;#039;&amp;#039;&amp;#039;least powerful QOS that is compatible with their needs&amp;#039;&amp;#039;&amp;#039;, where &amp;quot;powerful&amp;quot; means &amp;quot;rich with resources&amp;quot;. Powerful QOSes lower the priority of the jobs that use them, to encourage users to prefer less powerful QOSes.&lt;br /&gt;
&lt;br /&gt;
See [[#Priority|Priority]] to understand how priority affects the execution order of jobs in Mufasa 2.0.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; QOS is the default one: it exists only to ensure that users always specify a QOS when running a job. Since &amp;lt;code&amp;gt;normal&amp;lt;/code&amp;gt; has zero priority and no resources, any job run with this QOS would never be run.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; QOS ==&lt;br /&gt;
&lt;br /&gt;
This QOS is specifically designed to be used by Mufasa users to &amp;#039;&amp;#039;&amp;#039;build [[System#Containers|container images]]&amp;#039;&amp;#039;&amp;#039;. Its associated priority tier is very high, to allow SLURM jobs launched using this QOS to be executed quickly. On the other side, this QOS has very limited (but fully sufficient for building operations) resources, no access to GPUs and a short maximum duration for jobs: so it is not suitable for other computing activities.&lt;br /&gt;
&lt;br /&gt;
See [[Singularity#Building Singularity images|Building Singularity images]] for directions about building Singularity container images.&lt;br /&gt;
&lt;br /&gt;
== QOS restrictions ==&lt;br /&gt;
&lt;br /&gt;
Some of the QOSes are not available to M.Sc. students. See [[#Research users and students users|Research users and students users]] to understand the differences between the two categories of users of Mufasa and to find out what access you have to resources.&lt;br /&gt;
&lt;br /&gt;
= Research users and students users =&lt;br /&gt;
&lt;br /&gt;
Users of Mufasa belong to two &amp;#039;&amp;#039;&amp;#039;user categories&amp;#039;&amp;#039;&amp;#039;, which provide the users belonging to them with different access to system resources. &lt;br /&gt;
&lt;br /&gt;
User categories are:&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. academic personnel and Ph.D. students&lt;br /&gt;
::: * have access to all [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a higher &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is higher&lt;br /&gt;
&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, i.e. M.Sc. students&lt;br /&gt;
::: * do not have access to some [[#SLURM Quality of Service (QOS)|QOSes]]&lt;br /&gt;
::: * their jobs have a lower &amp;#039;&amp;#039;base priority&amp;#039;&amp;#039;&lt;br /&gt;
::: * the number of running jobs that the user can have is lower&lt;br /&gt;
&lt;br /&gt;
You can inspect the differences between &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association format=&amp;quot;account,priority,maxjobs&amp;quot; | grep -E &amp;#039;Account|research|students&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
   Account   Priority MaxJobs &lt;br /&gt;
  research          4       2 &lt;br /&gt;
  students          1       1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know what limits apply to your own user, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacctmgr list association where user=$USER format=&amp;quot;user,priority,maxjobs,qos%-60&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
      User   Priority MaxJobs QOS                                                          &lt;br /&gt;
---------- ---------- ------- ------------------------------------------------------------ &lt;br /&gt;
    preali          4       2 build,gpu,gpuheavy-20,gpuheavy-40,gpulight,gpuwide,nogpu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list under &amp;quot;QOS&amp;quot; shows what QOSes your user is allowed to use when [[User Jobs|running jobs]]. &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users can use all of them, while &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users can only access a subset of them.&lt;br /&gt;
&lt;br /&gt;
= Limits on jobs by the same user =&lt;br /&gt;
&lt;br /&gt;
Mufasa sets limits on the number of jobs of a user. Limits involve:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;submitted jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that the user launched and may be either running or queued&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;running jobs&amp;#039;&amp;#039;&amp;#039;, i.e. jobs that are in execution&lt;br /&gt;
&lt;br /&gt;
The following table summarises the limits that Mufasa sets on the number of jobs by the same user:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! number of running jobs&lt;br /&gt;
! number of submitted jobs&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | global limits (system-wide)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt; users&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the sum of the limits on submitted jobs set by the QoSes (below)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | limits for each QoS&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;not limited directly...&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;...but cannot exceed the global limit on running jobs (above) nor the QoS limit on submitted jobs (on the right)&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;2 for &amp;lt;code&amp;gt;gpuwide&amp;lt;/code&amp;gt; QoS&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;1 for all other QoSes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Limits on the number of running jobs depend on the user category (either [[#Research users and students users|researcher or students]]) that the user belongs to; limits on the number of submitted jobs depend on the properties of the [[#SLURM Quality of Service (QOS)|SLURM QOSes]] used to launch them.&lt;br /&gt;
&lt;br /&gt;
= Job priority =&lt;br /&gt;
&lt;br /&gt;
Once the execution of a job has been requested, the job is not run immediately: it is instead &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; by SLURM, together with all the other jobs awaiting execution. The job on top of the queue at any time is the first to be put into execution as soon as the resources it requires are available. The order of the jobs in the queue depends on the &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; of the jobs, and defines the order in which each job will reach execution.&lt;br /&gt;
&lt;br /&gt;
SLURM is configured to maximise resource availability, i.e. to ensure the shorter possible wait time before job execution.&lt;br /&gt;
&lt;br /&gt;
To achieves this goal, SLURM &amp;#039;&amp;#039;&amp;#039;encourages users to avoid asking for resources or execution time that their job does not need&amp;#039;&amp;#039;&amp;#039;. The more resources and the more time a job requests, the lower its priority in the execution queue will be.&lt;br /&gt;
&lt;br /&gt;
This mechanism creates a &amp;#039;&amp;#039;&amp;#039;virtuous cycle&amp;#039;&amp;#039;&amp;#039;. By carefully choosing what to ask for, a user ensures that their job will be executed as soon as possible; at the same time, users limiting their requests to what their jobs really need leave more resources available to other jobs in the queue, which will then be executed sooner.&lt;br /&gt;
&lt;br /&gt;
== Elements determining job priority ==&lt;br /&gt;
In Mufasa, the priority of a job is computed by SLURM according to the following elements:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#Research users and students users|User category]]&amp;#039;&amp;#039;&amp;#039; (i.e., &amp;lt;code&amp;gt;research&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;students&amp;lt;/code&amp;gt;)&lt;br /&gt;
::: Used to provide higher priority to jobs run by &amp;#039;&amp;#039;&amp;#039;research personnel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;[[#SLURM Quality of Service (QOS)|QOS]]&amp;#039;&amp;#039;&amp;#039; used by the job&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;less resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Number of CPUs&amp;#039;&amp;#039;&amp;#039; requested by the job (also called &amp;quot;job size&amp;quot;)&lt;br /&gt;
::: Used to provide higher priority to jobs asking for &amp;#039;&amp;#039;&amp;#039;a lower number of CPUs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job duration&amp;#039;&amp;#039;&amp;#039;, i.e. the execution time requested by the job&lt;br /&gt;
::: Used to provide higher priority to &amp;#039;&amp;#039;&amp;#039;shorter jobs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Job Age&amp;#039;&amp;#039;&amp;#039;, i.e. the time that the job has been waiting in the queue&lt;br /&gt;
::: Used to provide higher priority to jobs which have been &amp;#039;&amp;#039;&amp;#039;queued for a longer time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;FairShare&amp;#039;&amp;#039;&amp;#039;, i.e. a factor computed by SLURM to balance use of the system by different users&lt;br /&gt;
::: Used to provide higher priority to jobs by users who &amp;#039;&amp;#039;&amp;#039;used Mufasa less than others&amp;#039;&amp;#039;&amp;#039; (i.e., used less resources: CPUs, GPUs, RAM, execution time)&lt;br /&gt;
::: FairShare has a &amp;quot;fading memory&amp;quot;, i.e. the influence of past resource usage gets lower the farther it is from now&lt;br /&gt;
&lt;br /&gt;
== How to maximise the priority of your jobs ==&lt;br /&gt;
&lt;br /&gt;
Every time you run a SLURM job, follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
; Choose the less powerful QOS compatible with the needs of your job&lt;br /&gt;
:: QOSes with access to less resources lead to higher priority&lt;br /&gt;
&lt;br /&gt;
; Only request CPUs that your job will actually use&lt;br /&gt;
:: If you didn&amp;#039;t design your code to exploit multiple CPUs, check that it does! If it doesn&amp;#039;t, do not ask for them&lt;br /&gt;
&lt;br /&gt;
; Do not request more time than your jobs needs to complete&lt;br /&gt;
:: Make a worst-case estimate and only ask for that duration&lt;br /&gt;
&lt;br /&gt;
; Test and debug your code using less powerful QOSes before running it on more powerful QOSes&lt;br /&gt;
:: Your test jobs will get a higher priority and your FairShare will improve&lt;br /&gt;
&lt;br /&gt;
; Cancel jobs when you don&amp;#039;t need them anymore&lt;br /&gt;
:: [[User_Jobs#Cancelling_a_job_with_scancel|Use scancel]] to delete your jobs when finished (or if they become useless due to a bug): your Fairshare will improve&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System resources subjected to limitations =&lt;br /&gt;
&lt;br /&gt;
In systems based on SLURM like Mufasa, &amp;#039;&amp;#039;&amp;#039;TRES (Trackable RESources)&amp;#039;&amp;#039;&amp;#039; are (from [https://slurm.schedmd.com/tres.html SLURM&amp;#039;s documentation] &amp;quot;&amp;#039;&amp;#039;resources that can be tracked for usage or used to enforce limits against.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TRES include CPUs, RAM and &amp;#039;&amp;#039;&amp;#039;GRES&amp;#039;&amp;#039;&amp;#039;. The last term stands for &amp;#039;&amp;#039;Generic RESources&amp;#039;&amp;#039; that a job may need for its execution. In Mufasa, the only &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; resources are the GPUs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; syntax ==&lt;br /&gt;
&lt;br /&gt;
To ask SLURM to assign GRES resources (i.e., GPUs) to a job, a special syntax must be used. Precisely, the name of each GPU resource takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:Name:Type&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Considering the [[System#CPUs and GPUs|GPU complement of Mufasa]], &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; takes the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:40gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 40 Gbytes of RAM&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:4g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 4 compute units&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; for GPUs with 20 Gbytes of RAM and 3 compute units&lt;br /&gt;
&lt;br /&gt;
So, for instance,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:3g.20gb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
identifies a resource corresponding to a GPU with 20 GB of RAM and 3 compute units.&lt;br /&gt;
&lt;br /&gt;
When asking for a GRES resource (e.g., in an &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; command or an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive of an [[User Jobs#Using execution scripts to run jobs|execution script]]), the syntax required by SLURM is&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;gpu:&amp;lt;Type&amp;gt;:&amp;lt;Quantity&amp;gt;&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;Quantity&amp;lt;/code&amp;gt; is an integer value specifying how many items of the resource are requested. So, for instance, to ask for 2 GPUs of type &amp;lt;code&amp;gt;4g.20gb&amp;lt;/code&amp;gt; the syntax is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gpu:4g.20gb:2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SLURM&amp;#039;s &amp;#039;&amp;#039;generic resources&amp;#039;&amp;#039; are defined in &amp;lt;code&amp;gt;/etc/slurm/gres.conf&amp;lt;/code&amp;gt;. In order to make GPUs available to SLURM&amp;#039;s &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; management, Mufasa makes use of Nvidia&amp;#039;s [https://developer.nvidia.com/nvidia-management-library-nvml NVML library]. For additional information see [https://slurm.schedmd.com/gres.html SLURM&amp;#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
== Looking for unused GPUs ==&lt;br /&gt;
&lt;br /&gt;
GPUs are usually the most limited resource on Mufasa. So, if your job requires a GPU, the best way to get it executed quickly is to use a QOS associated to a type of GPU of which there are one or more that aren&amp;#039;t currently in use. This command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O Gres:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
provides a summary of all the Gres (i.e., GPU) resources possessed by Mufasa. It provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES                                                                                                &lt;br /&gt;
gpu:40gb:3,gpu:4g.20gb:5,gpu:3g.20gb:5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To know which of the GPUs are currently in use, use command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -O GresUsed:100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
GRES_USED&lt;br /&gt;
gpu:40gb:2(IDX:0-1),gpu:4g.20gb:2(IDX:5,8),gpu:3g.20gb:3(IDX:3-4,6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By comparing the two lists (GRES and GRES_USED) you can easily spot unused GPUs.&lt;br /&gt;
&lt;br /&gt;
= SLURM partitions =&lt;br /&gt;
&lt;br /&gt;
Partitions are another mechanism provided by SLURM to create different levels of access to system resources. Since in Mufasa 2.0 access to resources is controlled via [[#SLURM Quality of Service (QOS)|QOSes]], partitions are not very relevant. &lt;br /&gt;
&lt;br /&gt;
Note, however, that the default values for some features of SLURM jobs (e.g., duration) are [[#Default values|set by the partition]].&lt;br /&gt;
&lt;br /&gt;
In Mufasa 2.0, there is a single SLURM partition, called &amp;lt;code&amp;gt;jobs&amp;lt;/code&amp;gt;, and all jobs run on it. The partition status of Mufasa can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo -o &amp;quot;%10P %5a %9T %11L %10l&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PARTITION  AVAIL STATE     DEFAULTTIME TIMELIMIT &lt;br /&gt;
jobs*      up    idle      1:00:00     3-00:00:00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where columns correspond to the following information:&lt;br /&gt;
&lt;br /&gt;
:; PARTITION&lt;br /&gt;
:: name of the partition; the asterisks indicates that it&amp;#039;s the default one&lt;br /&gt;
&lt;br /&gt;
:; AVAIL&lt;br /&gt;
:: state/availability of the partition: see [[#Partition availability|below]]&lt;br /&gt;
&lt;br /&gt;
:; STATE&lt;br /&gt;
:: state (using [https://slurm.schedmd.com/sinfo.html#SECTION_NODE-STATE-CODES these codes])&lt;br /&gt;
:: typical values are &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;mixed&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that some of the resources are busy executing jobs while other are idle, and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;allocated&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; - meaning that all of the resources are in use&lt;br /&gt;
&lt;br /&gt;
:; DEFAULTTIME&lt;br /&gt;
:: default runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
:; TIMELIMIT&lt;br /&gt;
:: maximum runtime of a job, in format &amp;#039;&amp;#039;[days-]hours:minutes:seconds&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The asterisk at the end of the partition name indicates the default partition, i.e. the one on which jobs which do not ask for a specific partition are run.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; provides is the &amp;#039;&amp;#039;&amp;#039;availability&amp;#039;&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions. This is shown in column &amp;quot;AVAIL&amp;quot;. Possible partition states are:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is available&lt;br /&gt;
:: It&amp;#039;s possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Currently queued jobs will be executed as soon as resources allow&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is in the process of becoming unavailable (i.e., of entering the &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; state)&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: Currently running jobs will be completed&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; = the partition is unavailable&lt;br /&gt;
:: It&amp;#039;s not possible to launch jobs on the partition&lt;br /&gt;
:: There are no running jobs&lt;br /&gt;
:: Queued jobs will be executed when the partition becomes available again (i.e. goes back to the &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; state)&lt;br /&gt;
&lt;br /&gt;
When a partition goes from &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; no harm is done to running jobs. When a partition passes from any other state to &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt;, running jobs (if they exist) get killed. A partition in state &amp;lt;code&amp;gt;drain&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;down&amp;lt;/code&amp;gt; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Default values ==&lt;br /&gt;
&lt;br /&gt;
The features of SLURM partitions can be inspected with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scontrol show partition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which provides an output similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
PartitionName=jobs&lt;br /&gt;
   AllowGroups=ALL AllowAccounts=ALL AllowQos=nogpu,gpulight,gpu,gpuwide,gpuheavy-20,gpuheavy-40&lt;br /&gt;
   AllocNodes=ALL Default=YES QoS=N/A&lt;br /&gt;
-&amp;gt; DefaultTime=01:00:00 DisableRootJobs=NO ExclusiveUser=NO ExclusiveTopo=NO GraceTime=0 Hidden=NO&lt;br /&gt;
   MaxNodes=UNLIMITED MaxTime=3-00:00:00 MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED&lt;br /&gt;
   Nodes=gn01&lt;br /&gt;
   PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO&lt;br /&gt;
   OverTimeLimit=NONE PreemptMode=OFF&lt;br /&gt;
   State=UP TotalCPUs=48 TotalNodes=1 SelectTypeParameters=NONE&lt;br /&gt;
   JobDefaults=(null)&lt;br /&gt;
-&amp;gt; DefMemPerNode=4096 MaxMemPerNode=UNLIMITED&lt;br /&gt;
   TRES=cpu=48,mem=1011435M,node=1,billing=49,gres/gpu=13,gres/gpu:3g.20gb=5,gres/gpu:40gb=3,gres/gpu:4g.20gb=5&lt;br /&gt;
   TRESBillingWeights=cpu=1.0,gres/gpu:3g.20gb=6.0,gres/gpu:4g.20gb=6.0,gres/gpu:40gb=6.0,mem=0.05g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, we have highlighted with &amp;quot;-&amp;gt;&amp;quot; the most relevant for Mufasa users, i.e. two &amp;#039;&amp;#039;&amp;#039;default values&amp;#039;&amp;#039;&amp;#039; which are applied to jobs that do not make explicit requests. Precisely:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefaultTime&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default execution time assigned to a job run on the partition (e.g., 1 hour)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;DefMemPerNode&amp;lt;/code&amp;gt;&lt;br /&gt;
:: the default amount of RAM assigned to a job run on the partition (e.g., 4GB)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>
	</entry>
</feed>