{"id":366,"date":"2015-07-07T13:58:21","date_gmt":"2015-07-07T13:58:21","guid":{"rendered":"http:\/\/srvcnthpc001.uct.ac.za\/?p=366"},"modified":"2015-08-14T15:06:35","modified_gmt":"2015-08-14T13:06:35","slug":"berkeley-lab-checkpointrestart","status":"publish","type":"post","link":"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/","title":{"rendered":"Berkeley Lab Checkpoint\/Restart"},"content":{"rendered":"<p><a href=\"http:\/\/crd.lbl.gov\/departments\/computer-science\/CLaSS\/research\/BLCR\/\">Berkeley Lab Checkpoint\/Restart<\/a> has been installed on the SLURM cluster. This allows users to checkpoint a job, cancel it and then resume the job at a later date.\u00a0The executable is started with the cr_run wrapper:<\/p>\n<pre>cr_run \/home\/andy\/ram.pl &gt;&gt; \/home\/andy\/ramtest.out<\/pre>\n<p>This trivial job adds 100KB of data to an array every second and outputs the index of the array to a file.<br \/>\nStart the job:<\/p>\n<pre>~$ sbatch ramtest.sh\r\nSubmitted batch job 2180\r\n~$ squeue\r\nJOBID PARTITION    NAME USER ST TIME NODELIST\r\n 2180  ucthimem MemTest andy  R 0:05 hpc406\r\n<\/pre>\n<p>Create a checkpoint file at time=t1<\/p>\n<pre>~$ \/opt\/slurm\/bin\/scontrol checkpoint create 2180 ImageDir=\/home\/andy\r\n<\/pre>\n<p>Contents of output file at t1:<\/p>\n<pre>cat ramtest.out\r\nstarting at Tue Jul 7 13:08:35 2015\r\n0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18\r\n<\/pre>\n<p>A checkpoint folder has now been created:<\/p>\n<pre>ls -l \/home\/andy\/2180\/\r\n-r-------- 1 andy andy 5775884 Jul 7 15:09 script.ckpt\r\n<\/pre>\n<p>Cancel job at time=t2<\/p>\n<pre>~$ scancel 2180\r\n<\/pre>\n<p>Contents of output file at t2:<\/p>\n<pre>starting at Tue Jul 7 13:08:35 2015\r\n0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99\r\n<\/pre>\n<p>And the job has been stopped:<\/p>\n<pre>~$ cat slurm-2180.out\r\nslurmstepd: *** JOB 2180 CANCELLED AT 2015-07-07T15:12:05 *** on srvcnthpc406\r\n<\/pre>\n<p>Restart the job at time=t3<\/p>\n<pre>~$ \/opt\/slurm\/bin\/scontrol checkpoint restart 2180 ImageDir=\/home\/alewis\r\nscontrol_checkpoint error: Duplicate job id\r\n<\/pre>\n<p>This command failed as the scheduler keeps a short list of the last few JobIDs. You have to wait at least 15 minutes for the scheduler&#8217;s short term memory to &#8216;forget&#8217; about this job.<\/p>\n<p>Restart the job at time=t4<\/p>\n<pre>~$ \/opt\/slurm\/bin\/scontrol checkpoint restart 2180 ImageDir=\/home\/alewis\r\n<\/pre>\n<p>The job is restarted in the pending state:<\/p>\n<pre>alewis@srvcnthpc501:~$ squeue\r\nJOBID PARTITION    NAME USER ST TIME NODELIST\r\n 2180  ucthimem MemTest andy PD 0:00 (None)\r\n<\/pre>\n<p>After several seconds the job runs<\/p>\n<pre>alewis@srvcnthpc501:~$ squeue\r\nJOBID PARTITION NAME USER ST TIME NODELIST\r\n2180 ucthimem MemTest andy R 0:04 hpc406\r\n<\/pre>\n<p>The job files are reset as they were at t1:<\/p>\n<pre>~$ cat ramtest.out\r\nstarting at Tue Jul 7 13:08:35 2015\r\n0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Berkeley Lab Checkpoint\/Restart has been installed on the SLURM cluster. This allows users to checkpoint a job, cancel it and then resume the job at a later date.\u00a0The executable is started with the cr_run wrapper: cr_run \/home\/andy\/ram.pl &gt;&gt; \/home\/andy\/ramtest.out This trivial job adds 100KB of data to an array every second and outputs the index&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,5],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Berkeley Lab Checkpoint\/Restart - UCT HPC<\/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:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Berkeley Lab Checkpoint\/Restart - UCT HPC\" \/>\n<meta property=\"og:description\" content=\"Berkeley Lab Checkpoint\/Restart has been installed on the SLURM cluster. This allows users to checkpoint a job, cancel it and then resume the job at a later date.\u00a0The executable is started with the cr_run wrapper: cr_run \/home\/andy\/ram.pl &gt;&gt; \/home\/andy\/ramtest.out This trivial job adds 100KB of data to an array every second and outputs the index...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/\" \/>\n<meta property=\"og:site_name\" content=\"UCT HPC\" \/>\n<meta property=\"article:published_time\" content=\"2015-07-07T13:58:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-08-14T13:06:35+00:00\" \/>\n<meta name=\"author\" content=\"Andrew Lewis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andrew Lewis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/\"},\"author\":{\"name\":\"Andrew Lewis\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#\/schema\/person\/c183ad1c0a1063124a72d63963ae9c7e\"},\"headline\":\"Berkeley Lab Checkpoint\/Restart\",\"datePublished\":\"2015-07-07T13:58:21+00:00\",\"dateModified\":\"2015-08-14T13:06:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/\"},\"wordCount\":173,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#organization\"},\"articleSection\":[\"hpc\",\"SLURM\"],\"inLanguage\":\"en-ZA\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/\",\"url\":\"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/\",\"name\":\"Berkeley Lab Checkpoint\/Restart - UCT HPC\",\"isPartOf\":{\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#website\"},\"datePublished\":\"2015-07-07T13:58:21+00:00\",\"dateModified\":\"2015-08-14T13:06:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/#breadcrumb\"},\"inLanguage\":\"en-ZA\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ucthpc.uct.ac.za\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Berkeley Lab Checkpoint\/Restart\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#website\",\"url\":\"https:\/\/ucthpc.uct.ac.za\/\",\"name\":\"UCT HPC\",\"description\":\"University of Cape Town High Performance Computing\",\"publisher\":{\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ucthpc.uct.ac.za\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-ZA\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#organization\",\"name\":\"University of Cape Town High Performance Computing\",\"url\":\"https:\/\/ucthpc.uct.ac.za\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-ZA\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2015\/09\/logocircless.png\",\"contentUrl\":\"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2015\/09\/logocircless.png\",\"width\":450,\"height\":423,\"caption\":\"University of Cape Town High Performance Computing\"},\"image\":{\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#\/schema\/person\/c183ad1c0a1063124a72d63963ae9c7e\",\"name\":\"Andrew Lewis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-ZA\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9652c9c73beeab594b8dc2383a880048?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9652c9c73beeab594b8dc2383a880048?s=96&d=mm&r=g\",\"caption\":\"Andrew Lewis\"},\"sameAs\":[\"http:\/\/blogs.uct.ac.za\/blog\/big-bytes\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Berkeley Lab Checkpoint\/Restart - UCT HPC","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:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/","og_locale":"en_US","og_type":"article","og_title":"Berkeley Lab Checkpoint\/Restart - UCT HPC","og_description":"Berkeley Lab Checkpoint\/Restart has been installed on the SLURM cluster. This allows users to checkpoint a job, cancel it and then resume the job at a later date.\u00a0The executable is started with the cr_run wrapper: cr_run \/home\/andy\/ram.pl &gt;&gt; \/home\/andy\/ramtest.out This trivial job adds 100KB of data to an array every second and outputs the index...","og_url":"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/","og_site_name":"UCT HPC","article_published_time":"2015-07-07T13:58:21+00:00","article_modified_time":"2015-08-14T13:06:35+00:00","author":"Andrew Lewis","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Andrew Lewis","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/#article","isPartOf":{"@id":"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/"},"author":{"name":"Andrew Lewis","@id":"https:\/\/ucthpc.uct.ac.za\/#\/schema\/person\/c183ad1c0a1063124a72d63963ae9c7e"},"headline":"Berkeley Lab Checkpoint\/Restart","datePublished":"2015-07-07T13:58:21+00:00","dateModified":"2015-08-14T13:06:35+00:00","mainEntityOfPage":{"@id":"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/"},"wordCount":173,"commentCount":0,"publisher":{"@id":"https:\/\/ucthpc.uct.ac.za\/#organization"},"articleSection":["hpc","SLURM"],"inLanguage":"en-ZA","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/","url":"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/","name":"Berkeley Lab Checkpoint\/Restart - UCT HPC","isPartOf":{"@id":"https:\/\/ucthpc.uct.ac.za\/#website"},"datePublished":"2015-07-07T13:58:21+00:00","dateModified":"2015-08-14T13:06:35+00:00","breadcrumb":{"@id":"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/#breadcrumb"},"inLanguage":"en-ZA","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ucthpc.uct.ac.za\/index.php\/2015\/07\/07\/berkeley-lab-checkpointrestart\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ucthpc.uct.ac.za\/"},{"@type":"ListItem","position":2,"name":"Berkeley Lab Checkpoint\/Restart"}]},{"@type":"WebSite","@id":"https:\/\/ucthpc.uct.ac.za\/#website","url":"https:\/\/ucthpc.uct.ac.za\/","name":"UCT HPC","description":"University of Cape Town High Performance Computing","publisher":{"@id":"https:\/\/ucthpc.uct.ac.za\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ucthpc.uct.ac.za\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-ZA"},{"@type":"Organization","@id":"https:\/\/ucthpc.uct.ac.za\/#organization","name":"University of Cape Town High Performance Computing","url":"https:\/\/ucthpc.uct.ac.za\/","logo":{"@type":"ImageObject","inLanguage":"en-ZA","@id":"https:\/\/ucthpc.uct.ac.za\/#\/schema\/logo\/image\/","url":"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2015\/09\/logocircless.png","contentUrl":"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2015\/09\/logocircless.png","width":450,"height":423,"caption":"University of Cape Town High Performance Computing"},"image":{"@id":"https:\/\/ucthpc.uct.ac.za\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/ucthpc.uct.ac.za\/#\/schema\/person\/c183ad1c0a1063124a72d63963ae9c7e","name":"Andrew Lewis","image":{"@type":"ImageObject","inLanguage":"en-ZA","@id":"https:\/\/ucthpc.uct.ac.za\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9652c9c73beeab594b8dc2383a880048?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9652c9c73beeab594b8dc2383a880048?s=96&d=mm&r=g","caption":"Andrew Lewis"},"sameAs":["http:\/\/blogs.uct.ac.za\/blog\/big-bytes"]}]}},"_links":{"self":[{"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/posts\/366"}],"collection":[{"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/comments?post=366"}],"version-history":[{"count":29,"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/posts\/366\/revisions"}],"predecessor-version":[{"id":2016,"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/posts\/366\/revisions\/2016"}],"wp:attachment":[{"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/media?parent=366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/categories?post=366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/tags?post=366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}