{"id":9088,"date":"2025-03-12T13:52:00","date_gmt":"2025-03-12T13:52:00","guid":{"rendered":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/?page_id=9088"},"modified":"2026-03-30T11:03:07","modified_gmt":"2026-03-30T10:03:07","slug":"serial-jobs-slurm","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/batch-slurm\/serial-jobs-slurm\/","title":{"rendered":"Serial Jobs (Slurm)"},"content":{"rendered":"<h2>Serial batch job submission (Slurm)<\/h2>\n<p>For jobs that require one CPU core. A jobscript template is shown below. Please also consult the <a href=\"\/csf3\/batch-slurm\/partitions\">Partitions<\/a> page for details on available compute resources.<\/p>\n<p><em><strong>Please also consult the <a href=\"\/csf3\/software\/applications\">software page<\/a> for the code \/ application you are running for advice on running that application<\/strong><\/em>.<\/p>\n<p>A serial job script will run in the directory (folder) from which you submit the job. The jobscript takes the form:<\/p>\n<pre>\r\n#!\/bin\/bash --login\r\n#SBATCH -p serial  # Partition is <strong>required<\/strong>. Runs on <strong>Intel<\/strong> hardware.\r\n                   # Or submit batch jobs to the \"interactive\" partition for AMD Genoa serial jobs.\r\n#SBATCH -t 4-0     # Wallclock limit (days-hours). <strong>Required!<\/strong>\r\n                   # Max permitted is 7 days (7-0).\r\n\r\n# Load any required modulefiles. A purge is used to start with a clean environment.\r\nmodule purge\r\nmodule load <em>apps\/some\/example\/1.2.3<\/em>\r\n\r\n# Now the commands to be run by the job.\r\n<em>serialapp<\/em>.exe\r\n\r\n# If an app needs to be told explicitly to use one core, use $SLURM_NTASKS. For example:\r\n<em>serialapp<\/em> --cores $SLURM_NTASKS\r\n             #\r\n             # Check <em>your<\/em> app's documentation for its required flags!\r\n<\/pre>\n<p>In the above jobscript, we do not explicitly specify the number of cores. In this case, the default is assumed:<\/p>\n<pre>\r\n#SBATCH -n 1        # Causes the $SLURM_NTASKS env var to be set (to 1)\r\n<\/pre>\n<p>If you require the <code>$SLURM_CPUS_PER_TASKS<\/code> env var in your jobscript (set to 1), then you should specify instead of <code>-n<\/code>:<\/p>\n<pre>\r\n#SBATCH -c 1        # Causes the $SLURM_CPUS_PER_TASKS env var to be set (to 1)\r\n<\/pre>\n<h3>Command-line one-liner<\/h3>\n<p>The above serial job can also be achieved all on the command-line on the login node (a quick way of running a serial job in batch).<\/p>\n<p>Note that you will need to load any modulefiles <em>before<\/em> submitting the job. The batch system will take a copy of any settings made by the modulefile so that they are <em>visible<\/em> to the job when it eventually runs. You could logout of the CSF before the job runs and it will still have a copy of the modulefile settings allowing the job to run correctly.<\/p>\n<pre>\r\nmodule purge\r\nmodule load <em>apps\/some\/example\/1.2.3<\/em>\r\nsbatch -p serial -t 4-0 --wrap=\"theapp.exe <em>optional-args<\/em>\"\r\n                  #\r\n                  # The wallclock time limit is now <strong>required<\/strong>.\r\n                  # This example specifies 4 days (0 hours).\r\n<\/pre>\n<p>where <code><em>optional-args<\/em><\/code> are any command line flags that you want to pass to the <code>theapp.exe<\/code> program (or your own program). The <code>--wrap<\/code> flag indicates the filename submitted (<code>theapp.exe<\/code>) is a binary (executable) program, not a jobscript.<\/p>\n<h2>Available Hardware and Resources<\/h2>\n<p>Please see the <a href=\"\/csf3\/batch-slurm\/partitions\">Partitions<\/a> page for details on available compute resources.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Serial batch job submission (Slurm) For jobs that require one CPU core. A jobscript template is shown below. Please also consult the Partitions page for details on available compute resources. Please also consult the software page for the code \/ application you are running for advice on running that application. A serial job script will run in the directory (folder) from which you submit the job. The jobscript takes the form: #!\/bin\/bash &#8211;login #SBATCH -p.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/batch-slurm\/serial-jobs-slurm\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":9105,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-9088","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/9088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/comments?post=9088"}],"version-history":[{"count":14,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/9088\/revisions"}],"predecessor-version":[{"id":12214,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/9088\/revisions\/12214"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/9105"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/media?parent=9088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}