<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://hpc.mediawiki.hull.ac.uk/index.php?action=history&amp;feed=atom&amp;title=Quickstart%2Fsbatch</id>
	<title>Quickstart/sbatch - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://hpc.mediawiki.hull.ac.uk/index.php?action=history&amp;feed=atom&amp;title=Quickstart%2Fsbatch"/>
	<link rel="alternate" type="text/html" href="https://hpc.mediawiki.hull.ac.uk/index.php?title=Quickstart/sbatch&amp;action=history"/>
	<updated>2026-04-04T18:05:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://hpc.mediawiki.hull.ac.uk/index.php?title=Quickstart/sbatch&amp;diff=40637&amp;oldid=prev</id>
		<title>Pysdlb at 14:24, 9 November 2022</title>
		<link rel="alternate" type="text/html" href="https://hpc.mediawiki.hull.ac.uk/index.php?title=Quickstart/sbatch&amp;diff=40637&amp;oldid=prev"/>
		<updated>2022-11-09T14:24:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 14:24, 9 November 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__TOC__&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__TOC__&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Introduction ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Introduction ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Having been introduced to the Slurm scheduler in [[Quickstart/Slurm]] and then one of the ways of using Viper with Interactive sessions in [[Quickstart/Interactive]] the next way of making use of &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;a &lt;/del&gt;HPC system like Viper is by submitting jobs to run automatically without interaction when resource becomes available. We call these '''batch jobs'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Having been introduced to the Slurm scheduler in [[Quickstart/Slurm]] and then one of the ways of using Viper with Interactive sessions in [[Quickstart/Interactive]] the next way of making use of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;an &lt;/ins&gt;HPC system like Viper is by submitting jobs to run automatically without interaction when &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the &lt;/ins&gt;resource becomes available. We call these '''batch jobs'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In order to run a batch job, we need to provide Slurm with information about what we want to do. We do this via a job submission script, which is sort of like a recipe for the job. The submission script is a text file that provides information to Slurm about the task you are running so that it can be allocated to the appropriate resource, sets up the environment so the task can run. A minimal submission script has three main components:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In order to run a batch job, we need to provide Slurm with information about what we want to do. We do this via a job submission script, which is sort of like a recipe for the job. The submission script is a text file that provides information to Slurm about the task you are running so that it can be allocated to the appropriate resource, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;and &lt;/ins&gt;sets up the environment so the task can run. A minimal submission script has three main components:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A set of directives that provides Slurm some high level information such as what resource is required, a job name, how long the task should run for and where to log any output that would normally be shown on the screen.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A set of directives that provides Slurm &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;with &lt;/ins&gt;some high&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;-&lt;/ins&gt;level information such as what resource is required, a job name, how long the task should run for and where to log any output that would normally be shown on the screen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Information about how the job environment should be set up, for example, what application [[Quickstart/Modules]] should be loaded.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Information about how the job environment should be set up, for example, what application [[Quickstart/Modules]] should be loaded.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The actual command(s) that need to be run.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The actual command(s) that need to be run.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Pysdlb</name></author>
		
	</entry>
	<entry>
		<id>https://hpc.mediawiki.hull.ac.uk/index.php?title=Quickstart/sbatch&amp;diff=40635&amp;oldid=prev</id>
		<title>Chris.collins: Created page with &quot;__TOC__ == Introduction == Having been introduced to the Slurm scheduler in Quickstart/Slurm and then one of the ways of using Viper with Interactive sessions in Quickst...&quot;</title>
		<link rel="alternate" type="text/html" href="https://hpc.mediawiki.hull.ac.uk/index.php?title=Quickstart/sbatch&amp;diff=40635&amp;oldid=prev"/>
		<updated>2022-11-09T14:22:39Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__TOC__ == Introduction == Having been introduced to the Slurm scheduler in &lt;a href=&quot;/Quickstart/Slurm&quot; title=&quot;Quickstart/Slurm&quot;&gt;Quickstart/Slurm&lt;/a&gt; and then one of the ways of using Viper with Interactive sessions in Quickst...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Having been introduced to the Slurm scheduler in [[Quickstart/Slurm]] and then one of the ways of using Viper with Interactive sessions in [[Quickstart/Interactive]] the next way of making use of a HPC system like Viper is by submitting jobs to run automatically without interaction when resource becomes available. We call these '''batch jobs'''.&lt;br /&gt;
&lt;br /&gt;
In order to run a batch job, we need to provide Slurm with information about what we want to do. We do this via a job submission script, which is sort of like a recipe for the job. The submission script is a text file that provides information to Slurm about the task you are running so that it can be allocated to the appropriate resource, sets up the environment so the task can run. A minimal submission script has three main components:&lt;br /&gt;
&lt;br /&gt;
* A set of directives that provides Slurm some high level information such as what resource is required, a job name, how long the task should run for and where to log any output that would normally be shown on the screen.&lt;br /&gt;
* Information about how the job environment should be set up, for example, what application [[Quickstart/Modules]] should be loaded.&lt;br /&gt;
* The actual command(s) that need to be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:#800000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;!/bin/bash&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH -J&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH -n 1&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH -o slurm-%j.log&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH -e slurm-%j.err&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH -p compute&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;SBATCH --time=0-01:00:00&lt;br /&gt;
 &amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:#008000&amp;quot;&amp;gt;module purge&lt;br /&gt;
 module add MODULENAME&lt;br /&gt;
 &amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:#000080&amp;quot;&amp;gt;command&lt;br /&gt;
 &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Simple Example Job Submissions Scripts ===&lt;br /&gt;
==== Matlab ====&lt;br /&gt;
&amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; &amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH -J myjob&lt;br /&gt;
#SBATCH -n 1&lt;br /&gt;
#SBATCH -o slurm-%j.out&lt;br /&gt;
#SBATCH -e slurm-%j.out&lt;br /&gt;
#SBATCH -p compute&lt;br /&gt;
#SBATCH --time=0-01:00:00&lt;br /&gt;
 &lt;br /&gt;
module purge&lt;br /&gt;
module add MODULENAME&lt;br /&gt;
 &lt;br /&gt;
COMMAND SCRIPT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== R ====&lt;br /&gt;
&amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; &amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH -J myjob&lt;br /&gt;
#SBATCH -n 1&lt;br /&gt;
#SBATCH -o slurm-%j.out&lt;br /&gt;
#SBATCH -e slurm-%j.out&lt;br /&gt;
#SBATCH -p compute&lt;br /&gt;
#SBATCH --time=0-01:00:00&lt;br /&gt;
 &lt;br /&gt;
module purge&lt;br /&gt;
module add MODULENAME&lt;br /&gt;
 &lt;br /&gt;
COMMAND SCRIPT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris.collins</name></author>
		
	</entry>
</feed>