<?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=10.79.2.181</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=10.79.2.181"/>
	<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=Special:Contributions/10.79.2.181"/>
	<updated>2026-05-10T18:15:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.2</generator>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=Docker&amp;diff=416</id>
		<title>Docker</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=Docker&amp;diff=416"/>
		<updated>2022-01-26T13:06:23Z</updated>

		<summary type="html">&lt;p&gt;10.79.2.181: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Under construction]&lt;/div&gt;</summary>
		<author><name>10.79.2.181</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=User_Jobs&amp;diff=246</id>
		<title>User Jobs</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=User_Jobs&amp;diff=246"/>
		<updated>2022-01-18T16:08:44Z</updated>

		<summary type="html">&lt;p&gt;10.79.2.181: /* Launching a user job from within a Docker container */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of Mufasa 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;
Job Users are by necessity SLURM users (see [[System#The SLURM job scheduling system|The SLURM job scheduling system]]) so you may also want to read [https://slurm.schedmd.com/quickstart.html SLURM&amp;#039;s own Quick Start User Guide].&lt;br /&gt;
&lt;br /&gt;
= SLURM Partitions =&lt;br /&gt;
&lt;br /&gt;
Several execution queues for jobs have been defined on Mufasa. Such queues are called &amp;#039;&amp;#039;&amp;#039;partitions&amp;#039;&amp;#039;&amp;#039; in SLURM terminology. Each partition has features (in term of resources available to the jobs on that queue) that make the partition suitable for a certain category of jobs. 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;
sinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
([https://slurm.schedmd.com/sinfo.html link to SLURM docs]) provides a list of available partitions. Its 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;
PARTITION  AVAIL  TIMELIMIT  NODES  STATE NODELIST&lt;br /&gt;
debug         up   infinite      1    mix gn01&lt;br /&gt;
small*        up   12:00:00      1    mix gn01&lt;br /&gt;
normal        up 1-00:00:00      1    mix gn01&lt;br /&gt;
longnormal    up 3-00:00:00      1    mix gn01&lt;br /&gt;
gpu           up 1-00:00:00      1    mix gn01&lt;br /&gt;
gpulong       up 3-00:00:00      1    mix gn01&lt;br /&gt;
fat           up 3-00:00:00      1    mix gn01&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, available partitions are named “debug”, “small”, “normal”, “longnormal”, “gpu”, “gpulong”, “fat”. The asterisk beside &amp;quot;small&amp;quot; indicates that this is the default partition, i.e. the one that SLURM selects to run a job when no partition has been specified.&lt;br /&gt;
&lt;br /&gt;
On Mufasa, partition names have been chosen to reflect the type of job that they are dedicated to. A complete list of the features of each partition can be obtained 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;
sinfo --Format=all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its output can be overwhelming. For instance, in the example above the output of &amp;lt;code&amp;gt;sinfo --Format=all&amp;lt;/code&amp;gt; is 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;
AVAIL|ACTIVE_FEATURES|CPUS|TMP_DISK|FREE_MEM|AVAIL_FEATURES|GROUPS|OVERSUBSCRIBE|TIMELIMIT|MEMORY|HOSTNAMES|NODE_ADDR|PRIO_TIER|ROOT|JOB_SIZE|STATE|USER|VERSION|WEIGHT|S:C:T|NODES(A/I) |MAX_CPUS_PER_NODE |CPUS(A/I/O/T) |NODES |REASON |NODES(A/I/O/T) |GRES |TIMESTAMP |PRIO_JOB_FACTOR |DEFAULTTIME |PREEMPT_MODE |NODELIST |CPU_LOAD |PARTITION |PARTITION |ALLOCNODES |STATE |USER |CLUSTER |SOCKETS |CORES |THREADS &lt;br /&gt;
up|(null)|62|0|852393|(null)|all|NO|infinite|1027000|rk018445|rk018445|1|yes|1-infinite|mix|Unknown|21.08.2|1|2:31:1|1/0 |UNLIMITED |16/46/0/62 |1 |none |1/0/0/1 |gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1) |Unknown |1 |n/a |GANG,SUSPEND |gn01 |3.13 |debug |debug |all |mixed |Unknown |N/A |2 |31 |1 &lt;br /&gt;
up|(null)|62|0|852393|(null)|all|FORCE:2|12:00:00|1027000|rk018445|rk018445|0|no|1-infinite|mix|Unknown|21.08.2|1|2:31:1|1/0 |UNLIMITED |16/46/0/62 |1 |none |1/0/0/1 |gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1) |Unknown |1 |15:00 |GANG,SUSPEND |gn01 |3.13 |small* |small |all |mixed |Unknown |N/A |2 |31 |1 &lt;br /&gt;
up|(null)|62|0|852393|(null)|all|FORCE:2|1-00:00:00|1027000|rk018445|rk018445|10|no|1-infinite|mix|Unknown|21.08.2|1|2:31:1|1/0 |24 |16/46/0/62 |1 |none |1/0/0/1 |gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1) |Unknown |1 |15:00 |GANG,SUSPEND |gn01 |3.13 |normal |normal |all |mixed |Unknown |N/A |2 |31 |1 &lt;br /&gt;
up|(null)|62|0|852393|(null)|all|FORCE:2|3-00:00:00|1027000|rk018445|rk018445|100|no|1-infinite|mix|Unknown|21.08.2|1|2:31:1|1/0 |24 |16/46/0/62 |1 |none |1/0/0/1 |gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1) |Unknown |1 |1:00:00 |GANG,SUSPEND |gn01 |3.13 |longnormal |longnormal |all |mixed |Unknown |N/A |2 |31 |1 &lt;br /&gt;
up|(null)|62|0|852393|(null)|all|FORCE:2|1-00:00:00|1027000|rk018445|rk018445|25|no|1-infinite|mix|Unknown|21.08.2|1|2:31:1|1/0 |UNLIMITED |16/46/0/62 |1 |none |1/0/0/1 |gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1) |Unknown |1 |15:00 |GANG,SUSPEND |gn01 |3.13 |gpu |gpu |all |mixed |Unknown |N/A |2 |31 |1 &lt;br /&gt;
up|(null)|62|0|852393|(null)|all|FORCE:2|3-00:00:00|1027000|rk018445|rk018445|125|no|1-infinite|mix|Unknown|21.08.2|1|2:31:1|1/0 |UNLIMITED |16/46/0/62 |1 |none |1/0/0/1 |gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1) |Unknown |1 |1:00:00 |GANG,SUSPEND |gn01 |3.13 |gpulong |gpulong |all |mixed |Unknown |N/A |2 |31 |1 &lt;br /&gt;
up|(null)|62|0|852393|(null)|all|FORCE:2|3-00:00:00|1027000|rk018445|rk018445|200|no|1-infinite|mix|Unknown|21.08.2|1|2:31:1|1/0 |48 |16/46/0/62 |1 |none |1/0/0/1 |gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1) |Unknown |1 |1:00:00 |GANG,SUSPEND |gn01 |3.13 |fat |fat |all |mixed |Unknown |N/A |2 |31 |1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A less comprehensive but more readable view of partition features can be obtained via a tailored &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; command, i.e. one that only asks for the features that are most relevant to Mufasa users. An example of such command is this:&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 %.6a %.4c %.17B %.60G %.11l %.11L %.4r&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such command 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 CPUS MAX_CPUS_PER_NODE                                                         GRES   TIMELIMIT DEFAULTTIME ROOT&lt;br /&gt;
     debug     up   62         UNLIMITED        gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1)    infinite         n/a  yes&lt;br /&gt;
    small*     up   62         UNLIMITED        gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1)    12:00:00       15:00   no&lt;br /&gt;
    normal     up   62                24        gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1)  1-00:00:00       15:00   no&lt;br /&gt;
