Interactive jobs

This guide describes how to start interactive jobs on Abacus, i.e., jobs where you using a GUI or using the command line use one or more of our compute nodes as if you were sitting at your own computer.

If you only need text / terminal (ssh) access, you can use one of the first two options:

  • srun
  • sinteractive

If you need a graphical interface (GUI), this can be done using X or VNC. For more graphical intensive programs (MATLAB, etc), we suggest to use VNC as X is not designed to be used over a slow ssh tunnel.

  • sinteractive (X)
  • sinteractive-vnc (VNC)

The intended use of Abacus is for batch scripts submitted using sbatch. At periods with heavy load on the system, you may have to wait for quite some time for your interactive session to start.

We suggest to run interactive sessions with a run time of less than 24 hours, e.g., --time 4:00:00, as this makes it more likely that the interactive session/job can be fit into the Slurm job schedule.

Software

If you only need to run interactive text sessions, you do not need any additional software on your own computer on top of what you already use for ssh access.

For GUI interactive jobs, what you need depends on the operating system, you are using:

  • For Windows users, we recommend using MobaXterm as this includes both X and VNC as part of the installation. Further details can be found on our page on SSH installation for Windows.

  • For Mac users, you'll need two pieces of software:

    • XQuartz can be used for X sessions (sinteractive)
    • TurboVNC can be used for VNC sessions (sinteractive-vnc). The download page is available here. You should download and install the .dmg file.
  • 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 Remmina Remote Desktop Client. If not, we suggest to install to install TurboVNC:

srun: Text-only interactive jobs

The simplest solution when you want to run an interactive job is to use the srun command with a few options. This preserves your current environment including e.g. loaded modules, but does not setup X nor VNC:

testuser@fe1:~$ srun -A sdutest_gpu --time 1:00:00 --pty bash -i
testuser@s32p19:~$

Exactly as you do for sbatch, you can add extra options, if you need multiple nodes, etc.:

testuser@fe1:~$ srun -A sdutest_gpu --time 1:00:00 --nodes 8 --pty bash -i
testuser@s32p19:~$ #

sinteractive: Text-only or GUI/X interactive jobs

If you need a graphical interface, it becomes slightly more complicated. First, when connecting to Abacus, you must setup X forwarding using the -X option (If your are using MobaXterm on Windows, X support is turned on by default):

peter@laptop:~$ ssh -X testuser@fe.deic.sdu.dk

Next, on the frontend node use the command sinteractive. Note that sinteractive clears most environment variables, i.e., to make everything work, you have to reload software modules, etc when you are "inside" the interactive job.

testuser@fe1:~$ sinteractive -A sdutest_slim --time 1:00:00
Waiting for JOBID 8476 to start
testuser@s22p22:~$

In both cases you by default get 1 node. Exactly as you do for sbatch/sinteractive, you can add extra options, if you need multiple nodes, etc.:

testuser@fe1:~$ sinteractive -A sdutest_gpu --time 1:00:00 --nodes 4
Waiting for JOBID 8477 to start
testuser@s32p19:~$ #

sinteractive-vnc: GUI/VNC interative jobs

Some GUI applications, in particular COMSOL and MATLAB, do either not work correctly when using "simple" X forwarding over ssh as shown above or alternatively runs very slow. In these cases, you should consider looking at VNC.

Running a VNC session is a three step procedure:

1: Start a VNC server on one of the Abacus compute nodes

First, login to a frontend node and run the command sinteractive-vnc and follow the instructions:

testuser@fe1:~$ sinteractive-vnc --time 2:00:00 --account sdutest_slim

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 sbatch or sinteractive.

The first time you run sinteractive-vnc 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)

testuser@fe1:~$ sinteractive-vnc --time 2:00:00 --account sdutest_slim
==========================================================================
Interactive VNC session on Abacus
==========================================================================

------------
VNC password
------------
/home/testuser/.vnc/passwd does not exist

You are required to setup a VNC password for accessing your VNC session.

You should not reuse a password from elsewhere, as the password is not
encrypted securely.

Answer no to whether you want to enter a 'view-only password'.

Password:
Verify:
Would you like to enter a view-only password (y/n)? n

/home/testuser/.vnc/passwd exists and is probably ok.

If you forget your VNC password, use the command 'vncpassword' to reset it,
i.e., run
    module add turbovnc ; vncpasswd

--------------------------------
Submit interactive VNC slurm job
--------------------------------
Waiting for JOBID 95387 to start.
If this step is interrupted, you may have to cancel the job yourself using
    scancel 95387

--------------------------
VNC server ready on s12p34
--------------------------
Now run a VNC viewer on your own computer.

If you are using TurboVNC on a Mac/Linux computer, the following should work
    peter@laptop:~$ /opt/TurboVNC/bin/vncviewer -via testuser@fe.deic.sdu.dk -ExtSSH=1 s12p34

Otherwise first setup an SSH tunnel
    peter@laptop:~$ ssh -L 5900:s12p34:5900 testuser@fe.deic.sdu.dk
Next, while the above is running, start a vncviewer on your own computer
in another terminal window
    peter@laptop:~$ vncviewer localhost

Remember to cancel/shutdown the VNC server when you are done using
    scancel 95387

Note that the output from sinteractive-vnc includes the name of the compute node your interactive VNC session is running. In the output above, the node is s12p34.

2: Start a VNC viewer on your own computer

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., s12p34, via a gateway, i.e., a frontend node fe.deic.sdu.dk.

What you need to do depends on exactly which VNC viewer your are using -- see below for a few examples.

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:

VNC password - MobaXterm VNC password - TurboVNC

2.a: MobaXterm as a VNC Viewer (Windows)

In Step 2.a.3, replace s12p34 with the node name written in the output of sinteractive-vnc:

  1. Click Session (top left corner).
  2. Click VNC.
  3. Enter the compute node name in the middle, e.g., s12p34.
  4. Click the Network settings tab, and select fe.deic.sdu.dk as the gateway server.
  5. Enter your username, e.g., testuser.
  6. Click Use private key and select your SSH private key.
  7. Click OK
  8. Next, enter your VNC password in the box that appears.

VNC pic 4

2.b: TurboVNC as a VNC Viewer (Mac/Linux)

If you are using TurboVNC on Mac/Linux, run the following command on your own computer of course replacing s12p34 with the node name written in the output of sinteractive-vnc.

peter@laptop:~$ /opt/TurboVNC/bin/vncviewer -via testuser@fe1.deic.sdu.dk -ExtSSH=1 s12p34

2.c: Other VNC Viewers (Linux)

If you use neither MobaXterm nor TurboVNC, starting VNC is a two step process:

First, setup an ssh tunnel using a command similar to this (replacing s12p34 with the node name written in the output of sinteractive-vnc).

peter@laptop:~$ ssh -L 5900:s12p34:5900 testuser@fe1.deic.sdu.dk

Next, while the above is running, start the vncviewer on your computer and ask the viewer to connect to localhost:9000. For some viewers, this can be done using a command similar to this:

peter@laptop:~$ vncviewer localhost:5900

3: Start applications inside the VNC session

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.

Next, inside the xterm window, you can run anything you want, e.g., MATLAB:

testuser@s12p34:~$ module add matlab
testuser@s12p34:~$ matlab

Some applications does not work correctly in particular if they use 3D X11 library calls. Usually this can be fixed by adding the turbovnc module which includes the Mesa 3D software library.

testuser@s12p34:~$ module add turbovnc photoscan
testuser@s12p34:~$ photoscan

VNC session with MATALB