<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.anunna.wur.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dawes001</id>
	<title>HPCwiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.anunna.wur.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dawes001"/>
	<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/Special:Contributions/Dawes001"/>
	<updated>2026-06-18T08:47:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Main_Page&amp;diff=2166</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Main_Page&amp;diff=2166"/>
		<updated>2022-06-02T13:44:51Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* Events */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Anunna is a [http://en.wikipedia.org/wiki/High-performance_computing High Performance Computer] (HPC) infrastructure hosted by [http://www.wageningenur.nl/nl/activiteit/Opening-High-Performance-Computing-cluster-HPC.htm Wageningen University &amp;amp; Research Centre]. It is open for use for all WUR research groups as well as other organizations, including companies, that have collaborative projects with WUR. &lt;br /&gt;
&lt;br /&gt;
= Using Anunna =&lt;br /&gt;
* [[Tariffs | Costs associated with resource usage]]&lt;br /&gt;
&lt;br /&gt;
== Gaining access to Anunna==&lt;br /&gt;
Access to the cluster and file transfer are traditionally done via [http://en.wikipedia.org/wiki/Secure_Shell SSH and SFTP].&lt;br /&gt;
* [[log_in_to_B4F_cluster | Logging into cluster using ssh]]&lt;br /&gt;
* [[file_transfer | File transfer options]]&lt;br /&gt;
* [[Services | Alternative access methods, and extra features and services on Anunna]]&lt;br /&gt;
* [[Filesystems | Data storage methods on Anunna]]&lt;br /&gt;
&lt;br /&gt;
== Access Policy ==&lt;br /&gt;
[[Access_Policy | Main Article: Access Policy]]&lt;br /&gt;
&lt;br /&gt;
Access needs to be granted actively (by creation of an account on the cluster by FB-IT). Use of resources is limited by the scheduler. Depending on availability of queues (&#039;partitions&#039;) granted to a user, priority to the system&#039;s resources is regulated. Note that the use of Anunna is not free of charge. List price of CPU time and storage, and possible discounts on that list price for your organisation, can be retrieved from Shared Research Facilities or FB-IT.&lt;br /&gt;
&lt;br /&gt;
= Events =&lt;br /&gt;
* Upcoming courses on 23rd + 30th June!&lt;br /&gt;
&lt;br /&gt;
* Linux Basic - 23rd June&lt;br /&gt;
&lt;br /&gt;
* HPC Basic - 30th June&lt;br /&gt;
&lt;br /&gt;
* [[Courses]] that have happened and are happening&lt;br /&gt;
* [[Downtime]] that will affect all users&lt;br /&gt;
* [[Meetings]] that may affect the policies of Anunna&lt;br /&gt;
&lt;br /&gt;
= Other Software =&lt;br /&gt;
&lt;br /&gt;
== Cluster Management Software and Scheduler ==&lt;br /&gt;
Anunna uses Bright Cluster Manager software for overall cluster management, and Slurm as job scheduler.&lt;br /&gt;
* [[BCM_on_B4F_cluster | Monitor cluster status with BCM]]&lt;br /&gt;
* [[Using_Slurm | Submit jobs with Slurm]]&lt;br /&gt;
* [[node_usage_graph | Be aware of how much work the cluster is under right now with &#039;node_usage_graph&#039;]]&lt;br /&gt;
* [[SLURM_Compare | Rosetta Stone of Workload Managers]]&lt;br /&gt;
&lt;br /&gt;
== Installation of software by users ==&lt;br /&gt;
&lt;br /&gt;
* [[Domain_specific_software_on_B4Fcluster_installation_by_users | Installing domain specific software: installation by users]]&lt;br /&gt;
* [[Setting local variables]]&lt;br /&gt;
* [[Installing_R_packages_locally | Installing R packages locally]]&lt;br /&gt;
* [[Setting_up_Python_virtualenv | Setting up and using a virtual environment for Python3 ]]&lt;br /&gt;
* [[Virtual_environment_Python_3.4_or_higher | Setting up and using a virtual environment for Python3.4 or higher ]]&lt;br /&gt;
* [[Installing WRF and WPS]]&lt;br /&gt;
* [[Running scripts on a fixed timeschedule (cron)]]&lt;br /&gt;
&lt;br /&gt;
== Installed software ==&lt;br /&gt;
&lt;br /&gt;
* [[Globally_installed_software | Globally installed software]]&lt;br /&gt;
* [[ABGC_modules | ABGC specific modules]]&lt;br /&gt;
&lt;br /&gt;
= Useful Notes = &lt;br /&gt;
&lt;br /&gt;
== Being in control of Environment parameters ==&lt;br /&gt;
&lt;br /&gt;
* [[Using_environment_modules | Using environment modules]]&lt;br /&gt;
* [[Setting local variables]]&lt;br /&gt;
* [[Setting_TMPDIR | Set a custom temporary directory location]]&lt;br /&gt;
* [[Installing_R_packages_locally | Installing R packages locally]]&lt;br /&gt;
* [[Setting_up_Python_virtualenv | Setting up and using a virtual environment for Python3 ]]&lt;br /&gt;
&lt;br /&gt;
== Controlling costs ==&lt;br /&gt;
&lt;br /&gt;
* [[SACCT | using SACCT to see your costs]]&lt;br /&gt;
* [[get_my_bill | using the &amp;quot;get_my_bill&amp;quot; script to estimate costs]]&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
Product Owner of Anunna is Alexander van Ittersum (Wageningen UR,FB-IT, C&amp;amp;PS). [[User:dawes001 | Gwen Dawes (Wageningen UR, FB-IT, C&amp;amp;PS)]] and [[User:haars001 | Jan van Haarst (Wageningen UR,FB-IT, C&amp;amp;PS)]] are responsible for [[Maintenance_and_Management | Maintenance and Management]] of the cluster.&lt;br /&gt;
&lt;br /&gt;
* [[Roadmap | Ambitions regarding innovation, support and administration of Anunna ]]&lt;br /&gt;
&lt;br /&gt;
= Miscellaneous =&lt;br /&gt;
* [[Mailinglist | Electronic mail discussion lists]]&lt;br /&gt;
* [[History_of_the_Cluster | Historical information on the startup of Anunna]]&lt;br /&gt;
* [[Bioinformatics_tips_tricks_workflows | Bioinformatics tips, tricks, and workflows]]&lt;br /&gt;
* [[Parallel_R_code_on_SLURM | Running parallel R code on SLURM]]&lt;br /&gt;
* [[Convert_between_MediaWiki_and_other_formats | Convert between MediaWiki format and other formats]]&lt;br /&gt;
* [[Manual GitLab | GitLab: Create projects and add scripts]]&lt;br /&gt;
* [[Monitoring_executions | Monitoring job execution]]&lt;br /&gt;
* [[Shared_folders | Working with shared folders in the Lustre file system]]&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* [[Maintenance_and_Management | Maintenance and Management]]&lt;br /&gt;
* [[BCData | BCData]]&lt;br /&gt;
* [[Mailinglist | Electronic mail discussion lists]]&lt;br /&gt;
* [[About_ABGC | About ABGC]]&lt;br /&gt;
* [[Computer_cluster | High Performance Computing @ABGC]]&lt;br /&gt;
* [[Lustre_PFS_layout | Lustre Parallel File System layout]]&lt;br /&gt;
&lt;br /&gt;
= External links =&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; |&lt;br /&gt;
* [https://www.wur.nl/en/Value-Creation-Cooperation/Facilities/Wageningen-Shared-Research-Facilities/Our-facilities/Show/High-Performance-Computing-Cluster-HPC-Anunna.htm SRF offers a HPC facilty]&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; |&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Scientific_Linux Scientific Linux]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Help:Cheatsheet Help with editing Wiki pages]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Spark&amp;diff=2089</id>
		<title>Spark</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Spark&amp;diff=2089"/>
		<updated>2020-10-05T12:23:46Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* SPARK in Jupyter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Apache Spark is a means of distributing compute resources across multiple worker machines. It is the successor to Hadoop, and allows for a wider distribution of code to be executed on the clustered resources. The only requirement for Spark to be able to operate is that each worker must be able to reach each other via TCP, thus it allows for compute to be executed on very simple resources, if the code itself can be translated into the MapReduce paradigm.&lt;br /&gt;
&lt;br /&gt;
== SPARK on HPC ==&lt;br /&gt;
In order to create a personal SPARK cluster, you must first request resources on the HPC. Use this example submission script to initialise your cluster:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#!/bin/bash&lt;br /&gt;
#SBATCH --time=&amp;lt;length&amp;gt;&lt;br /&gt;
#SBATCH --mem-per-cpu=4000&lt;br /&gt;
#SBATCH --nodes=&amp;lt;number of nodes&amp;gt;&lt;br /&gt;
#SBATCH --tasks-per-node=&amp;lt;number of workers per node&amp;gt;&lt;br /&gt;
#SBATCH --job-name=&amp;quot;my spark cluster&amp;quot;&lt;br /&gt;
#SBATCH --qos=QOS&lt;br /&gt;
&lt;br /&gt;
module load spark/3.0.1-2.7&lt;br /&gt;
module load python/3.8.5&lt;br /&gt;
&lt;br /&gt;
source $SPARK_HOME/wur/start-spark&lt;br /&gt;
&lt;br /&gt;
tail -f /dev/null&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will spawn a new cluster of your desired dimensions once resources are available. This spark module has been written to output its logs to your home directory, at:&lt;br /&gt;
&lt;br /&gt;
/home/WUR/yourid/.spark/&amp;lt;jobid&amp;gt;/&lt;br /&gt;
&lt;br /&gt;
In this folder you will find the raw logs of the master and all worker threads. By default the master will consume 1Gb of memory from the first process, and so a single 4Gb &#039;cluster&#039; will be provided with one 3Gb worker. You can adjust the CPU/memory use by adjusting the parameters in your batch script.&lt;br /&gt;
&lt;br /&gt;
Within the log file you will find two unique files: master, and master-console. master will always contain the URI of the current spark cluster master access point, and master-console the URL of the console of it. &lt;br /&gt;
&lt;br /&gt;
To access the web console, the easiest solution is to use links:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;links http://myspark:8081&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will nicely render the page for you in the console. Ctrl-R reloads the page, q to quit.&lt;br /&gt;
&lt;br /&gt;
There are several caveats to remember with this:&lt;br /&gt;
&lt;br /&gt;
* The cluster exists (and consumes resources) until you cancel it with scancel &amp;lt;jobid&amp;gt;&lt;br /&gt;
* There is no security at all - any user of the HPC can access both these at any point if they know the port and host.&lt;br /&gt;
&lt;br /&gt;
== Instant SPARK ==&lt;br /&gt;
&lt;br /&gt;
You can also spin up clusters solely to execute scripts. Simply replace the last line from the example above:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;tail -f /dev/null&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
with&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;spark-submit myscript.py&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And after the script has executed, the cluster will automatically terminate.&lt;br /&gt;
&lt;br /&gt;
== SPARK in Jupyter ==&lt;br /&gt;
&lt;br /&gt;
There is a kernel available for using Spark from Jupyter. All this does is to set up the correct path to the python version and the spark binaries for you. In order to set up your Context, your first cell for each notebook should be:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;import os, pyspark&lt;br /&gt;
with open(os.environ[&#039;HOME&#039;]+&#039;/.spark/current/master&#039;) as f:&lt;br /&gt;
    conf = (pyspark.SparkConf()&lt;br /&gt;
         .setMaster(f.read().strip()))&lt;br /&gt;
         .setAppName(&amp;quot;MyName&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
sc = pyspark.SparkContext(conf=conf)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the cluster master name from the master file in your job output as above. Subsequent cells will then have sc defined. Run this cell only once - attempting to reconnect will throw an error. That application will run until the kernel is terminated and prevent other applications from being able to be executed - you may wish to manually terminate your kernel from the top bar in Jupyter to free resources.&lt;br /&gt;
&lt;br /&gt;
As a teacher, you might want to put that master file somewhere else, such as /lustre/shared, so that students can connect to your cluster.&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Spark&amp;diff=2088</id>
		<title>Spark</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Spark&amp;diff=2088"/>
		<updated>2020-10-05T12:21:30Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* SPARK on HPC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Apache Spark is a means of distributing compute resources across multiple worker machines. It is the successor to Hadoop, and allows for a wider distribution of code to be executed on the clustered resources. The only requirement for Spark to be able to operate is that each worker must be able to reach each other via TCP, thus it allows for compute to be executed on very simple resources, if the code itself can be translated into the MapReduce paradigm.&lt;br /&gt;
&lt;br /&gt;
== SPARK on HPC ==&lt;br /&gt;
In order to create a personal SPARK cluster, you must first request resources on the HPC. Use this example submission script to initialise your cluster:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#!/bin/bash&lt;br /&gt;
#SBATCH --time=&amp;lt;length&amp;gt;&lt;br /&gt;
#SBATCH --mem-per-cpu=4000&lt;br /&gt;
#SBATCH --nodes=&amp;lt;number of nodes&amp;gt;&lt;br /&gt;
#SBATCH --tasks-per-node=&amp;lt;number of workers per node&amp;gt;&lt;br /&gt;
#SBATCH --job-name=&amp;quot;my spark cluster&amp;quot;&lt;br /&gt;
#SBATCH --qos=QOS&lt;br /&gt;
&lt;br /&gt;
module load spark/3.0.1-2.7&lt;br /&gt;
module load python/3.8.5&lt;br /&gt;
&lt;br /&gt;
source $SPARK_HOME/wur/start-spark&lt;br /&gt;
&lt;br /&gt;
tail -f /dev/null&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will spawn a new cluster of your desired dimensions once resources are available. This spark module has been written to output its logs to your home directory, at:&lt;br /&gt;
&lt;br /&gt;
/home/WUR/yourid/.spark/&amp;lt;jobid&amp;gt;/&lt;br /&gt;
&lt;br /&gt;
In this folder you will find the raw logs of the master and all worker threads. By default the master will consume 1Gb of memory from the first process, and so a single 4Gb &#039;cluster&#039; will be provided with one 3Gb worker. You can adjust the CPU/memory use by adjusting the parameters in your batch script.&lt;br /&gt;
&lt;br /&gt;
Within the log file you will find two unique files: master, and master-console. master will always contain the URI of the current spark cluster master access point, and master-console the URL of the console of it. &lt;br /&gt;
&lt;br /&gt;
To access the web console, the easiest solution is to use links:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;links http://myspark:8081&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will nicely render the page for you in the console. Ctrl-R reloads the page, q to quit.&lt;br /&gt;
&lt;br /&gt;
There are several caveats to remember with this:&lt;br /&gt;
&lt;br /&gt;
* The cluster exists (and consumes resources) until you cancel it with scancel &amp;lt;jobid&amp;gt;&lt;br /&gt;
* There is no security at all - any user of the HPC can access both these at any point if they know the port and host.&lt;br /&gt;
&lt;br /&gt;
== Instant SPARK ==&lt;br /&gt;
&lt;br /&gt;
You can also spin up clusters solely to execute scripts. Simply replace the last line from the example above:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;tail -f /dev/null&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
with&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;spark-submit myscript.py&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And after the script has executed, the cluster will automatically terminate.&lt;br /&gt;
&lt;br /&gt;
== SPARK in Jupyter ==&lt;br /&gt;
&lt;br /&gt;
There is a kernel available for using Spark from Jupyter. All this does (for now) is to set up the correct path to the python version and the spark binaries for you. In order to set up your Context, your first cell for each notebook should be:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;import pyspark&lt;br /&gt;
conf = (pyspark.SparkConf()&lt;br /&gt;
         .setMaster(&amp;quot;spark://mysparkcluster:7077&amp;quot;)&lt;br /&gt;
         .setAppName(&amp;quot;MyName&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
sc = pyspark.SparkContext(conf=conf)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the cluster master name from the master file in your job output as above. Subsequent cells will then have sc defined. Run this cell only once - attempting to reconnect will throw an error. That application will run until the kernel is terminated and prevent other applications from being able to be executed - you may wish to manually terminate your kernel from the top bar in Jupyter to free resources.&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Conda_for_teaching&amp;diff=2077</id>
		<title>Conda for teaching</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Conda_for_teaching&amp;diff=2077"/>
		<updated>2020-05-27T09:03:03Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You are going to give a teaching course, and you need a specific code environment.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
First - find a good location that everyone can read (and not write). I&#039;d suggest somewhere under &amp;lt;code&amp;gt;/cm/shared/apps/SHARED/&amp;lt;/code&amp;gt; as a starting point - this allows everyone to access this location. It&#039;s important not to put anything secret there - it&#039;s a public resource, so please bear that in mind.&lt;br /&gt;
&lt;br /&gt;
Next - create a folder for your environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
mkdir /cm/shared/apps/SHARED/my_conda_env&lt;br /&gt;
chmod +r /cm/shared/apps/SHARED/my_conda_env&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You may want to manipulate the permissions for this folder if someone is going to set this up with you. Consider the commands in [[Shared folders]].&lt;br /&gt;
&lt;br /&gt;
Then, install Anaconda into it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
wget https://repo.anaconda.com/archive/Anaconda3-YEAR.MONTH-Linux-x86_64.sh&lt;br /&gt;
./Anaconda3-YEAR.MONTH-Linux-x86_64.sh -s -b -p /cm/shared/apps/SHARED/my_conda_env &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have a working conda environment in this folder. You can manipulate this here by running &amp;lt;code&amp;gt;/cm/shared/apps/SHARED/my_conda_env/bin/conda&amp;lt;/code&amp;gt;, or, I would recommend creating a modulefile so that you can use it as default.&lt;br /&gt;
&lt;br /&gt;
Create the following example modulefile in a matching &amp;lt;code&amp;gt;/cm/shared/modulefiles/SHARED/my_conda_env&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#%Module -*- tcl -*-&lt;br /&gt;
##&lt;br /&gt;
## conda environment modulefile&lt;br /&gt;
##&lt;br /&gt;
&lt;br /&gt;
set                     loadedmodules           [split $::env(LOADEDMODULES) &amp;quot;:&amp;quot;]&lt;br /&gt;
set                     modulepath              [split $ModulesCurrentModulefile &amp;quot;/&amp;quot;]&lt;br /&gt;
set                     envpath                 [lrange $modulepath 4 end]&lt;br /&gt;
&lt;br /&gt;
set                     root                    /cm/shared/apps/[join $envpath &amp;quot;/&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
proc ModulesHelp { } {&lt;br /&gt;
        global version&lt;br /&gt;
&lt;br /&gt;
        puts stderr &amp;quot;\tThis module provides the conda environment at $envpath&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if { [module-info mode] != &amp;quot;whatis&amp;quot; } {&lt;br /&gt;
        puts stderr &amp;quot;[module-info mode] environent $envpath .&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
module-whatis   &amp;quot;Provides environment $envpath&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
prepend-path            PATH                    $root/bin&lt;br /&gt;
prepend-path            LD_LIBRARY_PATH         $root/lib&lt;br /&gt;
prepend-path            LIBRARY_PATH            $root/lib&lt;br /&gt;
prepend-path            CPATH                   $root/include&lt;br /&gt;
prepend-path            MANPATH                 $root/share/man&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow you to &amp;lt;code&amp;gt;module load SHARED/my_conda_env&amp;lt;/code&amp;gt; and thus have &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; pathed to the currently active environment.&lt;br /&gt;
&lt;br /&gt;
== Jupyter Kernel ==&lt;br /&gt;
&lt;br /&gt;
In order for students to be able to use this environment in jupyter, they will need a kernel definition.&lt;br /&gt;
&lt;br /&gt;
Kernel definitions are usually a separate folder containing, in particular, a file called &amp;lt;code&amp;gt;kernel.json&amp;lt;/code&amp;gt;, plus an icon that is displayed that represents this kernel, and other helper code.&lt;br /&gt;
&lt;br /&gt;
The setup for this is that you should create the following folder for their access:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
mkdir -p /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env&lt;br /&gt;
chmod +r /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This folder is something they will need to copy in place to their home directory, specifically &amp;lt;code&amp;gt;$HOME/.local/share/jupyter/kernels/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inside this folder, create the following &amp;lt;code&amp;gt;kernel.json&amp;lt;/code&amp;gt; file. Watch out that the paths will need to match the current environment path if you&#039;re using a different location!&lt;br /&gt;
&lt;br /&gt;
=== Python Kernel ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
vim /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env/kernel.json&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;env&amp;quot;: {&lt;br /&gt;
   &amp;quot;PATH&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;/cm/shared/apps/SHARED/my_conda_env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
 &amp;quot;language&amp;quot;: &amp;quot;python&amp;quot;,&lt;br /&gt;
 &amp;quot;argv&amp;quot;: [&lt;br /&gt;
  &amp;quot;/cm/shared/apps/SHARED/my_conda_env/bin/python&amp;quot;,&lt;br /&gt;
  &amp;quot;-m&amp;quot;,&lt;br /&gt;
  &amp;quot;ipykernel&amp;quot;,&lt;br /&gt;
  &amp;quot;-f&amp;quot;,&lt;br /&gt;
  &amp;quot;{connection_file}&amp;quot;&lt;br /&gt;
 ],&lt;br /&gt;
 &amp;quot;display_name&amp;quot;: &amp;quot;my_conda_env&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Python, that&#039;s it. Ipykernel is installed automatically on conda initialisation.&lt;br /&gt;
&lt;br /&gt;
=== R Kernel ===&lt;br /&gt;
&lt;br /&gt;
For an R kernel, you need to make sure that the IRkernel package is installed. This is the package that is used to communicate from Jupyter to your running R kernel.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#MISSING EXAMPLE CODE&lt;br /&gt;
#PROBABLY /cm/shared/apps/SHARED/my_conda_env/bin/conda install R_irkernel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to create two files: &amp;lt;code&amp;gt;kernel.json&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;kernel.js&amp;lt;/code&amp;gt;. the &amp;lt;code&amp;gt;kernel.js&amp;lt;/code&amp;gt; is a helper script to allow jupyter to communicate to R effectively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
vim /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env/kernel.json&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;env&amp;quot;: {&lt;br /&gt;
   &amp;quot;LD_LIBRARY_PATH&amp;quot;:&lt;br /&gt;
      &amp;quot;/cm/shared/apps/SHARED/my_conda_env/lib:/cm/shared/apps/SHARED/my_conda_env/lib64&amp;quot;&lt;br /&gt;
 },&lt;br /&gt;
  &amp;quot;argv&amp;quot;: [&amp;quot;/cm/shared/apps/SHARED/my_conda_env/bin/R&amp;quot;, &amp;quot;--slave&amp;quot;, &amp;quot;-e&amp;quot;, &amp;quot;IRkernel::main()&amp;quot;, &amp;quot;--args&amp;quot;, &amp;quot;{connection_file}&amp;quot;],&lt;br /&gt;
  &amp;quot;display_name&amp;quot;: &amp;quot;MAE50806-AdvMolEcol/Sandbox_R&amp;quot;,&lt;br /&gt;
  &amp;quot;language&amp;quot;: &amp;quot;R&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
vim /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env/kernel.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
const cmd_key = /Mac/.test(navigator.platform) ? &#039;Cmd&#039; : &#039;Ctrl&#039;&lt;br /&gt;
&lt;br /&gt;
const edit_actions = [&lt;br /&gt;
	{&lt;br /&gt;
		name: &#039;R Assign&#039;,&lt;br /&gt;
		shortcut: &#039;Alt--&#039;,&lt;br /&gt;
		icon: &#039;fa-long-arrow-left&#039;,&lt;br /&gt;
		help: &#039;R: Inserts the left-assign operator (&amp;lt;-)&#039;,&lt;br /&gt;
		handler(cm) {&lt;br /&gt;
			cm.replaceSelection(&#039; &amp;lt;- &#039;)&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		name: &#039;R Pipe&#039;,&lt;br /&gt;
		shortcut: `Shift-${cmd_key}-M`,&lt;br /&gt;
		icon: &#039;fa-angle-right&#039;,&lt;br /&gt;
		help: &#039;R: Inserts the magrittr pipe operator (%&amp;gt;%)&#039;,&lt;br /&gt;
		handler(cm) {&lt;br /&gt;
			cm.replaceSelection(&#039; %&amp;gt;% &#039;)&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		name: &#039;R Help&#039;,&lt;br /&gt;
		shortcut: &#039;F1&#039;,&lt;br /&gt;
		icon: &#039;fa-book&#039;,&lt;br /&gt;
		help: &#039;R: Shows the manpage for the item under the cursor&#039;,&lt;br /&gt;
		handler(cm, cell) {&lt;br /&gt;
			const {anchor, head} = cm.findWordAt(cm.getCursor())&lt;br /&gt;
			const word = cm.getRange(anchor, head)&lt;br /&gt;
			&lt;br /&gt;
			const callbacks = cell.get_callbacks()&lt;br /&gt;
			const options = {silent: false, store_history: false, stop_on_error: true}&lt;br /&gt;
			cell.last_msg_id = cell.notebook.kernel.execute(`help(\`${word}\`)`, callbacks, options)&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
const prefix = &#039;irkernel&#039;&lt;br /&gt;
&lt;br /&gt;
function add_edit_shortcut(notebook, actions, keyboard_manager, edit_action) {&lt;br /&gt;
	const {name, shortcut, icon, help, handler} = edit_action&lt;br /&gt;
	&lt;br /&gt;
	const action = {&lt;br /&gt;
		icon, help,&lt;br /&gt;
		help_index : &#039;zz&#039;,&lt;br /&gt;
		handler: () =&amp;gt; {&lt;br /&gt;
			const cell = notebook.get_selected_cell()&lt;br /&gt;
			handler(cell.code_mirror, cell)&lt;br /&gt;
		},&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	const full_name = actions.register(action, name, prefix)&lt;br /&gt;
	&lt;br /&gt;
	Jupyter.keyboard_manager.edit_shortcuts.add_shortcut(shortcut, full_name)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function render_math(pager, html) {&lt;br /&gt;
	if (!html) return&lt;br /&gt;
	const $container = pager.pager_element.find(&#039;#pager-container&#039;)&lt;br /&gt;
	$container.find(&#039;p[style=&amp;quot;text-align: center;&amp;quot;]&#039;).map((i, e) =&amp;gt;&lt;br /&gt;
		e.outerHTML = `\\[${e.querySelector(&#039;i&#039;).innerHTML}\\]`)&lt;br /&gt;
	$container.find(&#039;i&#039;).map((i, e) =&amp;gt;&lt;br /&gt;
		e.outerHTML = `\\(${e.innerHTML}\\)`)&lt;br /&gt;
	MathJax.Hub.Queue([&#039;Typeset&#039;, MathJax.Hub, $container[0]])&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
define([&#039;base/js/namespace&#039;], ({&lt;br /&gt;
	notebook,&lt;br /&gt;
	actions,&lt;br /&gt;
	keyboard_manager,&lt;br /&gt;
	pager,&lt;br /&gt;
}) =&amp;gt; ({&lt;br /&gt;
	onload() {&lt;br /&gt;
		edit_actions.forEach(a =&amp;gt; add_edit_shortcut(notebook, actions, keyboard_manager, a))&lt;br /&gt;
		&lt;br /&gt;
		pager.events.on(&#039;open_with_text.Pager&#039;, (event, {data: {&#039;text/html&#039;: html}}) =&amp;gt;&lt;br /&gt;
			render_math(pager, html))&lt;br /&gt;
	},&lt;br /&gt;
}))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Last Steps ==&lt;br /&gt;
&lt;br /&gt;
In order to help your students get their kernel definitions into &amp;lt;code&amp;gt;$HOME/.local/share/jupyter/kernels/&amp;lt;/code&amp;gt;, it&#039;s probably a good idea to write a small and simple notebook to do this when executed, or else instruct them to do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
cp -rv /cm/shared/apps/SHARED/my_conda_env/kernel/* .local/share/jupyter/kernels/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Conda_for_teaching&amp;diff=2076</id>
		<title>Conda for teaching</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Conda_for_teaching&amp;diff=2076"/>
		<updated>2020-05-27T09:01:02Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You are going to give a teaching course, and you need a specific code environment.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
First - find a good location that everyone can read (and not write). I&#039;d suggest somewhere under /cm/shared/apps/SHARED/ as a starting point - this allows everyone to access this location. It&#039;s important not to put anything secret there - it&#039;s a public resource, so please bear that in mind.&lt;br /&gt;
&lt;br /&gt;
Next - create a folder for your environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
mkdir /cm/shared/apps/SHARED/my_conda_env&lt;br /&gt;
chmod +r /cm/shared/apps/SHARED/my_conda_env&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You may want to manipulate the permissions for this folder if someone is going to set this up with you. Consider the commands in [[Shared Folders]].&lt;br /&gt;
&lt;br /&gt;
Then, install Anaconda into it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
wget https://repo.anaconda.com/archive/Anaconda3-YEAR.MONTH-Linux-x86_64.sh&lt;br /&gt;
./Anaconda3-YEAR.MONTH-Linux-x86_64.sh -s -b -p /cm/shared/apps/SHARED/my_conda_env &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have a working conda environment in this folder. You can manipulate this here by running /cm/shared/apps/SHARED/my_conda_env/bin/conda , or, I would recommend creating a modulefile so that you can use it as default.&lt;br /&gt;
&lt;br /&gt;
Create the following example modulefile in a matching /cm/shared/modulefiles/SHARED/my_conda_env :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#%Module -*- tcl -*-&lt;br /&gt;
##&lt;br /&gt;
## conda environment modulefile&lt;br /&gt;
##&lt;br /&gt;
&lt;br /&gt;
set                     loadedmodules           [split $::env(LOADEDMODULES) &amp;quot;:&amp;quot;]&lt;br /&gt;
set                     modulepath              [split $ModulesCurrentModulefile &amp;quot;/&amp;quot;]&lt;br /&gt;
set                     envpath                 [lrange $modulepath 4 end]&lt;br /&gt;
&lt;br /&gt;
set                     root                    /cm/shared/apps/[join $envpath &amp;quot;/&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
proc ModulesHelp { } {&lt;br /&gt;
        global version&lt;br /&gt;
&lt;br /&gt;
        puts stderr &amp;quot;\tThis module provides the conda environment at $envpath&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if { [module-info mode] != &amp;quot;whatis&amp;quot; } {&lt;br /&gt;
        puts stderr &amp;quot;[module-info mode] environent $envpath .&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
module-whatis   &amp;quot;Provides environment $envpath&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
prepend-path            PATH                    $root/bin&lt;br /&gt;
prepend-path            LD_LIBRARY_PATH         $root/lib&lt;br /&gt;
prepend-path            LIBRARY_PATH            $root/lib&lt;br /&gt;
prepend-path            CPATH                   $root/include&lt;br /&gt;
prepend-path            MANPATH                 $root/share/man&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow you to &amp;lt;code&amp;gt;module load SHARED/my_conda_env&amp;lt;/code&amp;gt; and thus have &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; pathed to the currently active environment.&lt;br /&gt;
&lt;br /&gt;
== Jupyter Kernel ==&lt;br /&gt;
&lt;br /&gt;
In order for students to be able to use this environment in jupyter, they will need a kernel definition.&lt;br /&gt;
&lt;br /&gt;
Kernel definitions are usually a separate folder containing, in particular, a file called &amp;lt;code&amp;gt;kernel.json&amp;lt;/code&amp;gt;, plus an icon that is displayed that represents this kernel, and other helper code.&lt;br /&gt;
&lt;br /&gt;
The setup for this is that you should create the following folder for their access:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
mkdir -p /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env&lt;br /&gt;
chmod +r /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This folder is something they will need to copy in place to their home directory, specifically $HOME/.local/share/jupyter/kernels/&lt;br /&gt;
&lt;br /&gt;
Inside this folder, create the following kernel.json file. Watch out that the paths will need to match the current environment path if you&#039;re using a different location!&lt;br /&gt;
&lt;br /&gt;
=== Python Kernel ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
vim /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env/kernel.json&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;env&amp;quot;: {&lt;br /&gt;
   &amp;quot;PATH&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;/cm/shared/apps/SHARED/my_conda_env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
 &amp;quot;language&amp;quot;: &amp;quot;python&amp;quot;,&lt;br /&gt;
 &amp;quot;argv&amp;quot;: [&lt;br /&gt;
  &amp;quot;/cm/shared/apps/SHARED/my_conda_env/bin/python&amp;quot;,&lt;br /&gt;
  &amp;quot;-m&amp;quot;,&lt;br /&gt;
  &amp;quot;ipykernel&amp;quot;,&lt;br /&gt;
  &amp;quot;-f&amp;quot;,&lt;br /&gt;
  &amp;quot;{connection_file}&amp;quot;&lt;br /&gt;
 ],&lt;br /&gt;
 &amp;quot;display_name&amp;quot;: &amp;quot;my_conda_env&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Python, that&#039;s it. Ipykernel is installed automatically on conda initialisation.&lt;br /&gt;
&lt;br /&gt;
=== R Kernel ===&lt;br /&gt;
&lt;br /&gt;
For an R kernel, you need to make sure that the IRkernel package is installed. This is the package that is used to communicate from Jupyter to your running R kernel.&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#MISSING EXAMPLE CODE&lt;br /&gt;
#PROBABLY /cm/shared/apps/SHARED/my_conda_env/bin/conda install R_irkernel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to create two files. the kernel.js is a helper script to allow jupyter to communicate to R effectively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
vim /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env/kernel.json&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;env&amp;quot;: {&lt;br /&gt;
   &amp;quot;LD_LIBRARY_PATH&amp;quot;:&lt;br /&gt;
      &amp;quot;/cm/shared/apps/SHARED/my_conda_env/lib:/cm/shared/apps/SHARED/my_conda_env/lib64&amp;quot;&lt;br /&gt;
 },&lt;br /&gt;
  &amp;quot;argv&amp;quot;: [&amp;quot;/cm/shared/apps/SHARED/my_conda_env/bin/R&amp;quot;, &amp;quot;--slave&amp;quot;, &amp;quot;-e&amp;quot;, &amp;quot;IRkernel::main()&amp;quot;, &amp;quot;--args&amp;quot;, &amp;quot;{connection_file}&amp;quot;],&lt;br /&gt;
  &amp;quot;display_name&amp;quot;: &amp;quot;MAE50806-AdvMolEcol/Sandbox_R&amp;quot;,&lt;br /&gt;
  &amp;quot;language&amp;quot;: &amp;quot;R&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
vim /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env/kernel.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
const cmd_key = /Mac/.test(navigator.platform) ? &#039;Cmd&#039; : &#039;Ctrl&#039;&lt;br /&gt;
&lt;br /&gt;
const edit_actions = [&lt;br /&gt;
	{&lt;br /&gt;
		name: &#039;R Assign&#039;,&lt;br /&gt;
		shortcut: &#039;Alt--&#039;,&lt;br /&gt;
		icon: &#039;fa-long-arrow-left&#039;,&lt;br /&gt;
		help: &#039;R: Inserts the left-assign operator (&amp;lt;-)&#039;,&lt;br /&gt;
		handler(cm) {&lt;br /&gt;
			cm.replaceSelection(&#039; &amp;lt;- &#039;)&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		name: &#039;R Pipe&#039;,&lt;br /&gt;
		shortcut: `Shift-${cmd_key}-M`,&lt;br /&gt;
		icon: &#039;fa-angle-right&#039;,&lt;br /&gt;
		help: &#039;R: Inserts the magrittr pipe operator (%&amp;gt;%)&#039;,&lt;br /&gt;
		handler(cm) {&lt;br /&gt;
			cm.replaceSelection(&#039; %&amp;gt;% &#039;)&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		name: &#039;R Help&#039;,&lt;br /&gt;
		shortcut: &#039;F1&#039;,&lt;br /&gt;
		icon: &#039;fa-book&#039;,&lt;br /&gt;
		help: &#039;R: Shows the manpage for the item under the cursor&#039;,&lt;br /&gt;
		handler(cm, cell) {&lt;br /&gt;
			const {anchor, head} = cm.findWordAt(cm.getCursor())&lt;br /&gt;
			const word = cm.getRange(anchor, head)&lt;br /&gt;
			&lt;br /&gt;
			const callbacks = cell.get_callbacks()&lt;br /&gt;
			const options = {silent: false, store_history: false, stop_on_error: true}&lt;br /&gt;
			cell.last_msg_id = cell.notebook.kernel.execute(`help(\`${word}\`)`, callbacks, options)&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
const prefix = &#039;irkernel&#039;&lt;br /&gt;
&lt;br /&gt;
function add_edit_shortcut(notebook, actions, keyboard_manager, edit_action) {&lt;br /&gt;
	const {name, shortcut, icon, help, handler} = edit_action&lt;br /&gt;
	&lt;br /&gt;
	const action = {&lt;br /&gt;
		icon, help,&lt;br /&gt;
		help_index : &#039;zz&#039;,&lt;br /&gt;
		handler: () =&amp;gt; {&lt;br /&gt;
			const cell = notebook.get_selected_cell()&lt;br /&gt;
			handler(cell.code_mirror, cell)&lt;br /&gt;
		},&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	const full_name = actions.register(action, name, prefix)&lt;br /&gt;
	&lt;br /&gt;
	Jupyter.keyboard_manager.edit_shortcuts.add_shortcut(shortcut, full_name)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function render_math(pager, html) {&lt;br /&gt;
	if (!html) return&lt;br /&gt;
	const $container = pager.pager_element.find(&#039;#pager-container&#039;)&lt;br /&gt;
	$container.find(&#039;p[style=&amp;quot;text-align: center;&amp;quot;]&#039;).map((i, e) =&amp;gt;&lt;br /&gt;
		e.outerHTML = `\\[${e.querySelector(&#039;i&#039;).innerHTML}\\]`)&lt;br /&gt;
	$container.find(&#039;i&#039;).map((i, e) =&amp;gt;&lt;br /&gt;
		e.outerHTML = `\\(${e.innerHTML}\\)`)&lt;br /&gt;
	MathJax.Hub.Queue([&#039;Typeset&#039;, MathJax.Hub, $container[0]])&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
define([&#039;base/js/namespace&#039;], ({&lt;br /&gt;
	notebook,&lt;br /&gt;
	actions,&lt;br /&gt;
	keyboard_manager,&lt;br /&gt;
	pager,&lt;br /&gt;
}) =&amp;gt; ({&lt;br /&gt;
	onload() {&lt;br /&gt;
		edit_actions.forEach(a =&amp;gt; add_edit_shortcut(notebook, actions, keyboard_manager, a))&lt;br /&gt;
		&lt;br /&gt;
		pager.events.on(&#039;open_with_text.Pager&#039;, (event, {data: {&#039;text/html&#039;: html}}) =&amp;gt;&lt;br /&gt;
			render_math(pager, html))&lt;br /&gt;
	},&lt;br /&gt;
}))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Last Steps ==&lt;br /&gt;
&lt;br /&gt;
In order to help your students get their kernel definitions into $HOME/.local/share/jupyter/kernels/, it&#039;s probably a good idea to write a small and simple notebook to do this when executed, or else instruct them to do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
cp -rv /cm/shared/apps/SHARED/my_conda_env/kernel/* .local/share/jupyter/kernels/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Conda_for_teaching&amp;diff=2075</id>
		<title>Conda for teaching</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Conda_for_teaching&amp;diff=2075"/>
		<updated>2020-05-27T08:59:13Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* Jupyter Kernel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You are going to give a teaching course, and you need a specific code environment.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
First - find a good location that everyone can read (and not write). I&#039;d suggest somewhere under /cm/shared/apps/SHARED/ as a starting point - this allows everyone to access this location. It&#039;s important not to put anything secret there - it&#039;s a public resource, so please bear that in mind.&lt;br /&gt;
&lt;br /&gt;
Next - create a folder for your environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
mkdir /cm/shared/apps/SHARED/my_conda_env&lt;br /&gt;
chmod +r /cm/shared/apps/SHARED/my_conda_env&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You may want to manipulate the permissions for this folder if someone is going to set this up with you. Consider the commands in [[Shared Folders]].&lt;br /&gt;
&lt;br /&gt;
Then, install Anaconda into it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
wget https://repo.anaconda.com/archive/Anaconda3-YEAR.MONTH-Linux-x86_64.sh&lt;br /&gt;
./Anaconda3-YEAR.MONTH-Linux-x86_64.sh -s -b -p /cm/shared/apps/SHARED/my_conda_env &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have a working conda environment in this folder. You can manipulate this here by running /cm/shared/apps/SHARED/my_conda_env/bin/conda , or, I would recommend creating a modulefile so that you can use it as default.&lt;br /&gt;
&lt;br /&gt;
Create the following example modulefile in a matching /cm/shared/modulefiles/SHARED/my_conda_env :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#%Module -*- tcl -*-&lt;br /&gt;
##&lt;br /&gt;
## conda environment modulefile&lt;br /&gt;
##&lt;br /&gt;
&lt;br /&gt;
set                     loadedmodules           [split $::env(LOADEDMODULES) &amp;quot;:&amp;quot;]&lt;br /&gt;
set                     modulepath              [split $ModulesCurrentModulefile &amp;quot;/&amp;quot;]&lt;br /&gt;
set                     envpath                 [lrange $modulepath 4 end]&lt;br /&gt;
&lt;br /&gt;
set                     root                    /cm/shared/apps/[join $envpath &amp;quot;/&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
proc ModulesHelp { } {&lt;br /&gt;
        global version&lt;br /&gt;
&lt;br /&gt;
        puts stderr &amp;quot;\tThis module provides the conda environment at $envpath&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if { [module-info mode] != &amp;quot;whatis&amp;quot; } {&lt;br /&gt;
        puts stderr &amp;quot;[module-info mode] environent $envpath .&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
module-whatis   &amp;quot;Provides environment $envpath&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
prepend-path            PATH                    $root/bin&lt;br /&gt;
prepend-path            LD_LIBRARY_PATH         $root/lib&lt;br /&gt;
prepend-path            LIBRARY_PATH            $root/lib&lt;br /&gt;
prepend-path            CPATH                   $root/include&lt;br /&gt;
prepend-path            MANPATH                 $root/share/man&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow you to `module load SHARED/my_conda_env` and thus have `conda` pathed to the currently active environment.&lt;br /&gt;
&lt;br /&gt;
== Jupyter Kernel ==&lt;br /&gt;
&lt;br /&gt;
In order for students to be able to use this environment in jupyter, they will need a kernel definition.&lt;br /&gt;
&lt;br /&gt;
Kernel definitions are usually a separate folder containing, in particular, a file called `kernel.json`, plus an icon that is displayed that represents this kernel, and other helper code.&lt;br /&gt;
&lt;br /&gt;
The setup for this is that you should create the following folder for their access:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
mkdir -p /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env&lt;br /&gt;
chmod +r /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This folder is something they will need to copy in place to their home directory, specifically $HOME/.local/share/jupyter/kernels/&lt;br /&gt;
&lt;br /&gt;
Inside this folder, create the following kernel.json file. Watch out that the paths will need to match the current environment path if you&#039;re using a different location!&lt;br /&gt;
&lt;br /&gt;
=== Python Kernel ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
vim /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env/kernel.json&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;env&amp;quot;: {&lt;br /&gt;
   &amp;quot;PATH&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;/cm/shared/apps/SHARED/my_conda_env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
 &amp;quot;language&amp;quot;: &amp;quot;python&amp;quot;,&lt;br /&gt;
 &amp;quot;argv&amp;quot;: [&lt;br /&gt;
  &amp;quot;/cm/shared/apps/SHARED/my_conda_env/bin/python&amp;quot;,&lt;br /&gt;
  &amp;quot;-m&amp;quot;,&lt;br /&gt;
  &amp;quot;ipykernel&amp;quot;,&lt;br /&gt;
  &amp;quot;-f&amp;quot;,&lt;br /&gt;
  &amp;quot;{connection_file}&amp;quot;&lt;br /&gt;
 ],&lt;br /&gt;
 &amp;quot;display_name&amp;quot;: &amp;quot;my_conda_env&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Python, that&#039;s it. Ipykernel is installed automatically on conda initialisation.&lt;br /&gt;
&lt;br /&gt;
=== R Kernel ===&lt;br /&gt;
&lt;br /&gt;
For an R kernel, you need to make sure that the IRkernel package is installed. This is the package that is used to communicate from Jupyter to your running R kernel.&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#MISSING EXAMPLE CODE&lt;br /&gt;
#PROBABLY /cm/shared/apps/SHARED/my_conda_env/bin/conda install R_irkernel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to create two files. the kernel.js is a helper script to allow jupyter to communicate to R effectively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
vim /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env/kernel.json&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;env&amp;quot;: {&lt;br /&gt;
   &amp;quot;LD_LIBRARY_PATH&amp;quot;:&lt;br /&gt;
      &amp;quot;/cm/shared/apps/SHARED/my_conda_env/lib:/cm/shared/apps/SHARED/my_conda_env/lib64&amp;quot;&lt;br /&gt;
 },&lt;br /&gt;
  &amp;quot;argv&amp;quot;: [&amp;quot;/cm/shared/apps/SHARED/my_conda_env/bin/R&amp;quot;, &amp;quot;--slave&amp;quot;, &amp;quot;-e&amp;quot;, &amp;quot;IRkernel::main()&amp;quot;, &amp;quot;--args&amp;quot;, &amp;quot;{connection_file}&amp;quot;],&lt;br /&gt;
  &amp;quot;display_name&amp;quot;: &amp;quot;MAE50806-AdvMolEcol/Sandbox_R&amp;quot;,&lt;br /&gt;
  &amp;quot;language&amp;quot;: &amp;quot;R&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
vim /cm/shared/apps/SHARED/my_conda_env/kernel/my_conda_env/kernel.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
const cmd_key = /Mac/.test(navigator.platform) ? &#039;Cmd&#039; : &#039;Ctrl&#039;&lt;br /&gt;
&lt;br /&gt;
const edit_actions = [&lt;br /&gt;
	{&lt;br /&gt;
		name: &#039;R Assign&#039;,&lt;br /&gt;
		shortcut: &#039;Alt--&#039;,&lt;br /&gt;
		icon: &#039;fa-long-arrow-left&#039;,&lt;br /&gt;
		help: &#039;R: Inserts the left-assign operator (&amp;lt;-)&#039;,&lt;br /&gt;
		handler(cm) {&lt;br /&gt;
			cm.replaceSelection(&#039; &amp;lt;- &#039;)&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		name: &#039;R Pipe&#039;,&lt;br /&gt;
		shortcut: `Shift-${cmd_key}-M`,&lt;br /&gt;
		icon: &#039;fa-angle-right&#039;,&lt;br /&gt;
		help: &#039;R: Inserts the magrittr pipe operator (%&amp;gt;%)&#039;,&lt;br /&gt;
		handler(cm) {&lt;br /&gt;
			cm.replaceSelection(&#039; %&amp;gt;% &#039;)&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		name: &#039;R Help&#039;,&lt;br /&gt;
		shortcut: &#039;F1&#039;,&lt;br /&gt;
		icon: &#039;fa-book&#039;,&lt;br /&gt;
		help: &#039;R: Shows the manpage for the item under the cursor&#039;,&lt;br /&gt;
		handler(cm, cell) {&lt;br /&gt;
			const {anchor, head} = cm.findWordAt(cm.getCursor())&lt;br /&gt;
			const word = cm.getRange(anchor, head)&lt;br /&gt;
			&lt;br /&gt;
			const callbacks = cell.get_callbacks()&lt;br /&gt;
			const options = {silent: false, store_history: false, stop_on_error: true}&lt;br /&gt;
			cell.last_msg_id = cell.notebook.kernel.execute(`help(\`${word}\`)`, callbacks, options)&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
const prefix = &#039;irkernel&#039;&lt;br /&gt;
&lt;br /&gt;
function add_edit_shortcut(notebook, actions, keyboard_manager, edit_action) {&lt;br /&gt;
	const {name, shortcut, icon, help, handler} = edit_action&lt;br /&gt;
	&lt;br /&gt;
	const action = {&lt;br /&gt;
		icon, help,&lt;br /&gt;
		help_index : &#039;zz&#039;,&lt;br /&gt;
		handler: () =&amp;gt; {&lt;br /&gt;
			const cell = notebook.get_selected_cell()&lt;br /&gt;
			handler(cell.code_mirror, cell)&lt;br /&gt;
		},&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	const full_name = actions.register(action, name, prefix)&lt;br /&gt;
	&lt;br /&gt;
	Jupyter.keyboard_manager.edit_shortcuts.add_shortcut(shortcut, full_name)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function render_math(pager, html) {&lt;br /&gt;
	if (!html) return&lt;br /&gt;
	const $container = pager.pager_element.find(&#039;#pager-container&#039;)&lt;br /&gt;
	$container.find(&#039;p[style=&amp;quot;text-align: center;&amp;quot;]&#039;).map((i, e) =&amp;gt;&lt;br /&gt;
		e.outerHTML = `\\[${e.querySelector(&#039;i&#039;).innerHTML}\\]`)&lt;br /&gt;
	$container.find(&#039;i&#039;).map((i, e) =&amp;gt;&lt;br /&gt;
		e.outerHTML = `\\(${e.innerHTML}\\)`)&lt;br /&gt;
	MathJax.Hub.Queue([&#039;Typeset&#039;, MathJax.Hub, $container[0]])&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
define([&#039;base/js/namespace&#039;], ({&lt;br /&gt;
	notebook,&lt;br /&gt;
	actions,&lt;br /&gt;
	keyboard_manager,&lt;br /&gt;
	pager,&lt;br /&gt;
}) =&amp;gt; ({&lt;br /&gt;
	onload() {&lt;br /&gt;
		edit_actions.forEach(a =&amp;gt; add_edit_shortcut(notebook, actions, keyboard_manager, a))&lt;br /&gt;
		&lt;br /&gt;
		pager.events.on(&#039;open_with_text.Pager&#039;, (event, {data: {&#039;text/html&#039;: html}}) =&amp;gt;&lt;br /&gt;
			render_math(pager, html))&lt;br /&gt;
	},&lt;br /&gt;
}))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Last Steps ==&lt;br /&gt;
&lt;br /&gt;
In order to help your students get their kernel definitions into $HOME/.local/share/jupyter/kernels/, it&#039;s probably a good idea to write a small and simple notebook to do this when executed, or else instruct them to do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
cp -rv /cm/shared/apps/SHARED/my_conda_env/kernel/* .local/share/jupyter/kernels/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Conda_for_teaching&amp;diff=2074</id>
		<title>Conda for teaching</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Conda_for_teaching&amp;diff=2074"/>
		<updated>2020-05-27T08:45:06Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You are going to give a teaching course, and you need a specific code environment.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
First - find a good location that everyone can read (and not write). I&#039;d suggest somewhere under /cm/shared/apps/SHARED/ as a starting point - this allows everyone to access this location. It&#039;s important not to put anything secret there - it&#039;s a public resource, so please bear that in mind.&lt;br /&gt;
&lt;br /&gt;
Next - create a folder for your environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
mkdir /cm/shared/apps/SHARED/my_conda_env&lt;br /&gt;
chmod +r /cm/shared/apps/SHARED/my_conda_env&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You may want to manipulate the permissions for this folder if someone is going to set this up with you. Consider the commands in [[Shared Folders]].&lt;br /&gt;
&lt;br /&gt;
Then, install Anaconda into it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
wget https://repo.anaconda.com/archive/Anaconda3-YEAR.MONTH-Linux-x86_64.sh&lt;br /&gt;
./Anaconda3-YEAR.MONTH-Linux-x86_64.sh -s -b -p /cm/shared/apps/SHARED/my_conda_env &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have a working conda environment in this folder. You can manipulate this here by running /cm/shared/apps/SHARED/my_conda_env/bin/conda , or, I would recommend creating a modulefile so that you can use it as default.&lt;br /&gt;
&lt;br /&gt;
Create the following example modulefile in a matching /cm/shared/modulefiles/SHARED/my_conda_env :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#%Module -*- tcl -*-&lt;br /&gt;
##&lt;br /&gt;
## conda environment modulefile&lt;br /&gt;
##&lt;br /&gt;
&lt;br /&gt;
set                     loadedmodules           [split $::env(LOADEDMODULES) &amp;quot;:&amp;quot;]&lt;br /&gt;
set                     modulepath              [split $ModulesCurrentModulefile &amp;quot;/&amp;quot;]&lt;br /&gt;
set                     envpath                 [lrange $modulepath 4 end]&lt;br /&gt;
&lt;br /&gt;
set                     root                    /cm/shared/apps/[join $envpath &amp;quot;/&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
proc ModulesHelp { } {&lt;br /&gt;
        global version&lt;br /&gt;
&lt;br /&gt;
        puts stderr &amp;quot;\tThis module provides the conda environment at $envpath&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if { [module-info mode] != &amp;quot;whatis&amp;quot; } {&lt;br /&gt;
        puts stderr &amp;quot;[module-info mode] environent $envpath .&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
module-whatis   &amp;quot;Provides environment $envpath&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
prepend-path            PATH                    $root/bin&lt;br /&gt;
prepend-path            LD_LIBRARY_PATH         $root/lib&lt;br /&gt;
prepend-path            LIBRARY_PATH            $root/lib&lt;br /&gt;
prepend-path            CPATH                   $root/include&lt;br /&gt;
prepend-path            MANPATH                 $root/share/man&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow you to `module load SHARED/my_conda_env` and thus have `conda` pathed to the currently active environment.&lt;br /&gt;
&lt;br /&gt;
== Jupyter Kernel ==&lt;br /&gt;
&lt;br /&gt;
In order for students to be able to use this environment in jupyter, they will need a kernel definition.&lt;br /&gt;
&lt;br /&gt;
Kernel definitions are usually a separate folder containing, in particular, a file called `kernel.json`, plus an icon that is displayed that represents this kernel, and other helper code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is something they will need to copy in place to their home directory, specifically $HOME/.local/share/jupyter/kernels/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;env&amp;quot;: {&lt;br /&gt;
   &amp;quot;PATH&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;/cm/shared/apps/SHARED/my_conda_env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
 &amp;quot;language&amp;quot;: &amp;quot;python&amp;quot;,&lt;br /&gt;
 &amp;quot;argv&amp;quot;: [&lt;br /&gt;
  &amp;quot;/cm/shared/apps/SHARED/my_conda_env/bin/python&amp;quot;,&lt;br /&gt;
  &amp;quot;-m&amp;quot;,&lt;br /&gt;
  &amp;quot;ipykernel&amp;quot;,&lt;br /&gt;
  &amp;quot;-f&amp;quot;,&lt;br /&gt;
  &amp;quot;{connection_file}&amp;quot;&lt;br /&gt;
 ],&lt;br /&gt;
 &amp;quot;display_name&amp;quot;: &amp;quot;my_conda_env&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
kernel.js&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
const cmd_key = /Mac/.test(navigator.platform) ? &#039;Cmd&#039; : &#039;Ctrl&#039;&lt;br /&gt;
&lt;br /&gt;
const edit_actions = [&lt;br /&gt;
	{&lt;br /&gt;
		name: &#039;R Assign&#039;,&lt;br /&gt;
		shortcut: &#039;Alt--&#039;,&lt;br /&gt;
		icon: &#039;fa-long-arrow-left&#039;,&lt;br /&gt;
		help: &#039;R: Inserts the left-assign operator (&amp;lt;-)&#039;,&lt;br /&gt;
		handler(cm) {&lt;br /&gt;
			cm.replaceSelection(&#039; &amp;lt;- &#039;)&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		name: &#039;R Pipe&#039;,&lt;br /&gt;
		shortcut: `Shift-${cmd_key}-M`,&lt;br /&gt;
		icon: &#039;fa-angle-right&#039;,&lt;br /&gt;
		help: &#039;R: Inserts the magrittr pipe operator (%&amp;gt;%)&#039;,&lt;br /&gt;
		handler(cm) {&lt;br /&gt;
			cm.replaceSelection(&#039; %&amp;gt;% &#039;)&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		name: &#039;R Help&#039;,&lt;br /&gt;
		shortcut: &#039;F1&#039;,&lt;br /&gt;
		icon: &#039;fa-book&#039;,&lt;br /&gt;
		help: &#039;R: Shows the manpage for the item under the cursor&#039;,&lt;br /&gt;
		handler(cm, cell) {&lt;br /&gt;
			const {anchor, head} = cm.findWordAt(cm.getCursor())&lt;br /&gt;
			const word = cm.getRange(anchor, head)&lt;br /&gt;
			&lt;br /&gt;
			const callbacks = cell.get_callbacks()&lt;br /&gt;
			const options = {silent: false, store_history: false, stop_on_error: true}&lt;br /&gt;
			cell.last_msg_id = cell.notebook.kernel.execute(`help(\`${word}\`)`, callbacks, options)&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
const prefix = &#039;irkernel&#039;&lt;br /&gt;
&lt;br /&gt;
function add_edit_shortcut(notebook, actions, keyboard_manager, edit_action) {&lt;br /&gt;
	const {name, shortcut, icon, help, handler} = edit_action&lt;br /&gt;
	&lt;br /&gt;
	const action = {&lt;br /&gt;
		icon, help,&lt;br /&gt;
		help_index : &#039;zz&#039;,&lt;br /&gt;
		handler: () =&amp;gt; {&lt;br /&gt;
			const cell = notebook.get_selected_cell()&lt;br /&gt;
			handler(cell.code_mirror, cell)&lt;br /&gt;
		},&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	const full_name = actions.register(action, name, prefix)&lt;br /&gt;
	&lt;br /&gt;
	Jupyter.keyboard_manager.edit_shortcuts.add_shortcut(shortcut, full_name)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function render_math(pager, html) {&lt;br /&gt;
	if (!html) return&lt;br /&gt;
	const $container = pager.pager_element.find(&#039;#pager-container&#039;)&lt;br /&gt;
	$container.find(&#039;p[style=&amp;quot;text-align: center;&amp;quot;]&#039;).map((i, e) =&amp;gt;&lt;br /&gt;
		e.outerHTML = `\\[${e.querySelector(&#039;i&#039;).innerHTML}\\]`)&lt;br /&gt;
	$container.find(&#039;i&#039;).map((i, e) =&amp;gt;&lt;br /&gt;
		e.outerHTML = `\\(${e.innerHTML}\\)`)&lt;br /&gt;
	MathJax.Hub.Queue([&#039;Typeset&#039;, MathJax.Hub, $container[0]])&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
define([&#039;base/js/namespace&#039;], ({&lt;br /&gt;
	notebook,&lt;br /&gt;
	actions,&lt;br /&gt;
	keyboard_manager,&lt;br /&gt;
	pager,&lt;br /&gt;
}) =&amp;gt; ({&lt;br /&gt;
	onload() {&lt;br /&gt;
		edit_actions.forEach(a =&amp;gt; add_edit_shortcut(notebook, actions, keyboard_manager, a))&lt;br /&gt;
		&lt;br /&gt;
		pager.events.on(&#039;open_with_text.Pager&#039;, (event, {data: {&#039;text/html&#039;: html}}) =&amp;gt;&lt;br /&gt;
			render_math(pager, html))&lt;br /&gt;
	},&lt;br /&gt;
}))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Conda_for_teaching&amp;diff=2073</id>
		<title>Conda for teaching</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Conda_for_teaching&amp;diff=2073"/>
		<updated>2020-05-27T08:40:47Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* Jupyter Kernel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You are going to give a teaching course, and you need a specific code environment.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
First - find a good location that everyone can read (and not write). I&#039;d suggest somewhere under /cm/shared/apps/SHARED/ as a starting point - this allows everyone to access this location. It&#039;s important not to put anything secret there - it&#039;s a public resource, so please bear that in mind.&lt;br /&gt;
&lt;br /&gt;
Next - create a folder for your environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
mkdir /cm/shared/apps/SHARED/my_conda_env&lt;br /&gt;
chmod +r /cm/shared/apps/SHARED/my_conda_env&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You may want to manipulate the permissions for this folder if someone is going to set this up with you. Consider the commands in [[Shared Folders]].&lt;br /&gt;
&lt;br /&gt;
Then, install Anaconda into it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
wget https://repo.anaconda.com/archive/Anaconda3-YEAR.MONTH-Linux-x86_64.sh&lt;br /&gt;
./Anaconda3-YEAR.MONTH-Linux-x86_64.sh -s -b -p /cm/shared/apps/SHARED/my_conda_env &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have a working conda environment in this folder. You can manipulate this here by running /cm/shared/apps/SHARED/my_conda_env/bin/conda , or, I would recommend creating a modulefile so that you can use it as default.&lt;br /&gt;
&lt;br /&gt;
Create the following example modulefile in a matching /cm/shared/modulefiles/SHARED/my_conda_env :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#%Module -*- tcl -*-&lt;br /&gt;
##&lt;br /&gt;
## conda environment modulefile&lt;br /&gt;
##&lt;br /&gt;
&lt;br /&gt;
set                     loadedmodules           [split $::env(LOADEDMODULES) &amp;quot;:&amp;quot;]&lt;br /&gt;
set                     modulepath              [split $ModulesCurrentModulefile &amp;quot;/&amp;quot;]&lt;br /&gt;
set                     envpath                 [lrange $modulepath 4 end]&lt;br /&gt;
&lt;br /&gt;
set                     root                    /cm/shared/apps/[join $envpath &amp;quot;/&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
proc ModulesHelp { } {&lt;br /&gt;
        global version&lt;br /&gt;
&lt;br /&gt;
        puts stderr &amp;quot;\tThis module provides the conda environment at $envpath&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if { [module-info mode] != &amp;quot;whatis&amp;quot; } {&lt;br /&gt;
        puts stderr &amp;quot;[module-info mode] environent $envpath .&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
module-whatis   &amp;quot;Provides environment $envpath&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
prepend-path            PATH                    $root/bin&lt;br /&gt;
prepend-path            LD_LIBRARY_PATH         $root/lib&lt;br /&gt;
prepend-path            LIBRARY_PATH            $root/lib&lt;br /&gt;
prepend-path            CPATH                   $root/include&lt;br /&gt;
prepend-path            MANPATH                 $root/share/man&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow you to `module load SHARED/my_conda_env` and thus have `conda` pathed to the currently active environment.&lt;br /&gt;
&lt;br /&gt;
== Jupyter Kernel ==&lt;br /&gt;
&lt;br /&gt;
In order for students to be able to use this environment in jupyter, they will need a kernel definition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;env&amp;quot;: {&lt;br /&gt;
   &amp;quot;PATH&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;/cm/shared/apps/SHARED/my_conda_env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
 &amp;quot;language&amp;quot;: &amp;quot;python&amp;quot;,&lt;br /&gt;
 &amp;quot;argv&amp;quot;: [&lt;br /&gt;
  &amp;quot;/cm/shared/apps/SHARED/my_conda_env/bin/python&amp;quot;,&lt;br /&gt;
  &amp;quot;-m&amp;quot;,&lt;br /&gt;
  &amp;quot;ipykernel&amp;quot;,&lt;br /&gt;
  &amp;quot;-f&amp;quot;,&lt;br /&gt;
  &amp;quot;{connection_file}&amp;quot;&lt;br /&gt;
 ],&lt;br /&gt;
 &amp;quot;display_name&amp;quot;: &amp;quot;my_conda_env&amp;quot;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Conda_for_teaching&amp;diff=2072</id>
		<title>Conda for teaching</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Conda_for_teaching&amp;diff=2072"/>
		<updated>2020-05-27T08:38:31Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: Created page with &amp;quot;You are going to give a teaching course, and you need a specific code environment.  == Setup == First - find a good location that everyone can read (and not write). I&amp;#039;d sugges...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You are going to give a teaching course, and you need a specific code environment.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
First - find a good location that everyone can read (and not write). I&#039;d suggest somewhere under /cm/shared/apps/SHARED/ as a starting point - this allows everyone to access this location. It&#039;s important not to put anything secret there - it&#039;s a public resource, so please bear that in mind.&lt;br /&gt;
&lt;br /&gt;
Next - create a folder for your environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
mkdir /cm/shared/apps/SHARED/my_conda_env&lt;br /&gt;
chmod +r /cm/shared/apps/SHARED/my_conda_env&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You may want to manipulate the permissions for this folder if someone is going to set this up with you. Consider the commands in [[Shared Folders]].&lt;br /&gt;
&lt;br /&gt;
Then, install Anaconda into it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
wget https://repo.anaconda.com/archive/Anaconda3-YEAR.MONTH-Linux-x86_64.sh&lt;br /&gt;
./Anaconda3-YEAR.MONTH-Linux-x86_64.sh -s -b -p /cm/shared/apps/SHARED/my_conda_env &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have a working conda environment in this folder. You can manipulate this here by running /cm/shared/apps/SHARED/my_conda_env/bin/conda , or, I would recommend creating a modulefile so that you can use it as default.&lt;br /&gt;
&lt;br /&gt;
Create the following example modulefile in a matching /cm/shared/modulefiles/SHARED/my_conda_env :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#%Module -*- tcl -*-&lt;br /&gt;
##&lt;br /&gt;
## conda environment modulefile&lt;br /&gt;
##&lt;br /&gt;
&lt;br /&gt;
set                     loadedmodules           [split $::env(LOADEDMODULES) &amp;quot;:&amp;quot;]&lt;br /&gt;
set                     modulepath              [split $ModulesCurrentModulefile &amp;quot;/&amp;quot;]&lt;br /&gt;
set                     envpath                 [lrange $modulepath 4 end]&lt;br /&gt;
&lt;br /&gt;
set                     root                    /cm/shared/apps/[join $envpath &amp;quot;/&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
proc ModulesHelp { } {&lt;br /&gt;
        global version&lt;br /&gt;
&lt;br /&gt;
        puts stderr &amp;quot;\tThis module provides the conda environment at $envpath&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if { [module-info mode] != &amp;quot;whatis&amp;quot; } {&lt;br /&gt;
        puts stderr &amp;quot;[module-info mode] environent $envpath .&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
module-whatis   &amp;quot;Provides environment $envpath&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
prepend-path            PATH                    $root/bin&lt;br /&gt;
prepend-path            LD_LIBRARY_PATH         $root/lib&lt;br /&gt;
prepend-path            LIBRARY_PATH            $root/lib&lt;br /&gt;
prepend-path            CPATH                   $root/include&lt;br /&gt;
prepend-path            MANPATH                 $root/share/man&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow you to `module load SHARED/my_conda_env` and thus have `conda` pathed to the currently active environment.&lt;br /&gt;
&lt;br /&gt;
== Jupyter Kernel ==&lt;br /&gt;
&lt;br /&gt;
In order for students to be able to use this environment in jupyter, they will need a kernel definition.&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Tariffs&amp;diff=2068</id>
		<title>Tariffs</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Tariffs&amp;diff=2068"/>
		<updated>2020-02-17T08:46:03Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Computing: Calculations (cores)==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Queue&lt;br /&gt;
!CPU core hour&lt;br /&gt;
!GB memory hour&lt;br /&gt;
|-&lt;br /&gt;
|Standard queue&lt;br /&gt;
|€ 0.0150&lt;br /&gt;
|€ 0.0015&lt;br /&gt;
|-&lt;br /&gt;
|High priority queue&lt;br /&gt;
|€ 0.0200&lt;br /&gt;
|€ 0.0020&lt;br /&gt;
|-&lt;br /&gt;
|Low priority queue&lt;br /&gt;
|€ 0.0100&lt;br /&gt;
|€ 0.0010&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Computing: GPU Use==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Tariff per device per hour (gpu/hour)&lt;br /&gt;
|-&lt;br /&gt;
|€ 0.3000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Storage ==&lt;br /&gt;
Tariffs per year per TB&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Lustre Backup&lt;br /&gt;
!Lustre Nobackup&lt;br /&gt;
!Lustre Scratch&lt;br /&gt;
!Home-dir&lt;br /&gt;
!Archive&lt;br /&gt;
|-&lt;br /&gt;
|€ 175&lt;br /&gt;
|€ 125&lt;br /&gt;
|€ 125&lt;br /&gt;
|€ 175&lt;br /&gt;
|€ 125&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reservations ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Tariff per node per day (node/day)&lt;br /&gt;
|-&lt;br /&gt;
|€ 30&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Notes==&lt;br /&gt;
&lt;br /&gt;
If you are a member of a group with a commitment, then these costs get deducted from that commitment. Typically we are fairly lax with enforcing limits - only once you get to around 150% of your commitment will we consider taking action (mainly coming to discuss things).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
You are running a job that needs 4 cores, 32G of RAM and runs for 90 minutes in the std quality. To run this, you over-request resources slightly, and execute in a job that requests 4 CPUs, 40G of RAM and with a time limit of 3 hours. Your job terminates early. Thus, your costs are:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4 * 0.015 * 1.5 = 0.09 EUR for the CPU&lt;br /&gt;
&lt;br /&gt;
40 * 0.0015 * 1.5 = 0.09 EUR for the memory&lt;br /&gt;
&lt;br /&gt;
Total: 0.18 EUR&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Setting_up_Python_virtualenv&amp;diff=2067</id>
		<title>Setting up Python virtualenv</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Setting_up_Python_virtualenv&amp;diff=2067"/>
		<updated>2019-12-11T15:32:51Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* Virtualenv kernels in Jupyter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;With many Python packages available, which are often in conflict or requiring different versions depending on application, installing and controlling packages and versions is not always easy. In addition, so many packages are often used only occasionally, that it is questionable whether a system administrator of a centralized server system or a High Performance Compute (HPC) infrastructure can be expected to resolve all issues posed by users of the infrastructure. Even on a local system with full administrative rights managing versions, dependencies, and package collisions is often very difficult. The solution is to use a virtual environment, in which a specific set of packages can then be installed. As many different virtual environments can be created, and used side-by-side, as is necessary. &lt;br /&gt;
&lt;br /&gt;
NOTE: as of Python 3.3 virtual environment support is built-in. See this page for an [[virtual_environment_Python_3.4_or_higher | alternative set-up of your virtual environment if using Python 3.4 or higher]].&lt;br /&gt;
&lt;br /&gt;
== Creating a new virtual environment ==&lt;br /&gt;
It is assumed that the appropriate &amp;lt;code&amp;gt;virtualenv&amp;lt;/code&amp;gt; executable for the Python version of choice is installed. A new virtual environment, in this case called &amp;lt;code&amp;gt;newenv&amp;lt;/code&amp;gt; is created like so:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
module load python/my-favourite-version (e.g. 2.7.12)&lt;br /&gt;
virtualenv newenv&lt;br /&gt;
OR&lt;br /&gt;
pyvenv newenv (For versions &amp;gt;3.4)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new environment is created, one will see a message similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;  New python executable in newenv/bin/python3&lt;br /&gt;
  Also creating executable in newenv/bin/python&lt;br /&gt;
  Installing Setuptools.........................................................................done.&lt;br /&gt;
  Installing Pip................................................................................done.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Activating a virtual environment ==&lt;br /&gt;
Once the environment is created, each time the environment needs to be activated, the following command needs to be issued:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
source newenv/bin/activate&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This assumes that the folder that contains the virtual environment documents (in this case called &amp;lt;code&amp;gt;newenv&amp;lt;/code&amp;gt;), is in the present working directory.&lt;br /&gt;
When working on the virtual environment, the virtual environment name will be between brackets in front of the &amp;lt;code&amp;gt;user-host-prompt&amp;lt;/code&amp;gt; string.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;  (newenv)user@host:~$&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing modules on the virtual environment ==&lt;br /&gt;
Installing modules is the same as usual. The difference is that modules are in &amp;lt;code&amp;gt;/path/to/virtenv/lib&amp;lt;/code&amp;gt;, which may be living somewhere on your home directory. When working from the virtual environment, the default &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; will belong to the python version that is currently active. This means that the executable in &amp;lt;code&amp;gt;/path/to/virtenv/bin&amp;lt;/code&amp;gt; are in fact the first in the &amp;lt;code&amp;gt;$PATH&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
pip install numpy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Similarly, installing packages from source works exactly the same as usual.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
python setup.py install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== deactivating a virtual environment ==&lt;br /&gt;
Quitting a virtual environment can be done by using the command &amp;lt;code&amp;gt;deactivate&amp;lt;/code&amp;gt;, which was loaded using the &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; command upon activating the virtual environment.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
deactivate&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Virtualenv kernels in Jupyter ==&lt;br /&gt;
Want your own virtualenv kernel in a notebook? This can be done by making your own kernel specifications:&lt;br /&gt;
&lt;br /&gt;
* Make sure you have the ipykernel module in your venv. Activate it and pip install it:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source ~/path/to/my/virtualenv/bin/activate &amp;amp;&amp;amp; pip install ipykernel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Create the following directory path in your homedir if it doesn&#039;t already exist:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.local/share/jupyter/kernels/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Think of a nice descriptive name that doesn&#039;t clash with one of the already present kernels. I&#039;ll use &#039;testing&#039;. Create this folder:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir ~/.local/share/jupyter/kernels/testing/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Add this file to this folder:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;vi ~/.local/share/jupyter/kernels/testing/kernel.json &lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;language&amp;quot;: &amp;quot;python&amp;quot;,&lt;br /&gt;
 &amp;quot;argv&amp;quot;: [&lt;br /&gt;
  &amp;quot;/home/myhome/path/to/my/virtualenv/bin/python&amp;quot;,&lt;br /&gt;
  &amp;quot;-m&amp;quot;,&lt;br /&gt;
  &amp;quot;ipykernel&amp;quot;,&lt;br /&gt;
  &amp;quot;-f&amp;quot;,&lt;br /&gt;
  &amp;quot;{connection_file}&amp;quot;&lt;br /&gt;
 ],&lt;br /&gt;
 &amp;quot;display_name&amp;quot;: &amp;quot;testing&amp;quot;&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Reload Jupyterhub page. testing should now exist in your kernels list.&lt;br /&gt;
&lt;br /&gt;
You can do more complex things with this, such as construct your own Spark environment. This relies on having the module findspark installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; vi ~/.local/share/jupyter/kernels/mysparkkernel/kernel.json &lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;language&amp;quot;: &amp;quot;python&amp;quot;,&lt;br /&gt;
 &amp;quot;env&amp;quot;: {&lt;br /&gt;
   &amp;quot;SPARK_HOME&amp;quot;:&lt;br /&gt;
     &amp;quot;/cm/shared/apps/spark/my-spark-version&amp;quot;&lt;br /&gt;
 },&lt;br /&gt;
 &amp;quot;argv&amp;quot;: [&lt;br /&gt;
  &amp;quot;/home/myhome/my/spark/venv/bin/python&amp;quot;,&lt;br /&gt;
  &amp;quot;-m&amp;quot;,&lt;br /&gt;
  &amp;quot;ipykernel&amp;quot;,&lt;br /&gt;
  &amp;quot;-c&amp;quot;, &amp;quot;import findspark; findspark.init()&amp;quot;,&lt;br /&gt;
  &amp;quot;-f&amp;quot;,&lt;br /&gt;
  &amp;quot;{connection_file}&amp;quot;&lt;br /&gt;
 ],&lt;br /&gt;
 &amp;quot;display_name&amp;quot;: &amp;quot;My Spark kernel&amp;quot;&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
(You&#039;ll want to make sure your spark cluster has the same environment - start it after activating this venv inside your sbatch script)&lt;br /&gt;
&lt;br /&gt;
== Make IPython work under virtualenv ==&lt;br /&gt;
IPython may not work initially under a virtual environment. It may produce an error message like below:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;    File &amp;quot;/usr/bin/ipython&amp;quot;, line 11&lt;br /&gt;
    print &amp;quot;Could not start qtconsole. Please install ipython-qtconsole&amp;quot;&lt;br /&gt;
                                                                      ^&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be resolved by adding a soft link with the name &amp;lt;code&amp;gt;ipython&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the virtual environment folder.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ln -s /path/to/virtenv/bin/ipython3 /path/to/virtenv/bin/ipython&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [https://pypi.python.org/pypi/virtualenv Python3 documentation for virtualenv]&lt;br /&gt;
* [http://cemcfarland.wordpress.com/2013/03/09/getting-ipython3-working-inside-your-virtualenv/ Solving the IPython hickup under virtual environment]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Setting_up_Python_virtualenv&amp;diff=2066</id>
		<title>Setting up Python virtualenv</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Setting_up_Python_virtualenv&amp;diff=2066"/>
		<updated>2019-12-11T15:32:23Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* Virtualenv kernels in Jupyter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;With many Python packages available, which are often in conflict or requiring different versions depending on application, installing and controlling packages and versions is not always easy. In addition, so many packages are often used only occasionally, that it is questionable whether a system administrator of a centralized server system or a High Performance Compute (HPC) infrastructure can be expected to resolve all issues posed by users of the infrastructure. Even on a local system with full administrative rights managing versions, dependencies, and package collisions is often very difficult. The solution is to use a virtual environment, in which a specific set of packages can then be installed. As many different virtual environments can be created, and used side-by-side, as is necessary. &lt;br /&gt;
&lt;br /&gt;
NOTE: as of Python 3.3 virtual environment support is built-in. See this page for an [[virtual_environment_Python_3.4_or_higher | alternative set-up of your virtual environment if using Python 3.4 or higher]].&lt;br /&gt;
&lt;br /&gt;
== Creating a new virtual environment ==&lt;br /&gt;
It is assumed that the appropriate &amp;lt;code&amp;gt;virtualenv&amp;lt;/code&amp;gt; executable for the Python version of choice is installed. A new virtual environment, in this case called &amp;lt;code&amp;gt;newenv&amp;lt;/code&amp;gt; is created like so:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
module load python/my-favourite-version (e.g. 2.7.12)&lt;br /&gt;
virtualenv newenv&lt;br /&gt;
OR&lt;br /&gt;
pyvenv newenv (For versions &amp;gt;3.4)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new environment is created, one will see a message similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;  New python executable in newenv/bin/python3&lt;br /&gt;
  Also creating executable in newenv/bin/python&lt;br /&gt;
  Installing Setuptools.........................................................................done.&lt;br /&gt;
  Installing Pip................................................................................done.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Activating a virtual environment ==&lt;br /&gt;
Once the environment is created, each time the environment needs to be activated, the following command needs to be issued:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
source newenv/bin/activate&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This assumes that the folder that contains the virtual environment documents (in this case called &amp;lt;code&amp;gt;newenv&amp;lt;/code&amp;gt;), is in the present working directory.&lt;br /&gt;
When working on the virtual environment, the virtual environment name will be between brackets in front of the &amp;lt;code&amp;gt;user-host-prompt&amp;lt;/code&amp;gt; string.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;  (newenv)user@host:~$&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing modules on the virtual environment ==&lt;br /&gt;
Installing modules is the same as usual. The difference is that modules are in &amp;lt;code&amp;gt;/path/to/virtenv/lib&amp;lt;/code&amp;gt;, which may be living somewhere on your home directory. When working from the virtual environment, the default &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; will belong to the python version that is currently active. This means that the executable in &amp;lt;code&amp;gt;/path/to/virtenv/bin&amp;lt;/code&amp;gt; are in fact the first in the &amp;lt;code&amp;gt;$PATH&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
pip install numpy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Similarly, installing packages from source works exactly the same as usual.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
python setup.py install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== deactivating a virtual environment ==&lt;br /&gt;
Quitting a virtual environment can be done by using the command &amp;lt;code&amp;gt;deactivate&amp;lt;/code&amp;gt;, which was loaded using the &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; command upon activating the virtual environment.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
deactivate&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Virtualenv kernels in Jupyter ==&lt;br /&gt;
Want your own virtualenv kernel in a notebook? This can be done by making your own kernel specifications:&lt;br /&gt;
&lt;br /&gt;
* Make sure you have the ipykernel module in your venv. Activate it and pip install it:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source ~/path/to/my/virtualenv/bin/activate &amp;amp;&amp;amp; pip install ipykernel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Create the following directory path in your homedir if it doesn&#039;t already exist:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.local/share/jupyter/kernels/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Think of a nice descriptive name that doesn&#039;t clash with one of the already present kernels. I&#039;ll use &#039;testing&#039;. Create this folder:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir ~/.local/share/jupyter/kernels/testing/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Add this file to this folder:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;vi ~/.local/share/jupyter/kernels/testing/kernel.json &lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;language&amp;quot;: &amp;quot;python&amp;quot;,&lt;br /&gt;
 &amp;quot;argv&amp;quot;: [&lt;br /&gt;
  &amp;quot;~/path/to/my/virtualenv/bin/python&amp;quot;,&lt;br /&gt;
  &amp;quot;-m&amp;quot;,&lt;br /&gt;
  &amp;quot;ipykernel&amp;quot;,&lt;br /&gt;
  &amp;quot;-f&amp;quot;,&lt;br /&gt;
  &amp;quot;{connection_file}&amp;quot;&lt;br /&gt;
 ],&lt;br /&gt;
 &amp;quot;display_name&amp;quot;: &amp;quot;testing&amp;quot;&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Reload Jupyterhub page. testing should now exist in your kernels list.&lt;br /&gt;
&lt;br /&gt;
You can do more complex things with this, such as construct your own Spark environment. This relies on having the module findspark installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; vi ~/.local/share/jupyter/kernels/mysparkkernel/kernel.json &lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;language&amp;quot;: &amp;quot;python&amp;quot;,&lt;br /&gt;
 &amp;quot;env&amp;quot;: {&lt;br /&gt;
   &amp;quot;SPARK_HOME&amp;quot;:&lt;br /&gt;
     &amp;quot;/cm/shared/apps/spark/my-spark-version&amp;quot;&lt;br /&gt;
 },&lt;br /&gt;
 &amp;quot;argv&amp;quot;: [&lt;br /&gt;
  &amp;quot;/home/myhome/my/spark/venv/bin/python&amp;quot;,&lt;br /&gt;
  &amp;quot;-m&amp;quot;,&lt;br /&gt;
  &amp;quot;ipykernel&amp;quot;,&lt;br /&gt;
  &amp;quot;-c&amp;quot;, &amp;quot;import findspark; findspark.init()&amp;quot;,&lt;br /&gt;
  &amp;quot;-f&amp;quot;,&lt;br /&gt;
  &amp;quot;{connection_file}&amp;quot;&lt;br /&gt;
 ],&lt;br /&gt;
 &amp;quot;display_name&amp;quot;: &amp;quot;My Spark kernel&amp;quot;&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
(You&#039;ll want to make sure your spark cluster has the same environment - start it after activating this venv inside your sbatch script)&lt;br /&gt;
&lt;br /&gt;
== Make IPython work under virtualenv ==&lt;br /&gt;
IPython may not work initially under a virtual environment. It may produce an error message like below:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;    File &amp;quot;/usr/bin/ipython&amp;quot;, line 11&lt;br /&gt;
    print &amp;quot;Could not start qtconsole. Please install ipython-qtconsole&amp;quot;&lt;br /&gt;
                                                                      ^&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be resolved by adding a soft link with the name &amp;lt;code&amp;gt;ipython&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the virtual environment folder.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ln -s /path/to/virtenv/bin/ipython3 /path/to/virtenv/bin/ipython&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [https://pypi.python.org/pypi/virtualenv Python3 documentation for virtualenv]&lt;br /&gt;
* [http://cemcfarland.wordpress.com/2013/03/09/getting-ipython3-working-inside-your-virtualenv/ Solving the IPython hickup under virtual environment]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Scheduler_Overview_(Slurm)&amp;diff=2058</id>
		<title>Scheduler Overview (Slurm)</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Scheduler_Overview_(Slurm)&amp;diff=2058"/>
		<updated>2019-10-17T15:19:26Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* Batch script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The resource allocation / scheduling software on Anunna is [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management SLURM]: &#039;&#039;&#039;S&#039;&#039;&#039;imple &#039;&#039;&#039;L&#039;&#039;&#039;inux &#039;&#039;&#039;U&#039;&#039;&#039;tility for &#039;&#039;&#039;R&#039;&#039;&#039;esource &#039;&#039;&#039;M&#039;&#039;&#039;anagement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Queues and defaults ==&lt;br /&gt;
&lt;br /&gt;
=== Quality of Service ===&lt;br /&gt;
When submitting a job, you may optionally assign a different Quality of Service to it. You can do this with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --qos=std&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, jobs will use std, the standard quality.&lt;br /&gt;
&lt;br /&gt;
Optionally, you may elect to reduce the priority of your jobs to low. This comes with a limit of how long each job can be (8h) to prevent the cluster from being locked up entirely with low priority jobs.&lt;br /&gt;
&lt;br /&gt;
The high quality provides a higher priority to jobs (20) than std (10), or low (1). It is naturally more expensive.&lt;br /&gt;
&lt;br /&gt;
The highest priority goes to jobs in interactive quality (100), but you may not submit many jobs or many large jobs as this quality. This is exclusively for the use of immediate running jobs, ones that are going to have hands-on users behind them.&lt;br /&gt;
&lt;br /&gt;
Jobs may be restarted and rescheduled if a job with higher priority needs cluster resources, but as of right now, this is not occurring.&lt;br /&gt;
&lt;br /&gt;
=== Queues ===&lt;br /&gt;
The cluster consists of multiple partitions of nodes that you can submit to. The primary one is &#039;main&#039;. There are other partitions as needed - current plans include &#039;gpu&#039;.&lt;br /&gt;
&lt;br /&gt;
You can see the partitions available with `sinfo`:&lt;br /&gt;
&lt;br /&gt;
=== Defaults ===&lt;br /&gt;
The default partition is &#039;main&#039;. This will work for most jobs.&lt;br /&gt;
&lt;br /&gt;
The default qos is &#039;std&#039;.&lt;br /&gt;
&lt;br /&gt;
The default cpu count is 1.&lt;br /&gt;
&lt;br /&gt;
The default run time for a job is &#039;&#039;&#039;1 hour&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The default memory limit is &#039;&#039;&#039;100MB per node&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Submitting jobs: sbatch ==&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
Consider this simple python3 script that should calculate Pi to 1 million digits:&lt;br /&gt;
&amp;lt;source lang=&#039;python&#039;&amp;gt;&lt;br /&gt;
from decimal import *&lt;br /&gt;
D=Decimal&lt;br /&gt;
getcontext().prec=10000000&lt;br /&gt;
p=sum(D(1)/16**k*(D(4)/(8*k+1)-D(2)/(8*k+4)-D(1)/(8*k+5)-D(1)/(8*k+6))for k in range(411))&lt;br /&gt;
print(str(p)[:10000002])&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Loading modules ===&lt;br /&gt;
In order for this script to run, the first thing that is needed is that Python3, which is not the default Python version on the cluster, is load into your environment. Availability of (different versions of) software can be checked by the following command:&lt;br /&gt;
  module avail&lt;br /&gt;
&lt;br /&gt;
In the list you should note that python3 is indeed available to be loaded, which then can be loaded with the following command:&lt;br /&gt;
  module load python/3.3.3&lt;br /&gt;
&lt;br /&gt;
=== Batch script ===&lt;br /&gt;
[[Creating_sbatch_script | Main Article: Creating a sbatch script]]&lt;br /&gt;
&lt;br /&gt;
The following shell/slurm script can then be used to schedule the job using the sbatch command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --comment=773320000&lt;br /&gt;
#SBATCH --time=1200&lt;br /&gt;
#SBATCH --mem=2048&lt;br /&gt;
#SBATCH --cpus-per-task=1&lt;br /&gt;
#SBATCH --output=output_%j.txt&lt;br /&gt;
#SBATCH --error=error_output_%j.txt&lt;br /&gt;
#SBATCH --job-name=calc_pi.py&lt;br /&gt;
#SBATCH --mail-type=ALL&lt;br /&gt;
#SBATCH --mail-user=email@org.nl&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
time python3 calc_pi.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting ===&lt;br /&gt;
The script, assuming it was named &#039;run_calc_pi.sh&#039;, can then be posted using the following command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sbatch run_calc_pi.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting multiple jobs (simple) ===&lt;br /&gt;
Assuming there are 10 job scripts, name runscript_1.sh through runscript_10.sh, all these scripts can be submitted using the following line of shell code:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;for i in `seq 1 10`; do echo $i; sbatch runscript_$i.sh;done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting multiple jobs (complex) ===&lt;br /&gt;
Lets&#039;s say you have three job scripts that depend on each other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_1.sh #A simple initialisation script&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_2.sh #An array task&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_3.sh #Some finishing script, single run, after everything previous has finished&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can create a script to simultaneously submit each job with a dependency on each other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;#!/bin/bash&lt;br /&gt;
JOB1=$(sbatch job_1.sh| rev | cut -d &#039; &#039; -f 1 | rev) #Get me the last space-separated element&lt;br /&gt;
&lt;br /&gt;
if ! [ &amp;quot;z$JOB1&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;First job submitted as jobid $JOB1&amp;quot;&lt;br /&gt;
  JOB2=$(sbatch --dependency=afterany:$JOB1 job_2.sh| rev | cut -d &#039; &#039; -f 1 | rev)&lt;br /&gt;
&lt;br /&gt;
  if ! [ &amp;quot;z$JOB2&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Second job submitted as jobid $JOB2, following $JOB1&amp;quot;&lt;br /&gt;
  JOB3=$(sbatch --dependency=afterany:$JOB2 job_3.sh| rev | cut -d &#039; &#039; -f 1 | rev)&lt;br /&gt;
&lt;br /&gt;
  if ! [ &amp;quot;z$JOB3&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Third job submitted as jobid $JOB3, following after every element of $JOB2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  fi&lt;br /&gt;
 fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will ensure that the subsequent jobs occur after any finishing of the former (even if they failed).&lt;br /&gt;
&lt;br /&gt;
Please see [https://slurm.schedmd.com/sbatch.html#OPT_dependency the sbatch documentation] for other options available to you. Note that aftercorr makes a subsequent array jobs array elements start after the correspondingly numbered ones from the previous job.&lt;br /&gt;
&lt;br /&gt;
=== Submitting array jobs ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --array=0-10%4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
SLURM allows you to submit multiple jobs using the same template. Further information about this can be found [[Array_jobs|here]].&lt;br /&gt;
&lt;br /&gt;
=== Using /tmp ===&lt;br /&gt;
There is a local disk of ~300G that can be used to temporarily stage some of your workload attached to each node. This is free to use, but please remember to clean up your data after usage.&lt;br /&gt;
&lt;br /&gt;
In order to be sure that you&#039;re able to use space in /tmp, you can add&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --tmp=&amp;lt;required size&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To your sbatch script. This will prevent your job from being run on nodes where there is no free space, or it&#039;s aimed to be used by another job at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Using GPU ===&lt;br /&gt;
There are two GPU nodes, in order to run a job that uses GPU on one of these nodes, you can add &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --gres=gpu:&amp;lt;num gpus&amp;gt;&lt;br /&gt;
#SBATCH --constraint=&amp;lt;gpu flavour e.g. K80, V100&amp;gt;&lt;br /&gt;
#SBATCH --partition=gpu&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To your sbatch script. Without this parameter, your job won&#039;t run on one of these nodes.&lt;br /&gt;
&lt;br /&gt;
== Monitoring submitted jobs ==&lt;br /&gt;
Once a job is submitted, the status can be monitored using the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command. The &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command has a number of parameters for monitoring specific properties of the jobs such as time limit.&lt;br /&gt;
&lt;br /&gt;
=== Generic monitoring of all running jobs ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
  squeue&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should then get a list of jobs that are running at that time on the cluster, for the example on how to submit using the &#039;sbatch&#039; command, it may look like so:&lt;br /&gt;
    JOBID PARTITION     NAME     USER  ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
   3396      ABGC BOV-WUR- megen002   R      27:26      1 node004&lt;br /&gt;
   3397      ABGC BOV-WUR- megen002   R      27:26      1 node005&lt;br /&gt;
   3398      ABGC BOV-WUR- megen002   R      27:26      1 node006&lt;br /&gt;
   3399      ABGC BOV-WUR- megen002   R      27:26      1 node007&lt;br /&gt;
   3400      ABGC BOV-WUR- megen002   R      27:26      1 node008&lt;br /&gt;
   3401      ABGC BOV-WUR- megen002   R      27:26      1 node009&lt;br /&gt;
   3385  research BOV-WUR- megen002   R      44:38      1 node049&lt;br /&gt;
   3386  research BOV-WUR- megen002   R      44:38      1 node050&lt;br /&gt;
   3387  research BOV-WUR- megen002   R      44:38      1 node051&lt;br /&gt;
   3388  research BOV-WUR- megen002   R      44:38      1 node052&lt;br /&gt;
   3389  research BOV-WUR- megen002   R      44:38      1 node053&lt;br /&gt;
   3390  research BOV-WUR- megen002   R      44:38      1 node054&lt;br /&gt;
   3391  research BOV-WUR- megen002   R      44:38      3 node[049-051]&lt;br /&gt;
   3392  research BOV-WUR- megen002   R      44:38      3 node[052-054]&lt;br /&gt;
   3393  research BOV-WUR- megen002   R      44:38      1 node001&lt;br /&gt;
   3394  research BOV-WUR- megen002   R      44:38      1 node002&lt;br /&gt;
   3395  research BOV-WUR- megen002   R      44:38      1 node003&lt;br /&gt;
&lt;br /&gt;
=== Monitoring time limit set for a specific job ===&lt;br /&gt;
The default time limit is set at one hour. Estimated run times need to be specified when running jobs. To see what the time limit is that is set for a certain job, this can be done using the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
squeue -l -j 3532&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Information similar to the following should appear:&lt;br /&gt;
  Fri Nov 29 15:41:00 2013&lt;br /&gt;
   JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)&lt;br /&gt;
   3532      ABGC BOV-WUR- megen002  RUNNING    2:47:03 3-08:00:00      1 node054&lt;br /&gt;
&lt;br /&gt;
=== Query a specific active job: scontrol ===&lt;br /&gt;
Show all the details of a currently active job, so not a completed job.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
login ~]$ scontrol show jobid 4241&lt;br /&gt;
JobId=4241 Name=WB20F06&lt;br /&gt;
   UserId=megen002(16795409) GroupId=domain users(16777729)&lt;br /&gt;
   Priority=1 Account=(null) QOS=normal&lt;br /&gt;
   JobState=RUNNING Reason=None Dependency=(null)&lt;br /&gt;
   Requeue=1 Restarts=0 BatchFlag=1 ExitCode=0:0&lt;br /&gt;
   RunTime=02:55:25 TimeLimit=3-08:00:00 TimeMin=N/A&lt;br /&gt;
   SubmitTime=2013-12-09T13:37:29 EligibleTime=2013-12-09T13:37:29&lt;br /&gt;
   StartTime=2013-12-09T13:37:29 EndTime=2013-12-12T21:37:29&lt;br /&gt;
   PreemptTime=None SuspendTime=None SecsPreSuspend=0&lt;br /&gt;
   Partition=research AllocNode:Sid=login0:21799&lt;br /&gt;
   ReqNodeList=(null) ExcNodeList=(null)&lt;br /&gt;
   NodeList=node023&lt;br /&gt;
   BatchHost=node023&lt;br /&gt;
   NumNodes=1 NumCPUs=4 CPUs/Task=1 ReqS:C:T=*:*:*&lt;br /&gt;
   MinCPUsNode=1 MinMemoryNode=0 MinTmpDiskNode=0&lt;br /&gt;
   Features=(null) Gres=(null) Reservation=(null)&lt;br /&gt;
   Shared=OK Contiguous=0 Licenses=(null) Network=(null)&lt;br /&gt;
   Command=/lustre/scratch/WUR/ABGC/...&lt;br /&gt;
   WorkDir=/lustre/scratch/WUR/ABGC/...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Check on a pending job ===&lt;br /&gt;
A submitted job could result in a pending state when there are not enough resources available to this job.&lt;br /&gt;
In this example I sumbit a job, check the status and after finding out is it &#039;&#039;&#039;pending&#039;&#039;&#039; I&#039;ll check when is probably will start.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
[@login jobs]$ sbatch hpl_student.job&lt;br /&gt;
 Submitted batch job 740338&lt;br /&gt;
&lt;br /&gt;
[@login jobs]$ squeue -l -j 740338&lt;br /&gt;
 Fri Feb 21 15:32:31 2014&lt;br /&gt;
  JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)&lt;br /&gt;
 740338 ABGC_Stud HPLstude bohme999  PENDING       0:00 1-00:00:00      1 (ReqNodeNotAvail)&lt;br /&gt;
&lt;br /&gt;
[@login jobs]$ squeue --start -j 740338&lt;br /&gt;
  JOBID PARTITION     NAME     USER  ST           START_TIME  NODES NODELIST(REASON)&lt;br /&gt;
 740338 ABGC_Stud HPLstude bohme999  PD  2014-02-22T15:31:48      1 (ReqNodeNotAvail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
So it seems this job will problably start the next day, but&#039;s thats no guarantee it will start indeed.&lt;br /&gt;
&lt;br /&gt;
== Removing jobs from a list: scancel ==&lt;br /&gt;
If for some reason you want to delete a job that is either in the queue or already running, you can remove it using the &#039;scancel&#039; command. The &#039;scancel&#039; command takes the jobid as a parameter. For the example above, this would be done using the following code:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
scancel 3401&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Allocating resources interactively: sinteractive ==&lt;br /&gt;
sinteractive is a tiny wrapper on srun to create interactive jobs quickly and easily. It allows you to get a shell on one of the nodes, with similar limits as you would do for a normal job. To use it, simply run:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sinteractive -c &amp;lt;num_cpus&amp;gt; --mem &amp;lt;amount_mem&amp;gt; --time &amp;lt;minutes&amp;gt; -p &amp;lt;partition&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You will then be presented with a new shell prompt on one of the compute nodes (run &#039;hostname&#039; to see which!). From here, you can test out code in an interactive fashion as needs be.&lt;br /&gt;
&lt;br /&gt;
Be advised though - not filling in the above fields will get you a shell with 1 CPU and 100Mb of RAM for 1 hour. This is useful for quick testing, however.&lt;br /&gt;
&lt;br /&gt;
=== sinteractive source ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
srun &amp;quot;$@&amp;quot; -I60 -N 1 -n 1 --pty bash -i&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== interactive Slurm - using salloc ===&lt;br /&gt;
If you don&#039;t want your shell to be transported but want a new remote shell, do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
salloc -p ABGC_Low $SHELL&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now your shell will stay on the login node, but you can do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
srun &amp;lt;command&amp;gt; &amp;amp;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To submit tasks to this new shell!&lt;br /&gt;
&lt;br /&gt;
Be aware that the time limit of salloc is default 1 hour. If you intend to run jobs for longer times than this, you need to edit the settings for it. See: https://computing.llnl.gov/linux/slurm/salloc.html&lt;br /&gt;
&lt;br /&gt;
== Get overview of past and current jobs: sacct ==&lt;br /&gt;
To do some accounting on past and present jobs, and to see whether they ran to completion, you can do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sacct&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should provide information similar to the following:&lt;br /&gt;
&lt;br /&gt;
         JobID    JobName  Partition    Account  AllocCPUS      State ExitCode &lt;br /&gt;
  ------------ ---------- ---------- ---------- ---------- ---------- -------- &lt;br /&gt;
  3385         BOV-WUR-58   research                    12  COMPLETED      0:0 &lt;br /&gt;
  3385.batch        batch                                1  COMPLETED      0:0 &lt;br /&gt;
  3386         BOV-WUR-59   research                    12 CANCELLED+      0:0 &lt;br /&gt;
  3386.batch        batch                                1  CANCELLED     0:15 &lt;br /&gt;
  3528         BOV-WUR-59       ABGC                    16    RUNNING      0:0 &lt;br /&gt;
  3529         BOV-WUR-60       ABGC                    16    RUNNING      0:0&lt;br /&gt;
&lt;br /&gt;
Or in more detail for a specific job:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sacct --format=jobid,jobname,comment,partition,ntasks,alloccpus,elapsed,state,exitcode -j 4220&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should provide information about job id 4220:&lt;br /&gt;
&lt;br /&gt;
       JobID    JobName    Comment   Partition   NTasks  AllocCPUS    Elapsed      State ExitCode &lt;br /&gt;
  ------------ ---------- ---------- ---------- -------- ---------- ---------- ---------- -------- &lt;br /&gt;
  4220         PreProces+              research                   3   00:30:52  COMPLETED      0:0 &lt;br /&gt;
  4220.batch        batch                              1          1   00:30:52  COMPLETED      0:0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Job Status Codes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically your job will be either in the Running state of PenDing state. However here is a breakdown of all the states that your job could be in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Code!!State!!Description&lt;br /&gt;
|-&lt;br /&gt;
|CA	||CANCELLED||	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;
|CD||	COMPLETED||	Job has terminated all processes on all nodes.&lt;br /&gt;
|-&lt;br /&gt;
|CF||	CONFIGURING||	Job has been allocated resources, but are waiting for them to become ready for use (e.g. booting).&lt;br /&gt;
|-&lt;br /&gt;
|CG||	COMPLETING||	Job is in the process of completing. Some processes on some nodes may still be active.&lt;br /&gt;
|-&lt;br /&gt;
|F||	FAILED||	Job terminated with non-zero exit code or other failure condition.&lt;br /&gt;
|-&lt;br /&gt;
|NF||	NODE_FAIL||	Job terminated due to failure of one or more allocated nodes.&lt;br /&gt;
|-&lt;br /&gt;
|PD||	PENDING||	Job is awaiting resource allocation.&lt;br /&gt;
|-&lt;br /&gt;
|R||	RUNNING||	Job currently has an allocation.&lt;br /&gt;
|-&lt;br /&gt;
|S||	SUSPENDED||	Job has an allocation, but execution has been suspended.&lt;br /&gt;
|-&lt;br /&gt;
|TO||	TIMEOUT||	Job terminated upon reaching its time limit.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Running MPI jobs on Anunna ==&lt;br /&gt;
&lt;br /&gt;
[[MPI_on_B4F_cluster | Main article: MPI on Anunna]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Tariffs | Costs associated with resource usage]]&lt;br /&gt;
* [[B4F_cluster | Anunna]]&lt;br /&gt;
* [[BCM_on_B4F_cluster | BCM on Anunna]]&lt;br /&gt;
* [[SLURM_Compare | SLURM compared to other common schedulers]]&lt;br /&gt;
* [[Setting_up_Python_virtualenv | Setting up and using a virtual environment for Python3 ]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://slurm.schedmd.com Slurm official documentation]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management Slurm on Wikipedia]&lt;br /&gt;
* [http://www.youtube.com/watch?v=axWffyrk3aY Slurm Tutorial on Youtube]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Scheduler_Overview_(Slurm)&amp;diff=2056</id>
		<title>Scheduler Overview (Slurm)</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Scheduler_Overview_(Slurm)&amp;diff=2056"/>
		<updated>2019-10-02T08:00:14Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* Using GPU */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The resource allocation / scheduling software on Anunna is [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management SLURM]: &#039;&#039;&#039;S&#039;&#039;&#039;imple &#039;&#039;&#039;L&#039;&#039;&#039;inux &#039;&#039;&#039;U&#039;&#039;&#039;tility for &#039;&#039;&#039;R&#039;&#039;&#039;esource &#039;&#039;&#039;M&#039;&#039;&#039;anagement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Queues and defaults ==&lt;br /&gt;
&lt;br /&gt;
=== Quality of Service ===&lt;br /&gt;
When submitting a job, you may optionally assign a different Quality of Service to it. You can do this with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --qos=std&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, jobs will use std, the standard quality.&lt;br /&gt;
&lt;br /&gt;
Optionally, you may elect to reduce the priority of your jobs to low. This comes with a limit of how long each job can be (8h) to prevent the cluster from being locked up entirely with low priority jobs.&lt;br /&gt;
&lt;br /&gt;
The high quality provides a higher priority to jobs (20) than std (10), or low (1). It is naturally more expensive.&lt;br /&gt;
&lt;br /&gt;
The highest priority goes to jobs in interactive quality (100), but you may not submit many jobs or many large jobs as this quality. This is exclusively for the use of immediate running jobs, ones that are going to have hands-on users behind them.&lt;br /&gt;
&lt;br /&gt;
Jobs may be restarted and rescheduled if a job with higher priority needs cluster resources, but as of right now, this is not occurring.&lt;br /&gt;
&lt;br /&gt;
=== Queues ===&lt;br /&gt;
The cluster consists of multiple partitions of nodes that you can submit to. The primary one is &#039;main&#039;. There are other partitions as needed - current plans include &#039;gpu&#039;.&lt;br /&gt;
&lt;br /&gt;
You can see the partitions available with `sinfo`:&lt;br /&gt;
&lt;br /&gt;
=== Defaults ===&lt;br /&gt;
The default partition is &#039;main&#039;. This will work for most jobs.&lt;br /&gt;
&lt;br /&gt;
The default qos is &#039;std&#039;.&lt;br /&gt;
&lt;br /&gt;
The default cpu count is 1.&lt;br /&gt;
&lt;br /&gt;
The default run time for a job is &#039;&#039;&#039;1 hour&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The default memory limit is &#039;&#039;&#039;100MB per node&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Submitting jobs: sbatch ==&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
Consider this simple python3 script that should calculate Pi to 1 million digits:&lt;br /&gt;
&amp;lt;source lang=&#039;python&#039;&amp;gt;&lt;br /&gt;
from decimal import *&lt;br /&gt;
D=Decimal&lt;br /&gt;
getcontext().prec=10000000&lt;br /&gt;
p=sum(D(1)/16**k*(D(4)/(8*k+1)-D(2)/(8*k+4)-D(1)/(8*k+5)-D(1)/(8*k+6))for k in range(411))&lt;br /&gt;
print(str(p)[:10000002])&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Loading modules ===&lt;br /&gt;
In order for this script to run, the first thing that is needed is that Python3, which is not the default Python version on the cluster, is load into your environment. Availability of (different versions of) software can be checked by the following command:&lt;br /&gt;
  module avail&lt;br /&gt;
&lt;br /&gt;
In the list you should note that python3 is indeed available to be loaded, which then can be loaded with the following command:&lt;br /&gt;
  module load python/3.3.3&lt;br /&gt;
&lt;br /&gt;
=== Batch script ===&lt;br /&gt;
[[Creating_sbatch_script | Main Article: Creating a sbatch script]]&lt;br /&gt;
&lt;br /&gt;
The following shell/slurm script can then be used to schedule the job using the sbatch command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --comment=773320000&lt;br /&gt;
#SBATCH --time=1200&lt;br /&gt;
#SBATCH --mem=2048&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --output=output_%j.txt&lt;br /&gt;
#SBATCH --error=error_output_%j.txt&lt;br /&gt;
#SBATCH --job-name=calc_pi.py&lt;br /&gt;
#SBATCH --mail-type=ALL&lt;br /&gt;
#SBATCH --mail-user=email@org.nl&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
time python3 calc_pi.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting ===&lt;br /&gt;
The script, assuming it was named &#039;run_calc_pi.sh&#039;, can then be posted using the following command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sbatch run_calc_pi.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting multiple jobs (simple) ===&lt;br /&gt;
Assuming there are 10 job scripts, name runscript_1.sh through runscript_10.sh, all these scripts can be submitted using the following line of shell code:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;for i in `seq 1 10`; do echo $i; sbatch runscript_$i.sh;done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting multiple jobs (complex) ===&lt;br /&gt;
Lets&#039;s say you have three job scripts that depend on each other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_1.sh #A simple initialisation script&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_2.sh #An array task&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_3.sh #Some finishing script, single run, after everything previous has finished&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can create a script to simultaneously submit each job with a dependency on each other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;#!/bin/bash&lt;br /&gt;
JOB1=$(sbatch job_1.sh| rev | cut -d &#039; &#039; -f 1 | rev) #Get me the last space-separated element&lt;br /&gt;
&lt;br /&gt;
if ! [ &amp;quot;z$JOB1&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;First job submitted as jobid $JOB1&amp;quot;&lt;br /&gt;
  JOB2=$(sbatch --dependency=afterany:$JOB1 job_2.sh| rev | cut -d &#039; &#039; -f 1 | rev)&lt;br /&gt;
&lt;br /&gt;
  if ! [ &amp;quot;z$JOB2&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Second job submitted as jobid $JOB2, following $JOB1&amp;quot;&lt;br /&gt;
  JOB3=$(sbatch --dependency=afterany:$JOB2 job_3.sh| rev | cut -d &#039; &#039; -f 1 | rev)&lt;br /&gt;
&lt;br /&gt;
  if ! [ &amp;quot;z$JOB3&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Third job submitted as jobid $JOB3, following after every element of $JOB2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  fi&lt;br /&gt;
 fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will ensure that the subsequent jobs occur after any finishing of the former (even if they failed).&lt;br /&gt;
&lt;br /&gt;
Please see [https://slurm.schedmd.com/sbatch.html#OPT_dependency the sbatch documentation] for other options available to you. Note that aftercorr makes a subsequent array jobs array elements start after the correspondingly numbered ones from the previous job.&lt;br /&gt;
&lt;br /&gt;
=== Submitting array jobs ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --array=0-10%4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
SLURM allows you to submit multiple jobs using the same template. Further information about this can be found [[Array_jobs|here]].&lt;br /&gt;
&lt;br /&gt;
=== Using /tmp ===&lt;br /&gt;
There is a local disk of ~300G that can be used to temporarily stage some of your workload attached to each node. This is free to use, but please remember to clean up your data after usage.&lt;br /&gt;
&lt;br /&gt;
In order to be sure that you&#039;re able to use space in /tmp, you can add&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --tmp=&amp;lt;required size&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To your sbatch script. This will prevent your job from being run on nodes where there is no free space, or it&#039;s aimed to be used by another job at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Using GPU ===&lt;br /&gt;
There are two GPU nodes, in order to run a job that uses GPU on one of these nodes, you can add &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --gres=gpu:&amp;lt;num gpus&amp;gt;&lt;br /&gt;
#SBATCH --constraint=&amp;lt;gpu flavour e.g. K80, V100&amp;gt;&lt;br /&gt;
#SBATCH --partition=gpu&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To your sbatch script. Without this parameter, your job won&#039;t run on one of these nodes.&lt;br /&gt;
&lt;br /&gt;
== Monitoring submitted jobs ==&lt;br /&gt;
Once a job is submitted, the status can be monitored using the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command. The &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command has a number of parameters for monitoring specific properties of the jobs such as time limit.&lt;br /&gt;
&lt;br /&gt;
=== Generic monitoring of all running jobs ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
  squeue&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should then get a list of jobs that are running at that time on the cluster, for the example on how to submit using the &#039;sbatch&#039; command, it may look like so:&lt;br /&gt;
    JOBID PARTITION     NAME     USER  ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
   3396      ABGC BOV-WUR- megen002   R      27:26      1 node004&lt;br /&gt;
   3397      ABGC BOV-WUR- megen002   R      27:26      1 node005&lt;br /&gt;
   3398      ABGC BOV-WUR- megen002   R      27:26      1 node006&lt;br /&gt;
   3399      ABGC BOV-WUR- megen002   R      27:26      1 node007&lt;br /&gt;
   3400      ABGC BOV-WUR- megen002   R      27:26      1 node008&lt;br /&gt;
   3401      ABGC BOV-WUR- megen002   R      27:26      1 node009&lt;br /&gt;
   3385  research BOV-WUR- megen002   R      44:38      1 node049&lt;br /&gt;
   3386  research BOV-WUR- megen002   R      44:38      1 node050&lt;br /&gt;
   3387  research BOV-WUR- megen002   R      44:38      1 node051&lt;br /&gt;
   3388  research BOV-WUR- megen002   R      44:38      1 node052&lt;br /&gt;
   3389  research BOV-WUR- megen002   R      44:38      1 node053&lt;br /&gt;
   3390  research BOV-WUR- megen002   R      44:38      1 node054&lt;br /&gt;
   3391  research BOV-WUR- megen002   R      44:38      3 node[049-051]&lt;br /&gt;
   3392  research BOV-WUR- megen002   R      44:38      3 node[052-054]&lt;br /&gt;
   3393  research BOV-WUR- megen002   R      44:38      1 node001&lt;br /&gt;
   3394  research BOV-WUR- megen002   R      44:38      1 node002&lt;br /&gt;
   3395  research BOV-WUR- megen002   R      44:38      1 node003&lt;br /&gt;
&lt;br /&gt;
=== Monitoring time limit set for a specific job ===&lt;br /&gt;
The default time limit is set at one hour. Estimated run times need to be specified when running jobs. To see what the time limit is that is set for a certain job, this can be done using the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
squeue -l -j 3532&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Information similar to the following should appear:&lt;br /&gt;
  Fri Nov 29 15:41:00 2013&lt;br /&gt;
   JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)&lt;br /&gt;
   3532      ABGC BOV-WUR- megen002  RUNNING    2:47:03 3-08:00:00      1 node054&lt;br /&gt;
&lt;br /&gt;
=== Query a specific active job: scontrol ===&lt;br /&gt;
Show all the details of a currently active job, so not a completed job.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
login ~]$ scontrol show jobid 4241&lt;br /&gt;
JobId=4241 Name=WB20F06&lt;br /&gt;
   UserId=megen002(16795409) GroupId=domain users(16777729)&lt;br /&gt;
   Priority=1 Account=(null) QOS=normal&lt;br /&gt;
   JobState=RUNNING Reason=None Dependency=(null)&lt;br /&gt;
   Requeue=1 Restarts=0 BatchFlag=1 ExitCode=0:0&lt;br /&gt;
   RunTime=02:55:25 TimeLimit=3-08:00:00 TimeMin=N/A&lt;br /&gt;
   SubmitTime=2013-12-09T13:37:29 EligibleTime=2013-12-09T13:37:29&lt;br /&gt;
   StartTime=2013-12-09T13:37:29 EndTime=2013-12-12T21:37:29&lt;br /&gt;
   PreemptTime=None SuspendTime=None SecsPreSuspend=0&lt;br /&gt;
   Partition=research AllocNode:Sid=login0:21799&lt;br /&gt;
   ReqNodeList=(null) ExcNodeList=(null)&lt;br /&gt;
   NodeList=node023&lt;br /&gt;
   BatchHost=node023&lt;br /&gt;
   NumNodes=1 NumCPUs=4 CPUs/Task=1 ReqS:C:T=*:*:*&lt;br /&gt;
   MinCPUsNode=1 MinMemoryNode=0 MinTmpDiskNode=0&lt;br /&gt;
   Features=(null) Gres=(null) Reservation=(null)&lt;br /&gt;
   Shared=OK Contiguous=0 Licenses=(null) Network=(null)&lt;br /&gt;
   Command=/lustre/scratch/WUR/ABGC/...&lt;br /&gt;
   WorkDir=/lustre/scratch/WUR/ABGC/...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Check on a pending job ===&lt;br /&gt;
A submitted job could result in a pending state when there are not enough resources available to this job.&lt;br /&gt;
In this example I sumbit a job, check the status and after finding out is it &#039;&#039;&#039;pending&#039;&#039;&#039; I&#039;ll check when is probably will start.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
[@login jobs]$ sbatch hpl_student.job&lt;br /&gt;
 Submitted batch job 740338&lt;br /&gt;
&lt;br /&gt;
[@login jobs]$ squeue -l -j 740338&lt;br /&gt;
 Fri Feb 21 15:32:31 2014&lt;br /&gt;
  JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)&lt;br /&gt;
 740338 ABGC_Stud HPLstude bohme999  PENDING       0:00 1-00:00:00      1 (ReqNodeNotAvail)&lt;br /&gt;
&lt;br /&gt;
[@login jobs]$ squeue --start -j 740338&lt;br /&gt;
  JOBID PARTITION     NAME     USER  ST           START_TIME  NODES NODELIST(REASON)&lt;br /&gt;
 740338 ABGC_Stud HPLstude bohme999  PD  2014-02-22T15:31:48      1 (ReqNodeNotAvail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
So it seems this job will problably start the next day, but&#039;s thats no guarantee it will start indeed.&lt;br /&gt;
&lt;br /&gt;
== Removing jobs from a list: scancel ==&lt;br /&gt;
If for some reason you want to delete a job that is either in the queue or already running, you can remove it using the &#039;scancel&#039; command. The &#039;scancel&#039; command takes the jobid as a parameter. For the example above, this would be done using the following code:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
scancel 3401&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Allocating resources interactively: sinteractive ==&lt;br /&gt;
sinteractive is a tiny wrapper on srun to create interactive jobs quickly and easily. It allows you to get a shell on one of the nodes, with similar limits as you would do for a normal job. To use it, simply run:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sinteractive -c &amp;lt;num_cpus&amp;gt; --mem &amp;lt;amount_mem&amp;gt; --time &amp;lt;minutes&amp;gt; -p &amp;lt;partition&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You will then be presented with a new shell prompt on one of the compute nodes (run &#039;hostname&#039; to see which!). From here, you can test out code in an interactive fashion as needs be.&lt;br /&gt;
&lt;br /&gt;
Be advised though - not filling in the above fields will get you a shell with 1 CPU and 100Mb of RAM for 1 hour. This is useful for quick testing, however.&lt;br /&gt;
&lt;br /&gt;
=== sinteractive source ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
srun &amp;quot;$@&amp;quot; -I60 -N 1 -n 1 --pty bash -i&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== interactive Slurm - using salloc ===&lt;br /&gt;
If you don&#039;t want your shell to be transported but want a new remote shell, do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
salloc -p ABGC_Low $SHELL&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now your shell will stay on the login node, but you can do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
srun &amp;lt;command&amp;gt; &amp;amp;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To submit tasks to this new shell!&lt;br /&gt;
&lt;br /&gt;
Be aware that the time limit of salloc is default 1 hour. If you intend to run jobs for longer times than this, you need to edit the settings for it. See: https://computing.llnl.gov/linux/slurm/salloc.html&lt;br /&gt;
&lt;br /&gt;
== Get overview of past and current jobs: sacct ==&lt;br /&gt;
To do some accounting on past and present jobs, and to see whether they ran to completion, you can do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sacct&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should provide information similar to the following:&lt;br /&gt;
&lt;br /&gt;
         JobID    JobName  Partition    Account  AllocCPUS      State ExitCode &lt;br /&gt;
  ------------ ---------- ---------- ---------- ---------- ---------- -------- &lt;br /&gt;
  3385         BOV-WUR-58   research                    12  COMPLETED      0:0 &lt;br /&gt;
  3385.batch        batch                                1  COMPLETED      0:0 &lt;br /&gt;
  3386         BOV-WUR-59   research                    12 CANCELLED+      0:0 &lt;br /&gt;
  3386.batch        batch                                1  CANCELLED     0:15 &lt;br /&gt;
  3528         BOV-WUR-59       ABGC                    16    RUNNING      0:0 &lt;br /&gt;
  3529         BOV-WUR-60       ABGC                    16    RUNNING      0:0&lt;br /&gt;
&lt;br /&gt;
Or in more detail for a specific job:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sacct --format=jobid,jobname,comment,partition,ntasks,alloccpus,elapsed,state,exitcode -j 4220&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should provide information about job id 4220:&lt;br /&gt;
&lt;br /&gt;
       JobID    JobName    Comment   Partition   NTasks  AllocCPUS    Elapsed      State ExitCode &lt;br /&gt;
  ------------ ---------- ---------- ---------- -------- ---------- ---------- ---------- -------- &lt;br /&gt;
  4220         PreProces+              research                   3   00:30:52  COMPLETED      0:0 &lt;br /&gt;
  4220.batch        batch                              1          1   00:30:52  COMPLETED      0:0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Job Status Codes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically your job will be either in the Running state of PenDing state. However here is a breakdown of all the states that your job could be in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Code!!State!!Description&lt;br /&gt;
|-&lt;br /&gt;
|CA	||CANCELLED||	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;
|CD||	COMPLETED||	Job has terminated all processes on all nodes.&lt;br /&gt;
|-&lt;br /&gt;
|CF||	CONFIGURING||	Job has been allocated resources, but are waiting for them to become ready for use (e.g. booting).&lt;br /&gt;
|-&lt;br /&gt;
|CG||	COMPLETING||	Job is in the process of completing. Some processes on some nodes may still be active.&lt;br /&gt;
|-&lt;br /&gt;
|F||	FAILED||	Job terminated with non-zero exit code or other failure condition.&lt;br /&gt;
|-&lt;br /&gt;
|NF||	NODE_FAIL||	Job terminated due to failure of one or more allocated nodes.&lt;br /&gt;
|-&lt;br /&gt;
|PD||	PENDING||	Job is awaiting resource allocation.&lt;br /&gt;
|-&lt;br /&gt;
|R||	RUNNING||	Job currently has an allocation.&lt;br /&gt;
|-&lt;br /&gt;
|S||	SUSPENDED||	Job has an allocation, but execution has been suspended.&lt;br /&gt;
|-&lt;br /&gt;
|TO||	TIMEOUT||	Job terminated upon reaching its time limit.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Running MPI jobs on Anunna ==&lt;br /&gt;
&lt;br /&gt;
[[MPI_on_B4F_cluster | Main article: MPI on Anunna]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Tariffs | Costs associated with resource usage]]&lt;br /&gt;
* [[B4F_cluster | Anunna]]&lt;br /&gt;
* [[BCM_on_B4F_cluster | BCM on Anunna]]&lt;br /&gt;
* [[SLURM_Compare | SLURM compared to other common schedulers]]&lt;br /&gt;
* [[Setting_up_Python_virtualenv | Setting up and using a virtual environment for Python3 ]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://slurm.schedmd.com Slurm official documentation]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management Slurm on Wikipedia]&lt;br /&gt;
* [http://www.youtube.com/watch?v=axWffyrk3aY Slurm Tutorial on Youtube]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Scheduler_Overview_(Slurm)&amp;diff=2055</id>
		<title>Scheduler Overview (Slurm)</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Scheduler_Overview_(Slurm)&amp;diff=2055"/>
		<updated>2019-10-01T08:08:46Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* Using GPU */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The resource allocation / scheduling software on Anunna is [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management SLURM]: &#039;&#039;&#039;S&#039;&#039;&#039;imple &#039;&#039;&#039;L&#039;&#039;&#039;inux &#039;&#039;&#039;U&#039;&#039;&#039;tility for &#039;&#039;&#039;R&#039;&#039;&#039;esource &#039;&#039;&#039;M&#039;&#039;&#039;anagement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Queues and defaults ==&lt;br /&gt;
&lt;br /&gt;
=== Quality of Service ===&lt;br /&gt;
When submitting a job, you may optionally assign a different Quality of Service to it. You can do this with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --qos=std&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, jobs will use std, the standard quality.&lt;br /&gt;
&lt;br /&gt;
Optionally, you may elect to reduce the priority of your jobs to low. This comes with a limit of how long each job can be (8h) to prevent the cluster from being locked up entirely with low priority jobs.&lt;br /&gt;
&lt;br /&gt;
The high quality provides a higher priority to jobs (20) than std (10), or low (1). It is naturally more expensive.&lt;br /&gt;
&lt;br /&gt;
The highest priority goes to jobs in interactive quality (100), but you may not submit many jobs or many large jobs as this quality. This is exclusively for the use of immediate running jobs, ones that are going to have hands-on users behind them.&lt;br /&gt;
&lt;br /&gt;
Jobs may be restarted and rescheduled if a job with higher priority needs cluster resources, but as of right now, this is not occurring.&lt;br /&gt;
&lt;br /&gt;
=== Queues ===&lt;br /&gt;
The cluster consists of multiple partitions of nodes that you can submit to. The primary one is &#039;main&#039;. There are other partitions as needed - current plans include &#039;gpu&#039;.&lt;br /&gt;
&lt;br /&gt;
You can see the partitions available with `sinfo`:&lt;br /&gt;
&lt;br /&gt;
=== Defaults ===&lt;br /&gt;
The default partition is &#039;main&#039;. This will work for most jobs.&lt;br /&gt;
&lt;br /&gt;
The default qos is &#039;std&#039;.&lt;br /&gt;
&lt;br /&gt;
The default cpu count is 1.&lt;br /&gt;
&lt;br /&gt;
The default run time for a job is &#039;&#039;&#039;1 hour&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The default memory limit is &#039;&#039;&#039;100MB per node&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Submitting jobs: sbatch ==&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
Consider this simple python3 script that should calculate Pi to 1 million digits:&lt;br /&gt;
&amp;lt;source lang=&#039;python&#039;&amp;gt;&lt;br /&gt;
from decimal import *&lt;br /&gt;
D=Decimal&lt;br /&gt;
getcontext().prec=10000000&lt;br /&gt;
p=sum(D(1)/16**k*(D(4)/(8*k+1)-D(2)/(8*k+4)-D(1)/(8*k+5)-D(1)/(8*k+6))for k in range(411))&lt;br /&gt;
print(str(p)[:10000002])&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Loading modules ===&lt;br /&gt;
In order for this script to run, the first thing that is needed is that Python3, which is not the default Python version on the cluster, is load into your environment. Availability of (different versions of) software can be checked by the following command:&lt;br /&gt;
  module avail&lt;br /&gt;
&lt;br /&gt;
In the list you should note that python3 is indeed available to be loaded, which then can be loaded with the following command:&lt;br /&gt;
  module load python/3.3.3&lt;br /&gt;
&lt;br /&gt;
=== Batch script ===&lt;br /&gt;
[[Creating_sbatch_script | Main Article: Creating a sbatch script]]&lt;br /&gt;
&lt;br /&gt;
The following shell/slurm script can then be used to schedule the job using the sbatch command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --comment=773320000&lt;br /&gt;
#SBATCH --time=1200&lt;br /&gt;
#SBATCH --mem=2048&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --output=output_%j.txt&lt;br /&gt;
#SBATCH --error=error_output_%j.txt&lt;br /&gt;
#SBATCH --job-name=calc_pi.py&lt;br /&gt;
#SBATCH --mail-type=ALL&lt;br /&gt;
#SBATCH --mail-user=email@org.nl&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
time python3 calc_pi.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting ===&lt;br /&gt;
The script, assuming it was named &#039;run_calc_pi.sh&#039;, can then be posted using the following command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sbatch run_calc_pi.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting multiple jobs (simple) ===&lt;br /&gt;
Assuming there are 10 job scripts, name runscript_1.sh through runscript_10.sh, all these scripts can be submitted using the following line of shell code:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;for i in `seq 1 10`; do echo $i; sbatch runscript_$i.sh;done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting multiple jobs (complex) ===&lt;br /&gt;
Lets&#039;s say you have three job scripts that depend on each other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_1.sh #A simple initialisation script&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_2.sh #An array task&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_3.sh #Some finishing script, single run, after everything previous has finished&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can create a script to simultaneously submit each job with a dependency on each other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;#!/bin/bash&lt;br /&gt;
JOB1=$(sbatch job_1.sh| rev | cut -d &#039; &#039; -f 1 | rev) #Get me the last space-separated element&lt;br /&gt;
&lt;br /&gt;
if ! [ &amp;quot;z$JOB1&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;First job submitted as jobid $JOB1&amp;quot;&lt;br /&gt;
  JOB2=$(sbatch --dependency=afterany:$JOB1 job_2.sh| rev | cut -d &#039; &#039; -f 1 | rev)&lt;br /&gt;
&lt;br /&gt;
  if ! [ &amp;quot;z$JOB2&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Second job submitted as jobid $JOB2, following $JOB1&amp;quot;&lt;br /&gt;
  JOB3=$(sbatch --dependency=afterany:$JOB2 job_3.sh| rev | cut -d &#039; &#039; -f 1 | rev)&lt;br /&gt;
&lt;br /&gt;
  if ! [ &amp;quot;z$JOB3&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Third job submitted as jobid $JOB3, following after every element of $JOB2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  fi&lt;br /&gt;
 fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will ensure that the subsequent jobs occur after any finishing of the former (even if they failed).&lt;br /&gt;
&lt;br /&gt;
Please see [https://slurm.schedmd.com/sbatch.html#OPT_dependency the sbatch documentation] for other options available to you. Note that aftercorr makes a subsequent array jobs array elements start after the correspondingly numbered ones from the previous job.&lt;br /&gt;
&lt;br /&gt;
=== Submitting array jobs ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --array=0-10%4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
SLURM allows you to submit multiple jobs using the same template. Further information about this can be found [[Array_jobs|here]].&lt;br /&gt;
&lt;br /&gt;
=== Using /tmp ===&lt;br /&gt;
There is a local disk of ~300G that can be used to temporarily stage some of your workload attached to each node. This is free to use, but please remember to clean up your data after usage.&lt;br /&gt;
&lt;br /&gt;
In order to be sure that you&#039;re able to use space in /tmp, you can add&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --tmp=&amp;lt;required size&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To your sbatch script. This will prevent your job from being run on nodes where there is no free space, or it&#039;s aimed to be used by another job at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Using GPU ===&lt;br /&gt;
There are two GPU nodes, in order to run a job that uses GPU on one of these nodes, you can add &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --gres=gpu:&amp;lt;num gpus&amp;gt;&lt;br /&gt;
#SBATCH --constraint=&amp;lt;gpu flavour e.g. K80, V100&amp;gt;&lt;br /&gt;
#SBATCH --partition=GPU&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To your sbatch script. Without this parameter, your job won&#039;t run on one of these nodes.&lt;br /&gt;
&lt;br /&gt;
== Monitoring submitted jobs ==&lt;br /&gt;
Once a job is submitted, the status can be monitored using the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command. The &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command has a number of parameters for monitoring specific properties of the jobs such as time limit.&lt;br /&gt;
&lt;br /&gt;
=== Generic monitoring of all running jobs ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
  squeue&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should then get a list of jobs that are running at that time on the cluster, for the example on how to submit using the &#039;sbatch&#039; command, it may look like so:&lt;br /&gt;
    JOBID PARTITION     NAME     USER  ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
   3396      ABGC BOV-WUR- megen002   R      27:26      1 node004&lt;br /&gt;
   3397      ABGC BOV-WUR- megen002   R      27:26      1 node005&lt;br /&gt;
   3398      ABGC BOV-WUR- megen002   R      27:26      1 node006&lt;br /&gt;
   3399      ABGC BOV-WUR- megen002   R      27:26      1 node007&lt;br /&gt;
   3400      ABGC BOV-WUR- megen002   R      27:26      1 node008&lt;br /&gt;
   3401      ABGC BOV-WUR- megen002   R      27:26      1 node009&lt;br /&gt;
   3385  research BOV-WUR- megen002   R      44:38      1 node049&lt;br /&gt;
   3386  research BOV-WUR- megen002   R      44:38      1 node050&lt;br /&gt;
   3387  research BOV-WUR- megen002   R      44:38      1 node051&lt;br /&gt;
   3388  research BOV-WUR- megen002   R      44:38      1 node052&lt;br /&gt;
   3389  research BOV-WUR- megen002   R      44:38      1 node053&lt;br /&gt;
   3390  research BOV-WUR- megen002   R      44:38      1 node054&lt;br /&gt;
   3391  research BOV-WUR- megen002   R      44:38      3 node[049-051]&lt;br /&gt;
   3392  research BOV-WUR- megen002   R      44:38      3 node[052-054]&lt;br /&gt;
   3393  research BOV-WUR- megen002   R      44:38      1 node001&lt;br /&gt;
   3394  research BOV-WUR- megen002   R      44:38      1 node002&lt;br /&gt;
   3395  research BOV-WUR- megen002   R      44:38      1 node003&lt;br /&gt;
&lt;br /&gt;
=== Monitoring time limit set for a specific job ===&lt;br /&gt;
The default time limit is set at one hour. Estimated run times need to be specified when running jobs. To see what the time limit is that is set for a certain job, this can be done using the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
squeue -l -j 3532&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Information similar to the following should appear:&lt;br /&gt;
  Fri Nov 29 15:41:00 2013&lt;br /&gt;
   JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)&lt;br /&gt;
   3532      ABGC BOV-WUR- megen002  RUNNING    2:47:03 3-08:00:00      1 node054&lt;br /&gt;
&lt;br /&gt;
=== Query a specific active job: scontrol ===&lt;br /&gt;
Show all the details of a currently active job, so not a completed job.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
login ~]$ scontrol show jobid 4241&lt;br /&gt;
JobId=4241 Name=WB20F06&lt;br /&gt;
   UserId=megen002(16795409) GroupId=domain users(16777729)&lt;br /&gt;
   Priority=1 Account=(null) QOS=normal&lt;br /&gt;
   JobState=RUNNING Reason=None Dependency=(null)&lt;br /&gt;
   Requeue=1 Restarts=0 BatchFlag=1 ExitCode=0:0&lt;br /&gt;
   RunTime=02:55:25 TimeLimit=3-08:00:00 TimeMin=N/A&lt;br /&gt;
   SubmitTime=2013-12-09T13:37:29 EligibleTime=2013-12-09T13:37:29&lt;br /&gt;
   StartTime=2013-12-09T13:37:29 EndTime=2013-12-12T21:37:29&lt;br /&gt;
   PreemptTime=None SuspendTime=None SecsPreSuspend=0&lt;br /&gt;
   Partition=research AllocNode:Sid=login0:21799&lt;br /&gt;
   ReqNodeList=(null) ExcNodeList=(null)&lt;br /&gt;
   NodeList=node023&lt;br /&gt;
   BatchHost=node023&lt;br /&gt;
   NumNodes=1 NumCPUs=4 CPUs/Task=1 ReqS:C:T=*:*:*&lt;br /&gt;
   MinCPUsNode=1 MinMemoryNode=0 MinTmpDiskNode=0&lt;br /&gt;
   Features=(null) Gres=(null) Reservation=(null)&lt;br /&gt;
   Shared=OK Contiguous=0 Licenses=(null) Network=(null)&lt;br /&gt;
   Command=/lustre/scratch/WUR/ABGC/...&lt;br /&gt;
   WorkDir=/lustre/scratch/WUR/ABGC/...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Check on a pending job ===&lt;br /&gt;
A submitted job could result in a pending state when there are not enough resources available to this job.&lt;br /&gt;
In this example I sumbit a job, check the status and after finding out is it &#039;&#039;&#039;pending&#039;&#039;&#039; I&#039;ll check when is probably will start.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
[@login jobs]$ sbatch hpl_student.job&lt;br /&gt;
 Submitted batch job 740338&lt;br /&gt;
&lt;br /&gt;
[@login jobs]$ squeue -l -j 740338&lt;br /&gt;
 Fri Feb 21 15:32:31 2014&lt;br /&gt;
  JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)&lt;br /&gt;
 740338 ABGC_Stud HPLstude bohme999  PENDING       0:00 1-00:00:00      1 (ReqNodeNotAvail)&lt;br /&gt;
&lt;br /&gt;
[@login jobs]$ squeue --start -j 740338&lt;br /&gt;
  JOBID PARTITION     NAME     USER  ST           START_TIME  NODES NODELIST(REASON)&lt;br /&gt;
 740338 ABGC_Stud HPLstude bohme999  PD  2014-02-22T15:31:48      1 (ReqNodeNotAvail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
So it seems this job will problably start the next day, but&#039;s thats no guarantee it will start indeed.&lt;br /&gt;
&lt;br /&gt;
== Removing jobs from a list: scancel ==&lt;br /&gt;
If for some reason you want to delete a job that is either in the queue or already running, you can remove it using the &#039;scancel&#039; command. The &#039;scancel&#039; command takes the jobid as a parameter. For the example above, this would be done using the following code:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
scancel 3401&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Allocating resources interactively: sinteractive ==&lt;br /&gt;
sinteractive is a tiny wrapper on srun to create interactive jobs quickly and easily. It allows you to get a shell on one of the nodes, with similar limits as you would do for a normal job. To use it, simply run:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sinteractive -c &amp;lt;num_cpus&amp;gt; --mem &amp;lt;amount_mem&amp;gt; --time &amp;lt;minutes&amp;gt; -p &amp;lt;partition&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You will then be presented with a new shell prompt on one of the compute nodes (run &#039;hostname&#039; to see which!). From here, you can test out code in an interactive fashion as needs be.&lt;br /&gt;
&lt;br /&gt;
Be advised though - not filling in the above fields will get you a shell with 1 CPU and 100Mb of RAM for 1 hour. This is useful for quick testing, however.&lt;br /&gt;
&lt;br /&gt;
=== sinteractive source ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
srun &amp;quot;$@&amp;quot; -I60 -N 1 -n 1 --pty bash -i&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== interactive Slurm - using salloc ===&lt;br /&gt;
If you don&#039;t want your shell to be transported but want a new remote shell, do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
salloc -p ABGC_Low $SHELL&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now your shell will stay on the login node, but you can do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
srun &amp;lt;command&amp;gt; &amp;amp;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To submit tasks to this new shell!&lt;br /&gt;
&lt;br /&gt;
Be aware that the time limit of salloc is default 1 hour. If you intend to run jobs for longer times than this, you need to edit the settings for it. See: https://computing.llnl.gov/linux/slurm/salloc.html&lt;br /&gt;
&lt;br /&gt;
== Get overview of past and current jobs: sacct ==&lt;br /&gt;
To do some accounting on past and present jobs, and to see whether they ran to completion, you can do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sacct&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should provide information similar to the following:&lt;br /&gt;
&lt;br /&gt;
         JobID    JobName  Partition    Account  AllocCPUS      State ExitCode &lt;br /&gt;
  ------------ ---------- ---------- ---------- ---------- ---------- -------- &lt;br /&gt;
  3385         BOV-WUR-58   research                    12  COMPLETED      0:0 &lt;br /&gt;
  3385.batch        batch                                1  COMPLETED      0:0 &lt;br /&gt;
  3386         BOV-WUR-59   research                    12 CANCELLED+      0:0 &lt;br /&gt;
  3386.batch        batch                                1  CANCELLED     0:15 &lt;br /&gt;
  3528         BOV-WUR-59       ABGC                    16    RUNNING      0:0 &lt;br /&gt;
  3529         BOV-WUR-60       ABGC                    16    RUNNING      0:0&lt;br /&gt;
&lt;br /&gt;
Or in more detail for a specific job:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sacct --format=jobid,jobname,comment,partition,ntasks,alloccpus,elapsed,state,exitcode -j 4220&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should provide information about job id 4220:&lt;br /&gt;
&lt;br /&gt;
       JobID    JobName    Comment   Partition   NTasks  AllocCPUS    Elapsed      State ExitCode &lt;br /&gt;
  ------------ ---------- ---------- ---------- -------- ---------- ---------- ---------- -------- &lt;br /&gt;
  4220         PreProces+              research                   3   00:30:52  COMPLETED      0:0 &lt;br /&gt;
  4220.batch        batch                              1          1   00:30:52  COMPLETED      0:0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Job Status Codes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically your job will be either in the Running state of PenDing state. However here is a breakdown of all the states that your job could be in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Code!!State!!Description&lt;br /&gt;
|-&lt;br /&gt;
|CA	||CANCELLED||	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;
|CD||	COMPLETED||	Job has terminated all processes on all nodes.&lt;br /&gt;
|-&lt;br /&gt;
|CF||	CONFIGURING||	Job has been allocated resources, but are waiting for them to become ready for use (e.g. booting).&lt;br /&gt;
|-&lt;br /&gt;
|CG||	COMPLETING||	Job is in the process of completing. Some processes on some nodes may still be active.&lt;br /&gt;
|-&lt;br /&gt;
|F||	FAILED||	Job terminated with non-zero exit code or other failure condition.&lt;br /&gt;
|-&lt;br /&gt;
|NF||	NODE_FAIL||	Job terminated due to failure of one or more allocated nodes.&lt;br /&gt;
|-&lt;br /&gt;
|PD||	PENDING||	Job is awaiting resource allocation.&lt;br /&gt;
|-&lt;br /&gt;
|R||	RUNNING||	Job currently has an allocation.&lt;br /&gt;
|-&lt;br /&gt;
|S||	SUSPENDED||	Job has an allocation, but execution has been suspended.&lt;br /&gt;
|-&lt;br /&gt;
|TO||	TIMEOUT||	Job terminated upon reaching its time limit.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Running MPI jobs on Anunna ==&lt;br /&gt;
&lt;br /&gt;
[[MPI_on_B4F_cluster | Main article: MPI on Anunna]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Tariffs | Costs associated with resource usage]]&lt;br /&gt;
* [[B4F_cluster | Anunna]]&lt;br /&gt;
* [[BCM_on_B4F_cluster | BCM on Anunna]]&lt;br /&gt;
* [[SLURM_Compare | SLURM compared to other common schedulers]]&lt;br /&gt;
* [[Setting_up_Python_virtualenv | Setting up and using a virtual environment for Python3 ]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://slurm.schedmd.com Slurm official documentation]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management Slurm on Wikipedia]&lt;br /&gt;
* [http://www.youtube.com/watch?v=axWffyrk3aY Slurm Tutorial on Youtube]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Scheduler_Overview_(Slurm)&amp;diff=2054</id>
		<title>Scheduler Overview (Slurm)</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Scheduler_Overview_(Slurm)&amp;diff=2054"/>
		<updated>2019-10-01T08:07:53Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* Using GPU */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The resource allocation / scheduling software on Anunna is [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management SLURM]: &#039;&#039;&#039;S&#039;&#039;&#039;imple &#039;&#039;&#039;L&#039;&#039;&#039;inux &#039;&#039;&#039;U&#039;&#039;&#039;tility for &#039;&#039;&#039;R&#039;&#039;&#039;esource &#039;&#039;&#039;M&#039;&#039;&#039;anagement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Queues and defaults ==&lt;br /&gt;
&lt;br /&gt;
=== Quality of Service ===&lt;br /&gt;
When submitting a job, you may optionally assign a different Quality of Service to it. You can do this with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --qos=std&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, jobs will use std, the standard quality.&lt;br /&gt;
&lt;br /&gt;
Optionally, you may elect to reduce the priority of your jobs to low. This comes with a limit of how long each job can be (8h) to prevent the cluster from being locked up entirely with low priority jobs.&lt;br /&gt;
&lt;br /&gt;
The high quality provides a higher priority to jobs (20) than std (10), or low (1). It is naturally more expensive.&lt;br /&gt;
&lt;br /&gt;
The highest priority goes to jobs in interactive quality (100), but you may not submit many jobs or many large jobs as this quality. This is exclusively for the use of immediate running jobs, ones that are going to have hands-on users behind them.&lt;br /&gt;
&lt;br /&gt;
Jobs may be restarted and rescheduled if a job with higher priority needs cluster resources, but as of right now, this is not occurring.&lt;br /&gt;
&lt;br /&gt;
=== Queues ===&lt;br /&gt;
The cluster consists of multiple partitions of nodes that you can submit to. The primary one is &#039;main&#039;. There are other partitions as needed - current plans include &#039;gpu&#039;.&lt;br /&gt;
&lt;br /&gt;
You can see the partitions available with `sinfo`:&lt;br /&gt;
&lt;br /&gt;
=== Defaults ===&lt;br /&gt;
The default partition is &#039;main&#039;. This will work for most jobs.&lt;br /&gt;
&lt;br /&gt;
The default qos is &#039;std&#039;.&lt;br /&gt;
&lt;br /&gt;
The default cpu count is 1.&lt;br /&gt;
&lt;br /&gt;
The default run time for a job is &#039;&#039;&#039;1 hour&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The default memory limit is &#039;&#039;&#039;100MB per node&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Submitting jobs: sbatch ==&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
Consider this simple python3 script that should calculate Pi to 1 million digits:&lt;br /&gt;
&amp;lt;source lang=&#039;python&#039;&amp;gt;&lt;br /&gt;
from decimal import *&lt;br /&gt;
D=Decimal&lt;br /&gt;
getcontext().prec=10000000&lt;br /&gt;
p=sum(D(1)/16**k*(D(4)/(8*k+1)-D(2)/(8*k+4)-D(1)/(8*k+5)-D(1)/(8*k+6))for k in range(411))&lt;br /&gt;
print(str(p)[:10000002])&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Loading modules ===&lt;br /&gt;
In order for this script to run, the first thing that is needed is that Python3, which is not the default Python version on the cluster, is load into your environment. Availability of (different versions of) software can be checked by the following command:&lt;br /&gt;
  module avail&lt;br /&gt;
&lt;br /&gt;
In the list you should note that python3 is indeed available to be loaded, which then can be loaded with the following command:&lt;br /&gt;
  module load python/3.3.3&lt;br /&gt;
&lt;br /&gt;
=== Batch script ===&lt;br /&gt;
[[Creating_sbatch_script | Main Article: Creating a sbatch script]]&lt;br /&gt;
&lt;br /&gt;
The following shell/slurm script can then be used to schedule the job using the sbatch command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --comment=773320000&lt;br /&gt;
#SBATCH --time=1200&lt;br /&gt;
#SBATCH --mem=2048&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --output=output_%j.txt&lt;br /&gt;
#SBATCH --error=error_output_%j.txt&lt;br /&gt;
#SBATCH --job-name=calc_pi.py&lt;br /&gt;
#SBATCH --mail-type=ALL&lt;br /&gt;
#SBATCH --mail-user=email@org.nl&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
time python3 calc_pi.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting ===&lt;br /&gt;
The script, assuming it was named &#039;run_calc_pi.sh&#039;, can then be posted using the following command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sbatch run_calc_pi.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting multiple jobs (simple) ===&lt;br /&gt;
Assuming there are 10 job scripts, name runscript_1.sh through runscript_10.sh, all these scripts can be submitted using the following line of shell code:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;for i in `seq 1 10`; do echo $i; sbatch runscript_$i.sh;done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting multiple jobs (complex) ===&lt;br /&gt;
Lets&#039;s say you have three job scripts that depend on each other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_1.sh #A simple initialisation script&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_2.sh #An array task&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_3.sh #Some finishing script, single run, after everything previous has finished&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can create a script to simultaneously submit each job with a dependency on each other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;#!/bin/bash&lt;br /&gt;
JOB1=$(sbatch job_1.sh| rev | cut -d &#039; &#039; -f 1 | rev) #Get me the last space-separated element&lt;br /&gt;
&lt;br /&gt;
if ! [ &amp;quot;z$JOB1&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;First job submitted as jobid $JOB1&amp;quot;&lt;br /&gt;
  JOB2=$(sbatch --dependency=afterany:$JOB1 job_2.sh| rev | cut -d &#039; &#039; -f 1 | rev)&lt;br /&gt;
&lt;br /&gt;
  if ! [ &amp;quot;z$JOB2&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Second job submitted as jobid $JOB2, following $JOB1&amp;quot;&lt;br /&gt;
  JOB3=$(sbatch --dependency=afterany:$JOB2 job_3.sh| rev | cut -d &#039; &#039; -f 1 | rev)&lt;br /&gt;
&lt;br /&gt;
  if ! [ &amp;quot;z$JOB3&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Third job submitted as jobid $JOB3, following after every element of $JOB2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  fi&lt;br /&gt;
 fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will ensure that the subsequent jobs occur after any finishing of the former (even if they failed).&lt;br /&gt;
&lt;br /&gt;
Please see [https://slurm.schedmd.com/sbatch.html#OPT_dependency the sbatch documentation] for other options available to you. Note that aftercorr makes a subsequent array jobs array elements start after the correspondingly numbered ones from the previous job.&lt;br /&gt;
&lt;br /&gt;
=== Submitting array jobs ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --array=0-10%4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
SLURM allows you to submit multiple jobs using the same template. Further information about this can be found [[Array_jobs|here]].&lt;br /&gt;
&lt;br /&gt;
=== Using /tmp ===&lt;br /&gt;
There is a local disk of ~300G that can be used to temporarily stage some of your workload attached to each node. This is free to use, but please remember to clean up your data after usage.&lt;br /&gt;
&lt;br /&gt;
In order to be sure that you&#039;re able to use space in /tmp, you can add&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --tmp=&amp;lt;required size&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To your sbatch script. This will prevent your job from being run on nodes where there is no free space, or it&#039;s aimed to be used by another job at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Using GPU ===&lt;br /&gt;
There are two GPU nodes, in order to run a job that uses GPU on one of these nodes, you can add &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --gres=gpu:&amp;lt;num gpus&amp;gt;&lt;br /&gt;
#SBATCH --partition=GPU&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To your sbatch script. Without this parameter, your job won&#039;t run on one of these nodes.&lt;br /&gt;
&lt;br /&gt;
== Monitoring submitted jobs ==&lt;br /&gt;
Once a job is submitted, the status can be monitored using the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command. The &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command has a number of parameters for monitoring specific properties of the jobs such as time limit.&lt;br /&gt;
&lt;br /&gt;
=== Generic monitoring of all running jobs ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
  squeue&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should then get a list of jobs that are running at that time on the cluster, for the example on how to submit using the &#039;sbatch&#039; command, it may look like so:&lt;br /&gt;
    JOBID PARTITION     NAME     USER  ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
   3396      ABGC BOV-WUR- megen002   R      27:26      1 node004&lt;br /&gt;
   3397      ABGC BOV-WUR- megen002   R      27:26      1 node005&lt;br /&gt;
   3398      ABGC BOV-WUR- megen002   R      27:26      1 node006&lt;br /&gt;
   3399      ABGC BOV-WUR- megen002   R      27:26      1 node007&lt;br /&gt;
   3400      ABGC BOV-WUR- megen002   R      27:26      1 node008&lt;br /&gt;
   3401      ABGC BOV-WUR- megen002   R      27:26      1 node009&lt;br /&gt;
   3385  research BOV-WUR- megen002   R      44:38      1 node049&lt;br /&gt;
   3386  research BOV-WUR- megen002   R      44:38      1 node050&lt;br /&gt;
   3387  research BOV-WUR- megen002   R      44:38      1 node051&lt;br /&gt;
   3388  research BOV-WUR- megen002   R      44:38      1 node052&lt;br /&gt;
   3389  research BOV-WUR- megen002   R      44:38      1 node053&lt;br /&gt;
   3390  research BOV-WUR- megen002   R      44:38      1 node054&lt;br /&gt;
   3391  research BOV-WUR- megen002   R      44:38      3 node[049-051]&lt;br /&gt;
   3392  research BOV-WUR- megen002   R      44:38      3 node[052-054]&lt;br /&gt;
   3393  research BOV-WUR- megen002   R      44:38      1 node001&lt;br /&gt;
   3394  research BOV-WUR- megen002   R      44:38      1 node002&lt;br /&gt;
   3395  research BOV-WUR- megen002   R      44:38      1 node003&lt;br /&gt;
&lt;br /&gt;
=== Monitoring time limit set for a specific job ===&lt;br /&gt;
The default time limit is set at one hour. Estimated run times need to be specified when running jobs. To see what the time limit is that is set for a certain job, this can be done using the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
squeue -l -j 3532&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Information similar to the following should appear:&lt;br /&gt;
  Fri Nov 29 15:41:00 2013&lt;br /&gt;
   JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)&lt;br /&gt;
   3532      ABGC BOV-WUR- megen002  RUNNING    2:47:03 3-08:00:00      1 node054&lt;br /&gt;
&lt;br /&gt;
=== Query a specific active job: scontrol ===&lt;br /&gt;
Show all the details of a currently active job, so not a completed job.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
login ~]$ scontrol show jobid 4241&lt;br /&gt;
JobId=4241 Name=WB20F06&lt;br /&gt;
   UserId=megen002(16795409) GroupId=domain users(16777729)&lt;br /&gt;
   Priority=1 Account=(null) QOS=normal&lt;br /&gt;
   JobState=RUNNING Reason=None Dependency=(null)&lt;br /&gt;
   Requeue=1 Restarts=0 BatchFlag=1 ExitCode=0:0&lt;br /&gt;
   RunTime=02:55:25 TimeLimit=3-08:00:00 TimeMin=N/A&lt;br /&gt;
   SubmitTime=2013-12-09T13:37:29 EligibleTime=2013-12-09T13:37:29&lt;br /&gt;
   StartTime=2013-12-09T13:37:29 EndTime=2013-12-12T21:37:29&lt;br /&gt;
   PreemptTime=None SuspendTime=None SecsPreSuspend=0&lt;br /&gt;
   Partition=research AllocNode:Sid=login0:21799&lt;br /&gt;
   ReqNodeList=(null) ExcNodeList=(null)&lt;br /&gt;
   NodeList=node023&lt;br /&gt;
   BatchHost=node023&lt;br /&gt;
   NumNodes=1 NumCPUs=4 CPUs/Task=1 ReqS:C:T=*:*:*&lt;br /&gt;
   MinCPUsNode=1 MinMemoryNode=0 MinTmpDiskNode=0&lt;br /&gt;
   Features=(null) Gres=(null) Reservation=(null)&lt;br /&gt;
   Shared=OK Contiguous=0 Licenses=(null) Network=(null)&lt;br /&gt;
   Command=/lustre/scratch/WUR/ABGC/...&lt;br /&gt;
   WorkDir=/lustre/scratch/WUR/ABGC/...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Check on a pending job ===&lt;br /&gt;
A submitted job could result in a pending state when there are not enough resources available to this job.&lt;br /&gt;
In this example I sumbit a job, check the status and after finding out is it &#039;&#039;&#039;pending&#039;&#039;&#039; I&#039;ll check when is probably will start.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
[@login jobs]$ sbatch hpl_student.job&lt;br /&gt;
 Submitted batch job 740338&lt;br /&gt;
&lt;br /&gt;
[@login jobs]$ squeue -l -j 740338&lt;br /&gt;
 Fri Feb 21 15:32:31 2014&lt;br /&gt;
  JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)&lt;br /&gt;
 740338 ABGC_Stud HPLstude bohme999  PENDING       0:00 1-00:00:00      1 (ReqNodeNotAvail)&lt;br /&gt;
&lt;br /&gt;
[@login jobs]$ squeue --start -j 740338&lt;br /&gt;
  JOBID PARTITION     NAME     USER  ST           START_TIME  NODES NODELIST(REASON)&lt;br /&gt;
 740338 ABGC_Stud HPLstude bohme999  PD  2014-02-22T15:31:48      1 (ReqNodeNotAvail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
So it seems this job will problably start the next day, but&#039;s thats no guarantee it will start indeed.&lt;br /&gt;
&lt;br /&gt;
== Removing jobs from a list: scancel ==&lt;br /&gt;
If for some reason you want to delete a job that is either in the queue or already running, you can remove it using the &#039;scancel&#039; command. The &#039;scancel&#039; command takes the jobid as a parameter. For the example above, this would be done using the following code:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
scancel 3401&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Allocating resources interactively: sinteractive ==&lt;br /&gt;
sinteractive is a tiny wrapper on srun to create interactive jobs quickly and easily. It allows you to get a shell on one of the nodes, with similar limits as you would do for a normal job. To use it, simply run:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sinteractive -c &amp;lt;num_cpus&amp;gt; --mem &amp;lt;amount_mem&amp;gt; --time &amp;lt;minutes&amp;gt; -p &amp;lt;partition&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You will then be presented with a new shell prompt on one of the compute nodes (run &#039;hostname&#039; to see which!). From here, you can test out code in an interactive fashion as needs be.&lt;br /&gt;
&lt;br /&gt;
Be advised though - not filling in the above fields will get you a shell with 1 CPU and 100Mb of RAM for 1 hour. This is useful for quick testing, however.&lt;br /&gt;
&lt;br /&gt;
=== sinteractive source ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
srun &amp;quot;$@&amp;quot; -I60 -N 1 -n 1 --pty bash -i&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== interactive Slurm - using salloc ===&lt;br /&gt;
If you don&#039;t want your shell to be transported but want a new remote shell, do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
salloc -p ABGC_Low $SHELL&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now your shell will stay on the login node, but you can do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
srun &amp;lt;command&amp;gt; &amp;amp;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To submit tasks to this new shell!&lt;br /&gt;
&lt;br /&gt;
Be aware that the time limit of salloc is default 1 hour. If you intend to run jobs for longer times than this, you need to edit the settings for it. See: https://computing.llnl.gov/linux/slurm/salloc.html&lt;br /&gt;
&lt;br /&gt;
== Get overview of past and current jobs: sacct ==&lt;br /&gt;
To do some accounting on past and present jobs, and to see whether they ran to completion, you can do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sacct&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should provide information similar to the following:&lt;br /&gt;
&lt;br /&gt;
         JobID    JobName  Partition    Account  AllocCPUS      State ExitCode &lt;br /&gt;
  ------------ ---------- ---------- ---------- ---------- ---------- -------- &lt;br /&gt;
  3385         BOV-WUR-58   research                    12  COMPLETED      0:0 &lt;br /&gt;
  3385.batch        batch                                1  COMPLETED      0:0 &lt;br /&gt;
  3386         BOV-WUR-59   research                    12 CANCELLED+      0:0 &lt;br /&gt;
  3386.batch        batch                                1  CANCELLED     0:15 &lt;br /&gt;
  3528         BOV-WUR-59       ABGC                    16    RUNNING      0:0 &lt;br /&gt;
  3529         BOV-WUR-60       ABGC                    16    RUNNING      0:0&lt;br /&gt;
&lt;br /&gt;
Or in more detail for a specific job:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sacct --format=jobid,jobname,comment,partition,ntasks,alloccpus,elapsed,state,exitcode -j 4220&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should provide information about job id 4220:&lt;br /&gt;
&lt;br /&gt;
       JobID    JobName    Comment   Partition   NTasks  AllocCPUS    Elapsed      State ExitCode &lt;br /&gt;
  ------------ ---------- ---------- ---------- -------- ---------- ---------- ---------- -------- &lt;br /&gt;
  4220         PreProces+              research                   3   00:30:52  COMPLETED      0:0 &lt;br /&gt;
  4220.batch        batch                              1          1   00:30:52  COMPLETED      0:0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Job Status Codes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically your job will be either in the Running state of PenDing state. However here is a breakdown of all the states that your job could be in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Code!!State!!Description&lt;br /&gt;
|-&lt;br /&gt;
|CA	||CANCELLED||	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;
|CD||	COMPLETED||	Job has terminated all processes on all nodes.&lt;br /&gt;
|-&lt;br /&gt;
|CF||	CONFIGURING||	Job has been allocated resources, but are waiting for them to become ready for use (e.g. booting).&lt;br /&gt;
|-&lt;br /&gt;
|CG||	COMPLETING||	Job is in the process of completing. Some processes on some nodes may still be active.&lt;br /&gt;
|-&lt;br /&gt;
|F||	FAILED||	Job terminated with non-zero exit code or other failure condition.&lt;br /&gt;
|-&lt;br /&gt;
|NF||	NODE_FAIL||	Job terminated due to failure of one or more allocated nodes.&lt;br /&gt;
|-&lt;br /&gt;
|PD||	PENDING||	Job is awaiting resource allocation.&lt;br /&gt;
|-&lt;br /&gt;
|R||	RUNNING||	Job currently has an allocation.&lt;br /&gt;
|-&lt;br /&gt;
|S||	SUSPENDED||	Job has an allocation, but execution has been suspended.&lt;br /&gt;
|-&lt;br /&gt;
|TO||	TIMEOUT||	Job terminated upon reaching its time limit.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Running MPI jobs on Anunna ==&lt;br /&gt;
&lt;br /&gt;
[[MPI_on_B4F_cluster | Main article: MPI on Anunna]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Tariffs | Costs associated with resource usage]]&lt;br /&gt;
* [[B4F_cluster | Anunna]]&lt;br /&gt;
* [[BCM_on_B4F_cluster | BCM on Anunna]]&lt;br /&gt;
* [[SLURM_Compare | SLURM compared to other common schedulers]]&lt;br /&gt;
* [[Setting_up_Python_virtualenv | Setting up and using a virtual environment for Python3 ]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://slurm.schedmd.com Slurm official documentation]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management Slurm on Wikipedia]&lt;br /&gt;
* [http://www.youtube.com/watch?v=axWffyrk3aY Slurm Tutorial on Youtube]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Scheduler_Overview_(Slurm)&amp;diff=2053</id>
		<title>Scheduler Overview (Slurm)</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Scheduler_Overview_(Slurm)&amp;diff=2053"/>
		<updated>2019-10-01T08:06:55Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* Using GPU */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The resource allocation / scheduling software on Anunna is [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management SLURM]: &#039;&#039;&#039;S&#039;&#039;&#039;imple &#039;&#039;&#039;L&#039;&#039;&#039;inux &#039;&#039;&#039;U&#039;&#039;&#039;tility for &#039;&#039;&#039;R&#039;&#039;&#039;esource &#039;&#039;&#039;M&#039;&#039;&#039;anagement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Queues and defaults ==&lt;br /&gt;
&lt;br /&gt;
=== Quality of Service ===&lt;br /&gt;
When submitting a job, you may optionally assign a different Quality of Service to it. You can do this with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --qos=std&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, jobs will use std, the standard quality.&lt;br /&gt;
&lt;br /&gt;
Optionally, you may elect to reduce the priority of your jobs to low. This comes with a limit of how long each job can be (8h) to prevent the cluster from being locked up entirely with low priority jobs.&lt;br /&gt;
&lt;br /&gt;
The high quality provides a higher priority to jobs (20) than std (10), or low (1). It is naturally more expensive.&lt;br /&gt;
&lt;br /&gt;
The highest priority goes to jobs in interactive quality (100), but you may not submit many jobs or many large jobs as this quality. This is exclusively for the use of immediate running jobs, ones that are going to have hands-on users behind them.&lt;br /&gt;
&lt;br /&gt;
Jobs may be restarted and rescheduled if a job with higher priority needs cluster resources, but as of right now, this is not occurring.&lt;br /&gt;
&lt;br /&gt;
=== Queues ===&lt;br /&gt;
The cluster consists of multiple partitions of nodes that you can submit to. The primary one is &#039;main&#039;. There are other partitions as needed - current plans include &#039;gpu&#039;.&lt;br /&gt;
&lt;br /&gt;
You can see the partitions available with `sinfo`:&lt;br /&gt;
&lt;br /&gt;
=== Defaults ===&lt;br /&gt;
The default partition is &#039;main&#039;. This will work for most jobs.&lt;br /&gt;
&lt;br /&gt;
The default qos is &#039;std&#039;.&lt;br /&gt;
&lt;br /&gt;
The default cpu count is 1.&lt;br /&gt;
&lt;br /&gt;
The default run time for a job is &#039;&#039;&#039;1 hour&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The default memory limit is &#039;&#039;&#039;100MB per node&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Submitting jobs: sbatch ==&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
Consider this simple python3 script that should calculate Pi to 1 million digits:&lt;br /&gt;
&amp;lt;source lang=&#039;python&#039;&amp;gt;&lt;br /&gt;
from decimal import *&lt;br /&gt;
D=Decimal&lt;br /&gt;
getcontext().prec=10000000&lt;br /&gt;
p=sum(D(1)/16**k*(D(4)/(8*k+1)-D(2)/(8*k+4)-D(1)/(8*k+5)-D(1)/(8*k+6))for k in range(411))&lt;br /&gt;
print(str(p)[:10000002])&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Loading modules ===&lt;br /&gt;
In order for this script to run, the first thing that is needed is that Python3, which is not the default Python version on the cluster, is load into your environment. Availability of (different versions of) software can be checked by the following command:&lt;br /&gt;
  module avail&lt;br /&gt;
&lt;br /&gt;
In the list you should note that python3 is indeed available to be loaded, which then can be loaded with the following command:&lt;br /&gt;
  module load python/3.3.3&lt;br /&gt;
&lt;br /&gt;
=== Batch script ===&lt;br /&gt;
[[Creating_sbatch_script | Main Article: Creating a sbatch script]]&lt;br /&gt;
&lt;br /&gt;
The following shell/slurm script can then be used to schedule the job using the sbatch command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --comment=773320000&lt;br /&gt;
#SBATCH --time=1200&lt;br /&gt;
#SBATCH --mem=2048&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --output=output_%j.txt&lt;br /&gt;
#SBATCH --error=error_output_%j.txt&lt;br /&gt;
#SBATCH --job-name=calc_pi.py&lt;br /&gt;
#SBATCH --mail-type=ALL&lt;br /&gt;
#SBATCH --mail-user=email@org.nl&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
time python3 calc_pi.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting ===&lt;br /&gt;
The script, assuming it was named &#039;run_calc_pi.sh&#039;, can then be posted using the following command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sbatch run_calc_pi.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting multiple jobs (simple) ===&lt;br /&gt;
Assuming there are 10 job scripts, name runscript_1.sh through runscript_10.sh, all these scripts can be submitted using the following line of shell code:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;for i in `seq 1 10`; do echo $i; sbatch runscript_$i.sh;done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting multiple jobs (complex) ===&lt;br /&gt;
Lets&#039;s say you have three job scripts that depend on each other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_1.sh #A simple initialisation script&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_2.sh #An array task&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_3.sh #Some finishing script, single run, after everything previous has finished&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can create a script to simultaneously submit each job with a dependency on each other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;#!/bin/bash&lt;br /&gt;
JOB1=$(sbatch job_1.sh| rev | cut -d &#039; &#039; -f 1 | rev) #Get me the last space-separated element&lt;br /&gt;
&lt;br /&gt;
if ! [ &amp;quot;z$JOB1&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;First job submitted as jobid $JOB1&amp;quot;&lt;br /&gt;
  JOB2=$(sbatch --dependency=afterany:$JOB1 job_2.sh| rev | cut -d &#039; &#039; -f 1 | rev)&lt;br /&gt;
&lt;br /&gt;
  if ! [ &amp;quot;z$JOB2&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Second job submitted as jobid $JOB2, following $JOB1&amp;quot;&lt;br /&gt;
  JOB3=$(sbatch --dependency=afterany:$JOB2 job_3.sh| rev | cut -d &#039; &#039; -f 1 | rev)&lt;br /&gt;
&lt;br /&gt;
  if ! [ &amp;quot;z$JOB3&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Third job submitted as jobid $JOB3, following after every element of $JOB2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  fi&lt;br /&gt;
 fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will ensure that the subsequent jobs occur after any finishing of the former (even if they failed).&lt;br /&gt;
&lt;br /&gt;
Please see [https://slurm.schedmd.com/sbatch.html#OPT_dependency the sbatch documentation] for other options available to you. Note that aftercorr makes a subsequent array jobs array elements start after the correspondingly numbered ones from the previous job.&lt;br /&gt;
&lt;br /&gt;
=== Submitting array jobs ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --array=0-10%4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
SLURM allows you to submit multiple jobs using the same template. Further information about this can be found [[Array_jobs|here]].&lt;br /&gt;
&lt;br /&gt;
=== Using /tmp ===&lt;br /&gt;
There is a local disk of ~300G that can be used to temporarily stage some of your workload attached to each node. This is free to use, but please remember to clean up your data after usage.&lt;br /&gt;
&lt;br /&gt;
In order to be sure that you&#039;re able to use space in /tmp, you can add&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --tmp=&amp;lt;required size&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To your sbatch script. This will prevent your job from being run on nodes where there is no free space, or it&#039;s aimed to be used by another job at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Using GPU ===&lt;br /&gt;
There are two GPU nodes, in order to run a job that uses GPU on one of these nodes, you can add &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --partition=GPU&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To your sbatch script. Without this parameter, your job won&#039;t run on one of these nodes.&lt;br /&gt;
&lt;br /&gt;
== Monitoring submitted jobs ==&lt;br /&gt;
Once a job is submitted, the status can be monitored using the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command. The &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command has a number of parameters for monitoring specific properties of the jobs such as time limit.&lt;br /&gt;
&lt;br /&gt;
=== Generic monitoring of all running jobs ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
  squeue&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should then get a list of jobs that are running at that time on the cluster, for the example on how to submit using the &#039;sbatch&#039; command, it may look like so:&lt;br /&gt;
    JOBID PARTITION     NAME     USER  ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
   3396      ABGC BOV-WUR- megen002   R      27:26      1 node004&lt;br /&gt;
   3397      ABGC BOV-WUR- megen002   R      27:26      1 node005&lt;br /&gt;
   3398      ABGC BOV-WUR- megen002   R      27:26      1 node006&lt;br /&gt;
   3399      ABGC BOV-WUR- megen002   R      27:26      1 node007&lt;br /&gt;
   3400      ABGC BOV-WUR- megen002   R      27:26      1 node008&lt;br /&gt;
   3401      ABGC BOV-WUR- megen002   R      27:26      1 node009&lt;br /&gt;
   3385  research BOV-WUR- megen002   R      44:38      1 node049&lt;br /&gt;
   3386  research BOV-WUR- megen002   R      44:38      1 node050&lt;br /&gt;
   3387  research BOV-WUR- megen002   R      44:38      1 node051&lt;br /&gt;
   3388  research BOV-WUR- megen002   R      44:38      1 node052&lt;br /&gt;
   3389  research BOV-WUR- megen002   R      44:38      1 node053&lt;br /&gt;
   3390  research BOV-WUR- megen002   R      44:38      1 node054&lt;br /&gt;
   3391  research BOV-WUR- megen002   R      44:38      3 node[049-051]&lt;br /&gt;
   3392  research BOV-WUR- megen002   R      44:38      3 node[052-054]&lt;br /&gt;
   3393  research BOV-WUR- megen002   R      44:38      1 node001&lt;br /&gt;
   3394  research BOV-WUR- megen002   R      44:38      1 node002&lt;br /&gt;
   3395  research BOV-WUR- megen002   R      44:38      1 node003&lt;br /&gt;
&lt;br /&gt;
=== Monitoring time limit set for a specific job ===&lt;br /&gt;
The default time limit is set at one hour. Estimated run times need to be specified when running jobs. To see what the time limit is that is set for a certain job, this can be done using the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
squeue -l -j 3532&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Information similar to the following should appear:&lt;br /&gt;
  Fri Nov 29 15:41:00 2013&lt;br /&gt;
   JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)&lt;br /&gt;
   3532      ABGC BOV-WUR- megen002  RUNNING    2:47:03 3-08:00:00      1 node054&lt;br /&gt;
&lt;br /&gt;
=== Query a specific active job: scontrol ===&lt;br /&gt;
Show all the details of a currently active job, so not a completed job.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
login ~]$ scontrol show jobid 4241&lt;br /&gt;
JobId=4241 Name=WB20F06&lt;br /&gt;
   UserId=megen002(16795409) GroupId=domain users(16777729)&lt;br /&gt;
   Priority=1 Account=(null) QOS=normal&lt;br /&gt;
   JobState=RUNNING Reason=None Dependency=(null)&lt;br /&gt;
   Requeue=1 Restarts=0 BatchFlag=1 ExitCode=0:0&lt;br /&gt;
   RunTime=02:55:25 TimeLimit=3-08:00:00 TimeMin=N/A&lt;br /&gt;
   SubmitTime=2013-12-09T13:37:29 EligibleTime=2013-12-09T13:37:29&lt;br /&gt;
   StartTime=2013-12-09T13:37:29 EndTime=2013-12-12T21:37:29&lt;br /&gt;
   PreemptTime=None SuspendTime=None SecsPreSuspend=0&lt;br /&gt;
   Partition=research AllocNode:Sid=login0:21799&lt;br /&gt;
   ReqNodeList=(null) ExcNodeList=(null)&lt;br /&gt;
   NodeList=node023&lt;br /&gt;
   BatchHost=node023&lt;br /&gt;
   NumNodes=1 NumCPUs=4 CPUs/Task=1 ReqS:C:T=*:*:*&lt;br /&gt;
   MinCPUsNode=1 MinMemoryNode=0 MinTmpDiskNode=0&lt;br /&gt;
   Features=(null) Gres=(null) Reservation=(null)&lt;br /&gt;
   Shared=OK Contiguous=0 Licenses=(null) Network=(null)&lt;br /&gt;
   Command=/lustre/scratch/WUR/ABGC/...&lt;br /&gt;
   WorkDir=/lustre/scratch/WUR/ABGC/...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Check on a pending job ===&lt;br /&gt;
A submitted job could result in a pending state when there are not enough resources available to this job.&lt;br /&gt;
In this example I sumbit a job, check the status and after finding out is it &#039;&#039;&#039;pending&#039;&#039;&#039; I&#039;ll check when is probably will start.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
[@login jobs]$ sbatch hpl_student.job&lt;br /&gt;
 Submitted batch job 740338&lt;br /&gt;
&lt;br /&gt;
[@login jobs]$ squeue -l -j 740338&lt;br /&gt;
 Fri Feb 21 15:32:31 2014&lt;br /&gt;
  JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)&lt;br /&gt;
 740338 ABGC_Stud HPLstude bohme999  PENDING       0:00 1-00:00:00      1 (ReqNodeNotAvail)&lt;br /&gt;
&lt;br /&gt;
[@login jobs]$ squeue --start -j 740338&lt;br /&gt;
  JOBID PARTITION     NAME     USER  ST           START_TIME  NODES NODELIST(REASON)&lt;br /&gt;
 740338 ABGC_Stud HPLstude bohme999  PD  2014-02-22T15:31:48      1 (ReqNodeNotAvail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
So it seems this job will problably start the next day, but&#039;s thats no guarantee it will start indeed.&lt;br /&gt;
&lt;br /&gt;
== Removing jobs from a list: scancel ==&lt;br /&gt;
If for some reason you want to delete a job that is either in the queue or already running, you can remove it using the &#039;scancel&#039; command. The &#039;scancel&#039; command takes the jobid as a parameter. For the example above, this would be done using the following code:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
scancel 3401&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Allocating resources interactively: sinteractive ==&lt;br /&gt;
sinteractive is a tiny wrapper on srun to create interactive jobs quickly and easily. It allows you to get a shell on one of the nodes, with similar limits as you would do for a normal job. To use it, simply run:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sinteractive -c &amp;lt;num_cpus&amp;gt; --mem &amp;lt;amount_mem&amp;gt; --time &amp;lt;minutes&amp;gt; -p &amp;lt;partition&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You will then be presented with a new shell prompt on one of the compute nodes (run &#039;hostname&#039; to see which!). From here, you can test out code in an interactive fashion as needs be.&lt;br /&gt;
&lt;br /&gt;
Be advised though - not filling in the above fields will get you a shell with 1 CPU and 100Mb of RAM for 1 hour. This is useful for quick testing, however.&lt;br /&gt;
&lt;br /&gt;
=== sinteractive source ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
srun &amp;quot;$@&amp;quot; -I60 -N 1 -n 1 --pty bash -i&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== interactive Slurm - using salloc ===&lt;br /&gt;
If you don&#039;t want your shell to be transported but want a new remote shell, do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
salloc -p ABGC_Low $SHELL&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now your shell will stay on the login node, but you can do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
srun &amp;lt;command&amp;gt; &amp;amp;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To submit tasks to this new shell!&lt;br /&gt;
&lt;br /&gt;
Be aware that the time limit of salloc is default 1 hour. If you intend to run jobs for longer times than this, you need to edit the settings for it. See: https://computing.llnl.gov/linux/slurm/salloc.html&lt;br /&gt;
&lt;br /&gt;
== Get overview of past and current jobs: sacct ==&lt;br /&gt;
To do some accounting on past and present jobs, and to see whether they ran to completion, you can do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sacct&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should provide information similar to the following:&lt;br /&gt;
&lt;br /&gt;
         JobID    JobName  Partition    Account  AllocCPUS      State ExitCode &lt;br /&gt;
  ------------ ---------- ---------- ---------- ---------- ---------- -------- &lt;br /&gt;
  3385         BOV-WUR-58   research                    12  COMPLETED      0:0 &lt;br /&gt;
  3385.batch        batch                                1  COMPLETED      0:0 &lt;br /&gt;
  3386         BOV-WUR-59   research                    12 CANCELLED+      0:0 &lt;br /&gt;
  3386.batch        batch                                1  CANCELLED     0:15 &lt;br /&gt;
  3528         BOV-WUR-59       ABGC                    16    RUNNING      0:0 &lt;br /&gt;
  3529         BOV-WUR-60       ABGC                    16    RUNNING      0:0&lt;br /&gt;
&lt;br /&gt;
Or in more detail for a specific job:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sacct --format=jobid,jobname,comment,partition,ntasks,alloccpus,elapsed,state,exitcode -j 4220&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should provide information about job id 4220:&lt;br /&gt;
&lt;br /&gt;
       JobID    JobName    Comment   Partition   NTasks  AllocCPUS    Elapsed      State ExitCode &lt;br /&gt;
  ------------ ---------- ---------- ---------- -------- ---------- ---------- ---------- -------- &lt;br /&gt;
  4220         PreProces+              research                   3   00:30:52  COMPLETED      0:0 &lt;br /&gt;
  4220.batch        batch                              1          1   00:30:52  COMPLETED      0:0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Job Status Codes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically your job will be either in the Running state of PenDing state. However here is a breakdown of all the states that your job could be in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Code!!State!!Description&lt;br /&gt;
|-&lt;br /&gt;
|CA	||CANCELLED||	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;
|CD||	COMPLETED||	Job has terminated all processes on all nodes.&lt;br /&gt;
|-&lt;br /&gt;
|CF||	CONFIGURING||	Job has been allocated resources, but are waiting for them to become ready for use (e.g. booting).&lt;br /&gt;
|-&lt;br /&gt;
|CG||	COMPLETING||	Job is in the process of completing. Some processes on some nodes may still be active.&lt;br /&gt;
|-&lt;br /&gt;
|F||	FAILED||	Job terminated with non-zero exit code or other failure condition.&lt;br /&gt;
|-&lt;br /&gt;
|NF||	NODE_FAIL||	Job terminated due to failure of one or more allocated nodes.&lt;br /&gt;
|-&lt;br /&gt;
|PD||	PENDING||	Job is awaiting resource allocation.&lt;br /&gt;
|-&lt;br /&gt;
|R||	RUNNING||	Job currently has an allocation.&lt;br /&gt;
|-&lt;br /&gt;
|S||	SUSPENDED||	Job has an allocation, but execution has been suspended.&lt;br /&gt;
|-&lt;br /&gt;
|TO||	TIMEOUT||	Job terminated upon reaching its time limit.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Running MPI jobs on Anunna ==&lt;br /&gt;
&lt;br /&gt;
[[MPI_on_B4F_cluster | Main article: MPI on Anunna]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Tariffs | Costs associated with resource usage]]&lt;br /&gt;
* [[B4F_cluster | Anunna]]&lt;br /&gt;
* [[BCM_on_B4F_cluster | BCM on Anunna]]&lt;br /&gt;
* [[SLURM_Compare | SLURM compared to other common schedulers]]&lt;br /&gt;
* [[Setting_up_Python_virtualenv | Setting up and using a virtual environment for Python3 ]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://slurm.schedmd.com Slurm official documentation]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management Slurm on Wikipedia]&lt;br /&gt;
* [http://www.youtube.com/watch?v=axWffyrk3aY Slurm Tutorial on Youtube]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Ssh_without_password&amp;diff=2052</id>
		<title>Ssh without password</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Ssh_without_password&amp;diff=2052"/>
		<updated>2019-07-26T16:29:57Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* Step 1: create a public key and copy to remote computer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Secure shell (ssh) protocols can be configure to work without protocols. This is particularly helpful for machines that are used often. &lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password from a POSIX-compliant terminal ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: create a public key and copy to remote computer ===&lt;br /&gt;
* Log into a local Linux or MacOSX computer&lt;br /&gt;
* Type the following to generate the ssh key:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ssh-keygen&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Accept the default key location by pressing &amp;lt;code&amp;gt;Enter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Secure permission of your authentication keys by closing permission to your home directory, .ssh directory, and authentication files&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
chmod go-wx $HOME&lt;br /&gt;
chmod 700 $HOME/.ssh&lt;br /&gt;
chmod 600 $HOME/.ssh/*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Type the following to copy the key to the remote server (this will prompt for a password).&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ssh-copy-id remote_username@remote_host&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password for Anunna ==&lt;br /&gt;
&lt;br /&gt;
* Create a public key as in Step 1 of the previous section and copy it to Anunna. Note that a public/private key pair needs to be made only once per machine.&lt;br /&gt;
* Similar to step 2 of the previous section, add the public key to the &amp;lt;code&amp;gt;$HOME/.ssh/authorized_keys2&amp;lt;/code&amp;gt; file. There is already a &amp;lt;code&amp;gt;$HOME/.ssh/authorized_keys&amp;lt;/code&amp;gt; present. You may append the key to this file as an alternative, but take care not to remove content that is already there. The cluster is configured so that passwordless communication will all other nodes is default.&lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password using PuTTY ==&lt;br /&gt;
Use pAGEaNT: http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter9.html to generate local keys. You&#039;ll want have a copy of the pubkey in plaintext available.&lt;br /&gt;
&lt;br /&gt;
Make sure to paste that plaintext string into ~/.ssh/authorized_keys in one single line. Chmod the file 600 (so it shows -rw------- in ls -l) and the directory .ssh to 700 (drwx------).&lt;br /&gt;
&lt;br /&gt;
Now PuTTY will login passwordlessly whenever pAGEaNT is running.&lt;br /&gt;
&lt;br /&gt;
Finally, get pAGEaNT to load on startup: http://blog.shvetsov.com/2010/03/making-pageant-automatically-load-keys.html&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[log_in_to_Anunna | Logging into cluster using ssh and file transfer]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Ssh_without_password&amp;diff=2051</id>
		<title>Ssh without password</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Ssh_without_password&amp;diff=2051"/>
		<updated>2019-07-26T16:29:12Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* Step 1: create a public key and copy to remote computer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Secure shell (ssh) protocols can be configure to work without protocols. This is particularly helpful for machines that are used often. &lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password from a POSIX-compliant terminal ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: create a public key and copy to remote computer ===&lt;br /&gt;
* Log into a local Linux or MacOSX computer&lt;br /&gt;
* Type the following to generate the ssh key:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ssh-keygen&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Accept the default key location by pressing &amp;lt;code&amp;gt;Enter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Secure permission of your authentication keys by closing permission to your home directory, .ssh directory, and authentication files&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
chmod go-w $HOME&lt;br /&gt;
chmod 700 $HOME/.ssh&lt;br /&gt;
chmod go-rwx $HOME/.ssh/*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Type the following to copy the key to the remote server (this will prompt for a password).&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ssh-copy-id remote_username@remote_host&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password for Anunna ==&lt;br /&gt;
&lt;br /&gt;
* Create a public key as in Step 1 of the previous section and copy it to Anunna. Note that a public/private key pair needs to be made only once per machine.&lt;br /&gt;
* Similar to step 2 of the previous section, add the public key to the &amp;lt;code&amp;gt;$HOME/.ssh/authorized_keys2&amp;lt;/code&amp;gt; file. There is already a &amp;lt;code&amp;gt;$HOME/.ssh/authorized_keys&amp;lt;/code&amp;gt; present. You may append the key to this file as an alternative, but take care not to remove content that is already there. The cluster is configured so that passwordless communication will all other nodes is default.&lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password using PuTTY ==&lt;br /&gt;
Use pAGEaNT: http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter9.html to generate local keys. You&#039;ll want have a copy of the pubkey in plaintext available.&lt;br /&gt;
&lt;br /&gt;
Make sure to paste that plaintext string into ~/.ssh/authorized_keys in one single line. Chmod the file 600 (so it shows -rw------- in ls -l) and the directory .ssh to 700 (drwx------).&lt;br /&gt;
&lt;br /&gt;
Now PuTTY will login passwordlessly whenever pAGEaNT is running.&lt;br /&gt;
&lt;br /&gt;
Finally, get pAGEaNT to load on startup: http://blog.shvetsov.com/2010/03/making-pageant-automatically-load-keys.html&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[log_in_to_Anunna | Logging into cluster using ssh and file transfer]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Ssh_without_password&amp;diff=2050</id>
		<title>Ssh without password</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Ssh_without_password&amp;diff=2050"/>
		<updated>2019-07-26T16:28:37Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Secure shell (ssh) protocols can be configure to work without protocols. This is particularly helpful for machines that are used often. &lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password from a POSIX-compliant terminal ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: create a public key and copy to remote computer ===&lt;br /&gt;
* Log into a local Linux or MacOSX computer&lt;br /&gt;
* Type the following to generate the ssh key:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ssh-keygen&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Accept the default key location by pressing &amp;lt;code&amp;gt;Enter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Secure permission of your authentication keys by closing permission to your home directory, .ssh directory, and authentication files&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
chmod go-w $HOME&lt;br /&gt;
chmod 700 $HOME/.ssh&lt;br /&gt;
chmod go-rwx $HOME/.ssh/*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Type the following to copy the key to the remote server (this will prompt for a password).&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
cd ~/.ssh&lt;br /&gt;
ssh-copy-id remote_username@remote_host&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password for Anunna ==&lt;br /&gt;
&lt;br /&gt;
* Create a public key as in Step 1 of the previous section and copy it to Anunna. Note that a public/private key pair needs to be made only once per machine.&lt;br /&gt;
* Similar to step 2 of the previous section, add the public key to the &amp;lt;code&amp;gt;$HOME/.ssh/authorized_keys2&amp;lt;/code&amp;gt; file. There is already a &amp;lt;code&amp;gt;$HOME/.ssh/authorized_keys&amp;lt;/code&amp;gt; present. You may append the key to this file as an alternative, but take care not to remove content that is already there. The cluster is configured so that passwordless communication will all other nodes is default.&lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password using PuTTY ==&lt;br /&gt;
Use pAGEaNT: http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter9.html to generate local keys. You&#039;ll want have a copy of the pubkey in plaintext available.&lt;br /&gt;
&lt;br /&gt;
Make sure to paste that plaintext string into ~/.ssh/authorized_keys in one single line. Chmod the file 600 (so it shows -rw------- in ls -l) and the directory .ssh to 700 (drwx------).&lt;br /&gt;
&lt;br /&gt;
Now PuTTY will login passwordlessly whenever pAGEaNT is running.&lt;br /&gt;
&lt;br /&gt;
Finally, get pAGEaNT to load on startup: http://blog.shvetsov.com/2010/03/making-pageant-automatically-load-keys.html&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[log_in_to_Anunna | Logging into cluster using ssh and file transfer]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Creating_sbatch_script&amp;diff=2049</id>
		<title>Creating sbatch script</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Creating_sbatch_script&amp;diff=2049"/>
		<updated>2019-07-15T15:05:38Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== A skeleton Slurm script ==&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#-----------------------------Mail address-----------------------------&lt;br /&gt;
#SBATCH --mail-user=&lt;br /&gt;
#SBATCH --mail-type=ALL&lt;br /&gt;
#-----------------------------Output files-----------------------------&lt;br /&gt;
#SBATCH --output=output_%j.txt&lt;br /&gt;
#SBATCH --error=error_output_%j.txt&lt;br /&gt;
#-----------------------------Other information------------------------&lt;br /&gt;
#SBATCH --comment=&lt;br /&gt;
#SBATCH --qos=&lt;br /&gt;
#-----------------------------Required resources-----------------------&lt;br /&gt;
#SBATCH --time=0-0:0:0&lt;br /&gt;
#SBATCH --ntasks=&lt;br /&gt;
#SBATCH --cpus-per-task=&lt;br /&gt;
#SBATCH --mem-per-cpu=&lt;br /&gt;
&lt;br /&gt;
#-----------------------------Environment, Operations and Job steps----&lt;br /&gt;
#load modules&lt;br /&gt;
&lt;br /&gt;
#export variables&lt;br /&gt;
&lt;br /&gt;
#your job&lt;br /&gt;
&lt;br /&gt;
              &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Explanation of used SBATCH parameters==&lt;br /&gt;
===partition for resource allocation===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --partition=ABGC_Std&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Request a specific partition for the resource allocation. It is prefered to use your organizations partition.&lt;br /&gt;
&lt;br /&gt;
=== Adding accounting information or project number ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --comment=773320000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Charge resources used by this job to specified account. The comment is an arbitrary string. The comment may be changed after job submission using the &amp;lt;tt&amp;gt;scontrol&amp;lt;/tt&amp;gt; command. For WUR users a projectnumber or KTP number would be advisable.&lt;br /&gt;
&lt;br /&gt;
===time limit===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --time=1200&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A time limit of zero requests that no time limit be imposed. Acceptable time formats include &amp;quot;minutes&amp;quot;, &amp;quot;minutes:seconds&amp;quot;, &amp;quot;hours:minutes:seconds&amp;quot;, &amp;quot;days-hours&amp;quot;, &amp;quot;days-hours:minutes&amp;quot; and &amp;quot;days-hours:minutes:seconds&amp;quot;. So in this example the job will run for a maximum of 1200 minutes.&lt;br /&gt;
&lt;br /&gt;
===memory limit===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --mem=2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
SLURM imposes a memory limit on each job. By default, it is deliberately relatively small — 100 MB per node. If your job uses more than that, you’ll get an error that your job Exceeded job memory limit. To set a larger limit, add to your job submission: &lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --mem X&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where X is the maximum amount of memory your job will use per node, in MB. The larger your working data set, the larger this needs to be, but the smaller the number the easier it is for the scheduler to find a place to run your job. To determine an appropriate value, start relatively large (job slots on average have about 4000 MB per core, but that’s much larger than needed for most jobs) and then use sacct to look at how much your job is actually using or used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
$ sacct -o MaxRSS -j JOBID&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where JOBID is the one you’re interested in. The number is in KB, so divide by 1024 to get a rough idea of what to use with –mem (set it to something a little larger than that, since you’re defining a hard upper limit). If your job completed long in the past you may have to tell sacct to look further back in time by adding a start time with -S YYYY-MM-DD. Note that for parallel jobs spanning multiple nodes, this is the maximum memory used on any one node; if you’re not setting an even distribution of tasks per node (e.g. with –ntasks-per-node), the same job could have very different values when run at different times.&lt;br /&gt;
&lt;br /&gt;
===number of tasks===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
sbatch does not launch tasks, it requests an allocation of resources and submits a batch script. This option advises the SLURM controller that job steps run within the allocation will launch a maximum of number tasks and to provide for sufficient resources. The default is one task per node, but note that the --cpus-per-task option will change this default.&lt;br /&gt;
&lt;br /&gt;
When requesting multiple tasks, you may or may not want the job to be partitioned among multiple nodes. You can specify the minimum number of nodes using the &amp;lt;code&amp;gt;-N&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--node&amp;lt;/code&amp;gt; flag. If you provide only one number, this will be minimum and maximum at the same time. For instance:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should force your job to be scheduled to a single node.&lt;br /&gt;
&lt;br /&gt;
Because the cluster has a hybrid configuration, i.e. normal and fat nodes, it may be prudent to schedule your job specifically for one or the other node type, depending for instance on memory requirements. This can be done by using the &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--constraints&amp;lt;/code&amp;gt; flag.&lt;br /&gt;
&lt;br /&gt;
===constraints: selecting by feature===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --constraint=4gpercpu&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The HPC nodes have features associated with them, such as Intel CPU&#039;s, or the amount of memory per node. If you know that your job requires a specific architecture or memory size, you can elect to constrain your job to only these features.&lt;br /&gt;
&lt;br /&gt;
The example above will result in jobs being scheduled to the compute nodes with 4GB of memory per CPU. By using &amp;lt;code&amp;gt;12gpercpu&amp;lt;/code&amp;gt; as option the job will specifically be scheduled to one of the larger nodes with 12GB per CPU. &lt;br /&gt;
&lt;br /&gt;
All features can be seen using:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
scontrol show nodes | grep ActiveFeatures | sort | uniq&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===requesting specific resources===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --gres=gpu:1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In order to be able to use specific hardware resources, you need to request a Generic Resource. Once you do this, one of the resources will be allocated to your job when they are available. In the above example, one GPU is requested for use.&lt;br /&gt;
&lt;br /&gt;
===output (stderr,stdout) directed to file===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --output=output_%j.txt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Instruct SLURM to connect the batch script&#039;s standard output directly to the file name specified in the &amp;quot;filename pattern&amp;quot;. By default both standard output and standard error are directed to a file of the name &amp;quot;slurm-%j.out&amp;quot;, where the &amp;quot;%j&amp;quot; is replaced with the job allocation number. See the --input option for filename specification options.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --error=error_output_%j.txt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Instruct SLURM to connect the batch script&#039;s standard error directly to the file name specified in the &amp;quot;filename pattern&amp;quot;. By default both standard output and standard error are directed to a file of the name &amp;quot;slurm-%j.out&amp;quot;, where the &amp;quot;%j&amp;quot; is replaced with the job allocation number. See the --input option for filename specification options.&lt;br /&gt;
&lt;br /&gt;
===adding a job name===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --job-name=calc_pi.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Specify a name for the job allocation. The specified name will appear along with the job id number when querying running jobs on the system. The default is the name of the batch script, or just &amp;quot;sbatch&amp;quot; if the script is read on sbatch&#039;s standard input.&lt;br /&gt;
&lt;br /&gt;
===receiving mailed updates===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --mail-type=ALL&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Notify user by email when certain event types occur. Valid type values are BEGIN, END, FAIL, REQUEUE, and ALL (any state change). The user to be notified is indicated with --mail-user.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --mail-user=yourname001@wur.nl&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Email address to use.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Anunna | Anunna]]&lt;br /&gt;
* [[Using_Slurm#Batch_script | Submitting jobs to Slurm]]&lt;br /&gt;
* [[Array_jobs|Array job hints]]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Tariffs&amp;diff=2048</id>
		<title>Tariffs</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Tariffs&amp;diff=2048"/>
		<updated>2019-07-15T15:04:20Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Computing: Calculations (cores)==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Queue&lt;br /&gt;
!CPU core hour&lt;br /&gt;
!GB memory hour&lt;br /&gt;
|-&lt;br /&gt;
|Standard queue&lt;br /&gt;
|€ 0.0150&lt;br /&gt;
|€ 0.0015&lt;br /&gt;
|-&lt;br /&gt;
|High priority queue&lt;br /&gt;
|€ 0.0200&lt;br /&gt;
|€ 0.0020&lt;br /&gt;
|-&lt;br /&gt;
|Low priority queue&lt;br /&gt;
|€ 0.0100&lt;br /&gt;
|€ 0.0010&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Computing: GPU Use==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Tariff per device per hour (gpu/hour)&lt;br /&gt;
|-&lt;br /&gt;
|€ 0.3000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Storage ==&lt;br /&gt;
Tariffs per year per TB&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Lustre Nobackup&lt;br /&gt;
!Lustre Backup&lt;br /&gt;
!Home-dir&lt;br /&gt;
!Archive&lt;br /&gt;
|-&lt;br /&gt;
|€ 150&lt;br /&gt;
|€ 200&lt;br /&gt;
|€ 200&lt;br /&gt;
|€ 100&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reservations ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Tariff per node per day (node/day)&lt;br /&gt;
|-&lt;br /&gt;
|€ 30&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Notes==&lt;br /&gt;
&lt;br /&gt;
If you are a member of a group with a commitment, then these costs get deducted from that commitment. Typically we are fairly lax with enforcing limits - only once you get to around 150% of your commitment will we consider taking action (mainly coming to discuss things).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
You are running a job that needs 4 cores, 32G of RAM and runs for 90 minutes in the std quality. To run this, you over-request resources slightly, and execute in a job that requests 4 CPUs, 40G of RAM and with a time limit of 3 hours. Your job terminates early. Thus, your costs are:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4 * 0.015 * 1.5 = 0.09 EUR for the CPU&lt;br /&gt;
&lt;br /&gt;
40 * 0.0015 * 1.5 = 0.09 EUR for the memory&lt;br /&gt;
&lt;br /&gt;
Total: 0.18 EUR&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Spark&amp;diff=2047</id>
		<title>Spark</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Spark&amp;diff=2047"/>
		<updated>2019-07-15T15:03:35Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* SPARK on HPC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Apache Spark is a means of distributing compute resources across multiple worker machines. It is the successor to Hadoop, and allows for a wider distribution of code to be executed on the clustered resources. The only requirement for Spark to be able to operate is that each worker must be able to reach each other via TCP, thus it allows for compute to be executed on very simple resources, if the code itself can be translated into the MapReduce paradigm.&lt;br /&gt;
&lt;br /&gt;
== SPARK on HPC ==&lt;br /&gt;
In order to create a personal SPARK cluster, you must first request resources on the HPC. Use this example submission script to initialise your cluster:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#!/bin/bash&lt;br /&gt;
#SBATCH --time=&amp;lt;length&amp;gt;&lt;br /&gt;
#SBATCH --mem-per-cpu=4000&lt;br /&gt;
#SBATCH --nodes=&amp;lt;number of nodes&amp;gt;&lt;br /&gt;
#SBATCH --tasks-per-node=&amp;lt;number of workers per node&amp;gt;&lt;br /&gt;
#SBATCH --job-name=&amp;quot;my spark cluster&amp;quot;&lt;br /&gt;
#SBATCH --qos=QOS&lt;br /&gt;
&lt;br /&gt;
module load python&lt;br /&gt;
module load spark&lt;br /&gt;
&lt;br /&gt;
source $SPARK_HOME/wur/start-spark&lt;br /&gt;
&lt;br /&gt;
tail -f /dev/null&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will spawn a new cluster of your desired dimensions once resources are available. This spark module has been written to output its logs to your home directory, at:&lt;br /&gt;
&lt;br /&gt;
/home/WUR/yourid/.spark/&amp;lt;jobid&amp;gt;/&lt;br /&gt;
&lt;br /&gt;
In this folder you will find the raw logs of the master and all worker threads. By default the master will consume 1Gb of memory from the first process, and so a single 4Gb &#039;cluster&#039; will be provided with one 3Gb worker. You can adjust the CPU/memory use by adjusting the parameters in your batch script.&lt;br /&gt;
&lt;br /&gt;
Within the log file you will find two unique files: master, and master-console. master will always contain the URI of the current spark cluster master access point, and master-console the URL of the console of it. &lt;br /&gt;
&lt;br /&gt;
To access the web console, the easiest solution is to use links:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;links http://myspark:8081&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will nicely render the page for you in the console. Ctrl-R reloads the page, q to quit.&lt;br /&gt;
&lt;br /&gt;
There are several caveats to remember with this:&lt;br /&gt;
&lt;br /&gt;
* The cluster exists (and consumes resources) until you cancel it with scancel &amp;lt;jobid&amp;gt;&lt;br /&gt;
* There is no security at all - any user of the HPC can access both these at any point if they know the port and host.&lt;br /&gt;
&lt;br /&gt;
== Instant SPARK ==&lt;br /&gt;
&lt;br /&gt;
You can also spin up clusters solely to execute scripts. Simply replace the last line from the example above:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;tail -f /dev/null&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
with&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;spark-submit myscript.py&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And after the script has executed, the cluster will automatically terminate.&lt;br /&gt;
&lt;br /&gt;
== SPARK in Jupyter ==&lt;br /&gt;
&lt;br /&gt;
There is a kernel available for using Spark from Jupyter. All this does (for now) is to set up the correct path to the python version and the spark binaries for you. In order to set up your Context, your first cell for each notebook should be:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;import pyspark&lt;br /&gt;
conf = (pyspark.SparkConf()&lt;br /&gt;
         .setMaster(&amp;quot;spark://mysparkcluster:7077&amp;quot;)&lt;br /&gt;
         .setAppName(&amp;quot;MyName&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
sc = pyspark.SparkContext(conf=conf)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the cluster master name from the master file in your job output as above. Subsequent cells will then have sc defined. Run this cell only once - attempting to reconnect will throw an error. That application will run until the kernel is terminated and prevent other applications from being able to be executed - you may wish to manually terminate your kernel from the top bar in Jupyter to free resources.&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=MPI_on_B4F_cluster&amp;diff=2046</id>
		<title>MPI on B4F cluster</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=MPI_on_B4F_cluster&amp;diff=2046"/>
		<updated>2019-07-15T15:02:51Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== A simple &#039;Hello World&#039; example ==&lt;br /&gt;
Consider the following simple MPI version, in C, of the &#039;Hello World&#039; example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;cpp&#039;&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;mpi.h&amp;gt;&lt;br /&gt;
int main(int argc, char ** argv) {&lt;br /&gt;
  int size,rank,namelen;&lt;br /&gt;
  char processor_name[MPI_MAX_PROCESSOR_NAME];&lt;br /&gt;
  MPI_Init(&amp;amp;argc, &amp;amp;argv);&lt;br /&gt;
  MPI_Comm_rank(MPI_COMM_WORLD,&amp;amp;rank);&lt;br /&gt;
  MPI_Comm_size(MPI_COMM_WORLD,&amp;amp;size);&lt;br /&gt;
  MPI_Get_processor_name(processor_name, &amp;amp;namelen);&lt;br /&gt;
  printf(&amp;quot;Hello MPI! Process %d of %d on %s\n&amp;quot;, rank, size, processor_name);&lt;br /&gt;
  MPI_Finalize();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before compiling, make sure that the compilers that are required available.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
module list&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To avoid conflicts between libraries, the safest way is purging all modules:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
module purge&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The load both gcc and openmpi libraries. If modules were purged, then slurm needs to be reloaded too.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
module load gcc/4.8.1 openmpi/gcc/64/1.6.5 slurm/2.5.7&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the &amp;lt;code&amp;gt;hello_mpi.c&amp;lt;/code&amp;gt; code.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
mpicc hello_mpi.c -o test_hello_world&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If desired, a list of libraries compiled into the executable can be viewed:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ldd test_hello_world&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  linux-vdso.so.1 =&amp;gt;  (0x00002aaaaaacb000)&lt;br /&gt;
  libmpi.so.1 =&amp;gt; /cm/shared/apps/openmpi/gcc/64/1.6.5/lib64/libmpi.so.1 (0x00002aaaaaccd000)&lt;br /&gt;
  libdl.so.2 =&amp;gt; /lib64/libdl.so.2 (0x00002aaaab080000)&lt;br /&gt;
  libm.so.6 =&amp;gt; /lib64/libm.so.6 (0x00002aaaab284000)&lt;br /&gt;
  libnuma.so.1 =&amp;gt; /usr/lib64/libnuma.so.1 (0x0000003e29400000)&lt;br /&gt;
  librt.so.1 =&amp;gt; /lib64/librt.so.1 (0x00002aaaab509000)&lt;br /&gt;
  libnsl.so.1 =&amp;gt; /lib64/libnsl.so.1 (0x00002aaaab711000)&lt;br /&gt;
  libutil.so.1 =&amp;gt; /lib64/libutil.so.1 (0x00002aaaab92a000)&lt;br /&gt;
  libpthread.so.0 =&amp;gt; /lib64/libpthread.so.0 (0x00002aaaabb2e000)&lt;br /&gt;
  libc.so.6 =&amp;gt; /lib64/libc.so.6 (0x00002aaaabd4b000)&lt;br /&gt;
  /lib64/ld-linux-x86-64.so.2 (0x00002aaaaaaab000)&lt;br /&gt;
&lt;br /&gt;
Running the executable on two nodes, with four tasks per node, can be done like this:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
srun --nodes=2 --ntasks-per-node=4 --mpi=openmpi ./test_hello_world&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will result in the following output:&lt;br /&gt;
  Hello MPI! Process 4 of 8 on node011&lt;br /&gt;
  Hello MPI! Process 1 of 8 on node010&lt;br /&gt;
  Hello MPI! Process 7 of 8 on node011&lt;br /&gt;
  Hello MPI! Process 6 of 8 on node011&lt;br /&gt;
  Hello MPI! Process 5 of 8 on node011&lt;br /&gt;
  Hello MPI! Process 2 of 8 on node010&lt;br /&gt;
  Hello MPI! Process 0 of 8 on node010&lt;br /&gt;
  Hello MPI! Process 3 of 8 on node010&lt;br /&gt;
&lt;br /&gt;
== A mvapich2 sbatch example ==&lt;br /&gt;
A mpi job using mvapich2 on 32 cores, using the normal compute nodes and the fast infiniband interconnect for RDMA traffic.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
$ module load mvapich2/gcc&lt;br /&gt;
$ vim batch.sh&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 #SBATCH --comment=projectx&lt;br /&gt;
 #SBATCH --time=30-0&lt;br /&gt;
 #SBATCH  -n 32&lt;br /&gt;
 #SBATCH --constraint=4gpercpu&lt;br /&gt;
 #SBATCH --output=output_%j.txt&lt;br /&gt;
 #SBATCH --error=error_output_%j.txt&lt;br /&gt;
 #SBATCH --job-name=MPItest&lt;br /&gt;
 #SBATCH --mail-type=ALL&lt;br /&gt;
 #SBATCH --mail-user=user@wur.nl&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Starting at `date`&amp;quot;&lt;br /&gt;
 echo &amp;quot;Running on hosts: $SLURM_NODELIST&amp;quot;&lt;br /&gt;
 echo &amp;quot;Running on $SLURM_NNODES nodes.&amp;quot;&lt;br /&gt;
 echo &amp;quot;Running on $SLURM_NPROCS processors.&amp;quot;&lt;br /&gt;
 echo &amp;quot;Current working directory is `pwd`&amp;quot;&lt;br /&gt;
 # echo &amp;quot;Env var MPIR_CVAR_NEMESIS_TCP_NETWORK_IFACE is $MPIR_CVAR_NEMESIS_TCP_NETWORK_IFACE&amp;quot;&lt;br /&gt;
 # export MPIR_CVAR_NEMESIS_TCP_NETWORK_IFACE=ib0&lt;br /&gt;
&lt;br /&gt;
 mpirun -iface ib0 -np 32 ./tmf_par.out -NX 480 -NY 240 -alpha  11 -chi 1.3 -psi_b 5e-2  -beta  0.0 -zeta 3.5 -kT 0.10 &lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Program finished with exit code $? at: `date`&amp;quot;&lt;br /&gt;
&lt;br /&gt;
$ sbatch batch.sh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=MPI_on_B4F_cluster&amp;diff=2045</id>
		<title>MPI on B4F cluster</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=MPI_on_B4F_cluster&amp;diff=2045"/>
		<updated>2019-07-15T15:02:32Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== A simple &#039;Hello World&#039; example ==&lt;br /&gt;
Consider the following simple MPI version, in C, of the &#039;Hello World&#039; example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;cpp&#039;&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;mpi.h&amp;gt;&lt;br /&gt;
int main(int argc, char ** argv) {&lt;br /&gt;
  int size,rank,namelen;&lt;br /&gt;
  char processor_name[MPI_MAX_PROCESSOR_NAME];&lt;br /&gt;
  MPI_Init(&amp;amp;argc, &amp;amp;argv);&lt;br /&gt;
  MPI_Comm_rank(MPI_COMM_WORLD,&amp;amp;rank);&lt;br /&gt;
  MPI_Comm_size(MPI_COMM_WORLD,&amp;amp;size);&lt;br /&gt;
  MPI_Get_processor_name(processor_name, &amp;amp;namelen);&lt;br /&gt;
  printf(&amp;quot;Hello MPI! Process %d of %d on %s\n&amp;quot;, rank, size, processor_name);&lt;br /&gt;
  MPI_Finalize();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before compiling, make sure that the compilers that are required available.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
module list&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To avoid conflicts between libraries, the safest way is purging all modules:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
module purge&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The load both gcc and openmpi libraries. If modules were purged, then slurm needs to be reloaded too.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
module load gcc/4.8.1 openmpi/gcc/64/1.6.5 slurm/2.5.7&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the &amp;lt;code&amp;gt;hello_mpi.c&amp;lt;/code&amp;gt; code.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
mpicc hello_mpi.c -o test_hello_world&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If desired, a list of libraries compiled into the executable can be viewed:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ldd test_hello_world&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  linux-vdso.so.1 =&amp;gt;  (0x00002aaaaaacb000)&lt;br /&gt;
  libmpi.so.1 =&amp;gt; /cm/shared/apps/openmpi/gcc/64/1.6.5/lib64/libmpi.so.1 (0x00002aaaaaccd000)&lt;br /&gt;
  libdl.so.2 =&amp;gt; /lib64/libdl.so.2 (0x00002aaaab080000)&lt;br /&gt;
  libm.so.6 =&amp;gt; /lib64/libm.so.6 (0x00002aaaab284000)&lt;br /&gt;
  libnuma.so.1 =&amp;gt; /usr/lib64/libnuma.so.1 (0x0000003e29400000)&lt;br /&gt;
  librt.so.1 =&amp;gt; /lib64/librt.so.1 (0x00002aaaab509000)&lt;br /&gt;
  libnsl.so.1 =&amp;gt; /lib64/libnsl.so.1 (0x00002aaaab711000)&lt;br /&gt;
  libutil.so.1 =&amp;gt; /lib64/libutil.so.1 (0x00002aaaab92a000)&lt;br /&gt;
  libpthread.so.0 =&amp;gt; /lib64/libpthread.so.0 (0x00002aaaabb2e000)&lt;br /&gt;
  libc.so.6 =&amp;gt; /lib64/libc.so.6 (0x00002aaaabd4b000)&lt;br /&gt;
  /lib64/ld-linux-x86-64.so.2 (0x00002aaaaaaab000)&lt;br /&gt;
&lt;br /&gt;
Running the executable on two nodes, with four tasks per node, can be done like this:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
srun --nodes=2 --ntasks-per-node=4 --partition=ABGC --mpi=openmpi ./test_hello_world&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will result in the following output:&lt;br /&gt;
  Hello MPI! Process 4 of 8 on node011&lt;br /&gt;
  Hello MPI! Process 1 of 8 on node010&lt;br /&gt;
  Hello MPI! Process 7 of 8 on node011&lt;br /&gt;
  Hello MPI! Process 6 of 8 on node011&lt;br /&gt;
  Hello MPI! Process 5 of 8 on node011&lt;br /&gt;
  Hello MPI! Process 2 of 8 on node010&lt;br /&gt;
  Hello MPI! Process 0 of 8 on node010&lt;br /&gt;
  Hello MPI! Process 3 of 8 on node010&lt;br /&gt;
&lt;br /&gt;
== A mvapich2 sbatch example ==&lt;br /&gt;
A mpi job using mvapich2 on 32 cores, using the normal compute nodes and the fast infiniband interconnect for RDMA traffic.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
$ module load mvapich2/gcc&lt;br /&gt;
$ vim batch.sh&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 #SBATCH --comment=projectx&lt;br /&gt;
 #SBATCH --time=30-0&lt;br /&gt;
 #SBATCH  -n 32&lt;br /&gt;
 #SBATCH --constraint=4gpercpu&lt;br /&gt;
 #SBATCH --output=output_%j.txt&lt;br /&gt;
 #SBATCH --error=error_output_%j.txt&lt;br /&gt;
 #SBATCH --job-name=MPItest&lt;br /&gt;
 #SBATCH --mail-type=ALL&lt;br /&gt;
 #SBATCH --mail-user=user@wur.nl&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Starting at `date`&amp;quot;&lt;br /&gt;
 echo &amp;quot;Running on hosts: $SLURM_NODELIST&amp;quot;&lt;br /&gt;
 echo &amp;quot;Running on $SLURM_NNODES nodes.&amp;quot;&lt;br /&gt;
 echo &amp;quot;Running on $SLURM_NPROCS processors.&amp;quot;&lt;br /&gt;
 echo &amp;quot;Current working directory is `pwd`&amp;quot;&lt;br /&gt;
 # echo &amp;quot;Env var MPIR_CVAR_NEMESIS_TCP_NETWORK_IFACE is $MPIR_CVAR_NEMESIS_TCP_NETWORK_IFACE&amp;quot;&lt;br /&gt;
 # export MPIR_CVAR_NEMESIS_TCP_NETWORK_IFACE=ib0&lt;br /&gt;
&lt;br /&gt;
 mpirun -iface ib0 -np 32 ./tmf_par.out -NX 480 -NY 240 -alpha  11 -chi 1.3 -psi_b 5e-2  -beta  0.0 -zeta 3.5 -kT 0.10 &lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Program finished with exit code $? at: `date`&amp;quot;&lt;br /&gt;
&lt;br /&gt;
$ sbatch batch.sh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Array_Jobs&amp;diff=2037</id>
		<title>Array Jobs</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Array_Jobs&amp;diff=2037"/>
		<updated>2019-07-15T14:58:59Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SLURM can simplify your efforts if you are planning on submitting multiple independent jobs in parallel. Rather than having to use sbatch multiple times, you can instead use an array job to run your job.&lt;br /&gt;
&lt;br /&gt;
Take the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --output=output_%A.%a.txt&lt;br /&gt;
#SBATCH --error=error_%A.%a.txt&lt;br /&gt;
#SBATCH --time=10&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=1&lt;br /&gt;
#SBATCH --mem-per-cpu=4000&lt;br /&gt;
#SBATCH --array=0-9%4&lt;br /&gt;
&lt;br /&gt;
echo $SLURM_ARRAY_TASK_ID&lt;br /&gt;
              &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Let&#039;s break this down step by step:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --output=output_%A.%a.txt&lt;br /&gt;
#SBATCH --error=error_%A.%a.txt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This makes sure your job outputs to a file called output_&amp;lt;Jobnumber&amp;gt;.&amp;lt;Arrayid&amp;gt;.txt, allowing you to track which array ID returned what.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --array=0-9%4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This defined the array job itself. This specifies to run ten jobs, with array id&#039;s of 0 to 9, but not to allow more than 4 to run at once. The syntax for this allows you to specify exactly what ID&#039;s to use, for example:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --array=3,7-11&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will only run array tasks with ID&#039;s of 3, 7, 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
echo $SLURM_ARRAY_TASK_ID&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will print to stdout (and get redirected to output_%A.%a.txt) the environment variable set by SLURM that indicates which Array ID this process has.&lt;br /&gt;
&lt;br /&gt;
So, once this job is run, we will end up with ten files, all called output_&amp;lt;jobid&amp;gt;.&amp;lt;n&amp;gt;.txt, containing the number n.&lt;br /&gt;
&lt;br /&gt;
== Two dimensional arrays? ==&lt;br /&gt;
Running an array such as above will result in a one dimensional string of jobs, for example, with --array=0-9, then&lt;br /&gt;
&lt;br /&gt;
SLURM_ARRAY_TASK_ID=[ 0  1  2  3  4  5  6  7  8  9 ]&lt;br /&gt;
&lt;br /&gt;
for each job. What if you need two variables to change instead of one?&lt;br /&gt;
&lt;br /&gt;
Well, there&#039;s a simple function called modulo that can solve this. Let&#039;s use an example with a modulo of 10, and an example number of 93:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
A=$((93 / 10)) # A = 9&lt;br /&gt;
B=$((93 % 10)) # B = 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, this splits the number in half, allowing a job array of 0-99 to be made into two variables, traversing a 2D array. Bear in mind this always starts at 0, so if you need, say, A to be 1-5, and B to be 3-8, then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --array=0-29   ## 5*6 entries, thus 30, including 0 this is 0-29&lt;br /&gt;
A=$((SLURM_ARRAY_TASK_ID/5+1)) # A = [0-4]+1 = [1-5]&lt;br /&gt;
B=$((SLURM_ARRAY_TASK_ID%6+3)) # B = [0-5]+3 = [3-8]&lt;br /&gt;
mywork $A $B&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Creating_sbatch_script&amp;diff=2036</id>
		<title>Creating sbatch script</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Creating_sbatch_script&amp;diff=2036"/>
		<updated>2019-07-15T14:58:38Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== A skeleton Slurm script ==&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#-----------------------------Mail address-----------------------------&lt;br /&gt;
#SBATCH --mail-user=&lt;br /&gt;
#SBATCH --mail-type=ALL&lt;br /&gt;
#-----------------------------Output files-----------------------------&lt;br /&gt;
#SBATCH --output=output_%j.txt&lt;br /&gt;
#SBATCH --error=error_output_%j.txt&lt;br /&gt;
#-----------------------------Other information------------------------&lt;br /&gt;
#SBATCH --comment=&lt;br /&gt;
#SBATCH --qos=&lt;br /&gt;
#-----------------------------Required resources-----------------------&lt;br /&gt;
#SBATCH --time=0-0:0:0&lt;br /&gt;
#SBATCH --ntasks=&lt;br /&gt;
#SBATCH --cpus-per-task=&lt;br /&gt;
#SBATCH --mem-per-cpu=&lt;br /&gt;
&lt;br /&gt;
#-----------------------------Environment, Operations and Job steps----&lt;br /&gt;
#load modules&lt;br /&gt;
&lt;br /&gt;
#export variables&lt;br /&gt;
&lt;br /&gt;
#your job&lt;br /&gt;
&lt;br /&gt;
              &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Explanation of used SBATCH parameters==&lt;br /&gt;
===partition for resource allocation===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --partition=ABGC_Std&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Request a specific partition for the resource allocation. It is prefered to use your organizations partition.&lt;br /&gt;
&lt;br /&gt;
=== Adding accounting information or project number ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --comment=773320000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Charge resources used by this job to specified account. The comment is an arbitrary string. The comment may be changed after job submission using the &amp;lt;tt&amp;gt;scontrol&amp;lt;/tt&amp;gt; command. For WUR users a projectnumber or KTP number would be advisable.&lt;br /&gt;
&lt;br /&gt;
===time limit===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --time=1200&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A time limit of zero requests that no time limit be imposed. Acceptable time formats include &amp;quot;minutes&amp;quot;, &amp;quot;minutes:seconds&amp;quot;, &amp;quot;hours:minutes:seconds&amp;quot;, &amp;quot;days-hours&amp;quot;, &amp;quot;days-hours:minutes&amp;quot; and &amp;quot;days-hours:minutes:seconds&amp;quot;. So in this example the job will run for a maximum of 1200 minutes.&lt;br /&gt;
&lt;br /&gt;
===memory limit===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --mem=2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
SLURM imposes a memory limit on each job. By default, it is deliberately relatively small — 100 MB per node. If your job uses more than that, you’ll get an error that your job Exceeded job memory limit. To set a larger limit, add to your job submission: &lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --mem X&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where X is the maximum amount of memory your job will use per node, in MB. The larger your working data set, the larger this needs to be, but the smaller the number the easier it is for the scheduler to find a place to run your job. To determine an appropriate value, start relatively large (job slots on average have about 4000 MB per core, but that’s much larger than needed for most jobs) and then use sacct to look at how much your job is actually using or used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
$ sacct -o MaxRSS -j JOBID&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where JOBID is the one you’re interested in. The number is in KB, so divide by 1024 to get a rough idea of what to use with –mem (set it to something a little larger than that, since you’re defining a hard upper limit). If your job completed long in the past you may have to tell sacct to look further back in time by adding a start time with -S YYYY-MM-DD. Note that for parallel jobs spanning multiple nodes, this is the maximum memory used on any one node; if you’re not setting an even distribution of tasks per node (e.g. with –ntasks-per-node), the same job could have very different values when run at different times.&lt;br /&gt;
&lt;br /&gt;
===number of tasks===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
sbatch does not launch tasks, it requests an allocation of resources and submits a batch script. This option advises the SLURM controller that job steps run within the allocation will launch a maximum of number tasks and to provide for sufficient resources. The default is one task per node, but note that the --cpus-per-task option will change this default.&lt;br /&gt;
&lt;br /&gt;
When requesting multiple tasks, you may or may not want the job to be partitioned among multiple nodes. You can specify the minimum number of nodes using the &amp;lt;code&amp;gt;-N&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--node&amp;lt;/code&amp;gt; flag. If you provide only one number, this will be minimum and maximum at the same time. For instance:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should force your job to be scheduled to a single node.&lt;br /&gt;
&lt;br /&gt;
Because the cluster has a hybrid configuration, i.e. normal and fat nodes, it may be prudent to schedule your job specifically for one or the other node type, depending for instance on memory requirements. This can be done by using the &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--constraints&amp;lt;/code&amp;gt; flag.&lt;br /&gt;
&lt;br /&gt;
===constraints: selecting by feature===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --constraint=normalmem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The HPC nodes have features associated with them, such as Intel CPU&#039;s, or the amount of memory per node. If you know that your job requires a specific architecture or memory size, you can elect to constrain your job to only these features.&lt;br /&gt;
&lt;br /&gt;
The example above will result in jobs being scheduled to the regular compute nodes. By using &amp;lt;code&amp;gt;largemem&amp;lt;/code&amp;gt; as option the job will specifically be scheduled to one of the fat nodes. &lt;br /&gt;
&lt;br /&gt;
All features can be seen using:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
scontrol show nodes | grep ActiveFeatures | sort | uniq&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===requesting specific resources===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --gres=gpu:1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In order to be able to use specific hardware resources, you need to request a Generic Resource. Once you do this, one of the resources will be allocated to your job when they are available. In the above example, one GPU is requested for use.&lt;br /&gt;
&lt;br /&gt;
===output (stderr,stdout) directed to file===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --output=output_%j.txt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Instruct SLURM to connect the batch script&#039;s standard output directly to the file name specified in the &amp;quot;filename pattern&amp;quot;. By default both standard output and standard error are directed to a file of the name &amp;quot;slurm-%j.out&amp;quot;, where the &amp;quot;%j&amp;quot; is replaced with the job allocation number. See the --input option for filename specification options.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --error=error_output_%j.txt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Instruct SLURM to connect the batch script&#039;s standard error directly to the file name specified in the &amp;quot;filename pattern&amp;quot;. By default both standard output and standard error are directed to a file of the name &amp;quot;slurm-%j.out&amp;quot;, where the &amp;quot;%j&amp;quot; is replaced with the job allocation number. See the --input option for filename specification options.&lt;br /&gt;
&lt;br /&gt;
===adding a job name===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --job-name=calc_pi.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Specify a name for the job allocation. The specified name will appear along with the job id number when querying running jobs on the system. The default is the name of the batch script, or just &amp;quot;sbatch&amp;quot; if the script is read on sbatch&#039;s standard input.&lt;br /&gt;
&lt;br /&gt;
===receiving mailed updates===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --mail-type=ALL&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Notify user by email when certain event types occur. Valid type values are BEGIN, END, FAIL, REQUEUE, and ALL (any state change). The user to be notified is indicated with --mail-user.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --mail-user=yourname001@wur.nl&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Email address to use.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Anunna | Anunna]]&lt;br /&gt;
* [[Using_Slurm#Batch_script | Submitting jobs to Slurm]]&lt;br /&gt;
* [[Array_jobs|Array job hints]]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Scheduler_Overview_(Slurm)&amp;diff=2035</id>
		<title>Scheduler Overview (Slurm)</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Scheduler_Overview_(Slurm)&amp;diff=2035"/>
		<updated>2019-07-15T14:57:48Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The resource allocation / scheduling software on Anunna is [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management SLURM]: &#039;&#039;&#039;S&#039;&#039;&#039;imple &#039;&#039;&#039;L&#039;&#039;&#039;inux &#039;&#039;&#039;U&#039;&#039;&#039;tility for &#039;&#039;&#039;R&#039;&#039;&#039;esource &#039;&#039;&#039;M&#039;&#039;&#039;anagement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Queues and defaults ==&lt;br /&gt;
&lt;br /&gt;
=== Quality of Service ===&lt;br /&gt;
When submitting a job, you may optionally assign a different Quality of Service to it. You can do this with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --qos=std&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, jobs will use std, the standard quality.&lt;br /&gt;
&lt;br /&gt;
Optionally, you may elect to reduce the priority of your jobs to low. This comes with a limit of how long each job can be (8h) to prevent the cluster from being locked up entirely with low priority jobs.&lt;br /&gt;
&lt;br /&gt;
The high quality provides a higher priority to jobs (20) than std (10), or low (1). It is naturally more expensive.&lt;br /&gt;
&lt;br /&gt;
The highest priority goes to jobs in interactive quality (100), but you may not submit many jobs or many large jobs as this quality. This is exclusively for the use of immediate running jobs, ones that are going to have hands-on users behind them.&lt;br /&gt;
&lt;br /&gt;
Jobs may be restarted and rescheduled if a job with higher priority needs cluster resources, but as of right now, this is not occurring.&lt;br /&gt;
&lt;br /&gt;
=== Queues ===&lt;br /&gt;
The cluster consists of multiple partitions of nodes that you can submit to. The primary one is &#039;main&#039;. There are other partitions as needed - current plans include &#039;gpu&#039;.&lt;br /&gt;
&lt;br /&gt;
You can see the partitions available with `sinfo`:&lt;br /&gt;
&lt;br /&gt;
=== Defaults ===&lt;br /&gt;
The default partition is &#039;main&#039;. This will work for most jobs.&lt;br /&gt;
&lt;br /&gt;
The default qos is &#039;std&#039;.&lt;br /&gt;
&lt;br /&gt;
The default cpu count is 1.&lt;br /&gt;
&lt;br /&gt;
The default run time for a job is &#039;&#039;&#039;1 hour&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The default memory limit is &#039;&#039;&#039;100MB per node&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Submitting jobs: sbatch ==&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
Consider this simple python3 script that should calculate Pi to 1 million digits:&lt;br /&gt;
&amp;lt;source lang=&#039;python&#039;&amp;gt;&lt;br /&gt;
from decimal import *&lt;br /&gt;
D=Decimal&lt;br /&gt;
getcontext().prec=10000000&lt;br /&gt;
p=sum(D(1)/16**k*(D(4)/(8*k+1)-D(2)/(8*k+4)-D(1)/(8*k+5)-D(1)/(8*k+6))for k in range(411))&lt;br /&gt;
print(str(p)[:10000002])&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Loading modules ===&lt;br /&gt;
In order for this script to run, the first thing that is needed is that Python3, which is not the default Python version on the cluster, is load into your environment. Availability of (different versions of) software can be checked by the following command:&lt;br /&gt;
  module avail&lt;br /&gt;
&lt;br /&gt;
In the list you should note that python3 is indeed available to be loaded, which then can be loaded with the following command:&lt;br /&gt;
  module load python/3.3.3&lt;br /&gt;
&lt;br /&gt;
=== Batch script ===&lt;br /&gt;
[[Creating_sbatch_script | Main Article: Creating a sbatch script]]&lt;br /&gt;
&lt;br /&gt;
The following shell/slurm script can then be used to schedule the job using the sbatch command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --comment=773320000&lt;br /&gt;
#SBATCH --time=1200&lt;br /&gt;
#SBATCH --mem=2048&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --output=output_%j.txt&lt;br /&gt;
#SBATCH --error=error_output_%j.txt&lt;br /&gt;
#SBATCH --job-name=calc_pi.py&lt;br /&gt;
#SBATCH --mail-type=ALL&lt;br /&gt;
#SBATCH --mail-user=email@org.nl&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
time python3 calc_pi.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting ===&lt;br /&gt;
The script, assuming it was named &#039;run_calc_pi.sh&#039;, can then be posted using the following command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sbatch run_calc_pi.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting multiple jobs (simple) ===&lt;br /&gt;
Assuming there are 10 job scripts, name runscript_1.sh through runscript_10.sh, all these scripts can be submitted using the following line of shell code:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;for i in `seq 1 10`; do echo $i; sbatch runscript_$i.sh;done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting multiple jobs (complex) ===&lt;br /&gt;
Lets&#039;s say you have three job scripts that depend on each other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_1.sh #A simple initialisation script&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_2.sh #An array task&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_3.sh #Some finishing script, single run, after everything previous has finished&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can create a script to simultaneously submit each job with a dependency on each other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;#!/bin/bash&lt;br /&gt;
JOB1=$(sbatch job_1.sh| rev | cut -d &#039; &#039; -f 1 | rev) #Get me the last space-separated element&lt;br /&gt;
&lt;br /&gt;
if ! [ &amp;quot;z$JOB1&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;First job submitted as jobid $JOB1&amp;quot;&lt;br /&gt;
  JOB2=$(sbatch --dependency=afterany:$JOB1 job_2.sh| rev | cut -d &#039; &#039; -f 1 | rev)&lt;br /&gt;
&lt;br /&gt;
  if ! [ &amp;quot;z$JOB2&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Second job submitted as jobid $JOB2, following $JOB1&amp;quot;&lt;br /&gt;
  JOB3=$(sbatch --dependency=afterany:$JOB2 job_3.sh| rev | cut -d &#039; &#039; -f 1 | rev)&lt;br /&gt;
&lt;br /&gt;
  if ! [ &amp;quot;z$JOB3&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Third job submitted as jobid $JOB3, following after every element of $JOB2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  fi&lt;br /&gt;
 fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will ensure that the subsequent jobs occur after any finishing of the former (even if they failed).&lt;br /&gt;
&lt;br /&gt;
Please see [https://slurm.schedmd.com/sbatch.html#OPT_dependency the sbatch documentation] for other options available to you. Note that aftercorr makes a subsequent array jobs array elements start after the correspondingly numbered ones from the previous job.&lt;br /&gt;
&lt;br /&gt;
=== Submitting array jobs ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --array=0-10%4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
SLURM allows you to submit multiple jobs using the same template. Further information about this can be found [[Array_jobs|here]].&lt;br /&gt;
&lt;br /&gt;
=== Using /tmp ===&lt;br /&gt;
There is a local disk of ~300G that can be used to temporarily stage some of your workload attached to each node. This is free to use, but please remember to clean up your data after usage.&lt;br /&gt;
&lt;br /&gt;
In order to be sure that you&#039;re able to use space in /tmp, you can add&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --tmp=&amp;lt;required size&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To your sbatch script. This will prevent your job from being run on nodes where there is no free space, or it&#039;s aimed to be used by another job at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Using GPU ===&lt;br /&gt;
There are two GPU nodes, in order to run a job that uses GPU on one of these nodes, you can add &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --reservation=&#039;GPU&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To your sbatch script. Without this parameter, your job won&#039;t run on one of these nodes.&lt;br /&gt;
&lt;br /&gt;
THIS IS PRONE TO CHANGE SHORTLY! [[User:Dawes001|Dawes001]] ([[User talk:Dawes001|talk]]) 14:57, 15 July 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Monitoring submitted jobs ==&lt;br /&gt;
Once a job is submitted, the status can be monitored using the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command. The &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command has a number of parameters for monitoring specific properties of the jobs such as time limit.&lt;br /&gt;
&lt;br /&gt;
=== Generic monitoring of all running jobs ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
  squeue&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should then get a list of jobs that are running at that time on the cluster, for the example on how to submit using the &#039;sbatch&#039; command, it may look like so:&lt;br /&gt;
    JOBID PARTITION     NAME     USER  ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
   3396      ABGC BOV-WUR- megen002   R      27:26      1 node004&lt;br /&gt;
   3397      ABGC BOV-WUR- megen002   R      27:26      1 node005&lt;br /&gt;
   3398      ABGC BOV-WUR- megen002   R      27:26      1 node006&lt;br /&gt;
   3399      ABGC BOV-WUR- megen002   R      27:26      1 node007&lt;br /&gt;
   3400      ABGC BOV-WUR- megen002   R      27:26      1 node008&lt;br /&gt;
   3401      ABGC BOV-WUR- megen002   R      27:26      1 node009&lt;br /&gt;
   3385  research BOV-WUR- megen002   R      44:38      1 node049&lt;br /&gt;
   3386  research BOV-WUR- megen002   R      44:38      1 node050&lt;br /&gt;
   3387  research BOV-WUR- megen002   R      44:38      1 node051&lt;br /&gt;
   3388  research BOV-WUR- megen002   R      44:38      1 node052&lt;br /&gt;
   3389  research BOV-WUR- megen002   R      44:38      1 node053&lt;br /&gt;
   3390  research BOV-WUR- megen002   R      44:38      1 node054&lt;br /&gt;
   3391  research BOV-WUR- megen002   R      44:38      3 node[049-051]&lt;br /&gt;
   3392  research BOV-WUR- megen002   R      44:38      3 node[052-054]&lt;br /&gt;
   3393  research BOV-WUR- megen002   R      44:38      1 node001&lt;br /&gt;
   3394  research BOV-WUR- megen002   R      44:38      1 node002&lt;br /&gt;
   3395  research BOV-WUR- megen002   R      44:38      1 node003&lt;br /&gt;
&lt;br /&gt;
=== Monitoring time limit set for a specific job ===&lt;br /&gt;
The default time limit is set at one hour. Estimated run times need to be specified when running jobs. To see what the time limit is that is set for a certain job, this can be done using the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
squeue -l -j 3532&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Information similar to the following should appear:&lt;br /&gt;
  Fri Nov 29 15:41:00 2013&lt;br /&gt;
   JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)&lt;br /&gt;
   3532      ABGC BOV-WUR- megen002  RUNNING    2:47:03 3-08:00:00      1 node054&lt;br /&gt;
&lt;br /&gt;
=== Query a specific active job: scontrol ===&lt;br /&gt;
Show all the details of a currently active job, so not a completed job.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
login ~]$ scontrol show jobid 4241&lt;br /&gt;
JobId=4241 Name=WB20F06&lt;br /&gt;
   UserId=megen002(16795409) GroupId=domain users(16777729)&lt;br /&gt;
   Priority=1 Account=(null) QOS=normal&lt;br /&gt;
   JobState=RUNNING Reason=None Dependency=(null)&lt;br /&gt;
   Requeue=1 Restarts=0 BatchFlag=1 ExitCode=0:0&lt;br /&gt;
   RunTime=02:55:25 TimeLimit=3-08:00:00 TimeMin=N/A&lt;br /&gt;
   SubmitTime=2013-12-09T13:37:29 EligibleTime=2013-12-09T13:37:29&lt;br /&gt;
   StartTime=2013-12-09T13:37:29 EndTime=2013-12-12T21:37:29&lt;br /&gt;
   PreemptTime=None SuspendTime=None SecsPreSuspend=0&lt;br /&gt;
   Partition=research AllocNode:Sid=login0:21799&lt;br /&gt;
   ReqNodeList=(null) ExcNodeList=(null)&lt;br /&gt;
   NodeList=node023&lt;br /&gt;
   BatchHost=node023&lt;br /&gt;
   NumNodes=1 NumCPUs=4 CPUs/Task=1 ReqS:C:T=*:*:*&lt;br /&gt;
   MinCPUsNode=1 MinMemoryNode=0 MinTmpDiskNode=0&lt;br /&gt;
   Features=(null) Gres=(null) Reservation=(null)&lt;br /&gt;
   Shared=OK Contiguous=0 Licenses=(null) Network=(null)&lt;br /&gt;
   Command=/lustre/scratch/WUR/ABGC/...&lt;br /&gt;
   WorkDir=/lustre/scratch/WUR/ABGC/...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Check on a pending job ===&lt;br /&gt;
A submitted job could result in a pending state when there are not enough resources available to this job.&lt;br /&gt;
In this example I sumbit a job, check the status and after finding out is it &#039;&#039;&#039;pending&#039;&#039;&#039; I&#039;ll check when is probably will start.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
[@login jobs]$ sbatch hpl_student.job&lt;br /&gt;
 Submitted batch job 740338&lt;br /&gt;
&lt;br /&gt;
[@login jobs]$ squeue -l -j 740338&lt;br /&gt;
 Fri Feb 21 15:32:31 2014&lt;br /&gt;
  JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)&lt;br /&gt;
 740338 ABGC_Stud HPLstude bohme999  PENDING       0:00 1-00:00:00      1 (ReqNodeNotAvail)&lt;br /&gt;
&lt;br /&gt;
[@login jobs]$ squeue --start -j 740338&lt;br /&gt;
  JOBID PARTITION     NAME     USER  ST           START_TIME  NODES NODELIST(REASON)&lt;br /&gt;
 740338 ABGC_Stud HPLstude bohme999  PD  2014-02-22T15:31:48      1 (ReqNodeNotAvail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
So it seems this job will problably start the next day, but&#039;s thats no guarantee it will start indeed.&lt;br /&gt;
&lt;br /&gt;
== Removing jobs from a list: scancel ==&lt;br /&gt;
If for some reason you want to delete a job that is either in the queue or already running, you can remove it using the &#039;scancel&#039; command. The &#039;scancel&#039; command takes the jobid as a parameter. For the example above, this would be done using the following code:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
scancel 3401&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Allocating resources interactively: sinteractive ==&lt;br /&gt;
sinteractive is a tiny wrapper on srun to create interactive jobs quickly and easily. It allows you to get a shell on one of the nodes, with similar limits as you would do for a normal job. To use it, simply run:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sinteractive -c &amp;lt;num_cpus&amp;gt; --mem &amp;lt;amount_mem&amp;gt; --time &amp;lt;minutes&amp;gt; -p &amp;lt;partition&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You will then be presented with a new shell prompt on one of the compute nodes (run &#039;hostname&#039; to see which!). From here, you can test out code in an interactive fashion as needs be.&lt;br /&gt;
&lt;br /&gt;
Be advised though - not filling in the above fields will get you a shell with 1 CPU and 100Mb of RAM for 1 hour. This is useful for quick testing, however.&lt;br /&gt;
&lt;br /&gt;
=== sinteractive source ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
srun &amp;quot;$@&amp;quot; -I60 -N 1 -n 1 --pty bash -i&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== interactive Slurm - using salloc ===&lt;br /&gt;
If you don&#039;t want your shell to be transported but want a new remote shell, do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
salloc -p ABGC_Low $SHELL&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now your shell will stay on the login node, but you can do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
srun &amp;lt;command&amp;gt; &amp;amp;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To submit tasks to this new shell!&lt;br /&gt;
&lt;br /&gt;
Be aware that the time limit of salloc is default 1 hour. If you intend to run jobs for longer times than this, you need to edit the settings for it. See: https://computing.llnl.gov/linux/slurm/salloc.html&lt;br /&gt;
&lt;br /&gt;
== Get overview of past and current jobs: sacct ==&lt;br /&gt;
To do some accounting on past and present jobs, and to see whether they ran to completion, you can do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sacct&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should provide information similar to the following:&lt;br /&gt;
&lt;br /&gt;
         JobID    JobName  Partition    Account  AllocCPUS      State ExitCode &lt;br /&gt;
  ------------ ---------- ---------- ---------- ---------- ---------- -------- &lt;br /&gt;
  3385         BOV-WUR-58   research                    12  COMPLETED      0:0 &lt;br /&gt;
  3385.batch        batch                                1  COMPLETED      0:0 &lt;br /&gt;
  3386         BOV-WUR-59   research                    12 CANCELLED+      0:0 &lt;br /&gt;
  3386.batch        batch                                1  CANCELLED     0:15 &lt;br /&gt;
  3528         BOV-WUR-59       ABGC                    16    RUNNING      0:0 &lt;br /&gt;
  3529         BOV-WUR-60       ABGC                    16    RUNNING      0:0&lt;br /&gt;
&lt;br /&gt;
Or in more detail for a specific job:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sacct --format=jobid,jobname,comment,partition,ntasks,alloccpus,elapsed,state,exitcode -j 4220&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should provide information about job id 4220:&lt;br /&gt;
&lt;br /&gt;
       JobID    JobName    Comment   Partition   NTasks  AllocCPUS    Elapsed      State ExitCode &lt;br /&gt;
  ------------ ---------- ---------- ---------- -------- ---------- ---------- ---------- -------- &lt;br /&gt;
  4220         PreProces+              research                   3   00:30:52  COMPLETED      0:0 &lt;br /&gt;
  4220.batch        batch                              1          1   00:30:52  COMPLETED      0:0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Job Status Codes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically your job will be either in the Running state of PenDing state. However here is a breakdown of all the states that your job could be in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Code!!State!!Description&lt;br /&gt;
|-&lt;br /&gt;
|CA	||CANCELLED||	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;
|CD||	COMPLETED||	Job has terminated all processes on all nodes.&lt;br /&gt;
|-&lt;br /&gt;
|CF||	CONFIGURING||	Job has been allocated resources, but are waiting for them to become ready for use (e.g. booting).&lt;br /&gt;
|-&lt;br /&gt;
|CG||	COMPLETING||	Job is in the process of completing. Some processes on some nodes may still be active.&lt;br /&gt;
|-&lt;br /&gt;
|F||	FAILED||	Job terminated with non-zero exit code or other failure condition.&lt;br /&gt;
|-&lt;br /&gt;
|NF||	NODE_FAIL||	Job terminated due to failure of one or more allocated nodes.&lt;br /&gt;
|-&lt;br /&gt;
|PD||	PENDING||	Job is awaiting resource allocation.&lt;br /&gt;
|-&lt;br /&gt;
|R||	RUNNING||	Job currently has an allocation.&lt;br /&gt;
|-&lt;br /&gt;
|S||	SUSPENDED||	Job has an allocation, but execution has been suspended.&lt;br /&gt;
|-&lt;br /&gt;
|TO||	TIMEOUT||	Job terminated upon reaching its time limit.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Running MPI jobs on Anunna ==&lt;br /&gt;
&lt;br /&gt;
[[MPI_on_B4F_cluster | Main article: MPI on Anunna]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Tariffs | Costs associated with resource usage]]&lt;br /&gt;
* [[B4F_cluster | Anunna]]&lt;br /&gt;
* [[BCM_on_B4F_cluster | BCM on Anunna]]&lt;br /&gt;
* [[SLURM_Compare | SLURM compared to other common schedulers]]&lt;br /&gt;
* [[Setting_up_Python_virtualenv | Setting up and using a virtual environment for Python3 ]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://slurm.schedmd.com Slurm official documentation]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management Slurm on Wikipedia]&lt;br /&gt;
* [http://www.youtube.com/watch?v=axWffyrk3aY Slurm Tutorial on Youtube]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Courses&amp;diff=2033</id>
		<title>Courses</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Courses&amp;diff=2033"/>
		<updated>2019-06-27T08:29:50Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: /* HPC CUDA/AI Course - 2019-06-21 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Upcoming: HPC Basic Course - 2019-06-28==&lt;br /&gt;
&lt;br /&gt;
A course for beginners will be organised on the 28th of June, aiming to help absolute beginners to begin to use the main job scheduler, SLURM. You can register [https://oneschool.wur.nl/Lists/Cursus/DispForm.aspx?ID=100 here].&lt;br /&gt;
&lt;br /&gt;
== Upcoming Linux Basic Course - 2019-06-27 ==&lt;br /&gt;
&lt;br /&gt;
A course for beginners will be organised on the 13th of June, to help beginner Linux users gain some skills in using Linux. You can register for this course [https://www.wur.nl/en/activity/Linux-basic-course-on-13-June-2019.htm here]&lt;br /&gt;
&lt;br /&gt;
== HPC CUDA/AI Course - 2019-06-21 ==&lt;br /&gt;
&lt;br /&gt;
A course for interested users for deep learning and neural networks, combined with some deep level manipulation of graphics cards was given by Dell on the 21st of July.&lt;br /&gt;
&lt;br /&gt;
[[File:WUR_CUDA_210619.pdf|WUR CUDA Course]]&lt;br /&gt;
[[File:WUR_AI_101_210619.pdf|WUR AI Course 101]]&lt;br /&gt;
[[File:WUR_AI_201_210619.pdf|WUR AI Course 201]]&lt;br /&gt;
&lt;br /&gt;
[[File:WUR_CUDA_2_210619.pdf|WUR CUDA Course]]&lt;br /&gt;
[[File:WUR_Deep_Learning_Frameworks_210619.pdf|WUR Deep Learning Frameworks Primer]]&lt;br /&gt;
[[File:WUR_Deep_Learning_Lab_210619.pdf|WUR Deep Learning Lab]]&lt;br /&gt;
&lt;br /&gt;
== HPC Advanced Course - 2019-05-28 ==&lt;br /&gt;
&lt;br /&gt;
A course for experienced users was organised on the 28th of May, aiming to brush up users on techniques for submitting unusual jobs, and help provide some more helpful hints and techniques.&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_advanced_course_20190506.pdf|Advanced Course 1]]&lt;br /&gt;
[[File:HPC_advanced_slides_20190528.pdf|Advanced Course 2]]&lt;br /&gt;
&lt;br /&gt;
== HPC Basic Course - 2019-05-07 ==&lt;br /&gt;
&lt;br /&gt;
A course for beginners will be organised on the 7th of May, aiming to help absolute beginners to begin to use the main job scheduler, SLURM.&lt;br /&gt;
&lt;br /&gt;
[[File:HPC basic course 20190506.pdf|Basic Course]]&lt;br /&gt;
&lt;br /&gt;
== Linux Basic Course - 2019-04-16 ==&lt;br /&gt;
&lt;br /&gt;
A course for beginners was organised on the 16th of April, to help beginner Linux users gain some skills in using Linux.&lt;br /&gt;
&lt;br /&gt;
== HPC Advanced Course - 2018-10-16 ==&lt;br /&gt;
&lt;br /&gt;
A course for experienced users was organised on the 16th of October, aiming to brush up users on techniques for submitting unusual jobs, and help provide some more helpful hints and techniques.&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_Advanced_Slides_20181016.pdf|Advanced Course (Gwen)]]&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_advanced_course_20181008.pdf|Advanced Course (Jeremie)]]&lt;br /&gt;
&lt;br /&gt;
== HPC Basic Course - 2018-10-11 ==&lt;br /&gt;
&lt;br /&gt;
A course for beginners was organised on the 11th of October, aiming to help absolute beginners to begin to use the main job scheduler, SLURM.&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_basic_course_20181008.pdf|Basic Course]]&lt;br /&gt;
&lt;br /&gt;
== Basic Linux Course - 2018-10-02 ==&lt;br /&gt;
&lt;br /&gt;
A course basic Linux usage was organised on the 2nd of October, to help beginner Linux users gain some skills in using Linux.&lt;br /&gt;
&lt;br /&gt;
[https://etherpad.lug.wur.nl/p/UpkF2KXDVh]&lt;br /&gt;
&lt;br /&gt;
== HPC Advanced Course - 2018-05-18 ==&lt;br /&gt;
&lt;br /&gt;
A course for experienced users was organised on the 18th of May, aiming to brush up users on techniques for submitting unusual jobs, and help provide some more helpful hints and techniques.&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_Advanced_20180518-GD.pdf|Advanced Course (Gwen)]]&lt;br /&gt;
&lt;br /&gt;
== HPC Basic Course - 2018-05-17 ==&lt;br /&gt;
&lt;br /&gt;
A course for beginners was organised on the 17th of May, aiming to help absolute beginners to begin to use the main job scheduler, SLURM.&lt;br /&gt;
&lt;br /&gt;
== Basic Linux Course - 2018-04-19 ==&lt;br /&gt;
&lt;br /&gt;
A course basic Linux usage was organised on the 19th of April, to help beginner Linux users gain some skills in using Linux.&lt;br /&gt;
&lt;br /&gt;
== HPC Advanced Course - 2017-11-09 ==&lt;br /&gt;
&lt;br /&gt;
A course for experienced users was organised on the 9th of November, aiming to brush up users on techniques for submitting unusual jobs, and help provide some more helpful hints and techniques.&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_Advanced_course_2017-11-08-JV.pdf|Advanced Course (Jeremie)]]&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_Advanced_course_2017-11-08-GD.pdf|Advanced Course (Gwen)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Checkpointing_2017-11-08.pdf|Checkpointing]]&lt;br /&gt;
&lt;br /&gt;
== HPC Basic Course - 2017-10-30 ==&lt;br /&gt;
&lt;br /&gt;
A course for beginners was organised on the 30th of October, aiming to help absolute beginners to enhance their ability to use the main job scheduler, SLURM.&lt;br /&gt;
&lt;br /&gt;
The slides for this course can be found here:&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_basic_course_20171025.pdf | Basic introduction to Linux]]&lt;br /&gt;
&lt;br /&gt;
== HPC Teaching - 2017-06-07 ==&lt;br /&gt;
&lt;br /&gt;
A course for was organised on the 7th of June, aiming to help absolute beginners (and moderately experienced users) to enhance their ability to use the main job scheduler, SLURM.&lt;br /&gt;
&lt;br /&gt;
The slides for this course can be found here:&lt;br /&gt;
&lt;br /&gt;
[[File:Connecting_with_Secure_Shell_to_the_HPC_20170606.pdf | Basic introduction to Linux]]&lt;br /&gt;
&lt;br /&gt;
[[File:Submitting_and_monitoring_jobs_on_the_HPC_20170602.pdf | Submitting and Monitoring Jobs]]&lt;br /&gt;
&lt;br /&gt;
== Old Courses ==&lt;br /&gt;
* [http://www.basgen.nl/sdac/ Sequence Data Analysis Course (Dec. 2012)]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=File:WUR_Deep_Learning_Lab_210619.pdf&amp;diff=2032</id>
		<title>File:WUR Deep Learning Lab 210619.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=File:WUR_Deep_Learning_Lab_210619.pdf&amp;diff=2032"/>
		<updated>2019-06-27T08:28:39Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=File:WUR_Deep_Learning_Frameworks_210619.pdf&amp;diff=2031</id>
		<title>File:WUR Deep Learning Frameworks 210619.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=File:WUR_Deep_Learning_Frameworks_210619.pdf&amp;diff=2031"/>
		<updated>2019-06-27T08:28:23Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=File:WUR_CUDA_2_210619.pdf&amp;diff=2030</id>
		<title>File:WUR CUDA 2 210619.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=File:WUR_CUDA_2_210619.pdf&amp;diff=2030"/>
		<updated>2019-06-27T08:27:57Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Courses&amp;diff=2029</id>
		<title>Courses</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Courses&amp;diff=2029"/>
		<updated>2019-06-24T16:04:26Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Upcoming: HPC Basic Course - 2019-06-28==&lt;br /&gt;
&lt;br /&gt;
A course for beginners will be organised on the 28th of June, aiming to help absolute beginners to begin to use the main job scheduler, SLURM. You can register [https://oneschool.wur.nl/Lists/Cursus/DispForm.aspx?ID=100 here].&lt;br /&gt;
&lt;br /&gt;
== Upcoming Linux Basic Course - 2019-06-27 ==&lt;br /&gt;
&lt;br /&gt;
A course for beginners will be organised on the 13th of June, to help beginner Linux users gain some skills in using Linux. You can register for this course [https://www.wur.nl/en/activity/Linux-basic-course-on-13-June-2019.htm here]&lt;br /&gt;
&lt;br /&gt;
== HPC CUDA/AI Course - 2019-06-21 ==&lt;br /&gt;
&lt;br /&gt;
A course for interested users for deep learning and neural networks, combined with some deep level manipulation of graphics cards was given by Dell on the 21st of July.&lt;br /&gt;
&lt;br /&gt;
[[File:WUR_CUDA_210619.pdf|WUR CUDA Course]]&lt;br /&gt;
[[File:WUR_AI_101_210619.pdf|WUR AI Course 101]]&lt;br /&gt;
[[File:WUR_AI_201_210619.pdf|WUR AI Course 201]]&lt;br /&gt;
&lt;br /&gt;
== HPC Advanced Course - 2019-05-28 ==&lt;br /&gt;
&lt;br /&gt;
A course for experienced users was organised on the 28th of May, aiming to brush up users on techniques for submitting unusual jobs, and help provide some more helpful hints and techniques.&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_advanced_course_20190506.pdf|Advanced Course 1]]&lt;br /&gt;
[[File:HPC_advanced_slides_20190528.pdf|Advanced Course 2]]&lt;br /&gt;
&lt;br /&gt;
== HPC Basic Course - 2019-05-07 ==&lt;br /&gt;
&lt;br /&gt;
A course for beginners will be organised on the 7th of May, aiming to help absolute beginners to begin to use the main job scheduler, SLURM.&lt;br /&gt;
&lt;br /&gt;
[[File:HPC basic course 20190506.pdf|Basic Course]]&lt;br /&gt;
&lt;br /&gt;
== Linux Basic Course - 2019-04-16 ==&lt;br /&gt;
&lt;br /&gt;
A course for beginners was organised on the 16th of April, to help beginner Linux users gain some skills in using Linux.&lt;br /&gt;
&lt;br /&gt;
== HPC Advanced Course - 2018-10-16 ==&lt;br /&gt;
&lt;br /&gt;
A course for experienced users was organised on the 16th of October, aiming to brush up users on techniques for submitting unusual jobs, and help provide some more helpful hints and techniques.&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_Advanced_Slides_20181016.pdf|Advanced Course (Gwen)]]&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_advanced_course_20181008.pdf|Advanced Course (Jeremie)]]&lt;br /&gt;
&lt;br /&gt;
== HPC Basic Course - 2018-10-11 ==&lt;br /&gt;
&lt;br /&gt;
A course for beginners was organised on the 11th of October, aiming to help absolute beginners to begin to use the main job scheduler, SLURM.&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_basic_course_20181008.pdf|Basic Course]]&lt;br /&gt;
&lt;br /&gt;
== Basic Linux Course - 2018-10-02 ==&lt;br /&gt;
&lt;br /&gt;
A course basic Linux usage was organised on the 2nd of October, to help beginner Linux users gain some skills in using Linux.&lt;br /&gt;
&lt;br /&gt;
[https://etherpad.lug.wur.nl/p/UpkF2KXDVh]&lt;br /&gt;
&lt;br /&gt;
== HPC Advanced Course - 2018-05-18 ==&lt;br /&gt;
&lt;br /&gt;
A course for experienced users was organised on the 18th of May, aiming to brush up users on techniques for submitting unusual jobs, and help provide some more helpful hints and techniques.&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_Advanced_20180518-GD.pdf|Advanced Course (Gwen)]]&lt;br /&gt;
&lt;br /&gt;
== HPC Basic Course - 2018-05-17 ==&lt;br /&gt;
&lt;br /&gt;
A course for beginners was organised on the 17th of May, aiming to help absolute beginners to begin to use the main job scheduler, SLURM.&lt;br /&gt;
&lt;br /&gt;
== Basic Linux Course - 2018-04-19 ==&lt;br /&gt;
&lt;br /&gt;
A course basic Linux usage was organised on the 19th of April, to help beginner Linux users gain some skills in using Linux.&lt;br /&gt;
&lt;br /&gt;
== HPC Advanced Course - 2017-11-09 ==&lt;br /&gt;
&lt;br /&gt;
A course for experienced users was organised on the 9th of November, aiming to brush up users on techniques for submitting unusual jobs, and help provide some more helpful hints and techniques.&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_Advanced_course_2017-11-08-JV.pdf|Advanced Course (Jeremie)]]&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_Advanced_course_2017-11-08-GD.pdf|Advanced Course (Gwen)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Checkpointing_2017-11-08.pdf|Checkpointing]]&lt;br /&gt;
&lt;br /&gt;
== HPC Basic Course - 2017-10-30 ==&lt;br /&gt;
&lt;br /&gt;
A course for beginners was organised on the 30th of October, aiming to help absolute beginners to enhance their ability to use the main job scheduler, SLURM.&lt;br /&gt;
&lt;br /&gt;
The slides for this course can be found here:&lt;br /&gt;
&lt;br /&gt;
[[File:HPC_basic_course_20171025.pdf | Basic introduction to Linux]]&lt;br /&gt;
&lt;br /&gt;
== HPC Teaching - 2017-06-07 ==&lt;br /&gt;
&lt;br /&gt;
A course for was organised on the 7th of June, aiming to help absolute beginners (and moderately experienced users) to enhance their ability to use the main job scheduler, SLURM.&lt;br /&gt;
&lt;br /&gt;
The slides for this course can be found here:&lt;br /&gt;
&lt;br /&gt;
[[File:Connecting_with_Secure_Shell_to_the_HPC_20170606.pdf | Basic introduction to Linux]]&lt;br /&gt;
&lt;br /&gt;
[[File:Submitting_and_monitoring_jobs_on_the_HPC_20170602.pdf | Submitting and Monitoring Jobs]]&lt;br /&gt;
&lt;br /&gt;
== Old Courses ==&lt;br /&gt;
* [http://www.basgen.nl/sdac/ Sequence Data Analysis Course (Dec. 2012)]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=File:WUR_CUDA_210619.pdf&amp;diff=2028</id>
		<title>File:WUR CUDA 210619.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=File:WUR_CUDA_210619.pdf&amp;diff=2028"/>
		<updated>2019-06-24T16:01:56Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=File:WUR_AI_101_210619.pdf&amp;diff=2027</id>
		<title>File:WUR AI 101 210619.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=File:WUR_AI_101_210619.pdf&amp;diff=2027"/>
		<updated>2019-06-24T16:01:22Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=File:WUR_AI_201_210619.pdf&amp;diff=2026</id>
		<title>File:WUR AI 201 210619.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=File:WUR_AI_201_210619.pdf&amp;diff=2026"/>
		<updated>2019-06-24T16:00:59Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=File:Anunna_Flyer_2019.svg&amp;diff=2013</id>
		<title>File:Anunna Flyer 2019.svg</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=File:Anunna_Flyer_2019.svg&amp;diff=2013"/>
		<updated>2019-05-06T08:48:54Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Tariffs&amp;diff=2005</id>
		<title>Tariffs</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Tariffs&amp;diff=2005"/>
		<updated>2019-04-23T08:30:08Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Computing: Calculations (cores)==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Queue&lt;br /&gt;
!CPU core hour&lt;br /&gt;
!GB memory hour&lt;br /&gt;
|-&lt;br /&gt;
|Standard queue&lt;br /&gt;
|€ 0.0150&lt;br /&gt;
|€ 0.0015&lt;br /&gt;
|-&lt;br /&gt;
|High priority queue&lt;br /&gt;
|€ 0.0200&lt;br /&gt;
|€ 0.0020&lt;br /&gt;
|-&lt;br /&gt;
|Low priority queue&lt;br /&gt;
|€ 0.0100&lt;br /&gt;
|€ 0.0010&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Computing: GPU Use==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Tariff per device per hour (gpu/hour)&lt;br /&gt;
|-&lt;br /&gt;
|€ 0.3000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Storage ==&lt;br /&gt;
Tariffs per year per TB&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Lustre Nobackup&lt;br /&gt;
!Lustre Backup&lt;br /&gt;
!Home-dir&lt;br /&gt;
!Archive&lt;br /&gt;
|-&lt;br /&gt;
|€ 150&lt;br /&gt;
|€ 200&lt;br /&gt;
|€ 200&lt;br /&gt;
|€ 100&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reservations ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Tariff per node per day (node/day)&lt;br /&gt;
|-&lt;br /&gt;
|€ 50&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Notes==&lt;br /&gt;
&lt;br /&gt;
If you are a member of a group with a commitment, then these costs get deducted from that commitment. Typically we are fairly lax with enforcing limits - only once you get to around 150% of your commitment will we consider taking action (mainly coming to discuss things).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
You are running a job that needs 4 cores, 32G of RAM and runs for 90 minutes in the Std partition. To run this, you over-request resources slightly, and execute in a job that requests 4 CPUs, 40G of RAM and with a time limit of 3 hours. Your job terminates early. Thus, your costs are:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4 * 0.015 * 1.5 = 0.09 EUR for the CPU&lt;br /&gt;
&lt;br /&gt;
40 * 0.0015 * 1.5 = 0.09 EUR for the memory&lt;br /&gt;
&lt;br /&gt;
Total: 0.18 EUR&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Tariffs&amp;diff=2004</id>
		<title>Tariffs</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Tariffs&amp;diff=2004"/>
		<updated>2019-04-23T08:25:47Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Computing: Calculations (cores)==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Queue&lt;br /&gt;
!CPU core hour&lt;br /&gt;
!GB memory hour&lt;br /&gt;
|-&lt;br /&gt;
|Standard queue&lt;br /&gt;
|€ 0.0150&lt;br /&gt;
|€ 0.0015&lt;br /&gt;
|-&lt;br /&gt;
|High priority queue&lt;br /&gt;
|€ 0.0200&lt;br /&gt;
|€ 0.0020&lt;br /&gt;
|-&lt;br /&gt;
|Low priority queue&lt;br /&gt;
|€ 0.0100&lt;br /&gt;
|€ 0.0010&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Computing: GPU Use==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Tariff per device per hour (gpu/hour)&lt;br /&gt;
|-&lt;br /&gt;
|€ 0.3000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Storage ==&lt;br /&gt;
Tariffs per year per TB&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Lustre Nobackup&lt;br /&gt;
!Lustre Backup&lt;br /&gt;
!Home-dir&lt;br /&gt;
!Archive&lt;br /&gt;
|-&lt;br /&gt;
|€ 150&lt;br /&gt;
|€ 200&lt;br /&gt;
|€ 200&lt;br /&gt;
|€ 100&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reservations ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Tariff per node per day (node/day)&lt;br /&gt;
|-&lt;br /&gt;
|€ 50&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If you are a member of a group with a commitment, then these costs get deducted from that commitment. Typically we are fairly lax with enforcing limits - only once you get to around 150% of your commitment will we consider taking action (mainly coming to discuss things).&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Scheduler_Overview_(Slurm)&amp;diff=2003</id>
		<title>Scheduler Overview (Slurm)</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Scheduler_Overview_(Slurm)&amp;diff=2003"/>
		<updated>2019-04-04T08:44:14Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The resource allocation / scheduling software on Anunna is [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management SLURM]: &#039;&#039;&#039;S&#039;&#039;&#039;imple &#039;&#039;&#039;L&#039;&#039;&#039;inux &#039;&#039;&#039;U&#039;&#039;&#039;tility for &#039;&#039;&#039;R&#039;&#039;&#039;esource &#039;&#039;&#039;M&#039;&#039;&#039;anagement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Queues and defaults ==&lt;br /&gt;
&lt;br /&gt;
=== Queues ===&lt;br /&gt;
Every organization has 3 queues (in slurm called partitions) : a high, a standard and a low priority queue.&amp;lt;br&amp;gt;&lt;br /&gt;
The High queue provides the highest priority to jobs (20) then the standard queue (10). In the low priority queue (0)&amp;lt;br&amp;gt;&lt;br /&gt;
jobs will be resubmitted if a job with higer priority needs cluster resources and those resoruces are occupied by a Low queue jobs.&lt;br /&gt;
To find out which queues your account has been authorized for, type sinfo:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
PARTITION       AVAIL  TIMELIMIT  NODES  STATE NODELIST&lt;br /&gt;
ABGC_High      up   infinite     12  down* node[043-048,055-060]&lt;br /&gt;
ABGC_High      up   infinite      6    mix fat[001-002],node[002-005]&lt;br /&gt;
ABGC_High      up   infinite     44   idle node[001,006-042,049-054]&lt;br /&gt;
ABGC_Std       up   infinite     12  down* node[043-048,055-060]&lt;br /&gt;
ABGC_Std       up   infinite      6    mix fat[001-002],node[002-005]&lt;br /&gt;
ABGC_Std       up   infinite     44   idle node[001,006-042,049-054]&lt;br /&gt;
ABGC_Low       up   infinite     12  down* node[043-048,055-060]&lt;br /&gt;
ABGC_Low       up   infinite      6    mix fat[001-002],node[002-005]&lt;br /&gt;
ABGC_Low       up   infinite     44   idle node[001,006-042,049-054]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Defaults ===&lt;br /&gt;
There is no default queue, so you need to specify which queue to use when submitting a job.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The default run time for a job is 1 hour!&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Default memory limit is 100MB per node!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Submitting jobs: sbatch ==&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
Consider this simple python3 script that should calculate Pi to 1 million digits:&lt;br /&gt;
&amp;lt;source lang=&#039;python&#039;&amp;gt;&lt;br /&gt;
from decimal import *&lt;br /&gt;
D=Decimal&lt;br /&gt;
getcontext().prec=10000000&lt;br /&gt;
p=sum(D(1)/16**k*(D(4)/(8*k+1)-D(2)/(8*k+4)-D(1)/(8*k+5)-D(1)/(8*k+6))for k in range(411))&lt;br /&gt;
print(str(p)[:10000002])&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Loading modules ===&lt;br /&gt;
In order for this script to run, the first thing that is needed is that Python3, which is not the default Python version on the cluster, is load into your environment. Availability of (different versions of) software can be checked by the following command:&lt;br /&gt;
  module avail&lt;br /&gt;
&lt;br /&gt;
In the list you should note that python3 is indeed available to be loaded, which then can be loaded with the following command:&lt;br /&gt;
  module load python/3.3.3&lt;br /&gt;
&lt;br /&gt;
=== Batch script ===&lt;br /&gt;
[[Creating_sbatch_script | Main Article: Creating a sbatch script]]&lt;br /&gt;
&lt;br /&gt;
The following shell/slurm script can then be used to schedule the job using the sbatch command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --comment=773320000&lt;br /&gt;
#SBATCH --time=1200&lt;br /&gt;
#SBATCH --mem=2048&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --output=output_%j.txt&lt;br /&gt;
#SBATCH --error=error_output_%j.txt&lt;br /&gt;
#SBATCH --job-name=calc_pi.py&lt;br /&gt;
#SBATCH --partition=ABGC_Std&lt;br /&gt;
#SBATCH --mail-type=ALL&lt;br /&gt;
#SBATCH --mail-user=email@org.nl&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
time python3 calc_pi.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting ===&lt;br /&gt;
The script, assuming it was named &#039;run_calc_pi.sh&#039;, can then be posted using the following command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sbatch run_calc_pi.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting multiple jobs (simple) ===&lt;br /&gt;
Assuming there are 10 job scripts, name runscript_1.sh through runscript_10.sh, all these scripts can be submitted using the following line of shell code:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;for i in `seq 1 10`; do echo $i; sbatch runscript_$i.sh;done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Submitting multiple jobs (complex) ===&lt;br /&gt;
Lets&#039;s say you have three job scripts that depend on each other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_1.sh #A simple initialisation script&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_2.sh #An array task&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;job_3.sh #Some finishing script, single run, after everything previous has finished&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can create a script to simultaneously submit each job with a dependency on each other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;#!/bin/bash&lt;br /&gt;
JOB1=$(sbatch job_1.sh| rev | cut -d &#039; &#039; -f 1 | rev) #Get me the last space-separated element&lt;br /&gt;
&lt;br /&gt;
if ! [ &amp;quot;z$JOB1&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;First job submitted as jobid $JOB1&amp;quot;&lt;br /&gt;
  JOB2=$(sbatch --dependency=afterany:$JOB1 job_2.sh| rev | cut -d &#039; &#039; -f 1 | rev)&lt;br /&gt;
&lt;br /&gt;
  if ! [ &amp;quot;z$JOB2&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Second job submitted as jobid $JOB2, following $JOB1&amp;quot;&lt;br /&gt;
  JOB3=$(sbatch --dependency=afterany:$JOB2 job_3.sh| rev | cut -d &#039; &#039; -f 1 | rev)&lt;br /&gt;
&lt;br /&gt;
  if ! [ &amp;quot;z$JOB3&amp;quot; == &amp;quot;z&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Third job submitted as jobid $JOB3, following after every element of $JOB2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  fi&lt;br /&gt;
 fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will ensure that the subsequent jobs occur after any finishing of the former (even if they failed).&lt;br /&gt;
&lt;br /&gt;
Please see [https://slurm.schedmd.com/sbatch.html#OPT_dependency the sbatch documentation] for other options available to you. Note that aftercorr makes a subsequent array jobs array elements start after the correspondingly numbered ones from the previous job.&lt;br /&gt;
&lt;br /&gt;
=== Submitting array jobs ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --array=0-10%4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
SLURM allows you to submit multiple jobs using the same template. Further information about this can be found [[Array_jobs|here]].&lt;br /&gt;
&lt;br /&gt;
=== Using /tmp ===&lt;br /&gt;
There is a local disk of ~300G that can be used to temporarily stage some of your workload attached to each node. This is free to use, but please remember to clean up your data after usage.&lt;br /&gt;
&lt;br /&gt;
In order to be sure that you&#039;re able to use space in /tmp, you can add&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --tmp=&amp;lt;required size&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To your sbatch script. This will prevent your job from being run on nodes where there is no free space, or it&#039;s aimed to be used by another job at the same time.&lt;br /&gt;
&lt;br /&gt;
== Monitoring submitted jobs ==&lt;br /&gt;
Once a job is submitted, the status can be monitored using the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command. The &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command has a number of parameters for monitoring specific properties of the jobs such as time limit.&lt;br /&gt;
&lt;br /&gt;
=== Generic monitoring of all running jobs ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
  squeue&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should then get a list of jobs that are running at that time on the cluster, for the example on how to submit using the &#039;sbatch&#039; command, it may look like so:&lt;br /&gt;
    JOBID PARTITION     NAME     USER  ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
   3396      ABGC BOV-WUR- megen002   R      27:26      1 node004&lt;br /&gt;
   3397      ABGC BOV-WUR- megen002   R      27:26      1 node005&lt;br /&gt;
   3398      ABGC BOV-WUR- megen002   R      27:26      1 node006&lt;br /&gt;
   3399      ABGC BOV-WUR- megen002   R      27:26      1 node007&lt;br /&gt;
   3400      ABGC BOV-WUR- megen002   R      27:26      1 node008&lt;br /&gt;
   3401      ABGC BOV-WUR- megen002   R      27:26      1 node009&lt;br /&gt;
   3385  research BOV-WUR- megen002   R      44:38      1 node049&lt;br /&gt;
   3386  research BOV-WUR- megen002   R      44:38      1 node050&lt;br /&gt;
   3387  research BOV-WUR- megen002   R      44:38      1 node051&lt;br /&gt;
   3388  research BOV-WUR- megen002   R      44:38      1 node052&lt;br /&gt;
   3389  research BOV-WUR- megen002   R      44:38      1 node053&lt;br /&gt;
   3390  research BOV-WUR- megen002   R      44:38      1 node054&lt;br /&gt;
   3391  research BOV-WUR- megen002   R      44:38      3 node[049-051]&lt;br /&gt;
   3392  research BOV-WUR- megen002   R      44:38      3 node[052-054]&lt;br /&gt;
   3393  research BOV-WUR- megen002   R      44:38      1 node001&lt;br /&gt;
   3394  research BOV-WUR- megen002   R      44:38      1 node002&lt;br /&gt;
   3395  research BOV-WUR- megen002   R      44:38      1 node003&lt;br /&gt;
&lt;br /&gt;
=== Monitoring time limit set for a specific job ===&lt;br /&gt;
The default time limit is set at one hour. Estimated run times need to be specified when running jobs. To see what the time limit is that is set for a certain job, this can be done using the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
squeue -l -j 3532&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Information similar to the following should appear:&lt;br /&gt;
  Fri Nov 29 15:41:00 2013&lt;br /&gt;
   JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)&lt;br /&gt;
   3532      ABGC BOV-WUR- megen002  RUNNING    2:47:03 3-08:00:00      1 node054&lt;br /&gt;
&lt;br /&gt;
=== Query a specific active job: scontrol ===&lt;br /&gt;
Show all the details of a currently active job, so not a completed job.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
login ~]$ scontrol show jobid 4241&lt;br /&gt;
JobId=4241 Name=WB20F06&lt;br /&gt;
   UserId=megen002(16795409) GroupId=domain users(16777729)&lt;br /&gt;
   Priority=1 Account=(null) QOS=normal&lt;br /&gt;
   JobState=RUNNING Reason=None Dependency=(null)&lt;br /&gt;
   Requeue=1 Restarts=0 BatchFlag=1 ExitCode=0:0&lt;br /&gt;
   RunTime=02:55:25 TimeLimit=3-08:00:00 TimeMin=N/A&lt;br /&gt;
   SubmitTime=2013-12-09T13:37:29 EligibleTime=2013-12-09T13:37:29&lt;br /&gt;
   StartTime=2013-12-09T13:37:29 EndTime=2013-12-12T21:37:29&lt;br /&gt;
   PreemptTime=None SuspendTime=None SecsPreSuspend=0&lt;br /&gt;
   Partition=research AllocNode:Sid=login0:21799&lt;br /&gt;
   ReqNodeList=(null) ExcNodeList=(null)&lt;br /&gt;
   NodeList=node023&lt;br /&gt;
   BatchHost=node023&lt;br /&gt;
   NumNodes=1 NumCPUs=4 CPUs/Task=1 ReqS:C:T=*:*:*&lt;br /&gt;
   MinCPUsNode=1 MinMemoryNode=0 MinTmpDiskNode=0&lt;br /&gt;
   Features=(null) Gres=(null) Reservation=(null)&lt;br /&gt;
   Shared=OK Contiguous=0 Licenses=(null) Network=(null)&lt;br /&gt;
   Command=/lustre/scratch/WUR/ABGC/...&lt;br /&gt;
   WorkDir=/lustre/scratch/WUR/ABGC/...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Check on a pending job ===&lt;br /&gt;
A submitted job could result in a pending state when there are not enough resources available to this job.&lt;br /&gt;
In this example I sumbit a job, check the status and after finding out is it &#039;&#039;&#039;pending&#039;&#039;&#039; I&#039;ll check when is probably will start.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
[@login jobs]$ sbatch hpl_student.job&lt;br /&gt;
 Submitted batch job 740338&lt;br /&gt;
&lt;br /&gt;
[@login jobs]$ squeue -l -j 740338&lt;br /&gt;
 Fri Feb 21 15:32:31 2014&lt;br /&gt;
  JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)&lt;br /&gt;
 740338 ABGC_Stud HPLstude bohme999  PENDING       0:00 1-00:00:00      1 (ReqNodeNotAvail)&lt;br /&gt;
&lt;br /&gt;
[@login jobs]$ squeue --start -j 740338&lt;br /&gt;
  JOBID PARTITION     NAME     USER  ST           START_TIME  NODES NODELIST(REASON)&lt;br /&gt;
 740338 ABGC_Stud HPLstude bohme999  PD  2014-02-22T15:31:48      1 (ReqNodeNotAvail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
So it seems this job will problably start the next day, but&#039;s thats no guarantee it will start indeed.&lt;br /&gt;
&lt;br /&gt;
== Removing jobs from a list: scancel ==&lt;br /&gt;
If for some reason you want to delete a job that is either in the queue or already running, you can remove it using the &#039;scancel&#039; command. The &#039;scancel&#039; command takes the jobid as a parameter. For the example above, this would be done using the following code:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
scancel 3401&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Allocating resources interactively: sinteractive ==&lt;br /&gt;
sinteractive is a tiny wrapper on srun to create interactive jobs quickly and easily. It allows you to get a shell on one of the nodes, with similar limits as you would do for a normal job. To use it, simply run:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sinteractive -c &amp;lt;num_cpus&amp;gt; --mem &amp;lt;amount_mem&amp;gt; --time &amp;lt;minutes&amp;gt; -p &amp;lt;partition&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You will then be presented with a new shell prompt on one of the compute nodes (run &#039;hostname&#039; to see which!). From here, you can test out code in an interactive fashion as needs be.&lt;br /&gt;
&lt;br /&gt;
Be advised though - not filling in the above fields will get you a shell with 1 CPU and 100Mb of RAM for 1 hour. This is useful for quick testing, however.&lt;br /&gt;
&lt;br /&gt;
=== sinteractive source ===&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
srun &amp;quot;$@&amp;quot; -I60 -N 1 -n 1 --pty bash -i&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== interactive Slurm - using salloc ===&lt;br /&gt;
If you don&#039;t want your shell to be transported but want a new remote shell, do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
salloc -p ABGC_Low $SHELL&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now your shell will stay on the login node, but you can do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
srun &amp;lt;command&amp;gt; &amp;amp;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To submit tasks to this new shell!&lt;br /&gt;
&lt;br /&gt;
Be aware that the time limit of salloc is default 1 hour. If you intend to run jobs for longer times than this, you need to edit the settings for it. See: https://computing.llnl.gov/linux/slurm/salloc.html&lt;br /&gt;
&lt;br /&gt;
== Get overview of past and current jobs: sacct ==&lt;br /&gt;
To do some accounting on past and present jobs, and to see whether they ran to completion, you can do:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sacct&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should provide information similar to the following:&lt;br /&gt;
&lt;br /&gt;
         JobID    JobName  Partition    Account  AllocCPUS      State ExitCode &lt;br /&gt;
  ------------ ---------- ---------- ---------- ---------- ---------- -------- &lt;br /&gt;
  3385         BOV-WUR-58   research                    12  COMPLETED      0:0 &lt;br /&gt;
  3385.batch        batch                                1  COMPLETED      0:0 &lt;br /&gt;
  3386         BOV-WUR-59   research                    12 CANCELLED+      0:0 &lt;br /&gt;
  3386.batch        batch                                1  CANCELLED     0:15 &lt;br /&gt;
  3528         BOV-WUR-59       ABGC                    16    RUNNING      0:0 &lt;br /&gt;
  3529         BOV-WUR-60       ABGC                    16    RUNNING      0:0&lt;br /&gt;
&lt;br /&gt;
Or in more detail for a specific job:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sacct --format=jobid,jobname,comment,partition,ntasks,alloccpus,elapsed,state,exitcode -j 4220&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This should provide information about job id 4220:&lt;br /&gt;
&lt;br /&gt;
       JobID    JobName    Comment   Partition   NTasks  AllocCPUS    Elapsed      State ExitCode &lt;br /&gt;
  ------------ ---------- ---------- ---------- -------- ---------- ---------- ---------- -------- &lt;br /&gt;
  4220         PreProces+              research                   3   00:30:52  COMPLETED      0:0 &lt;br /&gt;
  4220.batch        batch                              1          1   00:30:52  COMPLETED      0:0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Job Status Codes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically your job will be either in the Running state of PenDing state. However here is a breakdown of all the states that your job could be in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Code!!State!!Description&lt;br /&gt;
|-&lt;br /&gt;
|CA	||CANCELLED||	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;
|CD||	COMPLETED||	Job has terminated all processes on all nodes.&lt;br /&gt;
|-&lt;br /&gt;
|CF||	CONFIGURING||	Job has been allocated resources, but are waiting for them to become ready for use (e.g. booting).&lt;br /&gt;
|-&lt;br /&gt;
|CG||	COMPLETING||	Job is in the process of completing. Some processes on some nodes may still be active.&lt;br /&gt;
|-&lt;br /&gt;
|F||	FAILED||	Job terminated with non-zero exit code or other failure condition.&lt;br /&gt;
|-&lt;br /&gt;
|NF||	NODE_FAIL||	Job terminated due to failure of one or more allocated nodes.&lt;br /&gt;
|-&lt;br /&gt;
|PD||	PENDING||	Job is awaiting resource allocation.&lt;br /&gt;
|-&lt;br /&gt;
|R||	RUNNING||	Job currently has an allocation.&lt;br /&gt;
|-&lt;br /&gt;
|S||	SUSPENDED||	Job has an allocation, but execution has been suspended.&lt;br /&gt;
|-&lt;br /&gt;
|TO||	TIMEOUT||	Job terminated upon reaching its time limit.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Running MPI jobs on Anunna ==&lt;br /&gt;
&lt;br /&gt;
[[MPI_on_B4F_cluster | Main article: MPI on Anunna]]&lt;br /&gt;
&amp;lt; text here &amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Understanding which resources are available to you: sinfo ==&lt;br /&gt;
By using the &#039;sinfo&#039; command you can retrieve information on which &#039;Partitions&#039; are available to you. A &#039;Partition&#039; using SLURM is similar to the &#039;queue&#039; when submitting using the Sun Grid Engine (&#039;qsub&#039;). The different Partitions grant different levels of resource allocation. Not all defined Partitions will be available to any given person. E.g., Master students will only have the Student Partition available, researchers at the ABGC will have &#039;student&#039;, &#039;research&#039;, and &#039;ABGC&#039; partitions available. The higher the level of  resource allocation, though, the higher the cost per compute-hour. The default Partition is the &#039;student&#039; partition. A full list of Partitions can be found from the Bright Cluster Manager webpage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
sinfo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  PARTITION AVAIL  TIMELIMIT  NODES  STATE NODELIST&lt;br /&gt;
  student*     up   infinite     12  down* node[043-048,055-060]&lt;br /&gt;
  student*     up   infinite     50   idle fat[001-002],node[001-042,049-054]&lt;br /&gt;
  research     up   infinite     12  down* node[043-048,055-060]&lt;br /&gt;
  research     up   infinite     50   idle fat[001-002],node[001-042,049-054]&lt;br /&gt;
  ABGC         up   infinite     12  down* node[043-048,055-060]&lt;br /&gt;
  ABGC         up   infinite     50   idle fat[001-002],node[001-042,049-054]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Tariffs | Costs associated with resource usage]]&lt;br /&gt;
* [[B4F_cluster | Anunna]]&lt;br /&gt;
* [[BCM_on_B4F_cluster | BCM on Anunna]]&lt;br /&gt;
* [[SLURM_Compare | SLURM compared to other common schedulers]]&lt;br /&gt;
* [[Setting_up_Python_virtualenv | Setting up and using a virtual environment for Python3 ]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://slurm.schedmd.com Slurm official documentation]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Simple_Linux_Utility_for_Resource_Management Slurm on Wikipedia]&lt;br /&gt;
* [http://www.youtube.com/watch?v=axWffyrk3aY Slurm Tutorial on Youtube]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Filesystems&amp;diff=2002</id>
		<title>Filesystems</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Filesystems&amp;diff=2002"/>
		<updated>2019-04-04T08:43:24Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Anunna currently has multiple filesystem mounts that are available cluster-wide:&lt;br /&gt;
&lt;br /&gt;
== Global ==&lt;br /&gt;
* /home - This mount uses NFS to mount the home directories directly from nfs01. Each user has a 200G quota for this filesystem, as it is regularly backed up to tape, and can reliably be restored from up to a week&#039;s history.&lt;br /&gt;
&lt;br /&gt;
* /cm/shared - This mount provides a consistent set of binaries for the entire cluster.&lt;br /&gt;
&lt;br /&gt;
* /lustre - This large mount uses the Lustre filesystem to provide files from multiple redundant servers. Access is provided per group, thus:&lt;br /&gt;
 /lustre/[level]/[partner]/[unit]&lt;br /&gt;
e.g.&lt;br /&gt;
 /lustre/backup/WUR/ABGC/&lt;br /&gt;
It comprises of three major parts (and some minor):&lt;br /&gt;
* /lustre/backup - In case of disaster, this data is stored a second time on a separate machine. Whilst this backup is purely in case of complete tragedy (such as some immense filesystem error, or multiple component failure), it can potentially be used to revert mistakes if you are very fast about reporting them. There is however no guarantee of this service.&lt;br /&gt;
* /lustre/nobackup - This is the &#039;normal&#039; filesystem for Lustre - no backups, just stored on the filesystem. Without having a backup needed, the cost of data here is not as much as under /lustre/backup, but in case of disaster cannot be recivered.&lt;br /&gt;
* /lustre/scratch - Files here may be removed after some time if the filesystem gets too full (Typically 30 days). You should tidy up this data yourself once work is complete.&lt;br /&gt;
* /lustre/shared - Same as /lustre/backup, except publicly available. This is where truly shared data lives that isn&#039;t assigned to a specific group.&lt;br /&gt;
&lt;br /&gt;
=== Private shared directories ===&lt;br /&gt;
If you are working with a group of users on a similar project, you might consider making a [[Shared_folders|Shared directory]] to coordinate. Information on how to do so is in the linked article.&lt;br /&gt;
&lt;br /&gt;
== Local ==&lt;br /&gt;
Specific to certain machines are some other filesystems that are available to you:&lt;br /&gt;
* /archive - an archive mount only accessible from the login nodes. Files here are sent to the Isilon for deeper storage. The cost of storing data here is much less than on the Lustre, but it cannot be used for compute work. This location is only available to WUR users. Files are able to be reverted via snapshot, and there is a separated backup, however this only comes in fortnightly (14 day) intervals.&lt;br /&gt;
&lt;br /&gt;
* /tmp - On each worker node there is a /tmp mount that can be used for temporary local caching. Be advised that you should clean this up, lest your files become a hindrance to other users. You can request a node with free space in your sbatch script like so:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
#SBATCH --tmp=&amp;lt;required space&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* /dev/shm - On each worker you may also create a virtual filesystem directly into memory, for extremely fast data access. Be advised that this will count against the memory used for your job, but it is also the fastest available filesystem if needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Tariffs | Costs associated with resource usage]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://wiki.lustre.org/index.php/Main_Page Lustre website]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Main_Page&amp;diff=2001</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Main_Page&amp;diff=2001"/>
		<updated>2019-04-04T08:42:41Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Anunna is a [http://en.wikipedia.org/wiki/High-performance_computing High Performance Computer] (HPC) infrastructure hosted by [http://www.wageningenur.nl/nl/activiteit/Opening-High-Performance-Computing-cluster-HPC.htm Wageningen University &amp;amp; Research Centre]. It is open for use for all WUR research groups as well as other organizations, including companies, that have collaborative projects with WUR. &lt;br /&gt;
&lt;br /&gt;
= Using Anunna =&lt;br /&gt;
== Gaining access to Anunna==&lt;br /&gt;
Access to the cluster and file transfer are traditionally done via [http://en.wikipedia.org/wiki/Secure_Shell SSH and SFTP].&lt;br /&gt;
* [[log_in_to_B4F_cluster | Logging into cluster using ssh and file transfer]]&lt;br /&gt;
* [[Services | Alternative access methods, and extra features and services on Anunna]]&lt;br /&gt;
* [[Filesystems | Accessible storage methods on Anunna]]&lt;br /&gt;
* [[Tariffs | Costs associated with resource usage]]&lt;br /&gt;
&lt;br /&gt;
== Access Policy ==&lt;br /&gt;
[[Access_Policy | Main Article: Access Policy]]&lt;br /&gt;
&lt;br /&gt;
Access needs to be granted actively (by creation of an account on the cluster by FB-IT). Use of resources is limited by the scheduler. Depending on availability of queues (&#039;partitions&#039;) granted to a user, priority to the system&#039;s resources is regulated. Note that the use of Anunna is not free of charge. List price of CPU time and storage, and possible discounts on that list price for your organisation, can be retrieved from CAT-AGRO or FB-ICT.&lt;br /&gt;
&lt;br /&gt;
= Events =&lt;br /&gt;
* [[Courses]] that have happened and are happening&lt;br /&gt;
* [[Downtime]] that will affect all users&lt;br /&gt;
* [[Meetings]] that may affect the policies of Anunna&lt;br /&gt;
&lt;br /&gt;
= Other Software =&lt;br /&gt;
&lt;br /&gt;
== Cluster Management Software and Scheduler ==&lt;br /&gt;
Anunna uses Bright Cluster Manager software for overall cluster management, and Slurm as job scheduler.&lt;br /&gt;
* [[BCM_on_B4F_cluster | Monitor cluster status with BCM]]&lt;br /&gt;
* [[Using_Slurm | Submit jobs with Slurm]]&lt;br /&gt;
* [[node_usage_graph | Be aware of how much work the cluster is under right now with &#039;node_usage_graph&#039;]]&lt;br /&gt;
* [[SLURM_Compare | Rosetta Stone of Workload Managers]]&lt;br /&gt;
&lt;br /&gt;
== Installation of software by users ==&lt;br /&gt;
&lt;br /&gt;
* [[Domain_specific_software_on_B4Fcluster_installation_by_users | Installing domain specific software: installation by users]]&lt;br /&gt;
* [[Setting local variables]]&lt;br /&gt;
* [[Installing_R_packages_locally | Installing R packages locally]]&lt;br /&gt;
* [[Setting_up_Python_virtualenv | Setting up and using a virtual environment for Python3 ]]&lt;br /&gt;
* [[Virtual_environment_Python_3.4_or_higher | Setting up and using a virtual environment for Python3.4 or higher ]]&lt;br /&gt;
* [[Installing WRF and WPS]]&lt;br /&gt;
&lt;br /&gt;
== Installed software ==&lt;br /&gt;
&lt;br /&gt;
* [[Globally_installed_software | Globally installed software]]&lt;br /&gt;
* [[ABGC_modules | ABGC specific modules]]&lt;br /&gt;
&lt;br /&gt;
= Useful Notes = &lt;br /&gt;
&lt;br /&gt;
== Being in control of Environment parameters ==&lt;br /&gt;
&lt;br /&gt;
* [[Using_environment_modules | Using environment modules]]&lt;br /&gt;
* [[Setting local variables]]&lt;br /&gt;
* [[Setting_TMPDIR | Set a custom temporary directory location]]&lt;br /&gt;
* [[Installing_R_packages_locally | Installing R packages locally]]&lt;br /&gt;
* [[Setting_up_Python_virtualenv | Setting up and using a virtual environment for Python3 ]]&lt;br /&gt;
&lt;br /&gt;
== Controlling costs ==&lt;br /&gt;
&lt;br /&gt;
* [[SACCT | using SACCT to see your costs]]&lt;br /&gt;
* [[get_my_bill | using the &amp;quot;get_my_bill&amp;quot; script to estimate costs]]&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
Project Leader of Anunna is Stephen Janssen (Wageningen UR,FB-IT, Service Management). [[User:lith010 | Jan van Lith (Wageningen UR,FB-IT, Infrastructure)]], [[User:dawes001 | Gwen Dawes (Wageningen UR, FB-IT, Infrastructure)]] and [[User:vaend001 | Catharina Vaendel(Wageningen UR,FB-IT, Infrastructure)]] are responsible for [[Maintenance_and_Management | Maintenance and Management]].&lt;br /&gt;
&lt;br /&gt;
* [[Roadmap | Ambitions regarding innovation, support and administration of Anunna ]]&lt;br /&gt;
&lt;br /&gt;
= Miscellaneous =&lt;br /&gt;
* [[Mailinglist | Electronic mail discussion lists]]&lt;br /&gt;
* [[History_of_the_Cluster | Historical information on the startup of Anunna]]&lt;br /&gt;
* [[Bioinformatics_tips_tricks_workflows | Bioinformatics tips, tricks, and workflows]]&lt;br /&gt;
* [[Parallel_R_code_on_SLURM | Running parallel R code on SLURM]]&lt;br /&gt;
* [[Convert_between_MediaWiki_and_other_formats | Convert between MediaWiki format and other formats]]&lt;br /&gt;
* [[Manual GitLab | GitLab: Create projects and add scripts]]&lt;br /&gt;
* [[Monitoring_executions | Monitoring job execution]]&lt;br /&gt;
* [[Shared_folders | Working with shared folders in the Lustre file system]]&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* [[Maintenance_and_Management | Maintenance and Management]]&lt;br /&gt;
* [[BCData | BCData]]&lt;br /&gt;
* [[Mailinglist | Electronic mail discussion lists]]&lt;br /&gt;
* [[About_ABGC | About ABGC]]&lt;br /&gt;
* [[Computer_cluster | High Performance Computing @ABGC]]&lt;br /&gt;
* [[Lustre_PFS_layout | Lustre Parallel File System layout]]&lt;br /&gt;
&lt;br /&gt;
= External links =&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; |&lt;br /&gt;
* [http://www.breed4food.com/en/show/Breed4Food-initiative-reinforces-the-Netherlands-position-as-an-innovative-country-in-animal-breeding-and-genomics.htm Breed4Food programme]&lt;br /&gt;
* [http://www.wageningenur.nl/en/Expertise-Services/Facilities/CATAgroFood-3/CATAgroFood-3/Our-facilities/Show/High-Performance-Computing-Cluster-HPC.htm CATAgroFood offers a HPC facilty]&lt;br /&gt;
* [http://www.cobb-vantress.com Cobb-Vantress homepage]&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; |&lt;br /&gt;
* [https://www.crv4all.nl CRV homepage]&lt;br /&gt;
* [http://www.hendrix-genetics.com Hendrix Genetics homepage]&lt;br /&gt;
* [http://www.topigs.com TOPIGS homepage]&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; |&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Scientific_Linux Scientific Linux]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Help:Cheatsheet Help with editing Wiki pages]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Tariffs&amp;diff=2000</id>
		<title>Tariffs</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Tariffs&amp;diff=2000"/>
		<updated>2019-04-04T08:41:47Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: Created page with &amp;quot;== Computing: Calculations (cores)== {| class=&amp;quot;wikitable&amp;quot; !Queue !CPU core hour !GB memory hour |- |Standard queue |€ 0.0150 |€ 0.0015 |- |High priority queue |€ 0.0200...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Computing: Calculations (cores)==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Queue&lt;br /&gt;
!CPU core hour&lt;br /&gt;
!GB memory hour&lt;br /&gt;
|-&lt;br /&gt;
|Standard queue&lt;br /&gt;
|€ 0.0150&lt;br /&gt;
|€ 0.0015&lt;br /&gt;
|-&lt;br /&gt;
|High priority queue&lt;br /&gt;
|€ 0.0200&lt;br /&gt;
|€ 0.0020&lt;br /&gt;
|-&lt;br /&gt;
|Low priority queue&lt;br /&gt;
|€ 0.0100&lt;br /&gt;
|€ 0.0010&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Computing: GPU Use==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Tariff per device per hour (gpu/hour)&lt;br /&gt;
|-&lt;br /&gt;
|€ 0.3000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Storage ==&lt;br /&gt;
Tariffs per year per TB&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Lustre Nobackup&lt;br /&gt;
!Lustre Backup&lt;br /&gt;
!Home-dir&lt;br /&gt;
!Archive&lt;br /&gt;
|-&lt;br /&gt;
|€ 150&lt;br /&gt;
|€ 200&lt;br /&gt;
|€ 200&lt;br /&gt;
|€ 100&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=File:Anunna.svg.png&amp;diff=1999</id>
		<title>File:Anunna.svg.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=File:Anunna.svg.png&amp;diff=1999"/>
		<updated>2019-03-19T14:11:52Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=B4F_cluster&amp;diff=1996</id>
		<title>B4F cluster</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=B4F_cluster&amp;diff=1996"/>
		<updated>2019-03-19T14:03:41Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Historical =&lt;br /&gt;
This page contains historical information about the WUR HPC Cluster as of 2013.&lt;br /&gt;
&lt;br /&gt;
== B4F Cluster ==&lt;br /&gt;
The [http://www.breed4food.com/en/breed4food.htm Breed4Food] (B4F) cluster is a joint [http://en.wikipedia.org/wiki/High-performance_computing High Performance Compute] (HPC) infrastructure of the [[About_ABGC | Animal Breeding and Genomics Centre]] (WU-Animal Breeding and Genomics and Wageningen Livestock Research) and four major breeding companies: [http://www.cobb-vantress.com Cobb-Vantress], [https://www.crv4all.nl CRV], [http://www.hendrix-genetics.com Hendrix Genetics], and [http://www.topigs.com TOPIGS]. &lt;br /&gt;
&lt;br /&gt;
== Rationale and Requirements for a new cluster ==&lt;br /&gt;
[[File:Breed4food-logo.jpg|thumb|right|200px|The Breed4Food logo]]&lt;br /&gt;
The B4F Cluster is, in a way, the 7th pillar of the [http://www.breed4food.com/en/show/Breed4Food-initiative-reinforces-the-Netherlands-position-as-an-innovative-country-in-animal-breeding-and-genomics.htm Breed4Food programme]. While the other six pillars revolve around specific research themes, the Cluster represents a joint infrastructure. The rationale behind the cluster is to enable the increasing computational needs in the field of genetics and genomics research, by creating a joint facility that will generate benefits of scale, thereby reducing cost. In addition, the joint infrastructure is intended to facilitate cross-organisational knowledge transfer. In that capacity, the B4F Cluster acts as a joint (virtual) laboratory where researchers - academic and applied - can benefit from each other&#039;s know how. Lastly, the joint cluster, housed at Wageningen University campus, allows retaining vital and often confidential data sources in a controlled environment, something that cloud services such as Amazon Cloud or others usually can not guarantee.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
== Process of acquisition and financing ==&lt;br /&gt;
&lt;br /&gt;
[[File:Signing_CatAgro.png|thumb|left|300px|Petra Caessens, manager operations of CAT-AgroFood, signs the contract of the supplier on August 1st, 2013. Next to her Johan van Arendonk on behalf of Breed4Food.]]&lt;br /&gt;
The B4F cluster was financed by [http://www.wageningenur.nl/en/Expertise-Services/Facilities/CATAgroFood-3/CATAgroFood-3/News-and-agenda/Show/CATAgroFood-invests-in-a-High-Performance-Computing-cluster.htm CATAgroFood]. The [[B4F_cluster#IT_Workgroup | IT-Workgroup]] formulated a set of requirements that in the end were best met by an offer from [http://www.dell.com/learn/nl/nl/rc1078544/hpcc Dell]. [http://www.clustervision.com ClusterVision] was responsible for installing the cluster at the Theia server centre of FB-ICT.&lt;br /&gt;
&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
== Architecture of the cluster ==&lt;br /&gt;
&lt;br /&gt;
[[File:Cluster_scheme.png|thumb|right|600px|Schematic overview of the cluster.]]&lt;br /&gt;
The new B4F HPC has a classic cluster architecture: state of the art Parallel File System (PSF), headnodes, compute nodes (of varying &#039;size&#039;), all connected by superfast internet connections (Infiniband). Implementation of the cluster will be done in stages. The initial stage includes a 600TB PFS, 48 slim nodes of 16 cores and 64GB RAM each, and 2 fat nodes of 64 cores and 1TB RAM each. The overall architecture, that include two head nodes in fall-over configuration and an infiniband network backbone, can be easily expanded by adding nodes and expanding the PFS. The cluster management software is designed to facilitate a heterogenous and evolving cluster.&lt;br /&gt;
{{-}}&lt;br /&gt;
=== Nodes ===&lt;br /&gt;
The cluster consists of a bunch of separate machines that each has its own operating system. The default operating system throughout the cluster is RHEL6. The cluster has two master nodes in a redundant configuration, which means that if one crashes, the other will take over seamlessly. Various other nodes exist to support the two main file systems (the Lustre parallel file system and the NFS file system). The actual computations are done on the worker nodes or compute nodes. The cluster is configured in a heterogeneous fashion: it consists of 48 so called &#039;slim nodes&#039;, that each have 16 cores and 64GB of RAM (called &#039;node001&#039; through &#039;node060&#039;; note that not all node names map to physical nodes), and two so called &#039;fat nodes&#039; that each have 64 cores and 1TB of RAM (&#039;fat001&#039; and &#039;fat002&#039;).&lt;br /&gt;
&lt;br /&gt;
Information from the Cluster Management Portal, as it appeared on November 23, 2013:&lt;br /&gt;
  &amp;lt;code&amp;gt;DEVICE INFORMATION&lt;br /&gt;
  Hostname	State	Memory	Cores	CPU	Speed	GPU	NICs	IB	Category&lt;br /&gt;
  master1, master2	UP	67.6 GiB	16	Intel(R) Xeon(R) CPU E5-2660 0+	2199 MHz		5	1	&lt;br /&gt;
  node001..node042, node049..node054	UP	67.6 GiB	16	Intel(R) Xeon(R) CPU E5-2660 0+	1200 MHz		3	1	default&lt;br /&gt;
  node043..node048, node055..node060	DOWN	N/A	N/A	N/A	N/A	N/A	N/A	N/A	default&lt;br /&gt;
  mds01, mds02	UP	16.8 GiB	8	Intel(R) Xeon(R) CPU E5-2609 0+	2400 MHz		5	1	mds&lt;br /&gt;
  storage01	UP	67.6 GiB	32	Intel(R) Xeon(R) CPU E5-2660 0+	2200 MHz		5	1	oss&lt;br /&gt;
  storage02..storage06	UP	67.6 GiB	32	Intel(R) Xeon(R) CPU E5-2660 0+	2199 MHz		5	1	oss&lt;br /&gt;
  nfs01	UP	67.6 GiB	8	Intel(R) Xeon(R) CPU E5-2609 0+	2400 MHz		7	1	login&lt;br /&gt;
  fat001, fat002	UP	1.0 TiB	64	AMD Opteron(tm) Processor 6376	2299 MHz		5	1	fat &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Main cluster node configuration:&lt;br /&gt;
* Master nodes: 2 PowerEdge R720 master nodes in a failover configuration&lt;br /&gt;
* The NFS server is a PowerEdge R720XD, which will share some applications and databases with machines in the cluster, for which the parallel file system is not the ideal solution. The NFS node will also act as a login node, where users log in and compile applications and submit jobs.&lt;br /&gt;
* 50 compute nodes&lt;br /&gt;
** 12x Dell PowerEdge C6000 enclosures, each containing four nodes&lt;br /&gt;
** 48x Dell PowerEdge C6220; 16 Intel Xeon cores, 64GB RAM each&lt;br /&gt;
** 2x Dell R815; 64 AMD Opteron cores, 1TB RAM each&lt;br /&gt;
Hyperthreading is disabled in compute nodes.&lt;br /&gt;
&lt;br /&gt;
=== Filesystems ===&lt;br /&gt;
&lt;br /&gt;
[[File:Storage_pic.png|thumb|right|300px|Schematic overview of storage components of the B4F cluster.]]&lt;br /&gt;
The B4F Cluster has two primary file systems, each with different properties and purposes.&lt;br /&gt;
==== Parallel File System: Lustre ====&lt;br /&gt;
At the base of the cluster is an ultrafast file system, a so called [http://en.wikipedia.org/wiki/Parallel_file_system Parallel File System] (PFS). The current size of the PFS is around 600TB. The PFS implemented in the B4F Cluster is called [http://en.wikipedia.org/wiki/Lustre_(file_system) Lustre]. Lustre has become very popular in recent years due to the fact that it is very feature rich, deemed very stable, and is Open Source. Lustre nowadays is the default option for PFS in Dell clusters as well as clusters sold by other vendors. The PFS is mounted on all head nodes and worker nodes of the cluster, providing a seamless integration between compute and data infrastructure. The strength of a PFS is speed - the total I/O should be up to 15GB/s. by design. With a very large number of compute nodes - and with very high volumes of data - these high read-write speeds that the PSF can provide are necessary. The Lustre filesystem is divided in [[Lustre_PFS_layout | several partitions]], each differing in persistence and backup features. The Lustre PSF is meant to store (shared) data that is likely to be used for analysis in the near future. Personal analysis scripts, software, or additional small data files can be stored in the $HOME directory of each of the users.&lt;br /&gt;
&lt;br /&gt;
The hardware components of the PFS:&lt;br /&gt;
* 2x Dell PowerEdge R720&lt;br /&gt;
* 1x Dell PowerVault MD3220&lt;br /&gt;
* 6x Dell PowerEdge R620&lt;br /&gt;
* 6x Dell PowerVault MD3260&lt;br /&gt;
&lt;br /&gt;
==== Network File System (NFS): $HOME dirs ====&lt;br /&gt;
Each user will have his/her own home directory. The path of the home directory will be: &lt;br /&gt;
&lt;br /&gt;
  /home/[name partner]/[username]&lt;br /&gt;
 &lt;br /&gt;
/home lives on a so called [http://en.wikipedia.org/wiki/Network_File_System Network File System], or NFS. The NFS is separate from the PFS and is far more limited in I/O (read/write speeds, latency, etc) than the PFS. This means that it is not meant to store large datavolumes that require high data transfer or small latency. Compared to the Lustre PFS (600TB in size), the size of the NFS is small in comparison - only 20TB. The /home partition will be backed up daily. The amount of space that can be allocated is limited per user. Personal quota and total use per user can be found using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
quota&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The NFS is supported through the NFS server that also serves as access point to the cluster.&lt;br /&gt;
&lt;br /&gt;
Hardware components of the NFS:&lt;br /&gt;
* 1x Dell PowerEdge R720XD&lt;br /&gt;
* 1x Dell PowerVault MD3220&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
The various components - head-nodes, worker nodes, and most importantly, the Lustre PFS - are all interconnected by an ultra-high speed network connection called [http://en.wikipedia.org/wiki/Infiniband InfiniBand]. A total of 7 InifiniBand switches are configured in a [http://en.wikipedia.org/wiki/Fat_tree fat tree] configuration.&lt;br /&gt;
&lt;br /&gt;
== Housing at Theia ==&lt;br /&gt;
[[File:Map_Theia.png|thumb|left|200px|Location of Theia, just outside of Wageningen campus]]&lt;br /&gt;
The B4F Cluster is housed at the main server centre of WUR-FB-ICT, near Wageningen Campus. The building (Theia)  may not look like much from the outside (used to function as potato storage) but inside is a modern server centre that includes, a.o., emergency power backup systems and automated fire extinguishers. Many of the server facilities provided by FB-ICT that are used on a daily basis by WUR personnel and students are located there, as is the B4F Cluster. Access to Theia is evidently highly restricted and can only be granted in the presence of a representative of FB-ICT.&lt;br /&gt;
{{-}}&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;10%&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; |&lt;br /&gt;
[[File:Cluster2_pic.png|thumb|left|220px|Some components of the cluster after unpacking.]]&lt;br /&gt;
| width=&amp;quot;70%&amp;quot; |&lt;br /&gt;
[[File:Cluster_pic.png|thumb|right|400px|The final configuration after installation.]]&lt;br /&gt;
|}&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
=== Project Leader ===&lt;br /&gt;
* Stephen Janssen (Wageningen UR, FB-IT, Service Management)&lt;br /&gt;
&lt;br /&gt;
=== Daily Project Management ===&lt;br /&gt;
* [[User:pollm001 | Koen Pollmann (Wageningen UR, FB-IT, Infrastructure)]]&lt;br /&gt;
* Gwen Dawes (Wageningen UR, FB-IT, Infrastructure)&lt;br /&gt;
[[Maintenance_and_Management | Maintenance and Management]]&lt;br /&gt;
&lt;br /&gt;
=== Steering Group ===&lt;br /&gt;
Ensures that the HPC generates enough revenues and meets the needs of the users. This includes setting fees, developing contracts, attracting new users, decisions on investments in the HPC and communication. &lt;br /&gt;
* Frido Hamoen (CRV, on behalf of Breed4Food industrial partners, replaced Alfred de Vries in August)&lt;br /&gt;
* Petra Caessens (CAT-AgroFood)&lt;br /&gt;
* Wojtek Sablik (Wageningen UR, FB-IT, Infrastructure)&lt;br /&gt;
* Edda Neuteboom (CAT_AgroFood, secretariat)&lt;br /&gt;
* Martien Groenen (Wageningen UR, chair, replaced Johan van Arendonk).&lt;br /&gt;
&lt;br /&gt;
=== IT Workgroup ===&lt;br /&gt;
[[File:Image_(1).jpeg|thumb|right|380px|(part of) the IT working group in front of the B4F Cluster]]&lt;br /&gt;
Is responsible for the technical performance of the HPC. The IT-workgroup has been involved in the design of the HPC and the selection of the supplier. They will support the technical management of the HPC and share experiences to ensure that the HPC meets the needs of its users. The IT-workgroup will advise the steering group on investments in software and hardware.&lt;br /&gt;
* Stephen Janssen (Wageningen UR, FB-IT, Service Management)&lt;br /&gt;
* [[User:pollm001 | Koen Pollmann (Wageningen UR, FB-IT, Infrastructure)]]&lt;br /&gt;
* Gwen Dawes (Wageningen UR, FB-IT, Infrastructure, replaced Andre ten Böhmer)&lt;br /&gt;
* Wes Barris (Cobb)&lt;br /&gt;
* Ton Dings (Hendrix Genetics)&lt;br /&gt;
* Henk van Dongen (Topigs)&lt;br /&gt;
* Harry Dijkstra (CRV)&lt;br /&gt;
* Mario Calus (ABGC-WLR)&lt;br /&gt;
* Hendrik-Jan Megens (ABGC-ABG)&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
=== User Group ===&lt;br /&gt;
The User Group ultimately is the most important of all groups, because it encompasses the users for which the infrastructure was built. In addition, successful use of the cluster will rely on an active community of users that is willing to share knowledge and best practices, including maintenance and expansion of this Wiki. Regular User Group meetings will be held in the future [frequency to be determined] to facilitate this process.&lt;br /&gt;
&lt;br /&gt;
== Access Policy ==&lt;br /&gt;
Access policy is still a work in progress. In principle, all staff and students of the five main partners will have access to the cluster. Access needs to be granted actively (by creation of an account on the cluster by FB-ICT). Use of resources is limited by the scheduler. Depending on availability of queues (&#039;partitions&#039;) granted to a user, priority to the system&#039;s resources is regulated. &lt;br /&gt;
&lt;br /&gt;
=== Contact Persons ===&lt;br /&gt;
A request to access the cluster needs to be directed to one of the following persons (please refer to appropriate partner):&lt;br /&gt;
&lt;br /&gt;
==== Cobb-Vantress ====&lt;br /&gt;
* Wes Barris&lt;br /&gt;
* Jun Chen&lt;br /&gt;
&lt;br /&gt;
==== ABGC ====&lt;br /&gt;
===== Animal Breeding and Genetics =====&lt;br /&gt;
* [[User:Hulze001 |Alex Hulzebosch]]&lt;br /&gt;
* [[User:Hjmegens | Hendrik-Jan Megens]]&lt;br /&gt;
&lt;br /&gt;
===== Wageningen Livestock Research =====&lt;br /&gt;
* Mario Calus&lt;br /&gt;
* Ina Hulsegge&lt;br /&gt;
==== CRV ====&lt;br /&gt;
* Frido Hamoen&lt;br /&gt;
* Chris Schrooten&lt;br /&gt;
==== Hendrix Genetics ==== &lt;br /&gt;
* Ton Dings&lt;br /&gt;
* Abe Huisman&lt;br /&gt;
* Addie Vereijken&lt;br /&gt;
==== Topigs ====&lt;br /&gt;
* Henk van Dongen&lt;br /&gt;
* Egiel Hanenbarg&lt;br /&gt;
* Naomi Duijvensteijn&lt;br /&gt;
&lt;br /&gt;
== Using the B4F Cluster ==&lt;br /&gt;
=== Gaining access to the B4F Cluster ===&lt;br /&gt;
Access to the cluster and file transfer are done by [http://en.wikipedia.org/wiki/Secure_Shell ssh-based protocols].&lt;br /&gt;
* [[log_in_to_B4F_cluster | Logging into cluster using ssh and file transfer]]&lt;br /&gt;
&lt;br /&gt;
=== Cluster Management Software and Scheduler ===&lt;br /&gt;
The B4F cluster uses Bright Cluster Manager software for overall cluster management, and Slurm as job scheduler.&lt;br /&gt;
* [[BCM_on_B4F_cluster | Monitor cluster status with BCM]]&lt;br /&gt;
* [[SLURM_on_B4F_cluster | Submit jobs with Slurm]]&lt;br /&gt;
&lt;br /&gt;
=== Installation of software by users ===&lt;br /&gt;
&lt;br /&gt;
* [[Domain_specific_software_on_B4Fcluster_installation_by_users | Installing domain specific software: installation by users]]&lt;br /&gt;
* [[Setting local variables]]&lt;br /&gt;
* [[Installing_R_packages_locally | Installing R packages locally]]&lt;br /&gt;
* [[Setting_up_Python_virtualenv | Setting up and using a virtual environment for Python3 ]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Maintenance_and_Management | Maintenance and Management]]&lt;br /&gt;
* [[About_ABGC | About ABGC]]&lt;br /&gt;
* [[Computer_cluster | High Performance Computing @ABGC]]&lt;br /&gt;
* [[Lustre_PFS_layout | Lustre Parallel File System layout]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;45%&amp;quot; |&lt;br /&gt;
* [http://www.breed4food.com/en/show/Breed4Food-initiative-reinforces-the-Netherlands-position-as-an-innovative-country-in-animal-breeding-and-genomics.htm Breed4Food programme]&lt;br /&gt;
* [http://www.wageningenur.nl/en/Expertise-Services/Facilities/CATAgroFood-3/CATAgroFood-3/News-and-agenda/Show/CATAgroFood-invests-in-a-High-Performance-Computing-cluster.htm CATAgroFood invests in HPC]&lt;br /&gt;
* [http://www.cobb-vantress.com Cobb-Vantress homepage]&lt;br /&gt;
| width=&amp;quot;45%&amp;quot; |&lt;br /&gt;
* [https://www.crv4all.nl CRV homepage]&lt;br /&gt;
* [http://www.hendrix-genetics.com Hendrix Genetics homepage]&lt;br /&gt;
* [http://www.topigs.com TOPIGS homepage]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Create_shortcut_log-in_command&amp;diff=1995</id>
		<title>Create shortcut log-in command</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Create_shortcut_log-in_command&amp;diff=1995"/>
		<updated>2019-03-19T14:00:32Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;It can be very tedious to have to type full command to log into a remote machine using the secure shell (ssh) when a remote machine is used often.&lt;br /&gt;
&lt;br /&gt;
== Add a custom command to the .bashrc ==&lt;br /&gt;
A simple solution is to add a custom command to the .basrc. Open the .bashrc (which is in the root of home directory) using any plain text editor. E.g.:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
vi $HOME/.bashrc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, using the &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; function, define a new function derived from the &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; command and your personal credentials:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
alias lx7=&amp;quot;ssh username@scomp1095.wurnet.nl&amp;quot;&lt;br /&gt;
alias hpc=&amp;quot;ssh username@login.anunna.wur.nl&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new function will be available from next login, therefore log out of the active terminal and log back in. From the freshly opened terminal, issuing the following command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
lx7&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
should give you direct access to &amp;lt;code&amp;gt;scomp1095&amp;lt;/code&amp;gt;, for instance. If you do this in combination with a [[ssh_without_password | passwordless setup]], you will not even be prompted for a password.&lt;br /&gt;
&lt;br /&gt;
== Using a ssh config file ==&lt;br /&gt;
Instead of using the alias function, it is possible to use a ssh config file. The ssh config file can be found at $HOME/.ssh/config .&lt;br /&gt;
If the ssh config file does not exist, you can create it with, e.g.,:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
touch $HOME/.ssh.config  &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If the ssh config file exists, you can add the different options you use to log in of the different servers/clusters. For example, for Anunna, you can add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
Host hpc&lt;br /&gt;
 Hostname login.anunna.wur.nl&lt;br /&gt;
 User username&lt;br /&gt;
 IdentityFile PATH_TO_PRIVATE_KEY (if applicable)&lt;br /&gt;
 ForwardX11 yes (if applicable)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the addition to the ssh congig file, you can log in as follows:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ssh hpc &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may add to the ssh config file several configurations for the same or several clusters. For example, for the two aliases in the section [[Add a custom command to the .bashrc | Add a custom command to the .bashrc ]], you can add the following lines to your ssh config file:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
Host scomp&lt;br /&gt;
 HostName scomp1095.wurnet.nl&lt;br /&gt;
 User username&lt;br /&gt;
Host hpc&lt;br /&gt;
 Hostname login.anunna.wur.nl&lt;br /&gt;
 User username&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information on the possible different options for the ssh config file, you may consult the [http://linux.die.net/man/5/ssh_config man page].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[ssh_without_password | ssh without password]]&lt;br /&gt;
* [[Lx6_and_Lx7_compute_nodes | Lx6 and Lx7 compute nodes]]&lt;br /&gt;
* [[log_in_to_Anunna | Logging into cluster using ssh and file transfer]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Create_shortcut_log-in_command&amp;diff=1994</id>
		<title>Create shortcut log-in command</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Create_shortcut_log-in_command&amp;diff=1994"/>
		<updated>2019-03-19T13:59:47Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;It can be very tedious to have to type full command to log into a remote machine using the secure shell (ssh) when a remote machine is used often.&lt;br /&gt;
&lt;br /&gt;
== Add a custom command to the .bashrc ==&lt;br /&gt;
A simple solution is to add a custom command to the .basrc. Open the .bashrc (which is in the root of home directory) using any plain text editor. E.g.:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
vi $HOME/.bashrc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, using the &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; function, define a new function derived from the &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; command and your personal credentials:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
alias lx7=&amp;quot;ssh username@scomp1095.wurnet.nl&amp;quot;&lt;br /&gt;
alias hpc=&amp;quot;ssh username@nfs01.hpcagrogenomics.wur.nl&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new function will be available from next login, therefore log out of the active terminal and log back in. From the freshly opened terminal, issuing the following command:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
lx7&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
should give you direct access to &amp;lt;code&amp;gt;scomp1095&amp;lt;/code&amp;gt;, for instance. If you do this in combination with a [[ssh_without_password | passwordless setup]], you will not even be prompted for a password.&lt;br /&gt;
&lt;br /&gt;
== Using a ssh config file ==&lt;br /&gt;
Instead of using the alias function, it is possible to use a ssh config file. The ssh config file can be found at $HOME/.ssh/config .&lt;br /&gt;
If the ssh config file does not exist, you can create it with, e.g.,:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
touch $HOME/.ssh.config  &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If the ssh config file exists, you can add the different options you use to log in of the different servers/clusters. For example, for Anunna, you can add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
Host hpc&lt;br /&gt;
 Hostname nfs01.hpcagrogenomics.wur.nl&lt;br /&gt;
 User username&lt;br /&gt;
 IdentityFile PATH_TO_PRIVATE_KEY (if applicable)&lt;br /&gt;
 ForwardX11 yes (if applicable)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the addition to the ssh congig file, you can log in as follows:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ssh hpc &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may add to the ssh config file several configurations for the same or several clusters. For example, for the two aliases in the section [[Add a custom command to the .bashrc | Add a custom command to the .bashrc ]], you can add the following lines to your ssh config file:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
Host scomp&lt;br /&gt;
 HostName scomp1095.wurnet.nl&lt;br /&gt;
 User username&lt;br /&gt;
Host hpc&lt;br /&gt;
 Hostname nfs01.hpcagrogenomics.wur.nl&lt;br /&gt;
 User username&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information on the possible different options for the ssh config file, you may consult the [http://linux.die.net/man/5/ssh_config man page].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[ssh_without_password | ssh without password]]&lt;br /&gt;
* [[Lx6_and_Lx7_compute_nodes | Lx6 and Lx7 compute nodes]]&lt;br /&gt;
* [[log_in_to_Anunna | Logging into cluster using ssh and file transfer]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Setting_up_Python_virtualenv&amp;diff=1993</id>
		<title>Setting up Python virtualenv</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Setting_up_Python_virtualenv&amp;diff=1993"/>
		<updated>2019-03-19T13:58:57Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;With many Python packages available, which are often in conflict or requiring different versions depending on application, installing and controlling packages and versions is not always easy. In addition, so many packages are often used only occasionally, that it is questionable whether a system administrator of a centralized server system or a High Performance Compute (HPC) infrastructure can be expected to resolve all issues posed by users of the infrastructure. Even on a local system with full administrative rights managing versions, dependencies, and package collisions is often very difficult. The solution is to use a virtual environment, in which a specific set of packages can then be installed. As many different virtual environments can be created, and used side-by-side, as is necessary. &lt;br /&gt;
&lt;br /&gt;
NOTE: as of Python 3.3 virtual environment support is built-in. See this page for an [[virtual_environment_Python_3.4_or_higher | alternative set-up of your virtual environment if using Python 3.4 or higher]].&lt;br /&gt;
&lt;br /&gt;
== Creating a new virtual environment ==&lt;br /&gt;
It is assumed that the appropriate &amp;lt;code&amp;gt;virtualenv&amp;lt;/code&amp;gt; executable for the Python version of choice is installed. A new virtual environment, in this case called &amp;lt;code&amp;gt;newenv&amp;lt;/code&amp;gt; is created like so:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
module load python/my-favourite-version (e.g. 2.7.12)&lt;br /&gt;
virtualenv newenv&lt;br /&gt;
OR&lt;br /&gt;
pyvenv newenv (For versions &amp;gt;3.4)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new environment is created, one will see a message similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;  New python executable in newenv/bin/python3&lt;br /&gt;
  Also creating executable in newenv/bin/python&lt;br /&gt;
  Installing Setuptools.........................................................................done.&lt;br /&gt;
  Installing Pip................................................................................done.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Activating a virtual environment ==&lt;br /&gt;
Once the environment is created, each time the environment needs to be activated, the following command needs to be issued:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
source newenv/bin/activate&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This assumes that the folder that contains the virtual environment documents (in this case called &amp;lt;code&amp;gt;newenv&amp;lt;/code&amp;gt;), is in the present working directory.&lt;br /&gt;
When working on the virtual environment, the virtual environment name will be between brackets in front of the &amp;lt;code&amp;gt;user-host-prompt&amp;lt;/code&amp;gt; string.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;  (newenv)user@host:~$&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing modules on the virtual environment ==&lt;br /&gt;
Installing modules is the same as usual. The difference is that modules are in &amp;lt;code&amp;gt;/path/to/virtenv/lib&amp;lt;/code&amp;gt;, which may be living somewhere on your home directory. When working from the virtual environment, the default &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; will belong to the python version that is currently active. This means that the executable in &amp;lt;code&amp;gt;/path/to/virtenv/bin&amp;lt;/code&amp;gt; are in fact the first in the &amp;lt;code&amp;gt;$PATH&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
pip install numpy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Similarly, installing packages from source works exactly the same as usual.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
python setup.py install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== deactivating a virtual environment ==&lt;br /&gt;
Quitting a virtual environment can be done by using the command &amp;lt;code&amp;gt;deactivate&amp;lt;/code&amp;gt;, which was loaded using the &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; command upon activating the virtual environment.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
deactivate&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Virtualenv kernels in Jupyter ==&lt;br /&gt;
Want your own virtualenv kernel in a notebook? This can be done by making your own kernel specifications:&lt;br /&gt;
&lt;br /&gt;
* Make sure you have the ipykernel module in your venv. Activate it and pip install it:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;source ~/path/to/my/virtualenv/bin/activate &amp;amp;&amp;amp; pip install ipykernel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Create the following directory path in your homedir if it doesn&#039;t already exist:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.local/share/jupyter/kernels/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Think of a nice descriptive name that doesn&#039;t clash with one of the already present kernels. I&#039;ll use &#039;testing&#039;. Create this folder:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir ~/.local/share/jupyter/kernels/testing/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Add this file to this folder:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;vi ~/.local/share/jupyter/kernels/testing/kernel.json &lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;language&amp;quot;: &amp;quot;python&amp;quot;,&lt;br /&gt;
 &amp;quot;argv&amp;quot;: [&lt;br /&gt;
  &amp;quot;~/path/to/my/virtualenv/bin/python&amp;quot;,&lt;br /&gt;
  &amp;quot;-m&amp;quot;,&lt;br /&gt;
  &amp;quot;ipykernel&amp;quot;,&lt;br /&gt;
  &amp;quot;-f&amp;quot;,&lt;br /&gt;
  &amp;quot;{connection_file}&amp;quot;&lt;br /&gt;
 ],&lt;br /&gt;
 &amp;quot;display_name&amp;quot;: &amp;quot;testing&amp;quot;&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Reload Jupyterhub page. testing should now exist in your kernels list.&lt;br /&gt;
&lt;br /&gt;
You can do more complex things with this, such as construct your own Spark environment. This relies on having the module findspark installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; vi ~/.local/share/jupyter/kernels/mysparkkernel/kernel.json &lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;language&amp;quot;: &amp;quot;python&amp;quot;,&lt;br /&gt;
 &amp;quot;env&amp;quot;: {&lt;br /&gt;
   &amp;quot;SPARK_HOME&amp;quot;:&lt;br /&gt;
     &amp;quot;/cm/shared/apps/spark/my-spark-version&amp;quot;&lt;br /&gt;
 },&lt;br /&gt;
 &amp;quot;argv&amp;quot;: [&lt;br /&gt;
  &amp;quot;~/my/spark/venv/bin/python&amp;quot;,&lt;br /&gt;
  &amp;quot;-m&amp;quot;,&lt;br /&gt;
  &amp;quot;ipykernel&amp;quot;,&lt;br /&gt;
  &amp;quot;-c&amp;quot;, &amp;quot;import findspark; findspark.init()&amp;quot;,&lt;br /&gt;
  &amp;quot;-f&amp;quot;,&lt;br /&gt;
  &amp;quot;{connection_file}&amp;quot;&lt;br /&gt;
 ],&lt;br /&gt;
 &amp;quot;display_name&amp;quot;: &amp;quot;My Spark kernel&amp;quot;&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
(You&#039;ll want to make sure your spark cluster has the same environment - start it after activating this venv inside your sbatch script)&lt;br /&gt;
&lt;br /&gt;
== Make IPython work under virtualenv ==&lt;br /&gt;
IPython may not work initially under a virtual environment. It may produce an error message like below:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;    File &amp;quot;/usr/bin/ipython&amp;quot;, line 11&lt;br /&gt;
    print &amp;quot;Could not start qtconsole. Please install ipython-qtconsole&amp;quot;&lt;br /&gt;
                                                                      ^&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be resolved by adding a soft link with the name &amp;lt;code&amp;gt;ipython&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the virtual environment folder.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ln -s /path/to/virtenv/bin/ipython3 /path/to/virtenv/bin/ipython&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [https://pypi.python.org/pypi/virtualenv Python3 documentation for virtualenv]&lt;br /&gt;
* [http://cemcfarland.wordpress.com/2013/03/09/getting-ipython3-working-inside-your-virtualenv/ Solving the IPython hickup under virtual environment]&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Ssh_without_password&amp;diff=1992</id>
		<title>Ssh without password</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Ssh_without_password&amp;diff=1992"/>
		<updated>2019-03-19T13:58:23Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Secure shell (ssh) protocols can be configure to work without protocols. This is particularly helpful for machines that are used often. &lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password from a POSIX-compliant terminal ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: create a public key and copy to remote computer ===&lt;br /&gt;
* Log into a local Linux or MacOSX computer&lt;br /&gt;
* Type the following to generate the ssh key:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Accept the default key location by pressing &amp;lt;code&amp;gt;Enter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Secure permission of your authentication keys by closing permission to your home directory, .ssh directory, and authentication files&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
chmod go-w $HOME&lt;br /&gt;
chmod 700 $HOME/.ssh&lt;br /&gt;
chmod go-rwx $HOME/.ssh/*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Type the following to copy the key to the remote server (this will prompt for a password).&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
cd ~/.ssh&lt;br /&gt;
scp id_dsa.pub remote_username@remote_host:/tmp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Type the following to add the ssh key to the remote user&#039;s authorization keys (this will prompt for a password).&lt;br /&gt;
ssh remote_username@remote_host &#039;cat /tmp/id_dsa.pub &amp;gt;&amp;gt;/home/&lt;br /&gt;
&lt;br /&gt;
=== Step 2: configure the public key from the local computer on the remote computer ===&lt;br /&gt;
* log in to the remote computer using ssh (this will prompt for a password)&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ssh remote_username@remote_host&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* copy the public key generated on the local computer, that was copied to &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt; on the remote computer, is now appended to &amp;lt;code&amp;gt;.ssh/authorized_keys2&amp;lt;/code&amp;gt;. Note that a file called &amp;lt;code&amp;gt;.ssh/authorized_keys&amp;lt;/code&amp;gt; may already be present. &lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
cat /tmp/id_dsa.pub &amp;gt;&amp;gt;$HOME/.ssh/authorized_keys2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* similar to your local computer, make sure the permission on your remote home folder, .ssh folder, and authentication files are properly set (NOTE: this may already be the case).&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
chmod go-w $HOME&lt;br /&gt;
chmod 700 $HOME/.ssh&lt;br /&gt;
chmod go-rwx $HOME/.ssh/*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Lastly, remove the public key from the temporary folder.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
rm /tmp/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* If you log out of the remote computer and back in again, from the local computer from which you copied the public key, you will notice you will no longer be prompted for a password.&lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password for Anunna ==&lt;br /&gt;
&lt;br /&gt;
* Create a public key as in Step 1 of the previous section and copy it to Anunna. Note that a public/private key pair needs to be made only once per machine.&lt;br /&gt;
* Similar to step 2 of the previous section, add the public key to the &amp;lt;code&amp;gt;$HOME/.ssh/authorized_keys2&amp;lt;/code&amp;gt; file. There is already a &amp;lt;code&amp;gt;$HOME/.ssh/authorized_keys&amp;lt;/code&amp;gt; present. You may append the key to this file as an alternative, but take care not to remove content that is already there. The cluster is configured so that passwordless communication will all other nodes is default.&lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password using PuTTY ==&lt;br /&gt;
Use pAGEaNT: http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter9.html to generate local keys. You&#039;ll want have a copy of the pubkey in plaintext available.&lt;br /&gt;
&lt;br /&gt;
Make sure to paste that plaintext string into ~/.ssh/authorized_keys in one single line. Chmod the file 600 (so it shows -rw------- in ls -l)&lt;br /&gt;
&lt;br /&gt;
Now PuTTY will login passwordlessly whenever pAGEaNT is running.&lt;br /&gt;
&lt;br /&gt;
Finally, get pAGEaNT to load on startup: http://blog.shvetsov.com/2010/03/making-pageant-automatically-load-keys.html&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[log_in_to_Anunna | Logging into cluster using ssh and file transfer]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Ssh_without_password&amp;diff=1991</id>
		<title>Ssh without password</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Ssh_without_password&amp;diff=1991"/>
		<updated>2019-03-19T13:57:46Z</updated>

		<summary type="html">&lt;p&gt;Dawes001: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Secure shell (ssh) protocols can be configure to work without protocols. This is particularly helpful for machines that are used often. &lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password from a POSIX-compliant terminal ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: create a public key and copy to remote computer ===&lt;br /&gt;
* Log into a local Linux or MacOSX computer&lt;br /&gt;
* Type the following to generate the ssh key:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Accept the default key location by pressing &amp;lt;code&amp;gt;Enter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Secure permission of your authentication keys by closing permission to your home directory, .ssh directory, and authentication files&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
chmod go-w $HOME&lt;br /&gt;
chmod 700 $HOME/.ssh&lt;br /&gt;
chmod go-rwx $HOME/.ssh/*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Type the following to copy the key to the remote server (this will prompt for a password).&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
cd ~/.ssh&lt;br /&gt;
scp id_dsa.pub remote_username@remote_host:/tmp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Type the following to add the ssh key to the remote user&#039;s authorization keys (this will prompt for a password).&lt;br /&gt;
ssh remote_username@remote_host &#039;cat /tmp/id_dsa.pub &amp;gt;&amp;gt;/home/&lt;br /&gt;
&lt;br /&gt;
=== Step 2: configure the public key from the local computer on the remote computer ===&lt;br /&gt;
* log in to the remote computer using ssh (this will prompt for a password)&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
ssh remote_username@remote_host&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* copy the public key generated on the local computer, that was copied to &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt; on the remote computer, is now appended to &amp;lt;code&amp;gt;.ssh/authorized_keys2&amp;lt;/code&amp;gt;. Note that a file called &amp;lt;code&amp;gt;.ssh/authorized_keys&amp;lt;/code&amp;gt; may already be present. &lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
cat /tmp/id_dsa.pub &amp;gt;&amp;gt;$HOME/.ssh/authorized_keys2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* similar to your local computer, make sure the permission on your remote home folder, .ssh folder, and authentication files are properly set (NOTE: this may already be the case).&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
chmod go-w $HOME&lt;br /&gt;
chmod 700 $HOME/.ssh&lt;br /&gt;
chmod go-rwx $HOME/.ssh/*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Lastly, remove the public key from the temporary folder.&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
rm /tmp/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* If you log out of the remote computer and back in again, from the local computer from which you copied the public key, you will notice you will no longer be prompted for a password.&lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password for Anunna ==&lt;br /&gt;
&lt;br /&gt;
* Create a public key as in Step 1 of the previous section and copy it to the B4F Cluster. Note that a public/private key pair needs to be made only once per machine.&lt;br /&gt;
* Similar to step 2 of the previous section, add the public key to the &amp;lt;code&amp;gt;$HOME/.ssh/authorized_keys2&amp;lt;/code&amp;gt; file. There is already a &amp;lt;code&amp;gt;$HOME/.ssh/authorized_keys&amp;lt;/code&amp;gt; present. You may append the key to this file as an alternative, but take care not to remove content that is already there. The cluster is configured so that passwordless communication will all other nodes is default.&lt;br /&gt;
&lt;br /&gt;
== Configuring ssh without password using PuTTY ==&lt;br /&gt;
Use pAGEaNT: http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter9.html to generate local keys. You&#039;ll want have a copy of the pubkey in plaintext available.&lt;br /&gt;
&lt;br /&gt;
Make sure to paste that plaintext string into ~/.ssh/authorized_keys in one single line. Chmod the file 600 (so it shows -rw------- in ls -l)&lt;br /&gt;
&lt;br /&gt;
Now PuTTY will login passwordlessly whenever pAGEaNT is running.&lt;br /&gt;
&lt;br /&gt;
Finally, get pAGEaNT to load on startup: http://blog.shvetsov.com/2010/03/making-pageant-automatically-load-keys.html&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[log_in_to_Anunna | Logging into cluster using ssh and file transfer]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;/div&gt;</summary>
		<author><name>Dawes001</name></author>
	</entry>
</feed>