longnormal     up   62                24        gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1)  3-00:00:00     1:00:00   no&lt;br /&gt;
       gpu     up   62         UNLIMITED        gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1)  1-00:00:00       15:00   no&lt;br /&gt;
   gpulong     up   62         UNLIMITED        gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1)  3-00:00:00     1:00:00   no&lt;br /&gt;
       fat     up   62                48        gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1)  3-00:00:00     1:00:00   no&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns in this output correspond to the following information (from [https://slurm.schedmd.com/sinfo.html SLURM docs]), where the &amp;#039;&amp;#039;node&amp;#039;&amp;#039; is Mufasa:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
: %P Partition name followed by &amp;quot;*&amp;quot; for the default partition&lt;br /&gt;
&lt;br /&gt;
: %a State/availability of a partition&lt;br /&gt;
&lt;br /&gt;
: %c Number of CPUs per node&lt;br /&gt;
&lt;br /&gt;
: %B The max number of CPUs per node available to jobs in the partition&lt;br /&gt;
&lt;br /&gt;
: %G Generic resources (gres) associated with the nodes [&amp;#039;&amp;#039;for Mufasa these correspond to the [[System#Hardware|virtual GPUs defined with MIG]]&amp;#039;&amp;#039;]&lt;br /&gt;
&lt;br /&gt;
: %l Maximum time for any job in the format &amp;quot;days-hours:minutes:seconds&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: %L Default time for any job in the format &amp;quot;days-hours:minutes:seconds&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: %r Only user root may initiate jobs, &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the actual command, field identifiers &amp;lt;code&amp;gt;%...&amp;lt;/code&amp;gt; are preceded by width specifiers in the form &amp;lt;code&amp;gt;.N&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt; is a positive integer. The specifiers define how many characters to reserve to each field in the command output, and can be used to help readability.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;#039;&amp;#039;sinfo&amp;#039;&amp;#039; provides to users is the &amp;#039;&amp;#039;availability&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions.&lt;br /&gt;
&lt;br /&gt;
For operational partitions, availability is &amp;#039;&amp;#039;up&amp;#039;&amp;#039;, meaning that the partition is available to be allocated work. A state/availability equal to &amp;#039;&amp;#039;drain&amp;#039;&amp;#039; means that the partition is not available to be allocated work, while &amp;#039;&amp;#039;down&amp;#039;&amp;#039; means the same as &amp;#039;&amp;#039;drain&amp;#039;&amp;#039; but also that the partition failed, i.e. that it suffered a disruption.&lt;br /&gt;
&lt;br /&gt;
A partition in state &amp;#039;&amp;#039;drain&amp;#039;&amp;#039; or &amp;#039;&amp;#039;down&amp;#039;&amp;#039; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;#039;&amp;#039;up&amp;#039;&amp;#039; state. Jobs waiting for that partition are paused.&lt;br /&gt;
&lt;br /&gt;
== Choosing the &amp;quot;right&amp;quot; partition ==&lt;br /&gt;
&lt;br /&gt;
When launching a job (as explained in [[User Jobs#Executing jobs on Mufasa|Executing jobs on Mufasa]]) a user should select the partition that is most suitable for it according to the job&amp;#039;s features. Launching a job on a partition avoids the need for the user to specify explicitly all of the resources that the job requires, and instead rely on the set of resources already defined for the partition. &lt;br /&gt;
&lt;br /&gt;
The fact that by selecting the right partition for their job a user can pre-define the requirements of the job without having to specify them makes partitions very handy, and avoids possible mistakes. However, users can -if needed- change the resource requested by their jobs wrt the default values associated to such partitions.&lt;br /&gt;
&lt;br /&gt;
Any element of the default assignment of resources provided by a specific partition can be overridden by specifying an option when launching the job, so users are not forced to accept the default value. However, it makes sense to choose the most suitable partition for a job in the first place, and then to specify the job&amp;#039;s requirements only for those resources that have an unsuitable default value.&lt;br /&gt;
&lt;br /&gt;
Resource requests by the user launching a job can be both lower and higher than the default value of the partition for that resource. However, they cannot exceed the maximum value that the partition allows for requests of such resource, if set. If a user tries to launch on a partition a job that requests a higher value of a resource than the partition‑specified maximum, the launch command is refused.&lt;br /&gt;
&lt;br /&gt;
One of the most important resources provided to jobs by partitions is &amp;#039;&amp;#039;time&amp;#039;&amp;#039;, in the sense that a job is permitted to run for no longer than a predefined time duration. Jobs that exceed their allotted time are killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
= Executing jobs on Mufasa =&lt;br /&gt;
&lt;br /&gt;
The main reason for a user to interact with Mufasa is to execute jobs that require resources not available to standard desktop-class machines. Therefore, launching jobs is the most important operation for Mufasa users: what follows explains how it is done. &lt;br /&gt;
&lt;br /&gt;
Considering that [[System#Docker Containers|all computation on Mufasa must occur within Docker containers]], the jobs run by Mufasa users are always containers except for menial, non-computationally intensive jobs. The process of launching a user job on Mufasa involves two steps:&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
:; Step 1&lt;br /&gt;
:: [[User Jobs#Using SLURM to run a Docker container|Use SLURM to run the Docker container where the job will take place]]&lt;br /&gt;
&lt;br /&gt;
:; Step 2&lt;br /&gt;
:: [[User Jobs#Launching a user job from within a Docker container|Launch the job from within the Docker container]]&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
As an optional preparatory step, it is often useful to define an [[User Jobs#Using execution scripts to run jobs|execution script]] to simplify the launching process and reduce the possibility of mistakes.&lt;br /&gt;
&lt;br /&gt;
The commands that SLURM provides to run jobs are &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun &amp;lt;options&amp;gt; &amp;lt;path_of_the_program_to_be_run_via_SLURM&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun &amp;lt;options&amp;gt; &amp;lt;path_of_the_program_to_be_run_via_SLURM&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(see SLURM documentation: [https://slurm.schedmd.com/srun.html srun], [https://slurm.schedmd.com/sbatch.html sbatch]). 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 processes that use the console for interaction with their user; &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;
Among the options available for &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;, one of the most important is &amp;lt;code&amp;gt;--res=gpu:K&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt; is an integer between 1 and the maximum number of GPUs available in the server (5 for Mufasa). This option specifies how many of the GPUs the program requests for use. Since GPUs are the most scarce resources of Mufasa, this option must always be explicitly specified when running a job that requires GPUs.&lt;br /&gt;
&lt;br /&gt;
As [[User Jobs#SLURM Partition|already explained]], a quick way to define the set of resources that a program will have access to is to use option &amp;lt;code&amp;gt;--p &amp;lt;partition name&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
This option specifies that SLURM will run the program on a specific partition, and therefore that it will have access to all and only the resources available to that partition. As a consequence, all options that define how many resources to assign the job, such as ‑‑res=gpu:K, will only be able to provide the job with resources that are available to the chosen partition. Jobs that require resources that are not available to the chosen partition do not get executed.&lt;br /&gt;
&lt;br /&gt;
For instance, running&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun -p small ./my_program&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
makes SLURM run &amp;lt;code&amp;gt;my_program&amp;lt;/code&amp;gt; on the partition named “small”. Running the program this way means that the resources associated to this partition will be available to it for use.&lt;br /&gt;
&lt;br /&gt;
= Using SLURM to run a Docker container =&lt;br /&gt;
&lt;br /&gt;
The first step to run a user job on Mufasa is to run the [[System#Docker Containers|Docker container]] where the job will take place. 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 they belong to 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;
Each user is in charge of preparing the Docker container(s) where the user&amp;#039;s jobs will be executed. In most situations the user can simply select a suitable ready-made container from the many which are already available for use.&lt;br /&gt;
&lt;br /&gt;
In order to run a Docker container via SLURM, a user must use a command 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;
srun ‑‑p &amp;lt;partition_name&amp;gt; ‑‑container-image=&amp;lt;container_path.sqsh&amp;gt; ‑‑no‑container‑entrypoint ‑‑container‑mounts=&amp;lt;mufasa_dir&amp;gt;:&amp;lt;docker_dir&amp;gt; ‑‑gres=&amp;lt;gpu_resources&amp;gt; ‑‑mem=&amp;lt;mem_resources&amp;gt; ‑‑cpus‑per‑task &amp;lt;cpu_amount&amp;gt; ‑‑pty ‑‑time=&amp;lt;hh:mm:ss&amp;gt; &amp;lt;command_to_run_within_container&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All parts of the command above that come after &amp;#039;&amp;#039;srun&amp;#039;&amp;#039; are options that specify what to execute and how. Below these options are explained.&lt;br /&gt;
&lt;br /&gt;
;‑‑p &amp;lt;partition_name&amp;gt;&lt;br /&gt;
: specifies the resource partition on which the job will be run.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Important! If &amp;lt;code&amp;gt;‑‑p &amp;lt;partition_name&amp;gt;&amp;lt;/code&amp;gt; is used, 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_number&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;‑‑time=&amp;lt;hh:mm:ss&amp;gt;&amp;lt;/code&amp;gt;) can be omitted, greatly simplyfying the command. If an explicit amount is not requested for a given resource, the job is assigned the default amount of the resource (as defined by the chosen partition). A notable exception to this rule concerns option &amp;lt;code&amp;gt;‑‑gres=&amp;lt;gpu_resources&amp;gt;&amp;lt;/code&amp;gt;: GPU resources, in fact, must always be explicitly requested with option &amp;lt;code&amp;gt;‑‑gres&amp;lt;/code&amp;gt;, otherwise no access to GPUs is granted to the job.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
;‑‑container-image=&amp;lt;container_path.sqsh&amp;gt;&lt;br /&gt;
: specifies the container to be run&lt;br /&gt;
&lt;br /&gt;
;‑‑no‑container‑entrypoint&lt;br /&gt;
: specifies that the entrypoint defined in the container image should not be executed (ENTRYPOINT in the Dockerfile that defines the container). The entrypoint is a command that gets executed as soon as the container is run: option ‑‑no‑container‑entrypoint is useful when the user is not sure of the effect of such command.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;‑‑container‑mounts=&amp;lt;mufasa_dir&amp;gt;:&amp;lt;docker_dir&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
: specifies what parts of Mufasa&amp;#039;s filesystem will be available within the container&amp;#039;s filesystem, and where they will be mounted; for instance, if &amp;lt;code&amp;gt;&amp;lt;mufasa_dir&amp;gt;:&amp;lt;docker_dir&amp;gt;&amp;lt;/code&amp;gt; takes the value &amp;lt;code&amp;gt;/home/mrossi:/data&amp;lt;/code&amp;gt; this tells srun to mount Mufasa&amp;#039;s directory &amp;lt;code&amp;gt;/home/mrossi&amp;lt;/code&amp;gt; in position &amp;lt;code&amp;gt;/data&amp;lt;/code&amp;gt; within the filesystem of the Docker container. When the docker container reads or writes files in directory &amp;lt;code&amp;gt;/data&amp;lt;/code&amp;gt; of its own (internal) filesystem, what actually happens is that files in &amp;lt;code&amp;gt;/home/mrossi&amp;lt;/code&amp;gt; get manipulated instead. &amp;lt;code&amp;gt;/home/mrossi&amp;lt;/code&amp;gt; is the only part of the filesystem of Mufasa that is visible to, and changeable by, the Docker container.&lt;br /&gt;
&lt;br /&gt;
;‑‑gres=&amp;lt;gpu_resources&amp;gt;&lt;br /&gt;
: specifies what GPUs to assign to the container; for instance, &amp;lt;code&amp;gt;&amp;lt;gpus&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;gpu:40gb:2&amp;lt;/code&amp;gt;, that corresponds to giving the job control to 2 entire large‑size GPUs.&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 mandatory if the job needs to use the system&amp;#039;s GPUs. Differently from other resources (where unspecified requests lead to the assignment of a default amount of the resource), GPUs must always be explicitly requested with &amp;lt;code&amp;gt;‑‑gres&amp;lt;/code&amp;gt;.&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 container; 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 container; 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;
;‑‑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 [[User Jobs#Running interactive jobs via SLURM|Running interactive jobs via SLURM]])&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;‑‑time=&amp;lt;d-hh:mm:ss&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
: specifies the maximum time allowed to the job to run, 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;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;command_to_run_within_container&amp;gt;&lt;br /&gt;
: the executable that will be run within the Docker container as soon as it is operative. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A typical value for &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;. This instructs srun to open an interactive shell session (i.e. a command-line terminal interface) within the container, from which the user will then run their job. Another typical value for &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;python&amp;lt;/code&amp;gt;, which launches an interactive Python session from which the user will then run their job. It is also possible to use &amp;lt;code&amp;gt;&amp;lt;command_to_run_within_container&amp;gt;&amp;lt;/code&amp;gt; to launch non-interactive programs.&lt;br /&gt;
&lt;br /&gt;
== Nvidia Pyxis ==&lt;br /&gt;
&lt;br /&gt;
Some of the options described below are specifically dedicated to Docker containers: these are provided by the [https://github.com/NVIDIA/pyxis Nvidia Pyxis] package that has been installed on Mufasa as an adjunct to SLURM. Pyxis allows unprivileged users (i.e., those that are not administrators of Mufasa) to execute containers and run commands within them. More specifically, options &amp;lt;code&amp;gt;‑‑container-image&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;‑‑no‑container‑entrypoint&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;‑‑container-mounts&amp;lt;/code&amp;gt; are provided to &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; by Pyxis.&lt;br /&gt;
&lt;br /&gt;
= Launching a user job from within a Docker container =&lt;br /&gt;
&lt;br /&gt;
Once the Docker container (run as [[User Jobs#Using SLURM to run a Docker container|explained here]]) is up and running, the user is dropped to the interactive environment specified by &amp;lt;code&amp;gt;&amp;lt;command_to_run_within_container&amp;gt;&amp;lt;/code&amp;gt;. This interactive environment can be, for instance, a bash shell or the interactive Python mode. Once inside the interactive environment, the user can simply run the required program in the usual way (depending on the type of environment).&lt;br /&gt;
&lt;br /&gt;
= Running interactive jobs via SLURM =&lt;br /&gt;
&lt;br /&gt;
As explained, SLURM command &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; is suitable for launching &amp;#039;&amp;#039;interactive&amp;#039;&amp;#039; user jobs, i.e. jobs that use the terminal output and the keyboard to exchange information with a human user. If a user needs this type of interaction, they must run a &amp;#039;&amp;#039;bash shell&amp;#039;&amp;#039; (i.e. a terminal session) with a command 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 --pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and subsequently use the bash shell to run the interactive program. To close the SLURM-spawned bash shell, run (as with any other 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;
Of course, also the “base” shell (i.e. the one that opens when an SSH connection to Mufasa is established) can be used to run programs: however, programs launched this way are not being run via SLURM and are not able to access most of the resources of the machine (in particular, there is no way to make GPUs accessible to them, and they can only access 2 CPUs). On the contrary, running programs with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; ensures that they can access all the resources managed by SLURM.&lt;br /&gt;
&lt;br /&gt;
As usual, GPU resources (if needed) must always be requested explicitly with parameter &amp;lt;code&amp;gt;--res=gpu:K&amp;lt;/code&amp;gt;. For instance, in order to run an interactive program which needs one GPU we may first run a bash shell via SLURM 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 --gres=gpu:1 --pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
an then run the interactive program from the newly opened shell.&lt;br /&gt;
&lt;br /&gt;
An alternative to explicitly specifying what resources to assign to the bash shell run via SLURM is to run &amp;lt;code&amp;gt;/bin/bash&amp;lt;/code&amp;gt; on one of the available partitions. For instance, to run the shell on partition “small” the command is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun -p small --pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mufasa is configured to show, as part of the command prompt of a bash shell run via SLURM, a message such as &amp;lt;code&amp;gt;(SLURM ID xx)&amp;lt;/code&amp;gt; (where &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is the ID of the &amp;lt;code&amp;gt;/bin/bash&amp;lt;/code&amp;gt; process within SLURM). When you see this message, you know that the bash shell you are interacting with is a SLURM-run one.&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;
= Detach from a running job with &amp;#039;&amp;#039;screen&amp;#039;&amp;#039; =&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 job but do not plan to keep the SSH connection to Mufasa open (or if you fear that the timeout on SSH connections will cut your contact with the shell) 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 detach 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). Now you can disconnect from Mufasa; when you need to reach your job again, you can can reopen an SSH connection to Mufasa and then reconnect to the &amp;#039;&amp;#039;screen&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
More specifically, to create a screen session and run a job in it:&lt;br /&gt;
&lt;br /&gt;
* Connect to Mufasa with SSH&lt;br /&gt;
* From the Mufasa shell, run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
screen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the screen session 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 session with &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 Mufasa shell, while your process will go on running in the screen session&lt;br /&gt;
* You can now close the SSH connection to Mufasa without damaging your process&lt;br /&gt;
&lt;br /&gt;
Later, when you are ready to resume contact with your running process:&lt;br /&gt;
&lt;br /&gt;
* Connect to Mufasa with SSH&lt;br /&gt;
* In the Mufasa shell, run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
screen -r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* You are now back to the screen session where you launched your job&lt;br /&gt;
&lt;br /&gt;
* When you do not need the screen containing your job anymore, destroy it by using (within the screen) &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;X&amp;#039;&amp;#039;&amp;#039;&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;
= Using execution scripts to run jobs =&lt;br /&gt;
&lt;br /&gt;
Previous Sections of this page explained how to use SLURM to run user jobs directly, i.e. by specifying the value of SLURM parameters directly on the command line.&lt;br /&gt;
&lt;br /&gt;
In general, though, it is preferable to wrap the commands that run jobs into &amp;#039;&amp;#039;&amp;#039;execution scripts&amp;#039;&amp;#039;&amp;#039;. An execution script makes specifying all required parameters easier, makes errors in configuring such parameters less likely, and -most importantly- can be reused for other jobs.&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;,  where 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;
# one or more &amp;#039;&amp;#039;&amp;#039;srun 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;
An execution script is a special type of Linux &amp;#039;&amp;#039;bash script&amp;#039;&amp;#039;. A bash script is a file that is intended to be run by the bash command interpreter. In order to be acceptable as a bash script, a text file must:&lt;br /&gt;
&lt;br /&gt;
* have the “executable” flag set&lt;br /&gt;
* have &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; as its very first line&lt;br /&gt;
&lt;br /&gt;
Usually, a Linux bash 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.&lt;br /&gt;
&lt;br /&gt;
To execute the script, just open a terminal (such as the one provided by an SSH connection with Mufasa), write the scripts&amp;#039;s full path (e.g., &amp;#039;&amp;#039;./my_execution_script.sh&amp;#039;&amp;#039;) and press the &amp;lt;enter&amp;gt; key. The script is executed in the terminal, and any output (e.g., whatever is printed by any &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; commands in the script) is shown on the terminal.&lt;br /&gt;
&lt;br /&gt;
Within a bash script, lines preceded by &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; are comments (with the notable exception of the initial &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; line). Use of blank lines as spacers is allowed.&lt;br /&gt;
&lt;br /&gt;
Below is an example of execution script (actual instructions are shown in bold; the rest are comments):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;#!/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;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; Note: these are examples. Put your own SBATCH directives below&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SBATCH --job-name=myjob&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; name assigned to the job&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SBATCH --cpus-per-task=1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; number of threads allocated to each task&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SBATCH --mem-per-cpu=500M&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; amount of memory per CPU core&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SBATCH --gres=gpu:1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; number of GPUs per node&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SBATCH --partition=small&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; the partition to run your jobs on&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SBATCH --time=0-00:01:00&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; time assigned to your jobs to run (format: days-hours:minutes:seconds, with days optional)&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;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; ----------------srun commands-----------------&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; Put your own srun command(s) below&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;srun ...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;srun ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; ----------------end of srun commands-----------------&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the example above shows, beyond the initial directive &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; the script includes a series of &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directives used to specify parameter values, and finally one or more &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands that run the jobs. Any parameter accepted by commands &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; can be used as an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive in an execution script.&lt;br /&gt;
&lt;br /&gt;
= Job caching =&lt;br /&gt;
&lt;br /&gt;
When a job is run via SLURM (with or without an execution script), Mufasa exploits a (fully tranparent) caching mechanism to speed up its execution. The speedup is obtained by removing the need for the running job to execute accesses to the (mechanical and therefore relatively slow) HDDs where &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; partitions reside, substituting them with accesses to (solid-state and therefore much faster) SSDs.&lt;br /&gt;
&lt;br /&gt;
Each time a job is run via SLURM, this is what happens automatically:&lt;br /&gt;
&lt;br /&gt;
# Mufasa temporarily copies code and associated data from the directory where the executables are located (in the user&amp;#039;s own &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt;) to a cache space located on system SSDs&lt;br /&gt;
# Mufasa launches the cached copy of the user executables, using the cached copies of the data as its input files&lt;br /&gt;
# The executables create their output files in the cache space&lt;br /&gt;
# When the user jobs end, Mufasa copies the output files from the cache space back to the user&amp;#039;s own &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The whole process is completely transparent to the user. The user simply prepares the executable (or the [[User Jobs# Using execution scripts to wrap user jobs|execution script]]) in a subdirectory of their &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory and runs the job. When job execution is complete, the user finds their output data in the origin subdirectory of &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt;, exactly as if the execution actually occurred there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Important!&amp;#039;&amp;#039;&amp;#039; The caching mechanism requires that &amp;#039;&amp;#039;during job execution&amp;#039;&amp;#039; the user does not modify the contents of the &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; subdirectory where executable and data were at execution time. Any such change, in fact, will be overwritten by Mufasa at the end of the execution, when files are copied back from the caching space.&lt;br /&gt;
&lt;br /&gt;
= Monitoring and managing jobs =&lt;br /&gt;
&lt;br /&gt;
SLURM provides Job Users with several tools to inspect and manage jobs. While a Job User is able to inspect all users&amp;#039; jobs, they are only allowed to modify the condition of their own jobs.&lt;br /&gt;
&lt;br /&gt;
From [https://slurm.schedmd.com/overview.html SLURM&amp;#039;s own overview]:&lt;br /&gt;
&lt;br /&gt;
“&amp;#039;&amp;#039;User tools include&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://slurm.schedmd.com/srun.html (link to SLURM docs)] to initiate jobs, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://slurm.schedmd.com/scancel.html (link to SLURM docs)] to terminate queued or running jobs,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://slurm.schedmd.com/sinfo.html (link to SLURM docs)] to report system status,&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;
[https://slurm.schedmd.com/squeue.html (link to SLURM docs)] to report the status of jobs [i.e. to inspect the scheduling queue], and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacct&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://slurm.schedmd.com/sacct.html (link to SLURM docs)] to get information about jobs and job steps that are running or have completed.&amp;#039;&amp;#039;”&lt;br /&gt;
&lt;br /&gt;
An example of the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; is 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;
== Job state ==&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;
; PD PENDING&lt;br /&gt;
: Job is awaiting resource allocation. &lt;br /&gt;
&lt;br /&gt;
; R RUNNING&lt;br /&gt;
: Job currently has an allocation.&lt;br /&gt;
&lt;br /&gt;
; S 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;
; CG 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;
; CD COMPLETED&lt;br /&gt;
: Job has terminated all processes on all nodes with an exit code of zero. &lt;br /&gt;
&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, reported here for completeness:&lt;br /&gt;
&lt;br /&gt;
; BF BOOT_FAIL&lt;br /&gt;
: Job terminated due to launch failure, typically due to a hardware failure (e.g. unable to boot the node or block and the job can not be requeued). &lt;br /&gt;
&lt;br /&gt;
; CA CANCELLED&lt;br /&gt;
: Job was explicitly cancelled by the user or system administrator. The job may or may not have been initiated. &lt;br /&gt;
&lt;br /&gt;
; CF CONFIGURING&lt;br /&gt;
: Job has been allocated resources, but are waiting for them to become ready for use (e.g. booting). &lt;br /&gt;
&lt;br /&gt;
; DL DEADLINE&lt;br /&gt;
: Job terminated on deadline. &lt;br /&gt;
&lt;br /&gt;
; F FAILED&lt;br /&gt;
: Job terminated with non-zero exit code or other failure condition. &lt;br /&gt;
&lt;br /&gt;
; NF NODE_FAIL&lt;br /&gt;
: Job terminated due to failure of one or more allocated nodes. &lt;br /&gt;
&lt;br /&gt;
; OOM OUT_OF_MEMORY&lt;br /&gt;
: Job experienced out of memory error. &lt;br /&gt;
&lt;br /&gt;
; PR PREEMPTED&lt;br /&gt;
: Job terminated due to preemption. &lt;br /&gt;
&lt;br /&gt;
; RD RESV_DEL_HOLD&lt;br /&gt;
: Job is being held after requested reservation was deleted. &lt;br /&gt;
&lt;br /&gt;
; RF REQUEUE_FED&lt;br /&gt;
: Job is being requeued by a federation. &lt;br /&gt;
&lt;br /&gt;
; RH REQUEUE_HOLD&lt;br /&gt;
: Held job is being requeued. &lt;br /&gt;
&lt;br /&gt;
; RQ REQUEUED&lt;br /&gt;
: Completing job is being requeued. &lt;br /&gt;
&lt;br /&gt;
; RS RESIZING&lt;br /&gt;
: Job is about to change size. &lt;br /&gt;
&lt;br /&gt;
; RV REVOKED&lt;br /&gt;
: Sibling was removed from cluster due to other cluster starting the job. &lt;br /&gt;
&lt;br /&gt;
; SI SIGNALING&lt;br /&gt;
: Job is being signaled. &lt;br /&gt;
&lt;br /&gt;
; SE SPECIAL_EXIT&lt;br /&gt;
: The job was requeued in a special state. This state can be set by users, typically in EpilogSlurmctld, if the job has terminated with a particular exit value. &lt;br /&gt;
&lt;br /&gt;
; SO STAGE_OUT&lt;br /&gt;
: Job is staging out files. &lt;br /&gt;
&lt;br /&gt;
; ST STOPPED&lt;br /&gt;
: Job has an allocation, but execution has been stopped with SIGSTOP signal. CPUS have been retained by this job. &lt;br /&gt;
&lt;br /&gt;
; TO TIMEOUT&lt;br /&gt;
: Job terminated upon reaching its time limit.&lt;/div&gt;</summary>
		<author><name>10.79.2.181</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=User_Jobs&amp;diff=245</id>
		<title>User Jobs</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=User_Jobs&amp;diff=245"/>
		<updated>2022-01-18T16:08:15Z</updated>

		<summary type="html">&lt;p&gt;10.79.2.181: /* Launching a user job from within a Docker container */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page presents the features of Mufasa 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;
Job Users are by necessity SLURM users (see [[System#The SLURM job scheduling system|The SLURM job scheduling system]]) so you may also want to read [https://slurm.schedmd.com/quickstart.html SLURM&amp;#039;s own Quick Start User Guide].&lt;br /&gt;
&lt;br /&gt;
= SLURM Partitions =&lt;br /&gt;
&lt;br /&gt;
Several execution queues for jobs have been defined on Mufasa. Such queues are called &amp;#039;&amp;#039;&amp;#039;partitions&amp;#039;&amp;#039;&amp;#039; in SLURM terminology. Each partition has features (in term of resources available to the jobs on that queue) that make the partition suitable for a certain category of jobs. 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;
sinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
([https://slurm.schedmd.com/sinfo.html link to SLURM docs]) provides a list of available partitions. Its 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;
PARTITION  AVAIL  TIMELIMIT  NODES  STATE NODELIST&lt;br /&gt;
debug         up   infinite      1    mix gn01&lt;br /&gt;
small*        up   12:00:00      1    mix gn01&lt;br /&gt;
normal        up 1-00:00:00      1    mix gn01&lt;br /&gt;
longnormal    up 3-00:00:00      1    mix gn01&lt;br /&gt;
gpu           up 1-00:00:00      1    mix gn01&lt;br /&gt;
gpulong       up 3-00:00:00      1    mix gn01&lt;br /&gt;
fat           up 3-00:00:00      1    mix gn01&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, available partitions are named “debug”, “small”, “normal”, “longnormal”, “gpu”, “gpulong”, “fat”. The asterisk beside &amp;quot;small&amp;quot; indicates that this is the default partition, i.e. the one that SLURM selects to run a job when no partition has been specified.&lt;br /&gt;
&lt;br /&gt;
On Mufasa, partition names have been chosen to reflect the type of job that they are dedicated to. A complete list of the features of each partition can be obtained 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;
sinfo --Format=all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its output can be overwhelming. For instance, in the example above the output of &amp;lt;code&amp;gt;sinfo --Format=all&amp;lt;/code&amp;gt; is 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;
AVAIL|ACTIVE_FEATURES|CPUS|TMP_DISK|FREE_MEM|AVAIL_FEATURES|GROUPS|OVERSUBSCRIBE|TIMELIMIT|MEMORY|HOSTNAMES|NODE_ADDR|PRIO_TIER|ROOT|JOB_SIZE|STATE|USER|VERSION|WEIGHT|S:C:T|NODES(A/I) |MAX_CPUS_PER_NODE |CPUS(A/I/O/T) |NODES |REASON |NODES(A/I/O/T) |GRES |TIMESTAMP |PRIO_JOB_FACTOR |DEFAULTTIME |PREEMPT_MODE |NODELIST |CPU_LOAD |PARTITION |PARTITION |ALLOCNODES |STATE |USER |CLUSTER |SOCKETS |CORES |THREADS &lt;br /&gt;
up|(null)|62|0|852393|(null)|all|NO|infinite|1027000|rk018445|rk018445|1|yes|1-infinite|mix|Unknown|21.08.2|1|2:31:1|1/0 |UNLIMITED |16/46/0/62 |1 |none |1/0/0/1 |gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1) |Unknown |1 |n/a |GANG,SUSPEND |gn01 |3.13 |debug |debug |all |mixed |Unknown |N/A |2 |31 |1 &lt;br /&gt;
up|(null)|62|0|852393|(null)|all|FORCE:2|12:00:00|1027000|rk018445|rk018445|0|no|1-infinite|mix|Unknown|21.08.2|1|2:31:1|1/0 |UNLIMITED |16/46/0/62 |1 |none |1/0/0/1 |gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1) |Unknown |1 |15:00 |GANG,SUSPEND |gn01 |3.13 |small* |small |all |mixed |Unknown |N/A |2 |31 |1 &lt;br /&gt;
up|(null)|62|0|852393|(null)|all|FORCE:2|1-00:00:00|1027000|rk018445|rk018445|10|no|1-infinite|mix|Unknown|21.08.2|1|2:31:1|1/0 |24 |16/46/0/62 |1 |none |1/0/0/1 |gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1) |Unknown |1 |15:00 |GANG,SUSPEND |gn01 |3.13 |normal |normal |all |mixed |Unknown |N/A |2 |31 |1 &lt;br /&gt;
up|(null)|62|0|852393|(null)|all|FORCE:2|3-00:00:00|1027000|rk018445|rk018445|100|no|1-infinite|mix|Unknown|21.08.2|1|2:31:1|1/0 |24 |16/46/0/62 |1 |none |1/0/0/1 |gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1) |Unknown |1 |1:00:00 |GANG,SUSPEND |gn01 |3.13 |longnormal |longnormal |all |mixed |Unknown |N/A |2 |31 |1 &lt;br /&gt;
up|(null)|62|0|852393|(null)|all|FORCE:2|1-00:00:00|1027000|rk018445|rk018445|25|no|1-infinite|mix|Unknown|21.08.2|1|2:31:1|1/0 |UNLIMITED |16/46/0/62 |1 |none |1/0/0/1 |gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1) |Unknown |1 |15:00 |GANG,SUSPEND |gn01 |3.13 |gpu |gpu |all |mixed |Unknown |N/A |2 |31 |1 &lt;br /&gt;
up|(null)|62|0|852393|(null)|all|FORCE:2|3-00:00:00|1027000|rk018445|rk018445|125|no|1-infinite|mix|Unknown|21.08.2|1|2:31:1|1/0 |UNLIMITED |16/46/0/62 |1 |none |1/0/0/1 |gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1) |Unknown |1 |1:00:00 |GANG,SUSPEND |gn01 |3.13 |gpulong |gpulong |all |mixed |Unknown |N/A |2 |31 |1 &lt;br /&gt;
up|(null)|62|0|852393|(null)|all|FORCE:2|3-00:00:00|1027000|rk018445|rk018445|200|no|1-infinite|mix|Unknown|21.08.2|1|2:31:1|1/0 |48 |16/46/0/62 |1 |none |1/0/0/1 |gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1) |Unknown |1 |1:00:00 |GANG,SUSPEND |gn01 |3.13 |fat |fat |all |mixed |Unknown |N/A |2 |31 |1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A less comprehensive but more readable view of partition features can be obtained via a tailored &amp;lt;code&amp;gt;sinfo&amp;lt;/code&amp;gt; command, i.e. one that only asks for the features that are most relevant to Mufasa users. An example of such command is this:&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 %.6a %.4c %.17B %.60G %.11l %.11L %.4r&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such command 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 CPUS MAX_CPUS_PER_NODE                                                         GRES   TIMELIMIT DEFAULTTIME ROOT&lt;br /&gt;
     debug     up   62         UNLIMITED        gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1)    infinite         n/a  yes&lt;br /&gt;
    small*     up   62         UNLIMITED        gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1)    12:00:00       15:00   no&lt;br /&gt;
    normal     up   62                24        gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1)  1-00:00:00       15:00   no&lt;br /&gt;
longnormal     up   62                24        gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1)  3-00:00:00     1:00:00   no&lt;br /&gt;
       gpu     up   62         UNLIMITED        gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1)  1-00:00:00       15:00   no&lt;br /&gt;
   gpulong     up   62         UNLIMITED        gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1)  3-00:00:00     1:00:00   no&lt;br /&gt;
       fat     up   62                48        gpu:40gb:2(S:0-1),gpu:20gb:3(S:0-1),gpu:10gb:6(S:0-1)  3-00:00:00     1:00:00   no&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The columns in this output correspond to the following information (from [https://slurm.schedmd.com/sinfo.html SLURM docs]), where the &amp;#039;&amp;#039;node&amp;#039;&amp;#039; is Mufasa:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
: %P Partition name followed by &amp;quot;*&amp;quot; for the default partition&lt;br /&gt;
&lt;br /&gt;
: %a State/availability of a partition&lt;br /&gt;
&lt;br /&gt;
: %c Number of CPUs per node&lt;br /&gt;
&lt;br /&gt;
: %B The max number of CPUs per node available to jobs in the partition&lt;br /&gt;
&lt;br /&gt;
: %G Generic resources (gres) associated with the nodes [&amp;#039;&amp;#039;for Mufasa these correspond to the [[System#Hardware|virtual GPUs defined with MIG]]&amp;#039;&amp;#039;]&lt;br /&gt;
&lt;br /&gt;
: %l Maximum time for any job in the format &amp;quot;days-hours:minutes:seconds&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: %L Default time for any job in the format &amp;quot;days-hours:minutes:seconds&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: %r Only user root may initiate jobs, &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the actual command, field identifiers &amp;lt;code&amp;gt;%...&amp;lt;/code&amp;gt; are preceded by width specifiers in the form &amp;lt;code&amp;gt;.N&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt; is a positive integer. The specifiers define how many characters to reserve to each field in the command output, and can be used to help readability.&lt;br /&gt;
&lt;br /&gt;
== Partition availability ==&lt;br /&gt;
&lt;br /&gt;
The most important information that &amp;#039;&amp;#039;sinfo&amp;#039;&amp;#039; provides to users is the &amp;#039;&amp;#039;availability&amp;#039;&amp;#039; (also called &amp;#039;&amp;#039;state&amp;#039;&amp;#039;) of partitions.&lt;br /&gt;
&lt;br /&gt;
For operational partitions, availability is &amp;#039;&amp;#039;up&amp;#039;&amp;#039;, meaning that the partition is available to be allocated work. A state/availability equal to &amp;#039;&amp;#039;drain&amp;#039;&amp;#039; means that the partition is not available to be allocated work, while &amp;#039;&amp;#039;down&amp;#039;&amp;#039; means the same as &amp;#039;&amp;#039;drain&amp;#039;&amp;#039; but also that the partition failed, i.e. that it suffered a disruption.&lt;br /&gt;
&lt;br /&gt;
A partition in state &amp;#039;&amp;#039;drain&amp;#039;&amp;#039; or &amp;#039;&amp;#039;down&amp;#039;&amp;#039; requires intervention by a [[Roles|Job Administrator]] to be restored to &amp;#039;&amp;#039;up&amp;#039;&amp;#039; state. Jobs waiting for that partition are paused.&lt;br /&gt;
&lt;br /&gt;
== Choosing the &amp;quot;right&amp;quot; partition ==&lt;br /&gt;
&lt;br /&gt;
When launching a job (as explained in [[User Jobs#Executing jobs on Mufasa|Executing jobs on Mufasa]]) a user should select the partition that is most suitable for it according to the job&amp;#039;s features. Launching a job on a partition avoids the need for the user to specify explicitly all of the resources that the job requires, and instead rely on the set of resources already defined for the partition. &lt;br /&gt;
&lt;br /&gt;
The fact that by selecting the right partition for their job a user can pre-define the requirements of the job without having to specify them makes partitions very handy, and avoids possible mistakes. However, users can -if needed- change the resource requested by their jobs wrt the default values associated to such partitions.&lt;br /&gt;
&lt;br /&gt;
Any element of the default assignment of resources provided by a specific partition can be overridden by specifying an option when launching the job, so users are not forced to accept the default value. However, it makes sense to choose the most suitable partition for a job in the first place, and then to specify the job&amp;#039;s requirements only for those resources that have an unsuitable default value.&lt;br /&gt;
&lt;br /&gt;
Resource requests by the user launching a job can be both lower and higher than the default value of the partition for that resource. However, they cannot exceed the maximum value that the partition allows for requests of such resource, if set. If a user tries to launch on a partition a job that requests a higher value of a resource than the partition‑specified maximum, the launch command is refused.&lt;br /&gt;
&lt;br /&gt;
One of the most important resources provided to jobs by partitions is &amp;#039;&amp;#039;time&amp;#039;&amp;#039;, in the sense that a job is permitted to run for no longer than a predefined time duration. Jobs that exceed their allotted time are killed by SLURM.&lt;br /&gt;
&lt;br /&gt;
= Executing jobs on Mufasa =&lt;br /&gt;
&lt;br /&gt;
The main reason for a user to interact with Mufasa is to execute jobs that require resources not available to standard desktop-class machines. Therefore, launching jobs is the most important operation for Mufasa users: what follows explains how it is done. &lt;br /&gt;
&lt;br /&gt;
Considering that [[System#Docker Containers|all computation on Mufasa must occur within Docker containers]], the jobs run by Mufasa users are always containers except for menial, non-computationally intensive jobs. The process of launching a user job on Mufasa involves two steps:&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
:; Step 1&lt;br /&gt;
:: [[User Jobs#Using SLURM to run a Docker container|Use SLURM to run the Docker container where the job will take place]]&lt;br /&gt;
&lt;br /&gt;
:; Step 2&lt;br /&gt;
:: [[User Jobs#Launching a user job from within a Docker container|Launch the job from within the Docker container]]&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
As an optional preparatory step, it is often useful to define an [[User Jobs#Using execution scripts to run jobs|execution script]] to simplify the launching process and reduce the possibility of mistakes.&lt;br /&gt;
&lt;br /&gt;
The commands that SLURM provides to run jobs are &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun &amp;lt;options&amp;gt; &amp;lt;path_of_the_program_to_be_run_via_SLURM&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun &amp;lt;options&amp;gt; &amp;lt;path_of_the_program_to_be_run_via_SLURM&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(see SLURM documentation: [https://slurm.schedmd.com/srun.html srun], [https://slurm.schedmd.com/sbatch.html sbatch]). 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 processes that use the console for interaction with their user; &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;
Among the options available for &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt;, one of the most important is &amp;lt;code&amp;gt;--res=gpu:K&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt; is an integer between 1 and the maximum number of GPUs available in the server (5 for Mufasa). This option specifies how many of the GPUs the program requests for use. Since GPUs are the most scarce resources of Mufasa, this option must always be explicitly specified when running a job that requires GPUs.&lt;br /&gt;
&lt;br /&gt;
As [[User Jobs#SLURM Partition|already explained]], a quick way to define the set of resources that a program will have access to is to use option &amp;lt;code&amp;gt;--p &amp;lt;partition name&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
This option specifies that SLURM will run the program on a specific partition, and therefore that it will have access to all and only the resources available to that partition. As a consequence, all options that define how many resources to assign the job, such as ‑‑res=gpu:K, will only be able to provide the job with resources that are available to the chosen partition. Jobs that require resources that are not available to the chosen partition do not get executed.&lt;br /&gt;
&lt;br /&gt;
For instance, running&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun -p small ./my_program&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
makes SLURM run &amp;lt;code&amp;gt;my_program&amp;lt;/code&amp;gt; on the partition named “small”. Running the program this way means that the resources associated to this partition will be available to it for use.&lt;br /&gt;
&lt;br /&gt;
= Using SLURM to run a Docker container =&lt;br /&gt;
&lt;br /&gt;
The first step to run a user job on Mufasa is to run the [[System#Docker Containers|Docker container]] where the job will take place. 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 they belong to 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;
Each user is in charge of preparing the Docker container(s) where the user&amp;#039;s jobs will be executed. In most situations the user can simply select a suitable ready-made container from the many which are already available for use.&lt;br /&gt;
&lt;br /&gt;
In order to run a Docker container via SLURM, a user must use a command 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;
srun ‑‑p &amp;lt;partition_name&amp;gt; ‑‑container-image=&amp;lt;container_path.sqsh&amp;gt; ‑‑no‑container‑entrypoint ‑‑container‑mounts=&amp;lt;mufasa_dir&amp;gt;:&amp;lt;docker_dir&amp;gt; ‑‑gres=&amp;lt;gpu_resources&amp;gt; ‑‑mem=&amp;lt;mem_resources&amp;gt; ‑‑cpus‑per‑task &amp;lt;cpu_amount&amp;gt; ‑‑pty ‑‑time=&amp;lt;hh:mm:ss&amp;gt; &amp;lt;command_to_run_within_container&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All parts of the command above that come after &amp;#039;&amp;#039;srun&amp;#039;&amp;#039; are options that specify what to execute and how. Below these options are explained.&lt;br /&gt;
&lt;br /&gt;
;‑‑p &amp;lt;partition_name&amp;gt;&lt;br /&gt;
: specifies the resource partition on which the job will be run.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Important! If &amp;lt;code&amp;gt;‑‑p &amp;lt;partition_name&amp;gt;&amp;lt;/code&amp;gt; is used, 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_number&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;‑‑time=&amp;lt;hh:mm:ss&amp;gt;&amp;lt;/code&amp;gt;) can be omitted, greatly simplyfying the command. If an explicit amount is not requested for a given resource, the job is assigned the default amount of the resource (as defined by the chosen partition). A notable exception to this rule concerns option &amp;lt;code&amp;gt;‑‑gres=&amp;lt;gpu_resources&amp;gt;&amp;lt;/code&amp;gt;: GPU resources, in fact, must always be explicitly requested with option &amp;lt;code&amp;gt;‑‑gres&amp;lt;/code&amp;gt;, otherwise no access to GPUs is granted to the job.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
;‑‑container-image=&amp;lt;container_path.sqsh&amp;gt;&lt;br /&gt;
: specifies the container to be run&lt;br /&gt;
&lt;br /&gt;
;‑‑no‑container‑entrypoint&lt;br /&gt;
: specifies that the entrypoint defined in the container image should not be executed (ENTRYPOINT in the Dockerfile that defines the container). The entrypoint is a command that gets executed as soon as the container is run: option ‑‑no‑container‑entrypoint is useful when the user is not sure of the effect of such command.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;‑‑container‑mounts=&amp;lt;mufasa_dir&amp;gt;:&amp;lt;docker_dir&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
: specifies what parts of Mufasa&amp;#039;s filesystem will be available within the container&amp;#039;s filesystem, and where they will be mounted; for instance, if &amp;lt;code&amp;gt;&amp;lt;mufasa_dir&amp;gt;:&amp;lt;docker_dir&amp;gt;&amp;lt;/code&amp;gt; takes the value &amp;lt;code&amp;gt;/home/mrossi:/data&amp;lt;/code&amp;gt; this tells srun to mount Mufasa&amp;#039;s directory &amp;lt;code&amp;gt;/home/mrossi&amp;lt;/code&amp;gt; in position &amp;lt;code&amp;gt;/data&amp;lt;/code&amp;gt; within the filesystem of the Docker container. When the docker container reads or writes files in directory &amp;lt;code&amp;gt;/data&amp;lt;/code&amp;gt; of its own (internal) filesystem, what actually happens is that files in &amp;lt;code&amp;gt;/home/mrossi&amp;lt;/code&amp;gt; get manipulated instead. &amp;lt;code&amp;gt;/home/mrossi&amp;lt;/code&amp;gt; is the only part of the filesystem of Mufasa that is visible to, and changeable by, the Docker container.&lt;br /&gt;
&lt;br /&gt;
;‑‑gres=&amp;lt;gpu_resources&amp;gt;&lt;br /&gt;
: specifies what GPUs to assign to the container; for instance, &amp;lt;code&amp;gt;&amp;lt;gpus&amp;gt;&amp;lt;/code&amp;gt; may be &amp;lt;code&amp;gt;gpu:40gb:2&amp;lt;/code&amp;gt;, that corresponds to giving the job control to 2 entire large‑size GPUs.&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 mandatory if the job needs to use the system&amp;#039;s GPUs. Differently from other resources (where unspecified requests lead to the assignment of a default amount of the resource), GPUs must always be explicitly requested with &amp;lt;code&amp;gt;‑‑gres&amp;lt;/code&amp;gt;.&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 container; 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 container; 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;
;‑‑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 [[User Jobs#Running interactive jobs via SLURM|Running interactive jobs via SLURM]])&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;‑‑time=&amp;lt;d-hh:mm:ss&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
: specifies the maximum time allowed to the job to run, 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;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;command_to_run_within_container&amp;gt;&lt;br /&gt;
: the executable that will be run within the Docker container as soon as it is operative. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A typical value for &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;. This instructs srun to open an interactive shell session (i.e. a command-line terminal interface) within the container, from which the user will then run their job. Another typical value for &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;python&amp;lt;/code&amp;gt;, which launches an interactive Python session from which the user will then run their job. It is also possible to use &amp;lt;code&amp;gt;&amp;lt;command_to_run_within_container&amp;gt;&amp;lt;/code&amp;gt; to launch non-interactive programs.&lt;br /&gt;
&lt;br /&gt;
== Nvidia Pyxis ==&lt;br /&gt;
&lt;br /&gt;
Some of the options described below are specifically dedicated to Docker containers: these are provided by the [https://github.com/NVIDIA/pyxis Nvidia Pyxis] package that has been installed on Mufasa as an adjunct to SLURM. Pyxis allows unprivileged users (i.e., those that are not administrators of Mufasa) to execute containers and run commands within them. More specifically, options &amp;lt;code&amp;gt;‑‑container-image&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;‑‑no‑container‑entrypoint&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;‑‑container-mounts&amp;lt;/code&amp;gt; are provided to &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; by Pyxis.&lt;br /&gt;
&lt;br /&gt;
= Launching a user job from within a Docker container =&lt;br /&gt;
&lt;br /&gt;
Once the Docker container (run as [[User Jobs#Using SLURM to run a Docker container|explained here]]) is up and running, usually the user is dropped to the interactive environment specified by &amp;lt;code&amp;gt;&amp;lt;command_to_run_within_container&amp;gt;&amp;lt;/code&amp;gt;. This interactive environment can be, for instance, a bash shell or the interactive Python mode. Once inside the interactive environment, the user can simply run the required program in the usual way (depending on the type of environment).&lt;br /&gt;
&lt;br /&gt;
= Running interactive jobs via SLURM =&lt;br /&gt;
&lt;br /&gt;
As explained, SLURM command &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; is suitable for launching &amp;#039;&amp;#039;interactive&amp;#039;&amp;#039; user jobs, i.e. jobs that use the terminal output and the keyboard to exchange information with a human user. If a user needs this type of interaction, they must run a &amp;#039;&amp;#039;bash shell&amp;#039;&amp;#039; (i.e. a terminal session) with a command 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 --pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and subsequently use the bash shell to run the interactive program. To close the SLURM-spawned bash shell, run (as with any other 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;
Of course, also the “base” shell (i.e. the one that opens when an SSH connection to Mufasa is established) can be used to run programs: however, programs launched this way are not being run via SLURM and are not able to access most of the resources of the machine (in particular, there is no way to make GPUs accessible to them, and they can only access 2 CPUs). On the contrary, running programs with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; ensures that they can access all the resources managed by SLURM.&lt;br /&gt;
&lt;br /&gt;
As usual, GPU resources (if needed) must always be requested explicitly with parameter &amp;lt;code&amp;gt;--res=gpu:K&amp;lt;/code&amp;gt;. For instance, in order to run an interactive program which needs one GPU we may first run a bash shell via SLURM 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 --gres=gpu:1 --pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
an then run the interactive program from the newly opened shell.&lt;br /&gt;
&lt;br /&gt;
An alternative to explicitly specifying what resources to assign to the bash shell run via SLURM is to run &amp;lt;code&amp;gt;/bin/bash&amp;lt;/code&amp;gt; on one of the available partitions. For instance, to run the shell on partition “small” the command is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun -p small --pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mufasa is configured to show, as part of the command prompt of a bash shell run via SLURM, a message such as &amp;lt;code&amp;gt;(SLURM ID xx)&amp;lt;/code&amp;gt; (where &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is the ID of the &amp;lt;code&amp;gt;/bin/bash&amp;lt;/code&amp;gt; process within SLURM). When you see this message, you know that the bash shell you are interacting with is a SLURM-run one.&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;
= Detach from a running job with &amp;#039;&amp;#039;screen&amp;#039;&amp;#039; =&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 job but do not plan to keep the SSH connection to Mufasa open (or if you fear that the timeout on SSH connections will cut your contact with the shell) 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 detach 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). Now you can disconnect from Mufasa; when you need to reach your job again, you can can reopen an SSH connection to Mufasa and then reconnect to the &amp;#039;&amp;#039;screen&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
More specifically, to create a screen session and run a job in it:&lt;br /&gt;
&lt;br /&gt;
* Connect to Mufasa with SSH&lt;br /&gt;
* From the Mufasa shell, run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
screen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the screen session 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 session with &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 Mufasa shell, while your process will go on running in the screen session&lt;br /&gt;
* You can now close the SSH connection to Mufasa without damaging your process&lt;br /&gt;
&lt;br /&gt;
Later, when you are ready to resume contact with your running process:&lt;br /&gt;
&lt;br /&gt;
* Connect to Mufasa with SSH&lt;br /&gt;
* In the Mufasa shell, run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
screen -r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* You are now back to the screen session where you launched your job&lt;br /&gt;
&lt;br /&gt;
* When you do not need the screen containing your job anymore, destroy it by using (within the screen) &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;X&amp;#039;&amp;#039;&amp;#039;&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;
= Using execution scripts to run jobs =&lt;br /&gt;
&lt;br /&gt;
Previous Sections of this page explained how to use SLURM to run user jobs directly, i.e. by specifying the value of SLURM parameters directly on the command line.&lt;br /&gt;
&lt;br /&gt;
In general, though, it is preferable to wrap the commands that run jobs into &amp;#039;&amp;#039;&amp;#039;execution scripts&amp;#039;&amp;#039;&amp;#039;. An execution script makes specifying all required parameters easier, makes errors in configuring such parameters less likely, and -most importantly- can be reused for other jobs.&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;,  where 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;
# one or more &amp;#039;&amp;#039;&amp;#039;srun 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;
An execution script is a special type of Linux &amp;#039;&amp;#039;bash script&amp;#039;&amp;#039;. A bash script is a file that is intended to be run by the bash command interpreter. In order to be acceptable as a bash script, a text file must:&lt;br /&gt;
&lt;br /&gt;
* have the “executable” flag set&lt;br /&gt;
* have &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; as its very first line&lt;br /&gt;
&lt;br /&gt;
Usually, a Linux bash 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.&lt;br /&gt;
&lt;br /&gt;
To execute the script, just open a terminal (such as the one provided by an SSH connection with Mufasa), write the scripts&amp;#039;s full path (e.g., &amp;#039;&amp;#039;./my_execution_script.sh&amp;#039;&amp;#039;) and press the &amp;lt;enter&amp;gt; key. The script is executed in the terminal, and any output (e.g., whatever is printed by any &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; commands in the script) is shown on the terminal.&lt;br /&gt;
&lt;br /&gt;
Within a bash script, lines preceded by &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; are comments (with the notable exception of the initial &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; line). Use of blank lines as spacers is allowed.&lt;br /&gt;
&lt;br /&gt;
Below is an example of execution script (actual instructions are shown in bold; the rest are comments):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;#!/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;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; Note: these are examples. Put your own SBATCH directives below&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SBATCH --job-name=myjob&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; name assigned to the job&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SBATCH --cpus-per-task=1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; number of threads allocated to each task&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SBATCH --mem-per-cpu=500M&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; amount of memory per CPU core&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SBATCH --gres=gpu:1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; number of GPUs per node&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SBATCH --partition=small&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; the partition to run your jobs on&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SBATCH --time=0-00:01:00&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; time assigned to your jobs to run (format: days-hours:minutes:seconds, with days optional)&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;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; ----------------srun commands-----------------&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; Put your own srun command(s) below&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;srun ...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;srun ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; ----------------end of srun commands-----------------&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the example above shows, beyond the initial directive &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt; the script includes a series of &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directives used to specify parameter values, and finally one or more &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; commands that run the jobs. Any parameter accepted by commands &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; can be used as an &amp;lt;code&amp;gt;SBATCH&amp;lt;/code&amp;gt; directive in an execution script.&lt;br /&gt;
&lt;br /&gt;
= Job caching =&lt;br /&gt;
&lt;br /&gt;
When a job is run via SLURM (with or without an execution script), Mufasa exploits a (fully tranparent) caching mechanism to speed up its execution. The speedup is obtained by removing the need for the running job to execute accesses to the (mechanical and therefore relatively slow) HDDs where &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; partitions reside, substituting them with accesses to (solid-state and therefore much faster) SSDs.&lt;br /&gt;
&lt;br /&gt;
Each time a job is run via SLURM, this is what happens automatically:&lt;br /&gt;
&lt;br /&gt;
# Mufasa temporarily copies code and associated data from the directory where the executables are located (in the user&amp;#039;s own &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt;) to a cache space located on system SSDs&lt;br /&gt;
# Mufasa launches the cached copy of the user executables, using the cached copies of the data as its input files&lt;br /&gt;
# The executables create their output files in the cache space&lt;br /&gt;
# When the user jobs end, Mufasa copies the output files from the cache space back to the user&amp;#039;s own &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The whole process is completely transparent to the user. The user simply prepares the executable (or the [[User Jobs# Using execution scripts to wrap user jobs|execution script]]) in a subdirectory of their &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory and runs the job. When job execution is complete, the user finds their output data in the origin subdirectory of &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt;, exactly as if the execution actually occurred there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Important!&amp;#039;&amp;#039;&amp;#039; The caching mechanism requires that &amp;#039;&amp;#039;during job execution&amp;#039;&amp;#039; the user does not modify the contents of the &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; subdirectory where executable and data were at execution time. Any such change, in fact, will be overwritten by Mufasa at the end of the execution, when files are copied back from the caching space.&lt;br /&gt;
&lt;br /&gt;
= Monitoring and managing jobs =&lt;br /&gt;
&lt;br /&gt;
SLURM provides Job Users with several tools to inspect and manage jobs. While a Job User is able to inspect all users&amp;#039; jobs, they are only allowed to modify the condition of their own jobs.&lt;br /&gt;
&lt;br /&gt;
From [https://slurm.schedmd.com/overview.html SLURM&amp;#039;s own overview]:&lt;br /&gt;
&lt;br /&gt;
“&amp;#039;&amp;#039;User tools include&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
srun&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://slurm.schedmd.com/srun.html (link to SLURM docs)] to initiate jobs, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
scancel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://slurm.schedmd.com/scancel.html (link to SLURM docs)] to terminate queued or running jobs,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://slurm.schedmd.com/sinfo.html (link to SLURM docs)] to report system status,&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;
[https://slurm.schedmd.com/squeue.html (link to SLURM docs)] to report the status of jobs [i.e. to inspect the scheduling queue], and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: lightgrey; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sacct&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://slurm.schedmd.com/sacct.html (link to SLURM docs)] to get information about jobs and job steps that are running or have completed.&amp;#039;&amp;#039;”&lt;br /&gt;
&lt;br /&gt;
An example of the output of &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; is 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;
== Job state ==&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;
; PD PENDING&lt;br /&gt;
: Job is awaiting resource allocation. &lt;br /&gt;
&lt;br /&gt;
; R RUNNING&lt;br /&gt;
: Job currently has an allocation.&lt;br /&gt;
&lt;br /&gt;
; S 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;
; CG 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;
; CD COMPLETED&lt;br /&gt;
: Job has terminated all processes on all nodes with an exit code of zero. &lt;br /&gt;
&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, reported here for completeness:&lt;br /&gt;
&lt;br /&gt;
; BF BOOT_FAIL&lt;br /&gt;
: Job terminated due to launch failure, typically due to a hardware failure (e.g. unable to boot the node or block and the job can not be requeued). &lt;br /&gt;
&lt;br /&gt;
; CA CANCELLED&lt;br /&gt;
: Job was explicitly cancelled by the user or system administrator. The job may or may not have been initiated. &lt;br /&gt;
&lt;br /&gt;
; CF CONFIGURING&lt;br /&gt;
: Job has been allocated resources, but are waiting for them to become ready for use (e.g. booting). &lt;br /&gt;
&lt;br /&gt;
; DL DEADLINE&lt;br /&gt;
: Job terminated on deadline. &lt;br /&gt;
&lt;br /&gt;
; F FAILED&lt;br /&gt;
: Job terminated with non-zero exit code or other failure condition. &lt;br /&gt;
&lt;br /&gt;
; NF NODE_FAIL&lt;br /&gt;
: Job terminated due to failure of one or more allocated nodes. &lt;br /&gt;
&lt;br /&gt;
; OOM OUT_OF_MEMORY&lt;br /&gt;
: Job experienced out of memory error. &lt;br /&gt;
&lt;br /&gt;
; PR PREEMPTED&lt;br /&gt;
: Job terminated due to preemption. &lt;br /&gt;
&lt;br /&gt;
; RD RESV_DEL_HOLD&lt;br /&gt;
: Job is being held after requested reservation was deleted. &lt;br /&gt;
&lt;br /&gt;
; RF REQUEUE_FED&lt;br /&gt;
: Job is being requeued by a federation. &lt;br /&gt;
&lt;br /&gt;
; RH REQUEUE_HOLD&lt;br /&gt;
: Held job is being requeued. &lt;br /&gt;
&lt;br /&gt;
; RQ REQUEUED&lt;br /&gt;
: Completing job is being requeued. &lt;br /&gt;
&lt;br /&gt;
; RS RESIZING&lt;br /&gt;
: Job is about to change size. &lt;br /&gt;
&lt;br /&gt;
; RV REVOKED&lt;br /&gt;
: Sibling was removed from cluster due to other cluster starting the job. &lt;br /&gt;
&lt;br /&gt;
; SI SIGNALING&lt;br /&gt;
: Job is being signaled. &lt;br /&gt;
&lt;br /&gt;
; SE SPECIAL_EXIT&lt;br /&gt;
: The job was requeued in a special state. This state can be set by users, typically in EpilogSlurmctld, if the job has terminated with a particular exit value. &lt;br /&gt;
&lt;br /&gt;
; SO STAGE_OUT&lt;br /&gt;
: Job is staging out files. &lt;br /&gt;
&lt;br /&gt;
; ST STOPPED&lt;br /&gt;
: Job has an allocation, but execution has been stopped with SIGSTOP signal. CPUS have been retained by this job. &lt;br /&gt;
&lt;br /&gt;
; TO TIMEOUT&lt;br /&gt;
: Job terminated upon reaching its time limit.&lt;/div&gt;</summary>
		<author><name>10.79.2.181</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=System&amp;diff=72</id>
		<title>System</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=System&amp;diff=72"/>
		<updated>2022-01-17T14:29:42Z</updated>

		<summary type="html">&lt;p&gt;10.79.2.181: /* File transfer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mufasa is a Linux server located in a server room managed by the [[Roles|System Administrators]]. [[Roles|Job Users]] and [[Roles|Job Administrators]] can only access Mufasa remotely. &lt;br /&gt;
&lt;br /&gt;
Remote access to Mufasa is performed using the [[System#Accessing Mufasa|SSH protocol]] for the execution of commands and the [[System#File transfer|SFTP protocol]] for the exchange of files. Once logged in, a user interacts with Mufasa via a terminal (text-based) interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware =&lt;br /&gt;
&lt;br /&gt;
Mufasa is a server for massively parallel computation. Its main hardware components are:&lt;br /&gt;
&lt;br /&gt;
* 32-core, 64-thread AMD processor&lt;br /&gt;
* 1 TB RAM&lt;br /&gt;
* 9 TB of SSDs (for OS and execution cache)&lt;br /&gt;
* 28TB of HDDs (for user /home directories)&lt;br /&gt;
* 5 Nvidia A100 GPUs [based on the &amp;#039;&amp;#039;Ampere&amp;#039;&amp;#039; architecture]&lt;br /&gt;
* Linux Ubuntu operating system&lt;br /&gt;
&lt;br /&gt;
Usually each of these resources (e.g., a GPU) is not fully assigned to a single user or a single job. On the contrary, access resources are shared among different users and processes in order to optimise their usage and availability.&lt;br /&gt;
&lt;br /&gt;
For what concerns GPUs, the 5 physical A100 GPUs are subdivided into “virtual” GPUs with different capabilities using Nvidia&amp;#039; MIG system. From [https://docs.nvidia.com/datacenter/tesla/mig-user-guide/ MIG&amp;#039;s user guide]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;“&amp;#039;&amp;#039;The Multi-Instance GPU (MIG) feature allows GPUs based on the NVIDIA Ampere architecture (such as NVIDIA A100) to be securely partitioned into up to seven separate GPU Instances for CUDA applications, providing multiple users with separate GPU resources for optimal GPU utilization. This feature is particularly beneficial for workloads that do not fully saturate the GPU’s compute capacity and therefore users may want to run different workloads in parallel to maximize utilization.&amp;#039;&amp;#039;”&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In practice, MIG allows flexible partitioning of a very powerful (but single) GPU to create multiple virtual GPUs with different capabilities, that are then made available to users as if they were separate devices.&lt;br /&gt;
&lt;br /&gt;
Command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[https://developer.nvidia.com/nvidia-system-management-interface nvidia-smi]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(“smi” stands for System Management Interface) provides an overview of the physical and virtual GPUs available to users in a system&amp;lt;ref&amp;gt;On Mufasa, this command may require to be launched via the SLURM job scheduling system (as explained in Section 2 of this document) in order to be able to access the GPUs.&lt;br /&gt;
&lt;br /&gt;
= Accessing Mufasa =&lt;br /&gt;
&lt;br /&gt;
User access to Mufasa is always remote and exploits the &amp;#039;&amp;#039;SSH&amp;#039;&amp;#039; (&amp;#039;&amp;#039;Secure SHell&amp;#039;&amp;#039;) protocol. &lt;br /&gt;
&lt;br /&gt;
To open a remote connection to Mufasa, open a local terminal on your computer and, in it, run command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
ssh &amp;lt;your_username_on_Mufasa&amp;gt;@&amp;lt;Mufasa&amp;#039;s_IP_address&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;Mufasa&amp;#039;s_IP_address&amp;gt;&amp;lt;/code&amp;gt; is either &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;10.79.23.96&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;10.79.23.97&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
For example, user mrossi may access Mufasa with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
ssh mrossi@10.79.23.97&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Access via SSH works with Linux, MacOs and Windows 10 (and later) terminals. For Windows users, a handy alternative tool (also including an X server, required to run on Mufasa Linux programs with a graphical user interface) is [https://mobaxterm.mobatek.net/ MobaXterm].&lt;br /&gt;
&lt;br /&gt;
If you don&amp;#039;t have a user account on Mufasa, you first have to ask your supervisor for one. See [[System#Users and groups|Users and groups]] for more information about Mufasa&amp;#039;s users.&lt;br /&gt;
&lt;br /&gt;
As soon as you launch the &amp;#039;&amp;#039;ssh&amp;#039;&amp;#039; command, you will be asked to type the password (i.e., the one of your user account on Mufasa). Once you provide the password, the local terminal on your computer becomes a remote terminal (a “remote shell”) through which you interact with Mufasa. The remote shell sports a &amp;#039;&amp;#039;command prompt&amp;#039;&amp;#039; such as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;your_username_on_Mufasa&amp;gt;@rk018445:~$&lt;br /&gt;
&lt;br /&gt;
(&amp;#039;&amp;#039;rk018445&amp;#039;&amp;#039; is the Linux hostname of Mufasa). For instance, user mrossi will see a prompt similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
mrossi@rk018445:~$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the remote shell, you can issue commands to Mufasa by typing them after the prompt, then pressing the &amp;#039;&amp;#039;enter&amp;#039;&amp;#039; key. Being Mufasa a Linux server, it will respond to all the standard Linux system commands such as &amp;lt;code&amp;gt;pwd&amp;lt;/code&amp;gt; (which prints the path to the current directory) or &amp;lt;code&amp;gt;cd &amp;lt;destination_dir&amp;gt;&amp;lt;/code&amp;gt; (which changes the current directory). On the internet you can find many tutorials about the Linux command line, such as [https://linuxcommand.org/index.php this one].&lt;br /&gt;
&lt;br /&gt;
To close the SSH session run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the command prompt of the remote shell.&lt;br /&gt;
&lt;br /&gt;
== VPN ==&lt;br /&gt;
To be able to connect to Mufasa, your computer must belong to Polimi&amp;#039;s LAN. This happens either because the computer is physically located at Politecnico di Milano and connected via ethernet, or because you are using Polimi&amp;#039;s VPN to connect to its LAN from somewhere else (such as your home). In particular, using the VPN is the &amp;#039;&amp;#039;only&amp;#039;&amp;#039; way to use Mufasa from outside Polimi. See [https://intranet.deib.polimi.it/ita/vpn-wifi this DEIB webpage] for instructions about how to activate VPN access.&lt;br /&gt;
&lt;br /&gt;
== Timeout ==&lt;br /&gt;
&lt;br /&gt;
SSH sessions to Mufasa may be subjected to an inactivity timeout: i.e., after a given inactivity period the ssh session gets automatically closed. Users who need to be able to reconnect to the very same shell where they launched a program (for instance because their program is interactive or because it provides progress update messages) should use the &amp;#039;&amp;#039;screen&amp;#039;&amp;#039; command, as explained in [[User Jobs#Using screen with srun]].&lt;br /&gt;
&lt;br /&gt;
== Using SSH with graphics ==&lt;br /&gt;
&lt;br /&gt;
The standard form of the &amp;#039;&amp;#039;ssh&amp;#039;&amp;#039; command, i.e. the one described above, should always be preferred. However, it only allows text communication with Mufasa. In special cases it may be necessary to remotely run (on Mufasa) Linux programs that have a graphical user interface. These programs require interaction with the X server of the remote user&amp;#039;s machine (which must use Linux as well). A special mode of operation of &amp;#039;&amp;#039;ssh&amp;#039;&amp;#039; is needed to enable this. This mode is engaged by running &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ssh -X &amp;lt;your username on Mufasa&amp;gt;@&amp;lt;Mufasa&amp;#039;s IP address&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= File transfer =&lt;br /&gt;
&lt;br /&gt;
Uploading files from local machine to Mufasa and downloading files from Mufasa onto local machines is done using the &amp;#039;&amp;#039;SFTP&amp;#039;&amp;#039; protocol (&amp;#039;&amp;#039;Secure File Transfer Protocol&amp;#039;&amp;#039;). &lt;br /&gt;
&lt;br /&gt;
Linux and MacOS users can directly use the &amp;#039;&amp;#039;sftp&amp;#039;&amp;#039; package, as explained (for instance) by [https://geekflare.com/sftp-command-examples/ this guide]. Windows users can interact with Mufasa via SFTP protocol using the [https://mobaxterm.mobatek.net/ MobaXterm] software package. MacOS users can interact with Mufasa via SFTP also with the [https://cyberduck.io/ Cyberduck] software package.&lt;br /&gt;
&lt;br /&gt;
For Linux and MacOS user, file transfer to/from Mufasa occurs via an &amp;#039;&amp;#039;interactive sftp shell&amp;#039;&amp;#039;, i.e. a remote shell very similar to the one one described in [[Accessing Mufasa|Accessing Mufasa]]. &lt;br /&gt;
The first thing to do is to open a terminal and run the following command (note the similarity to SSH connections):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sftp &amp;lt;your_username_on_Mufasa&amp;gt;@&amp;lt;Mufasa&amp;#039;s_IP_address&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;Mufasa&amp;#039;s_IP_address&amp;gt;&amp;lt;/code&amp;gt; is either &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;10.79.23.96&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;10.79.23.97&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked your password. Once you provide it, you access an interactive sftp shell, where the command prompt takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sftp&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this shell you can run the commands to exchange files. Most of these commands have two forms: one to act on the remote machine (in this case, Mufasa) and one to act on the local machine (i.e. your own computer). To differentiate, the “local” versions usually have names that start with the letter “l” (lowercase L). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
cd &amp;lt;path&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to change directory to &amp;lt;code&amp;gt;&amp;lt;path&amp;gt;&amp;lt;/code&amp;gt; on the remote machine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
lcd &amp;lt;path&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to change directory to &amp;lt;code&amp;gt;&amp;lt;path&amp;gt;&amp;lt;/code&amp;gt; on the local machine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
get &amp;lt;file&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to download (i.e. copy) &amp;lt;code&amp;gt;&amp;lt;file&amp;gt;&amp;lt;/code&amp;gt; from the current directory of the remote machine to the current directory of the local machine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
put &amp;lt;file&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to upload (i.e. copy) &amp;lt;code&amp;gt;&amp;lt;file&amp;gt;&amp;lt;/code&amp;gt; from the current directory of the local machine to the current directory of the remote machine.&lt;br /&gt;
&lt;br /&gt;
Naturally, a user can only upload files to directories where they have write permission (usually only their own /home directory and its subdirectories). Also, users can only download files from directories where they have read permission. (File permission on Mufasa follow the standard Linux rules.)&lt;br /&gt;
&lt;br /&gt;
= Docker containers =&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;As a general rule, all computation performed on Mufasa must occur within &amp;#039;&amp;#039;&amp;#039;[https://www.docker.com/ &amp;#039;&amp;#039;&amp;#039;Docker containers&amp;#039;&amp;#039;&amp;#039;]. This allows every user to configure their own execution environment without any risk of interfering with everyone else&amp;#039;s.&lt;br /&gt;
&lt;br /&gt;
From [https://docs.docker.com/get-started/ Docker&amp;#039;s documentation]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;“&amp;#039;&amp;#039;Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Docker provides the ability to package and run an application in a loosely isolated environment called a container. The isolation and security allow you to run many containers simultaneously on a given host. Containers are lightweight and contain everything needed to run the application, so you do not need to rely on what is currently installed on the host.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;#039;&amp;#039;A container is a sandboxed process on your machine that is isolated from all other processes on the host machine. When running a container, it uses an isolated filesystem. [containing] everything needed to run an application - all dependencies, configuration, scripts, binaries, etc. The image also contains other configuration for the container, such as environment variables, a default command to run, and other metadata.&amp;#039;&amp;#039;”&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Using Docker allows each user of Mufasa to build the software environment that their job(s) require. In particular, using Docker containers enables users to configure their own (containerized) system and install any required libraries on their own, without need to ask administrators to modify the configuration of Mufasa. As a consequence, users can freely experiment with their (containerized) system without risk to the work of other users and to the stability and reliability of Mufasa. In particular, containers allow users to run jobs that require multiple and/or obsolete versions of the same library.&lt;br /&gt;
&lt;br /&gt;
A large number of preconfigured Docker containers are already available, so users do not usually need to start from scratch in preparing the environment where their jobs will run on Mufasa. The official Docker container repository is [https://hub.docker.com/search?q=&amp;amp;type=image dockerhub].&lt;br /&gt;
&lt;br /&gt;
How to run Docker containers on Mufasa will be explained in Part 2 of this document.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span id=&amp;quot;anchor-6&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;The SLURM job scheduling system ==&lt;br /&gt;
&lt;br /&gt;
Mufasa uses [https://slurm.schedmd.com/overview.html SLURM] to manage shared access to its resources. &amp;#039;&amp;#039;&amp;#039;Users of Mufasa must use SLURM to run and manage the jobs they run on the machine&amp;#039;&amp;#039;&amp;#039;&amp;lt;ref&amp;gt;It is possible for users to run jobs without using SLURM; however, running jobs run this way is only intended for “housekeeping” activities and only provides access to a small subset of Mufasa&amp;#039;s resources. For instance, jobs run outside SLURM cannot access the GPUs, can only use a few processor cores, can only access a small portion of RAM. Using SLURM is therefore necessary for any resource-intensive job.&lt;br /&gt;
&amp;lt;/ref&amp;gt;. From [https://slurm.schedmd.com/documentation.html SLURM&amp;#039;s documentation]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;“&amp;#039;&amp;#039;Slurm is an open source, fault-tolerant, and highly scalable cluster management and job scheduling system for large and small Linux clusters. Slurm has three key functions. First, it allocates exclusive and/or non-exclusive access to resources (compute nodes) to users for some duration of time so they can perform work. Second, it provides a framework for starting, executing, and monitoring work (normally a parallel job) on the set of allocated nodes. Finally, it arbitrates contention for resources by managing a queue of pending work.&amp;#039;&amp;#039;”&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The use of a job scheduling system ensures that Mufasa&amp;#039;s resources are exploited in an efficient way. However, the fact that a schedule exists means that usually a job does not get immediately executed as soon as it is launched: instead, the job gets &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; and will be executed as soon as possible, according to the availability of resources in the machine.&lt;br /&gt;
&lt;br /&gt;
Useful references for SLURM users are the [https://slurm.schedmd.com/man_index.html collected man pages] and the [https://slurm.schedmd.com/pdfs/summary.pdf command overview].&lt;br /&gt;
&lt;br /&gt;
In order to let SLURM schedule job execution, before launching a job a user must specify what resources (such as RAM, processor cores, GPUs, ...) it requires. While managing process queues, SLURM will consider such requirements and match them with the available resources. As a consequence, resource-heavy jobs generally take longer to get executed, while less demanding jobs are usually put into execution quickly. On the other hand, processes that -while running- try to use more resources than they requested get killed by SLURM to avoid damaging other jobs.&lt;br /&gt;
&lt;br /&gt;
All in all, the take-away message is: &amp;#039;&amp;#039;consider carefully how much resources to ask for your job&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
In Part 2 of this document it will be explained how resource requests can be greatly simplified by making use of predefined resource sets called &amp;#039;&amp;#039;SLURM partitions&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Users and groups =&lt;br /&gt;
&lt;br /&gt;
As already explained, only Mufasa users can access the machine and interact with it. Creation of new users is done by Job Administrators or by specially designated users within each research group.&lt;br /&gt;
&lt;br /&gt;
Mufasa usernames have the form &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;xyyy&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; (all lowercase) where &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;x&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is the first letter of the first name and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;yyy&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is the complete surname. For instance, user Mario Rossi will be assigned user name &amp;#039;&amp;#039;mrossi&amp;#039;&amp;#039;. If multiple users with the same surname and first letter of the name exist, those created after the first are given usernames &amp;#039;&amp;#039;xyyy01&amp;#039;&amp;#039;, &amp;#039;&amp;#039;xyyy02&amp;#039;&amp;#039;, and so on.&lt;br /&gt;
&lt;br /&gt;
On Linux machines such as Mufasa, users belong to &amp;#039;&amp;#039;groups&amp;#039;&amp;#039;. On Mufasa, groups are used to identify the research group that a specific user is part of. Assigment of Mufasa&amp;#039;s users to groups follow these rules:&lt;br /&gt;
&lt;br /&gt;
* All users belong to group &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Additionally, each user must belong to &amp;#039;&amp;#039;one and only one&amp;#039;&amp;#039; of the following (within brackets is the name of the faculty who is in charge of Mufasa for each group):&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;nearmrs&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, i.e. [https://nearlab.polimi.it/medical/ Medical Robotics Section of NearLab] (prof. De Momi);&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;nearnes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, i.e. [https://nearlab.polimi.it/neuroengineering/ NeuroEngineering Section of NearLab] (prof. Ferrante);&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;cartcas&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, i.e. [http://www.cartcas.polimi.it/ CartCasLab] (prof. Cerveri);&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;biomech&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, i.e. [http://www.biomech.polimi.it/ Biomechanics Research Group] (prof. Votta);&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;bio&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, for BioEngineering users not belonging to the research groups listed above.&lt;br /&gt;
&lt;br /&gt;
Users who are not Job Administrators but have been given the power to create users can do so with command&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;sudo /opt/share/sbin/add_user.sh -u &amp;amp;lt;user&amp;amp;gt; -g users,&amp;amp;lt;group&amp;amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;#039;&amp;#039;&amp;amp;lt;user&amp;amp;gt;&amp;#039;&amp;#039; is the username of the new user and &amp;#039;&amp;#039;&amp;amp;lt;group&amp;amp;gt;&amp;#039;&amp;#039; is one of the 6 groups from the list above.&lt;br /&gt;
&lt;br /&gt;
For instance, in order to create a user on Mufasa for a person named Mario Rossi belonging to the NeuroEngineering Section of NearLab, the following command will be used:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;sudo /opt/share/sbin/add_user.sh -u mrossi -g users,nearnes&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
New users are created with a predefined password, that they will be asked to change at their first login. For security reason, it is important that such first login occurs as soon as possible.&lt;/div&gt;</summary>
		<author><name>10.79.2.181</name></author>
	</entry>
	<entry>
		<id>https://biohpc.deib.polimi.it/index.php?title=System&amp;diff=71</id>
		<title>System</title>
		<link rel="alternate" type="text/html" href="https://biohpc.deib.polimi.it/index.php?title=System&amp;diff=71"/>
		<updated>2022-01-17T14:23:36Z</updated>

		<summary type="html">&lt;p&gt;10.79.2.181: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mufasa is a Linux server located in a server room managed by the [[Roles|System Administrators]]. [[Roles|Job Users]] and [[Roles|Job Administrators]] can only access Mufasa remotely. &lt;br /&gt;
&lt;br /&gt;
Remote access to Mufasa is performed using the [[System#Accessing Mufasa|SSH protocol]] for the execution of commands and the [[System#File transfer|SFTP protocol]] for the exchange of files. Once logged in, a user interacts with Mufasa via a terminal (text-based) interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware =&lt;br /&gt;
&lt;br /&gt;
Mufasa is a server for massively parallel computation. Its main hardware components are:&lt;br /&gt;
&lt;br /&gt;
* 32-core, 64-thread AMD processor&lt;br /&gt;
* 1 TB RAM&lt;br /&gt;
* 9 TB of SSDs (for OS and execution cache)&lt;br /&gt;
* 28TB of HDDs (for user /home directories)&lt;br /&gt;
* 5 Nvidia A100 GPUs [based on the &amp;#039;&amp;#039;Ampere&amp;#039;&amp;#039; architecture]&lt;br /&gt;
* Linux Ubuntu operating system&lt;br /&gt;
&lt;br /&gt;
Usually each of these resources (e.g., a GPU) is not fully assigned to a single user or a single job. On the contrary, access resources are shared among different users and processes in order to optimise their usage and availability.&lt;br /&gt;
&lt;br /&gt;
For what concerns GPUs, the 5 physical A100 GPUs are subdivided into “virtual” GPUs with different capabilities using Nvidia&amp;#039; MIG system. From [https://docs.nvidia.com/datacenter/tesla/mig-user-guide/ MIG&amp;#039;s user guide]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;“&amp;#039;&amp;#039;The Multi-Instance GPU (MIG) feature allows GPUs based on the NVIDIA Ampere architecture (such as NVIDIA A100) to be securely partitioned into up to seven separate GPU Instances for CUDA applications, providing multiple users with separate GPU resources for optimal GPU utilization. This feature is particularly beneficial for workloads that do not fully saturate the GPU’s compute capacity and therefore users may want to run different workloads in parallel to maximize utilization.&amp;#039;&amp;#039;”&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In practice, MIG allows flexible partitioning of a very powerful (but single) GPU to create multiple virtual GPUs with different capabilities, that are then made available to users as if they were separate devices.&lt;br /&gt;
&lt;br /&gt;
Command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[https://developer.nvidia.com/nvidia-system-management-interface nvidia-smi]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(“smi” stands for System Management Interface) provides an overview of the physical and virtual GPUs available to users in a system&amp;lt;ref&amp;gt;On Mufasa, this command may require to be launched via the SLURM job scheduling system (as explained in Section 2 of this document) in order to be able to access the GPUs.&lt;br /&gt;
&lt;br /&gt;
= Accessing Mufasa =&lt;br /&gt;
&lt;br /&gt;
User access to Mufasa is always remote and exploits the &amp;#039;&amp;#039;SSH&amp;#039;&amp;#039; (&amp;#039;&amp;#039;Secure SHell&amp;#039;&amp;#039;) protocol. &lt;br /&gt;
&lt;br /&gt;
To open a remote connection to Mufasa, open a local terminal on your computer and, in it, run command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
ssh &amp;lt;your_username_on_Mufasa&amp;gt;@&amp;lt;Mufasa&amp;#039;s_IP_address&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;Mufasa&amp;#039;s_IP_address&amp;gt;&amp;lt;/code&amp;gt; is either &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;10.79.23.96&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;10.79.23.97&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
For example, user mrossi may access Mufasa with command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
ssh mrossi@10.79.23.97&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Access via SSH works with Linux, MacOs and Windows 10 (and later) terminals. For Windows users, a handy alternative tool (also including an X server, required to run on Mufasa Linux programs with a graphical user interface) is [https://mobaxterm.mobatek.net/ MobaXterm].&lt;br /&gt;
&lt;br /&gt;
If you don&amp;#039;t have a user account on Mufasa, you first have to ask your supervisor for one. See [[System#Users and groups|Users and groups]] for more information about Mufasa&amp;#039;s users.&lt;br /&gt;
&lt;br /&gt;
As soon as you launch the &amp;#039;&amp;#039;ssh&amp;#039;&amp;#039; command, you will be asked to type the password (i.e., the one of your user account on Mufasa). Once you provide the password, the local terminal on your computer becomes a remote terminal (a “remote shell”) through which you interact with Mufasa. The remote shell sports a &amp;#039;&amp;#039;command prompt&amp;#039;&amp;#039; such as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;your_username_on_Mufasa&amp;gt;@rk018445:~$&lt;br /&gt;
&lt;br /&gt;
(&amp;#039;&amp;#039;rk018445&amp;#039;&amp;#039; is the Linux hostname of Mufasa). For instance, user mrossi will see a prompt similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
mrossi@rk018445:~$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the remote shell, you can issue commands to Mufasa by typing them after the prompt, then pressing the &amp;#039;&amp;#039;enter&amp;#039;&amp;#039; key. Being Mufasa a Linux server, it will respond to all the standard Linux system commands such as &amp;lt;code&amp;gt;pwd&amp;lt;/code&amp;gt; (which prints the path to the current directory) or &amp;lt;code&amp;gt;cd &amp;lt;destination_dir&amp;gt;&amp;lt;/code&amp;gt; (which changes the current directory). On the internet you can find many tutorials about the Linux command line, such as [https://linuxcommand.org/index.php this one].&lt;br /&gt;
&lt;br /&gt;
To close the SSH session run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the command prompt of the remote shell.&lt;br /&gt;
&lt;br /&gt;
== VPN ==&lt;br /&gt;
To be able to connect to Mufasa, your computer must belong to Polimi&amp;#039;s LAN. This happens either because the computer is physically located at Politecnico di Milano and connected via ethernet, or because you are using Polimi&amp;#039;s VPN to connect to its LAN from somewhere else (such as your home). In particular, using the VPN is the &amp;#039;&amp;#039;only&amp;#039;&amp;#039; way to use Mufasa from outside Polimi. See [https://intranet.deib.polimi.it/ita/vpn-wifi this DEIB webpage] for instructions about how to activate VPN access.&lt;br /&gt;
&lt;br /&gt;
== Timeout ==&lt;br /&gt;
&lt;br /&gt;
SSH sessions to Mufasa may be subjected to an inactivity timeout: i.e., after a given inactivity period the ssh session gets automatically closed. Users who need to be able to reconnect to the very same shell where they launched a program (for instance because their program is interactive or because it provides progress update messages) should use the &amp;#039;&amp;#039;screen&amp;#039;&amp;#039; command, as explained in [[User Jobs#Using screen with srun]].&lt;br /&gt;
&lt;br /&gt;
== Using SSH with graphics ==&lt;br /&gt;
&lt;br /&gt;
The standard form of the &amp;#039;&amp;#039;ssh&amp;#039;&amp;#039; command, i.e. the one described above, should always be preferred. However, it only allows text communication with Mufasa. In special cases it may be necessary to remotely run (on Mufasa) Linux programs that have a graphical user interface. These programs require interaction with the X server of the remote user&amp;#039;s machine (which must use Linux as well). A special mode of operation of &amp;#039;&amp;#039;ssh&amp;#039;&amp;#039; is needed to enable this. This mode is engaged by running &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ssh -X &amp;lt;your username on Mufasa&amp;gt;@&amp;lt;Mufasa&amp;#039;s IP address&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= File transfer =&lt;br /&gt;
&lt;br /&gt;
Uploading files from local machine to Mufasa and downloading files from Mufasa onto local machines is done using the &amp;#039;&amp;#039;SFTP&amp;#039;&amp;#039; protocol (&amp;#039;&amp;#039;Secure File Transfer Protocol&amp;#039;&amp;#039;). &lt;br /&gt;
&lt;br /&gt;
Linux and MacOS users can directly use the &amp;#039;&amp;#039;sftp&amp;#039;&amp;#039; package, as explained (for instance) by [https://geekflare.com/sftp-command-examples/ this guide]. Windows users can interact with Mufasa via SFTP protocol using the [https://mobaxterm.mobatek.net/ MobaXterm] software package.&lt;br /&gt;
&lt;br /&gt;
For Linux and MacOS user, file transfer to/from Mufasa occurs via an &amp;#039;&amp;#039;interactive sftp shell&amp;#039;&amp;#039;, i.e. a remote shell very similar to the one one described in [[Accessing Mufasa|Accessing Mufasa]]. &lt;br /&gt;
The first thing to do is to open a terminal and run the following command (note the similarity to SSH connections):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sftp &amp;lt;your_username_on_Mufasa&amp;gt;@&amp;lt;Mufasa&amp;#039;s_IP_address&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;Mufasa&amp;#039;s_IP_address&amp;gt;&amp;lt;/code&amp;gt; is either &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;10.79.23.96&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;10.79.23.97&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked your password. Once you provide it, you access an interactive sftp shell, where the command prompt takes the form&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: silver; background: black;&amp;quot;&amp;gt;&lt;br /&gt;
sftp&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this shell you can run the commands to exchange files. Most of these commands have two forms: one to act on the remote machine (in this case, Mufasa) and one to act on the local machine (i.e. your own computer). To differentiate, the “local” versions usually have names that start with the letter “l” (lowercase L). &lt;br /&gt;
&lt;br /&gt;
MacOS users can interact with Mufasa via SFTP also using the [https://cyberduck.io/ Cyberduck] software package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The most basic &amp;#039;&amp;#039;sftp&amp;#039;&amp;#039; commands (to be issued from the sftp command prompt) are:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;cd &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;amp;lt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;path&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Change directory to &amp;amp;lt;path&amp;amp;gt; on remote machine (i.e. Mufasa)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;lcd &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;amp;lt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;path&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Change directory to &amp;amp;lt;path&amp;amp;gt; on local machine (i.e. user&amp;#039;s machine)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;get &amp;amp;lt;file&amp;amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Downloads (i.e. copies) &amp;amp;lt;file&amp;amp;gt; from current directory of remote&amp;lt;br /&amp;gt;&lt;br /&gt;
machine tocurrent directory of local machine&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;put &amp;amp;lt;file&amp;amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Uploads (i.e. copies) &amp;amp;lt;file&amp;amp;gt; from current directory of local machine to&amp;lt;br /&amp;gt;&lt;br /&gt;
current directory of remote machine&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;exit&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Quit sftp&lt;br /&gt;
&lt;br /&gt;
Of course, a user can only upload files to directories where they have write permission (usually only their own /home directory and its subdirectories), and can only download files that they have read permission.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Docker containers =&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;As a general rule, all computation performed on Mufasa must occur within &amp;#039;&amp;#039;&amp;#039;[https://www.docker.com/ &amp;#039;&amp;#039;&amp;#039;Docker containers&amp;#039;&amp;#039;&amp;#039;]. This allows every user to configure their own execution environment without any risk of interfering with everyone else&amp;#039;s.&lt;br /&gt;
&lt;br /&gt;
From [https://docs.docker.com/get-started/ Docker&amp;#039;s documentation]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;“&amp;#039;&amp;#039;Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Docker provides the ability to package and run an application in a loosely isolated environment called a container. The isolation and security allow you to run many containers simultaneously on a given host. Containers are lightweight and contain everything needed to run the application, so you do not need to rely on what is currently installed on the host.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;#039;&amp;#039;A container is a sandboxed process on your machine that is isolated from all other processes on the host machine. When running a container, it uses an isolated filesystem. [containing] everything needed to run an application - all dependencies, configuration, scripts, binaries, etc. The image also contains other configuration for the container, such as environment variables, a default command to run, and other metadata.&amp;#039;&amp;#039;”&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Using Docker allows each user of Mufasa to build the software environment that their job(s) require. In particular, using Docker containers enables users to configure their own (containerized) system and install any required libraries on their own, without need to ask administrators to modify the configuration of Mufasa. As a consequence, users can freely experiment with their (containerized) system without risk to the work of other users and to the stability and reliability of Mufasa. In particular, containers allow users to run jobs that require multiple and/or obsolete versions of the same library.&lt;br /&gt;
&lt;br /&gt;
A large number of preconfigured Docker containers are already available, so users do not usually need to start from scratch in preparing the environment where their jobs will run on Mufasa. The official Docker container repository is [https://hub.docker.com/search?q=&amp;amp;type=image dockerhub].&lt;br /&gt;
&lt;br /&gt;
How to run Docker containers on Mufasa will be explained in Part 2 of this document.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span id=&amp;quot;anchor-6&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;The SLURM job scheduling system ==&lt;br /&gt;
&lt;br /&gt;
Mufasa uses [https://slurm.schedmd.com/overview.html SLURM] to manage shared access to its resources. &amp;#039;&amp;#039;&amp;#039;Users of Mufasa must use SLURM to run and manage the jobs they run on the machine&amp;#039;&amp;#039;&amp;#039;&amp;lt;ref&amp;gt;It is possible for users to run jobs without using SLURM; however, running jobs run this way is only intended for “housekeeping” activities and only provides access to a small subset of Mufasa&amp;#039;s resources. For instance, jobs run outside SLURM cannot access the GPUs, can only use a few processor cores, can only access a small portion of RAM. Using SLURM is therefore necessary for any resource-intensive job.&lt;br /&gt;
&amp;lt;/ref&amp;gt;. From [https://slurm.schedmd.com/documentation.html SLURM&amp;#039;s documentation]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;“&amp;#039;&amp;#039;Slurm is an open source, fault-tolerant, and highly scalable cluster management and job scheduling system for large and small Linux clusters. Slurm has three key functions. First, it allocates exclusive and/or non-exclusive access to resources (compute nodes) to users for some duration of time so they can perform work. Second, it provides a framework for starting, executing, and monitoring work (normally a parallel job) on the set of allocated nodes. Finally, it arbitrates contention for resources by managing a queue of pending work.&amp;#039;&amp;#039;”&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The use of a job scheduling system ensures that Mufasa&amp;#039;s resources are exploited in an efficient way. However, the fact that a schedule exists means that usually a job does not get immediately executed as soon as it is launched: instead, the job gets &amp;#039;&amp;#039;queued&amp;#039;&amp;#039; and will be executed as soon as possible, according to the availability of resources in the machine.&lt;br /&gt;
&lt;br /&gt;
Useful references for SLURM users are the [https://slurm.schedmd.com/man_index.html collected man pages] and the [https://slurm.schedmd.com/pdfs/summary.pdf command overview].&lt;br /&gt;
&lt;br /&gt;
In order to let SLURM schedule job execution, before launching a job a user must specify what resources (such as RAM, processor cores, GPUs, ...) it requires. While managing process queues, SLURM will consider such requirements and match them with the available resources. As a consequence, resource-heavy jobs generally take longer to get executed, while less demanding jobs are usually put into execution quickly. On the other hand, processes that -while running- try to use more resources than they requested get killed by SLURM to avoid damaging other jobs.&lt;br /&gt;
&lt;br /&gt;
All in all, the take-away message is: &amp;#039;&amp;#039;consider carefully how much resources to ask for your job&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
In Part 2 of this document it will be explained how resource requests can be greatly simplified by making use of predefined resource sets called &amp;#039;&amp;#039;SLURM partitions&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Users and groups =&lt;br /&gt;
&lt;br /&gt;
As already explained, only Mufasa users can access the machine and interact with it. Creation of new users is done by Job Administrators or by specially designated users within each research group.&lt;br /&gt;
&lt;br /&gt;
Mufasa usernames have the form &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;xyyy&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; (all lowercase) where &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;x&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is the first letter of the first name and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;yyy&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is the complete surname. For instance, user Mario Rossi will be assigned user name &amp;#039;&amp;#039;mrossi&amp;#039;&amp;#039;. If multiple users with the same surname and first letter of the name exist, those created after the first are given usernames &amp;#039;&amp;#039;xyyy01&amp;#039;&amp;#039;, &amp;#039;&amp;#039;xyyy02&amp;#039;&amp;#039;, and so on.&lt;br /&gt;
&lt;br /&gt;
On Linux machines such as Mufasa, users belong to &amp;#039;&amp;#039;groups&amp;#039;&amp;#039;. On Mufasa, groups are used to identify the research group that a specific user is part of. Assigment of Mufasa&amp;#039;s users to groups follow these rules:&lt;br /&gt;
&lt;br /&gt;
* All users belong to group &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;users&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Additionally, each user must belong to &amp;#039;&amp;#039;one and only one&amp;#039;&amp;#039; of the following (within brackets is the name of the faculty who is in charge of Mufasa for each group):&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;nearmrs&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, i.e. [https://nearlab.polimi.it/medical/ Medical Robotics Section of NearLab] (prof. De Momi);&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;nearnes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, i.e. [https://nearlab.polimi.it/neuroengineering/ NeuroEngineering Section of NearLab] (prof. Ferrante);&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;cartcas&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, i.e. [http://www.cartcas.polimi.it/ CartCasLab] (prof. Cerveri);&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;biomech&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, i.e. [http://www.biomech.polimi.it/ Biomechanics Research Group] (prof. Votta);&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;bio&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, for BioEngineering users not belonging to the research groups listed above.&lt;br /&gt;
&lt;br /&gt;
Users who are not Job Administrators but have been given the power to create users can do so with command&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;sudo /opt/share/sbin/add_user.sh -u &amp;amp;lt;user&amp;amp;gt; -g users,&amp;amp;lt;group&amp;amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;#039;&amp;#039;&amp;amp;lt;user&amp;amp;gt;&amp;#039;&amp;#039; is the username of the new user and &amp;#039;&amp;#039;&amp;amp;lt;group&amp;amp;gt;&amp;#039;&amp;#039; is one of the 6 groups from the list above.&lt;br /&gt;
&lt;br /&gt;
For instance, in order to create a user on Mufasa for a person named Mario Rossi belonging to the NeuroEngineering Section of NearLab, the following command will be used:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;sudo /opt/share/sbin/add_user.sh -u mrossi -g users,nearnes&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
New users are created with a predefined password, that they will be asked to change at their first login. For security reason, it is important that such first login occurs as soon as possible.&lt;/div&gt;</summary>
		<author><name>10.79.2.181</name></author>
	</entry>
</feed>