Difference between revisions of "Interactive Jobs"

From HPC users
Jump to navigationJump to search
Line 23: Line 23:
After that you can create an interactive session using e.g. the command  
After that you can create an interactive session using e.g. the command  
  /path/to/srun.x11 -p carl.p -n 1
  /path/to/srun.x11 -p carl.p -n 1
You can add any of the options from the sbatch command you would like to use (e.g. --gres=gpu:1 if you also use partition mpcg.p). You will need to (re)load the module <tt>hpc-uniol-env</tt> or do a
You can add any of the options from the sbatch command you would like to use (e.g. --gres=gpu:1 if you also use partition mpcg.p). In the interactive session, this
module restore
before loading additional modules. So finally, this
$ module load hpc-uniol-env
  $ module load gnuplot
  $ module load gnuplot
  $ gnuplot
  $ gnuplot
  > plot sin(x)
  > plot sin(x)
should open a windows showing the plot of sin(x) on your machine.
should open a windows showing the plot of sin(x) on your machine (if you have problems loading module a <tt>module restore</tt> may help).

Revision as of 12:00, 15 February 2019

Interactive jobs should not be used unless needed for a specific reason. If you have to use an interactive session on the compute nodes please keep it short (do not request more than 8h per session) and log out as soon as you done with the interactive work!

Interactive Login

Method 1: Start a bash shell on a compute node and reserve four CPUs/cores (with default run time and memory):

srun --pty -p carl.p --ntasks=1 --cpus-per-task=4 bash

Interactive Login with X11-forwarding

If you need graphical output during an interactive session things become more complicated. SLURM does not natively support X11-forwarding for jobs running on the compute nodes. Here is a work around that can be used:

First, login to the cluster with X11-fowarding enabled:

ssh -X abcd1234@carl.hpc.uni-oldenburg.de

Next, get a copy of srun.x11 with the command

git clone https://github.com/jbornschein/srun.x11.git

which will create a directory srun.x11 with some files in it (you may want to cd to a preferred directory before using git clone). One of the files is named srun.x11 and it is recommended to modify it ((-) old line, (+) new line) as follows:

(-) trap "{ /usr/bin/scancel -Q $JOB; exit; }" SIGINT SIGTERM EXIT
(+) trap "{ scancel -Q $JOB; exit; }" SIGINT SIGTERM EXIT

and

(-)    sleep 1s
(+)    sleep 2s

After that you can create an interactive session using e.g. the command

/path/to/srun.x11 -p carl.p -n 1

You can add any of the options from the sbatch command you would like to use (e.g. --gres=gpu:1 if you also use partition mpcg.p). In the interactive session, this

$ module load gnuplot
$ gnuplot
> plot sin(x)

should open a windows showing the plot of sin(x) on your machine (if you have problems loading module a module restore may help).