From 06d388aeb23d8092423b247c5160eeaff22e8aea Mon Sep 17 00:00:00 2001 From: Neil Douglas Date: Fri, 1 Dec 2023 12:04:45 +0000 Subject: [PATCH 1/2] update virtual desktops to include salloc --- docs/source/using_viking/virtual_desktops.rst | 51 +++++++++++++++---- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/docs/source/using_viking/virtual_desktops.rst b/docs/source/using_viking/virtual_desktops.rst index 8a9552c..3b2c0f8 100644 --- a/docs/source/using_viking/virtual_desktops.rst +++ b/docs/source/using_viking/virtual_desktops.rst @@ -199,23 +199,54 @@ Your ``Identity`` code will be different to mine, this is just an example. Compute node ------------- -.. attention:: +The above method is great for light work like checking results but if you want to do heavier work with a graphical application then you need to use a compute node. When you've logged into the the virtual desktop :ref:`like above `, you then request resources on a compute node using the `salloc `_ command. This takes the same options as the ``srun`` and ``sbatch`` commands so this should be familiar, here is an example: + +.. code-block:: console + :caption: this describes one node, one tasks and eight CPU cores for four hours - This does not currently work and it being worked on, please bear with us. + $ salloc --nodes=1 --ntasks=1 --cpus-per-task=8 --time=04:00:00 -The above method is great for light work like checking results but what if you want to do the heavy work with a GUI application? It's easy, when you get the the virtual desktop :ref:`like above `, then you ask for some resources on a compute node, this is exactly the same as using the ``srun`` command however we use a special wrapper called ``start-interactive-session.sh`` in the terminal in the virtual desktop, for example: +You'll have to wait for the resources but when they are allocated you'll get output similar to that below: .. code-block:: console - :caption: like ``srun``, this describes 1 node, 20 tasks, for 4 hours and runs a bash shell - $ start-interactive-session.sh -N 1 -n 20 -t 4:0:0 --pty /bin/bash + [abc123@login2[viking2] ~]$ salloc --nodes=1 --ntasks=1 --cpus-per-task=8 --time=04:00:00 + salloc: Pending job allocation 689814 + salloc: job 689814 queued and waiting for resources + salloc: job 689814 has been allocated resources + salloc: Granted job allocation 689814 + flight start: Flight Direct environment is already active. + [abc123@login2[viking2] ~]$ -You'll have to wait for the resources and you'll get output similar to that below: +There is one extra step, after requesting resources we need to manually ``ssh`` into the node where the resources have been allocated and ensure we use the ``-X`` option, we can easily do this using the ``$SLURM_NODELIST`` variable which Slurm sets for us: .. code-block:: console - srun: job 25363864 queued and waiting for resources - srun: job 25363864 has been allocated resources - Enabling login2 to accept our X-connection... node001 being added to access control list + [abc123@login2[viking2] ~]$ ssh -X $SLURM_NODELIST + +Very shortly you'll be logged into the compute node, with all the login welcome text and then your prompt should look something like this: + +.. code-block:: console + + [abc123@node064[viking2] ~]$ + +In this example I'm logged into ``node064``. + + +Run your program +---------------- + +Once you're logged into the compute node, you can now load the modules and run your graphical program. In this example we run MATLAB: + +.. code-block:: console + + $ module load MATLAB/2023b + $ matlab + +After a few moments, the window for MATLAB should appear in your virtual desktop yet it's running on the compute node. + + +Tidy up +------- -After this you'll have a new session on one of the compute nodes. Stay in this terminal, load your modules and run your program and it will be running on the compute node. After you're done close everything down and remember to kill the virtual desktop just like we showed :ref:`before `. +After you're done close everything down and remember to :ref:`kill the virtual desktop ` just like we showed before. From 3b3db50c05741620e7414571c7a1033a08224e71 Mon Sep 17 00:00:00 2001 From: Neil Douglas Date: Fri, 1 Dec 2023 12:21:21 +0000 Subject: [PATCH 2/2] add -g note for flight command --- docs/source/using_viking/virtual_desktops.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/source/using_viking/virtual_desktops.rst b/docs/source/using_viking/virtual_desktops.rst index 3b2c0f8..1b189e1 100644 --- a/docs/source/using_viking/virtual_desktops.rst +++ b/docs/source/using_viking/virtual_desktops.rst @@ -95,6 +95,12 @@ We need more info, from the output copy and run the command from the line highli If prompted, you should supply the following password: muAtEks5 + +.. tip:: + + You can change the size of the virtual desktop 'display' once you're logged into the virtual desktop by clicking in the top right symbols, to the right of the time and date to open a small pop up menu. Then click on the spanner button, then the control panel will appear. Click on ``Devices`` then ``Displays`` and you can adjust the setting there but not all settings will be usable. Alternatively, you can set the ``geometry`` with the ``-g`` option when you run the ``flight`` command for example: ``flight desktop start gnome -g 1600x1200``. + + Create the ssh tunnel ^^^^^^^^^^^^^^^^^^^^^