Difference between revisions of "Interactive Jobs"

From HPC users
Jump to navigationJump to search
(Created page with "{{warningbox|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 n...")
 
Line 8: Line 8:


== Interactive Login with X11-forwarding ==
== 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 <tt>srun.x11</tt> 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 <tt>srun.x11</tt> 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). You will need to (re)load the module <tt>hpc-uniol-env</tt> or do a
module restore
before loading additional modules. So finally, this
$ module load hpc-uniol-env
$ module load gnuplot
$ gnuplot
> plot sin(x)
should open a windows showing the plot of sin(x) on your machine.

Revision as of 14:58, 16 March 2017

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). You will need to (re)load the module hpc-uniol-env or do a

module restore

before loading additional modules. So finally, this

$ module load hpc-uniol-env
$ module load gnuplot
$ gnuplot
> plot sin(x)

should open a windows showing the plot of sin(x) on your machine.