{"id":7599,"date":"2024-04-24T14:56:58","date_gmt":"2024-04-24T13:56:58","guid":{"rendered":"https:\/\/research.reading.ac.uk\/act\/?post_type=kbe_knowledgebase&#038;p=7599"},"modified":"2024-05-02T14:21:51","modified_gmt":"2024-05-02T13:21:51","slug":"racc2-slurm-commands","status":"publish","type":"kbe_knowledgebase","link":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/","title":{"rendered":"RACC2 &#8211; Slurm commands"},"content":{"rendered":"<h2>Essential SLURM commands<\/h2>\n<p>This is a compact reference sheet for the most essential SLURM commands and their usage. Not all possible commands are listed here. For more information about command options\/flags and additional commands, please refer to <a href=\"https:\/\/slurm.schedmd.com\/man_index.html\">SLURM&#8217;s own manual pages<\/a> or their <a href=\"https:\/\/slurm.schedmd.com\/pdfs\/summary.pdf\">summary sheet<\/a>, however please note that some commands in those pages are available for system administrators only.<\/p>\n<table style=\"border-collapse: collapse; width: 100%; height: 246px;\">\n<tbody>\n<tr style=\"height: 41px;\">\n<td style=\"width: 18.2573%; height: 41px;\">\n<h3>Command<\/h3>\n<\/td>\n<td style=\"width: 48.5477%; height: 41px;\">\n<h3>Description<\/h3>\n<\/td>\n<td style=\"width: 33.1949%; height: 41px;\">\n<h3>Usage<\/h3>\n<\/td>\n<\/tr>\n<tr style=\"height: 41px;\">\n<td style=\"width: 18.2573%; height: 41px;\">sbatch<\/td>\n<td style=\"width: 48.5477%; height: 41px;\">Submits a batch job to the queue.<\/td>\n<td style=\"width: 33.1949%; height: 41px;\">\n<pre>sbatch jobscript.sh<\/pre>\n<\/td>\n<\/tr>\n<tr style=\"height: 41px;\">\n<td style=\"width: 18.2573%; height: 41px;\">squeue<\/td>\n<td style=\"width: 48.5477%; height: 41px;\">Displays the state of a submitted job.<\/p>\n<p>Use with -u for job information for a specific username.<\/td>\n<td style=\"width: 33.1949%; height: 41px;\">\n<pre>squeue -u username<\/pre>\n<\/td>\n<\/tr>\n<tr style=\"height: 41px;\">\n<td style=\"width: 18.2573%; height: 41px;\">scancel<\/td>\n<td style=\"width: 48.5477%; height: 41px;\">Kills an existing job.<\/p>\n<p>Infer the jobID with squeue.<\/td>\n<td style=\"width: 33.1949%; height: 41px;\">\n<pre>scancel jobID<\/pre>\n<\/td>\n<\/tr>\n<tr style=\"height: 41px;\">\n<td style=\"width: 18.2573%; height: 41px;\">sinfo<\/td>\n<td style=\"width: 48.5477%; height: 41px;\">Displays all available cluster resources.<\/td>\n<td style=\"width: 33.1949%; height: 41px;\">\n<pre>sinfo<\/pre>\n<\/td>\n<\/tr>\n<tr style=\"height: 41px;\">\n<td style=\"width: 18.2573%; height: 41px;\">sacct<\/td>\n<td style=\"width: 48.5477%; height: 41px;\">View job accounting data, use with -j for specific jobIDs.<\/td>\n<td style=\"width: 33.1949%; height: 41px;\">\n<pre>sacct -j jobID<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 18.2573%;\">salloc<\/td>\n<td style=\"width: 48.5477%;\">Allocates compute node resources for interactive use.<\/td>\n<td style=\"width: 33.1949%;\">\n<pre>salloc<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>Monitoring cluster resources with \u2018<\/strong><strong>sinfo<\/strong><strong>\u2019:<\/strong><\/p>\n<p>As \u2018short\u2019 is the default partition, it is convenient to display the resources for just this one, by adding \u2018-p short\u2019 to the \u2018sinfo\u2019 command. By default, the nodes which are in the same state are grouped together.<\/p>\n<pre class=\"toolbar-hide:true show-title:false nums:false nums-toggle:false lang:default highlight:0 decode:true\">$ sinfo -p short\r\n\r\nPARTITION AVAIL TIMELIMIT NODES STATE NODELIST\r\nshort* up 1-00:00:00 1 mix# racc2-comp-2\r\nshort* up 1-00:00:00 29 idle~ racc2-comp-[3-31]\r\nshort* up 1-00:00:00 2 mix racc2-comp-[0-1]<\/pre>\n<p>The above output shows that nodes 3-31 are idle, and \u2018~\u2019 means they are switched off to save power. Nodes 1 and 2 are in a &#8216;mix&#8217; state, meaning that some of the cores on the node are in use and some of them are free. Fully allocated nodes show the status &#8216;alloc&#8217;,\u00a0meaning they will not be available for new jobs until the jobs currently running on them are finished.<\/p>\n<p>Further details can be displayed using the \u2018-o\u2019 flag. See the manual page, \u2018<a href=\"https:\/\/slurm.schedmd.com\/sinfo.html\">man sinfo<\/a>\u2019, for more details on format specifiers. In this example, the number of CPU cores are displayed with the command:<\/p>\n<pre class=\"toolbar-hide:false show-title:false nums:false nums-toggle:false lang:default highlight:0 decode:true\">$ sinfo -p short -o \"%P %.6t %C\"\r\n\r\nPARTITION STATE CPUS(A\/I\/O\/T)\r\nshort* mix# 48\/80\/0\/128\r\nshort* idle~ 0\/3712\/0\/3712\r\nshort* mix 240\/16\/0\/256\r\n<\/pre>\n<p>A\/I\/O\/T stands for Allocated\/Idle\/Other\/Total. The idle and switched off nodes have 3712 cores available. There is a node that is partially allocated, and another that is partially allocated and is being started (mix#). In total, there are 3808 cores (80 + 3712 + 16) available for new jobs.<\/p>\n<p>Nodes can be listed individually by adding the \u2018-N\u2019 flag:<\/p>\n<pre class=\"top-set:false bottom-set:false toolbar-hide:false show-title:false marking:false ranges:false nums:false nums-toggle:false wrap-toggle:false plain:false plain-toggle:false copy:false popup:false expand-toggle:false decode-attributes:false trim-whitespace:false trim-code-tag:false mixed:false lang:sh highlight:0 decode:true show_mixed:false show_mixed:false show_mixed:false show_mixed:false\">$ sinfo -p short -N -o \"%N %.6t %C\"\r\nNODELIST  STATE CPUS(A\/I\/O\/T)\r\nracc2-comp-0 idle 0\/128\/0\/128\r\nracc2-comp-1 idle 0\/128\/0\/128\r\nracc2-comp-2 idle~ 0\/128\/0\/128\r\nracc2-comp-3 idle~ 0\/128\/0\/128\r\nracc2-comp-4 idle~ 0\/128\/0\/128\r\nracc2-comp-5 idle~ 0\/128\/0\/128\r\nracc2-comp-6 idle~ 0\/128\/0\/128\r\nracc2-comp-7 idle~ 0\/128\/0\/128\r\nracc2-comp-8 idle~ 0\/128\/0\/128\r\nracc2-comp-9 idle~ 0\/128\/0\/128\r\nracc2-comp-10 idle~ 0\/128\/0\/128\r\nracc2-comp-11 idle~ 0\/128\/0\/128\r\nracc2-comp-12 idle~ 0\/128\/0\/128\r\nracc2-comp-13 idle~ 0\/128\/0\/128\r\nracc2-comp-14 idle~ 0\/128\/0\/128\r\nracc2-comp-15 idle~ 0\/128\/0\/128\r\nracc2-comp-16 idle~ 0\/128\/0\/128\r\nracc2-comp-17 idle~ 0\/128\/0\/128\r\nracc2-comp-18 idle~ 0\/128\/0\/128\r\nracc2-comp-19 idle~ 0\/128\/0\/128\r\nracc2-comp-20 idle~ 0\/128\/0\/128\r\nracc2-comp-21 idle~ 0\/128\/0\/128\r\nracc2-comp-22 idle~ 0\/128\/0\/128\r\nracc2-comp-23 idle~ 0\/128\/0\/128\r\nracc2-comp-24 idle~ 0\/128\/0\/128\r\nracc2-comp-25 idle~ 0\/128\/0\/128\r\nracc2-comp-26 idle~ 0\/128\/0\/128\r\nracc2-comp-27 idle~ 0\/128\/0\/128\r\nracc2-comp-28 idle~ 0\/128\/0\/128\r\nracc2-comp-29 idle~ 0\/128\/0\/128\r\nracc2-comp-30 idle~ 0\/128\/0\/128\r\nracc2-comp-31 idle~ 0\/128\/0\/128\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Essential SLURM commands  This is a compact reference sheet for the most essential SLURM commands and their usage. Not all possible commands are listed here. For more information about command options\/flags and additional commands, please refer to SLURM&#8217;s own manual pages or their summary sheet, however please note that some commands in those pages<\/p>\n","protected":false},"author":421,"featured_media":223,"template":"","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"__cvm_playback_settings":[],"__cvm_video_id":"","_links_to":"","_links_to_target":""},"kbe_taxonomy":[100],"kbe_tags":[],"class_list":["post-7599","kbe_knowledgebase","type-kbe_knowledgebase","status-publish","has-post-thumbnail","hentry","kbe_taxonomy-racc2"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>RACC2 - Slurm commands - Academic Computing Team<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RACC2 - Slurm commands - Academic Computing Team\" \/>\n<meta property=\"og:description\" content=\"Essential SLURM commands This is a compact reference sheet for the most essential SLURM commands and their usage. Not all possible commands are listed here. For more information about command options\/flags and additional commands, please refer to SLURM&#039;s own manual pages or their summary sheet, however please note that some commands in those pages\" \/>\n<meta property=\"og:url\" content=\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"Academic Computing Team\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-02T13:21:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/research.reading.ac.uk\/act\/wp-content\/uploads\/sites\/2\/2017\/03\/cluster-1-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"128\" \/>\n\t<meta property=\"og:image:height\" content=\"128\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/\",\"url\":\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/\",\"name\":\"RACC2 - Slurm commands - Academic Computing Team\",\"isPartOf\":{\"@id\":\"https:\/\/research.reading.ac.uk\/act\/#website\"},\"datePublished\":\"2024-04-24T13:56:58+00:00\",\"dateModified\":\"2024-05-02T13:21:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/research.reading.ac.uk\/act\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Knowledgebase\",\"item\":\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"RACC2 &#8211; Slurm commands\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/research.reading.ac.uk\/act\/#website\",\"url\":\"https:\/\/research.reading.ac.uk\/act\/\",\"name\":\"Academic Computing Team\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/research.reading.ac.uk\/act\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/research.reading.ac.uk\/act\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/research.reading.ac.uk\/act\/#organization\",\"name\":\"University of Reading\",\"url\":\"https:\/\/research.reading.ac.uk\/act\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/research.reading.ac.uk\/act\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/research.reading.ac.uk\/act\/wp-content\/uploads\/sites\/2\/2017\/08\/cropped-University_of_Reading_shield-1.png\",\"contentUrl\":\"https:\/\/research.reading.ac.uk\/act\/wp-content\/uploads\/sites\/2\/2017\/08\/cropped-University_of_Reading_shield-1.png\",\"width\":512,\"height\":512,\"caption\":\"University of Reading\"},\"image\":{\"@id\":\"https:\/\/research.reading.ac.uk\/act\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"RACC2 - Slurm commands - Academic Computing Team","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/","og_locale":"en_GB","og_type":"article","og_title":"RACC2 - Slurm commands - Academic Computing Team","og_description":"Essential SLURM commands This is a compact reference sheet for the most essential SLURM commands and their usage. Not all possible commands are listed here. For more information about command options\/flags and additional commands, please refer to SLURM's own manual pages or their summary sheet, however please note that some commands in those pages","og_url":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/","og_site_name":"Academic Computing Team","article_modified_time":"2024-05-02T13:21:51+00:00","og_image":[{"width":128,"height":128,"url":"https:\/\/research.reading.ac.uk\/act\/wp-content\/uploads\/sites\/2\/2017\/03\/cluster-1-1.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/","url":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/","name":"RACC2 - Slurm commands - Academic Computing Team","isPartOf":{"@id":"https:\/\/research.reading.ac.uk\/act\/#website"},"datePublished":"2024-04-24T13:56:58+00:00","dateModified":"2024-05-02T13:21:51+00:00","breadcrumb":{"@id":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/racc2-slurm-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/research.reading.ac.uk\/act\/"},{"@type":"ListItem","position":2,"name":"Knowledgebase","item":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/"},{"@type":"ListItem","position":3,"name":"RACC2 &#8211; Slurm commands"}]},{"@type":"WebSite","@id":"https:\/\/research.reading.ac.uk\/act\/#website","url":"https:\/\/research.reading.ac.uk\/act\/","name":"Academic Computing Team","description":"","publisher":{"@id":"https:\/\/research.reading.ac.uk\/act\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/research.reading.ac.uk\/act\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/research.reading.ac.uk\/act\/#organization","name":"University of Reading","url":"https:\/\/research.reading.ac.uk\/act\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/research.reading.ac.uk\/act\/#\/schema\/logo\/image\/","url":"https:\/\/research.reading.ac.uk\/act\/wp-content\/uploads\/sites\/2\/2017\/08\/cropped-University_of_Reading_shield-1.png","contentUrl":"https:\/\/research.reading.ac.uk\/act\/wp-content\/uploads\/sites\/2\/2017\/08\/cropped-University_of_Reading_shield-1.png","width":512,"height":512,"caption":"University of Reading"},"image":{"@id":"https:\/\/research.reading.ac.uk\/act\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/kbe_knowledgebase\/7599","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/kbe_knowledgebase"}],"about":[{"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/types\/kbe_knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/users\/421"}],"version-history":[{"count":10,"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/kbe_knowledgebase\/7599\/revisions"}],"predecessor-version":[{"id":7628,"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/kbe_knowledgebase\/7599\/revisions\/7628"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/media\/223"}],"wp:attachment":[{"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/media?parent=7599"}],"wp:term":[{"taxonomy":"kbe_taxonomy","embeddable":true,"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/kbe_taxonomy?post=7599"},{"taxonomy":"kbe_tags","embeddable":true,"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/kbe_tags?post=7599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}