Interactive Jobs

Command Line Interactive Jobs

Interactive jobs are possible on Chinook using srun:

chinook:~$ srun -p debug --nodes=1 --exclusive --pty /bin/bash

The above command will reserve one node in the debug partition and launch an interactive shell job. The --pty option executes task zero in pseudo terminal mode and implicitly sets --unbuffered and --error and --output to /dev/null for all tasks except task zero, which may cause those tasks to exit immediately.

Displaying X Windows from Interactive Jobs

A new module named "sintr" is available to create an interactive job that forwards application windows from the first compute node back the local display. This relies on using X11 forwarding over SSH, so make sure to enable graphics when connecting to a chinook login node. An SSH key pair on a Chinook login node will have to be generated which can be done by running the ssh-keygen -t rsa command:

chinook00 % ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/<USERNAME>/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: ...

The command will prompt you for the location to save the file, using /home/<USERNAME>/.ssh/id_rsa as the default. The rsa key pair must be saved in that file. You will also be prompted for a passphrase for the key pair which will be used when connecting to a compute node with sintr. The contents of $HOME/.ssh/id_rsa.pub must then be added to $HOME/.ssh/authorized_keys. This can be done with the following command:

cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys

The sintr command accepts the same command line arguments as sbatch. To launch a single node interactive job in the debug partition, for example, follow these steps:

chinook:~$ module load sintr chinook:~$ sintr -p debug -N 1 Waiting for JOBID #### to start. ...

The command will wait for a node to be assigned and the job to launch. As soon as that happens, the next prompt should be on the first allocated compute node, and the DISPLAY environment variable will be set to send X windows back across the SSH connection. It is now possible to load and execute a desired windowed application. Here's an example with Totalview.

bash-4.1$ module load totalview bash-4.1$ totalview

After exiting an application, exit the session too. This will release the allocated node(s) and end the interactive job.

bash-4.1$ exit exit [screen is terminating] chinook:~$

Last updated