{"id":1611,"date":"2017-11-22T09:05:43","date_gmt":"2017-11-22T09:05:43","guid":{"rendered":"http:\/\/35.198.183.193\/?page_id=1611"},"modified":"2019-06-03T09:10:09","modified_gmt":"2019-06-03T09:10:09","slug":"interactive-jobs","status":"publish","type":"page","link":"http:\/\/escience.sdu.dk\/index.php\/interactive-jobs\/","title":{"rendered":"Interactive jobs"},"content":{"rendered":"<p>This guide describes how to start interactive jobs on ABACUS2.0, i.e. jobs where you using a GUI (Graphical User Interface) or using the command line use one or more of our compute nodes as if you were sitting at your own computer.<br \/>\nIf you only need text \/ terminal (ssh) access, you can use one of the first two options:<\/p>\n<ul>\n<li><code>srun<\/code><\/li>\n<li><code>sinteractive<\/code><\/li>\n<\/ul>\n<p>If you need a Graphical User Interface (GUI), this can be done using X or VNC (Virtual Network Computing). For more graphical intensive programs (MATLAB (<b>is<\/b><span>\u00a0a fourth-generation programming\u00a0<\/span><b>language<\/b><span>\u00a0and numerical analysis environment. Uses for\u00a0<\/span><b>MATLAB<\/b><span>\u00a0include matrix calculations, developing and running algorithms, creating user interfaces (UI) and data visualization)<\/span>, etc), we suggest to use VNC as X is not designed to be used over a slow SSH (Secure Shell) tunnel.<\/p>\n<ul>\n<li><code>sinteractive<\/code><span>\u00a0<\/span>(X)<\/li>\n<li><code>sinteractive-vnc<\/code><span>\u00a0<\/span>(VNC)<\/li>\n<\/ul>\n<p>The intended use of ABACUS2.0 is for batch scripts to be submitted using<span>\u00a0<\/span><code>sbatch<\/code>. During periods of heavy loads on the system, you may have to wait for quite some time for your interactive session to start.<\/p>\n<p>We suggest you run interactive sessions with a run time of less than 24 hours, e.g.,<span>\u00a0<\/span><code>--time 4:00:00<\/code>, as this makes it more likely that the interactive session\/job can be fit into the Slurm job schedule.<\/p>\n<h4 id=\"software\">Software<\/h4>\n<p>If you only need to run interactive<span>\u00a0<\/span><em>text<\/em><span>\u00a0<\/span>sessions, you do not need any additional software on your own computer on top of what you already use for SSH access.<\/p>\n<p>For GUI interactive jobs, what you need depends on the operating system, you are using:<\/p>\n<ul>\n<li>For Windows users, we recommend using<span>\u00a0<\/span><a href=\"http:\/\/mobaxterm.mobatek.net\/\">MobaXterm<\/a><span>\u00a0<\/span>as this includes both X and VNC as part of the installation. Further details can be found on our page on<span>\u00a0<\/span><a href=\"\/index.php\/ssh-setups\/\">SSH installation for Windows<\/a>.<\/li>\n<li>For Mac users, you&#8217;ll need two pieces of software:\n<ul>\n<li><a href=\"https:\/\/www.xquartz.org\/\">XQuartz<\/a><span>\u00a0<\/span>can be used for X sessions (<code>sinteractive<\/code>)<\/li>\n<li><a href=\"http:\/\/www.turbovnc.org\/\">TurboVNC<\/a><span>\u00a0<\/span>can be used for VNC sessions (<code>sinteractive-vnc<\/code>). The<span>\u00a0<\/span><a href=\"https:\/\/sourceforge.net\/projects\/turbovnc\/files\/\">download page<\/a><span>\u00a0<\/span>is available <a href=\"https:\/\/sourceforge.net\/projects\/turbovnc\/files\/\">here<\/a>. You should download and install the .dmg file.<\/li>\n<\/ul>\n<\/li>\n<li>For Linux users, support for X is already installed by default. For VNC support, we suggest to check whether your system already has a VNC viewer installed, e.g., Ubuntu installs<span>\u00a0<\/span><em>Remmina Remote Desktop Client<\/em>. If not, we suggest you install TurboVNC:\n<ul>\n<li><a href=\"http:\/\/www.turbovnc.org\/\">TurboVNC<\/a><span>\u00a0<\/span>can be downloaded<span>\u00a0<\/span><a href=\"https:\/\/sourceforge.net\/projects\/turbovnc\/files\/\">here<\/a>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4 id=\"srun\">srun: Text-only interactive jobs<\/h4>\n<p>The simplest solution when you want to run an interactive job is to use the<span>\u00a0<\/span><code>srun<\/code><span>\u00a0<\/span>command with a few options. This preserves your current environment including e.g. loaded modules, but does not setup X nor VNC:<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"gp\">testuser@fe1:~$<\/span> srun -A sdutest_gpu --time 1:00:00 --pty bash -i\n<span class=\"gp\">testuser@s32p19:~$<\/span>\n<\/code><\/pre>\n<\/div>\n<p>Exactly as you do for<span>\u00a0<\/span><code>sbatch<\/code>, you can add extra options, if you need multiple nodes, etc.:<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"gp\">testuser@fe1:~$<\/span> srun -A sdutest_gpu --time 1:00:00 --nodes <span class=\"m\">8<\/span> --pty bash -i\n<span class=\"gp\">testuser@s32p19:~$<\/span> <span class=\"c\">#<\/span>\n<\/code><\/pre>\n<\/div>\n<h4 id=\"sinteractive\">sinteractive: Text-only or GUI\/X interactive jobs<\/h4>\n<p>If you need a graphical interface, it becomes slightly more complicated. First, when connecting to ABACUS2.0, you must setup X forwarding using the<span>\u00a0<\/span><code>-X<\/code><span>\u00a0<\/span>option (If your are using MobaXterm on Windows, X support is turned on by default):<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"gp\">peter@laptop:~$<\/span> ssh -X testuser@fe.deic.sdu.dk\n<\/code><\/pre>\n<\/div>\n<p>Next, on the frontend node use the command<span>\u00a0<\/span><code>sinteractive<\/code>. Note that<span>\u00a0<\/span><code>sinteractive<\/code><span>\u00a0<\/span>clears most environment variables, i.e., to make everything work, you have to reload software modules, etc. when you are &#8220;inside&#8221; the interactive job.<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"gp\">testuser@fe1:~$<\/span> sinteractive -A sdutest_slim --time 1:00:00\n<span class=\"go\">Waiting for JOBID 8476 to start<\/span>\n<span class=\"gp\">testuser@s22p22:~$<\/span>\n<\/code><\/pre>\n<\/div>\n<p>In both cases, by default you get 1 node. Exactly as you do using<span>\u00a0<\/span><code>sbatch<\/code>\/<code>sinteractive<\/code>, you can add extra options, if you need multiple nodes, etc.:<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"gp\">testuser@fe1:~$<\/span> sinteractive -A sdutest_gpu --time 1:00:00 --nodes 4\n<span class=\"go\">Waiting for JOBID 8477 to start<\/span>\n<span class=\"gp\">testuser@s32p19:~$<\/span> <span class=\"c\">#<\/span>\n<\/code><\/pre>\n<\/div>\n<h4 id=\"sinteractive-vnc-guivnc-interative-jobs\">sinteractive-vnc: GUI\/VNC interative jobs<\/h4>\n<p>Some GUI applications, in particular COMSOL (<span>Multiphysics\u00a0<\/span><em>is<\/em><span>\u00a0a cross-platform finite element analysis, solver and multiphysics simulation software. It allows conventional physics-based user interfaces and coupled systems of partial differential equations (PDEs))<\/span> and MATLAB, do not either\u00a0 work correctly when using &#8220;simple&#8221; X forwarding over SSH as shown above or alternatively run very slow. In these cases, you should consider looking at VNC.<\/p>\n<p>Running a VNC session is a three step procedure:<\/p>\n<h4 id=\"1-start-a-vnc-server-on-one-of-the-abacus-compute-nodes\">1: Start a VNC server on one of the ABACUS2.0 compute nodes<\/h4>\n<p>First, login to a frontend node and run the command<span>\u00a0<\/span><code>sinteractive-vnc<\/code><span>\u00a0<\/span>and follow the instructions:<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"gp\">testuser@fe1:~$<\/span> sinteractive-vnc --time 2:00:00 --account sdutest_slim\n<\/code><\/pre>\n<\/div>\n<p>This starts a two hour job. You may want to request more\/less hours. You can also add extra options to get more than one node, etc. Exactly as you do for<span>\u00a0<\/span><code>sbatch<\/code><span>\u00a0<\/span>or<span>\u00a0<\/span><code>sinteractive<\/code>.<\/p>\n<p>The first time you run<span>\u00a0<\/span><code>sinteractive-vnc<\/code><span>\u00a0<\/span>you are asked to setup a VNC password, which you later use when you connect your VNC viewer to the server (in Step 2.a\/2.b)<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"gp\">testuser@fe1:~$<\/span> sinteractive-vnc --time 2:00:00 --account sdutest_slim\n<span class=\"go\">==========================================================================<\/span>\n<span class=\"go\">Interactive VNC session on Abacus<\/span>\n<span class=\"go\">==========================================================================<\/span>\n\n<span class=\"go\">------------<\/span>\n<span class=\"go\">VNC password<\/span>\n<span class=\"go\">------------<\/span>\n<span class=\"go\">\/home\/testuser\/.vnc\/passwd does not exist<\/span>\n\n<span class=\"go\">You are required to setup a VNC password for accessing your VNC session.<\/span>\n\n<span class=\"go\">You should not reuse a password from elsewhere, as the password is not<\/span>\n<span class=\"go\">encrypted securely.<\/span>\n\n<span class=\"go\">Answer no to whether you want to enter a 'view-only password'.<\/span>\n\n<span class=\"go\">Password:<\/span>\n<span class=\"go\">Verify:<\/span>\n<span class=\"go\">Would you like to enter a view-only password (y\/n)? n<\/span>\n\n<span class=\"go\">\/home\/testuser\/.vnc\/passwd exists and is probably ok.<\/span>\n\n<span class=\"go\">If you forget your VNC password, use the command 'vncpassword' to reset it,<\/span>\n<span class=\"go\">i.e., run<\/span>\n<span class=\"go\">    module add turbovnc ; vncpasswd<\/span>\n\n<span class=\"go\">--------------------------------<\/span>\n<span class=\"go\">Submit interactive VNC slurm job<\/span>\n<span class=\"go\">--------------------------------<\/span>\n<span class=\"go\">Waiting for JOBID 95387 to start.<\/span>\n<span class=\"go\">If this step is interrupted, you may have to cancel the job yourself using<\/span>\n<span class=\"go\">    scancel 95387<\/span>\n\n<span class=\"go\">--------------------------<\/span>\n<span class=\"go\">VNC server ready on s12p34<\/span>\n<span class=\"go\">--------------------------<\/span>\n<span class=\"go\">Now run a VNC viewer on your own computer.<\/span>\n\n<span class=\"go\">If you are using TurboVNC on a Mac\/Linux computer, the following should work<\/span>\n<span class=\"go\">    peter@laptop:~$ \/opt\/TurboVNC\/bin\/vncviewer -via testuser@fe.deic.sdu.dk -ExtSSH=1 s12p34<\/span>\n\n<span class=\"go\">Otherwise first setup an SSH tunnel<\/span>\n<span class=\"go\">    peter@laptop:~$ ssh -L 5900:s12p34:5900 testuser@fe.deic.sdu.dk<\/span>\n<span class=\"go\">Next, while the above is running, start a vncviewer on your own computer<\/span>\n<span class=\"go\">in another terminal window<\/span>\n<span class=\"go\">    peter@laptop:~$ vncviewer localhost<\/span>\n\n<span class=\"go\">Remember to cancel\/shutdown the VNC server when you are done using<\/span>\n<span class=\"go\">    scancel 95387<\/span>\n<\/code><\/pre>\n<\/div>\n<p>Note that the output from<span>\u00a0<\/span><code>sinteractive-vnc<\/code><span>\u00a0<\/span>includes the name of the compute node your interactive VNC session is running. In the output above, the node is<span>\u00a0<\/span><code>s12p34<\/code>.<\/p>\n<h4 id=\"2-start-a-vnc-viewer-on-your-own-computer\">2: Start a VNC viewer on your own computer<\/h4>\n<p>The next step is to start a VNC viewer on your own computer. The VNC viewer connects to the VNC server running on the compute node, e.g.<span>\u00a0<\/span><code>s12p34<\/code>, via a gateway, i.e. a frontend node<span>\u00a0<\/span><code>fe.deic.sdu.dk<\/code>.<\/p>\n<p>What you need to do depends on exactly which VNC viewer your are using &#8212; see below for a few examples.<\/p>\n<p>In all cases, as part of establishing the connection you are asked for a password. This is the VNC password you entered earlier in Step 1:<\/p>\n<p><img src=\"https:\/\/deic-info.sdu.dk\/content\/doc\/images\/win-moba-vnc-5.png\" alt=\"VNC password - MobaXterm\" \/><span>\u00a0<\/span><img src=\"https:\/\/deic-info.sdu.dk\/content\/doc\/images\/vnc-2.png\" alt=\"VNC password - TurboVNC\" \/><\/p>\n<h4 id=\"2a-mobaxterm-as-a-vnc-viewer-windows\">2.a: MobaXterm as a VNC Viewer (Windows)<\/h4>\n<p>In Step 2.a.3, replace<span>\u00a0<\/span><code>s12p34<\/code><span>\u00a0<\/span>with the node name written in the output of<span>\u00a0<\/span><code>sinteractive-vnc<\/code>:<\/p>\n<ul>\n<li>Click Session (top left corner).<\/li>\n<li>Click VNC.<\/li>\n<li>Enter the compute node name in the middle, e.g.,<span>\u00a0<\/span><code>s12p34<\/code>.<\/li>\n<li>Click the<span>\u00a0<\/span><em>Network settings<\/em><span>\u00a0<\/span>tab, and select<span>\u00a0<\/span><code>fe.deic.sdu.dk<\/code><span>\u00a0<\/span>as the gateway server.<\/li>\n<li>Enter your username, e.g.,<span>\u00a0<\/span><code>testuser<\/code>.<\/li>\n<li>Click<span>\u00a0<\/span><em>Use private key<\/em><span>\u00a0<\/span>and select your SSH private key.<\/li>\n<li>Click OK<\/li>\n<li>Next, enter your VNC password in the box that appears.<\/li>\n<\/ul>\n<p><img src=\"https:\/\/deic-info.sdu.dk\/content\/doc\/images\/win-moba-vnc-4b.png\" alt=\"VNC pic 4\" \/><\/p>\n<h4 id=\"2b-turbovnc-as-a-vnc-viewer-maclinux\">2.b: TurboVNC as a VNC Viewer (Mac\/Linux)<\/h4>\n<p>If you are using TurboVNC on Mac\/Linux, run the following command on your own computer replacing<span>\u00a0<\/span><code>s12p34<\/code><span>\u00a0<\/span>with the node name written in the output of<span>\u00a0<\/span><code>sinteractive-vnc<\/code>.<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"gp\">peter@laptop:~$<\/span> \/opt\/TurboVNC\/bin\/vncviewer -via testuser@fe1.deic.sdu.dk -ExtSSH<span class=\"o\">=<\/span><span class=\"m\">1<\/span> s12p34\n<\/code><\/pre>\n<\/div>\n<h4 id=\"2c-other-vnc-viewers-linux\">2.c: Other VNC Viewers (Linux)<\/h4>\n<p>If you neither use MobaXterm nor TurboVNC, starting VNC is a two step process:<\/p>\n<p>First, setup a SSH tunnel using a command similar to this (replacing<span>\u00a0<\/span><code>s12p34<\/code><span>\u00a0<\/span>with the node name written in the output of<span>\u00a0<\/span><code>sinteractive-vnc<\/code>).<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"gp\">peter@laptop:~$<\/span> ssh -L 5900:s12p34:5900 testuser@fe1.deic.sdu.dk\n<\/code><\/pre>\n<\/div>\n<p>Next,<span>\u00a0<\/span><em>while the above is running<\/em>, start the vncviewer on your computer and ask the viewer to connect to<span>\u00a0<\/span><code>localhost:9000<\/code>. For some viewers, this can be done using a command similar to this:<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"gp\">peter@laptop:~$<\/span> vncviewer localhost:5900\n<\/code><\/pre>\n<\/div>\n<h4 id=\"3-start-applications-inside-the-vnc-session\">3: Start applications inside the VNC session<\/h4>\n<p>Inside the VNC window, you can start applications by first clicking the iceWM logo in the lower-left corner, and then starting an xterm window.<\/p>\n<p>Next, inside the xterm window, you can run anything you want, e.g. MATLAB:<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"gp\">testuser@s12p34:~$<\/span> module add matlab\n<span class=\"gp\">testuser@s12p34:~$<\/span> matlab\n<\/code><\/pre>\n<\/div>\n<p>Some applications do not work correctly, in particular, if they use 3D X11 library calls. Usually this can be fixed by adding the<span>\u00a0<\/span><code>turbovnc<\/code><span>\u00a0<\/span>module which includes the Mesa 3D software library.<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"gp\">testuser@s12p34:~$<\/span> module add turbovnc photoscan\n<span class=\"gp\">testuser@s12p34:~$<\/span> photoscan\n<\/code><\/pre>\n<\/div>\n<p><img src=\"https:\/\/deic-info.sdu.dk\/content\/doc\/images\/vnc-1.png\" alt=\"VNC session with MATALB\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide describes how to start interactive jobs on ABACUS2.0, i.e. jobs where you using a GUI (Graphical User Interface) or using the command line use one or more of our compute nodes as if<a class=\"moretag\" href=\"http:\/\/escience.sdu.dk\/index.php\/interactive-jobs\/\"> Read more&hellip;<\/a><\/p>\n","protected":false},"author":1,"featured_media":3986,"parent":0,"menu_order":28,"comment_status":"closed","ping_status":"closed","template":"page-templates\/template-fullwidth.php","meta":[],"_links":{"self":[{"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/pages\/1611"}],"collection":[{"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/comments?post=1611"}],"version-history":[{"count":8,"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/pages\/1611\/revisions"}],"predecessor-version":[{"id":4751,"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/pages\/1611\/revisions\/4751"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/media\/3986"}],"wp:attachment":[{"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/media?parent=1611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}