{"id":494,"date":"2017-12-11T14:22:16","date_gmt":"2017-12-11T13:22:16","guid":{"rendered":"https:\/\/wpethzprd.ethz.ch\/isgdmath\/?p=494"},"modified":"2023-05-17T10:34:15","modified_gmt":"2023-05-17T08:34:15","slug":"screen","status":"publish","type":"post","link":"https:\/\/blogs.ethz.ch\/isgdmath\/screen\/","title":{"rendered":"Using &#8220;screen&#8221; to run simulations on a remote host"},"content":{"rendered":"<p>The suggested way to run your simulations on a remote host (let say for instance on ada-18) is to use screen, which allows you to:<\/p>\n<ul>\n<li>use multiple shell windows from a <strong>single SSH session<\/strong><\/li>\n<li><strong>keep a shell active<\/strong> even through network disruptions<\/li>\n<li>disconnect and <strong>re-connect to a shell sessions<\/strong> from multiple locations<\/li>\n<li>run a long running process without maintaining an active shell session.<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h2>Start screen<\/h2>\n<p>Enter in a terminal<\/p>\n<pre>screen<\/pre>\n<p>or &#8211; better &#8211; start a screen session by giving it a name (for instance &#8220;sim1&#8221;):<\/p>\n<pre>screen -S sim1<\/pre>\n<p>This is very useful if you are going to start several screen sessions on the same host.<\/p>\n<h2>Start a simulation<\/h2>\n<p>After you&#8217;ve started a screen session (see above) you will see a normal terminal prompt and at this point you can start your simulation:<\/p>\n<pre>.\/start_my_simulation_nr_1 with some parameters<\/pre>\n<p>Afterwards to disconnect from the screen session just type &#8220;<strong>Ctrl+a<\/strong>&#8221; and &#8220;<strong>d<\/strong>&#8221; (i.e. the control key and a lowercase &#8220;a&#8221; and then the lowercase &#8220;d&#8221;; d=disconnect).<\/p>\n<p>Later you can re-connect to this screen session with the command:<\/p>\n<pre>screen -r<\/pre>\n<p>or &#8211; if you started screen with the &#8220;-S&#8221; option &#8211; with the command:<\/p>\n<pre>screen -r sim1<\/pre>\n<h2>More information<\/h2>\n<p>See the man page of screen:<\/p>\n<pre>man screen<\/pre>\n<p>In particular read about the &#8220;screen commands&#8221;, those that begin with Ctrl+a.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The suggested way to run your simulations on a remote host (let say for instance on ada-18) is to use screen, which allows you to: use multiple shell windows from a single SSH session keep a shell active even through network disruptions disconnect and re-connect to a shell sessions from multiple locations run a long [&hellip;]<\/p>\n","protected":false},"author":43853,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[198216],"tags":[],"class_list":["post-494","post","type-post","status-publish","format-standard","hentry","category-computing"],"_links":{"self":[{"href":"https:\/\/blogs.ethz.ch\/isgdmath\/wp-json\/wp\/v2\/posts\/494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.ethz.ch\/isgdmath\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.ethz.ch\/isgdmath\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.ethz.ch\/isgdmath\/wp-json\/wp\/v2\/users\/43853"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.ethz.ch\/isgdmath\/wp-json\/wp\/v2\/comments?post=494"}],"version-history":[{"count":0,"href":"https:\/\/blogs.ethz.ch\/isgdmath\/wp-json\/wp\/v2\/posts\/494\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.ethz.ch\/isgdmath\/wp-json\/wp\/v2\/media?parent=494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.ethz.ch\/isgdmath\/wp-json\/wp\/v2\/categories?post=494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.ethz.ch\/isgdmath\/wp-json\/wp\/v2\/tags?post=494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}