From e646fe9206a3e9b1e44ca617b801d0aef856b2b3 Mon Sep 17 00:00:00 2001 From: patmjen <patmjen@dtu.dk> Date: Thu, 3 Nov 2022 16:56:01 +0100 Subject: [PATCH] Add more formatting This hopefully makes it easier to spot what's an actual step in the and what is extra info. --- HPC_Python_Guide.md | 76 ++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/HPC_Python_Guide.md b/HPC_Python_Guide.md index 09fa019..9e46750 100644 --- a/HPC_Python_Guide.md +++ b/HPC_Python_Guide.md @@ -48,11 +48,11 @@ a100sh ``` You should now be able to install packages with pip install <PACKAGE> as normal. -If pip doesn't work, you may need to manually install it with: -``` -easy_install pip -``` -To run python, remember to use the `python3` command. + +> __Troubleshooting:__ If pip doesn't work, you may need to manually install it with: +> ``` +> easy_install pip +> ``` ## III. Virtualenv activation @@ -74,23 +74,23 @@ To run python, remember to use the `python3` command. source <VENV_NAME>/bin/activate ``` -__Pro tip:__ To make life easy, put these commands in a bash script called `init.sh`: -``` -#!/bin/bash -module load python3/3.8.9 -module load numpy/1.19.5-python-3.8.9-openblas-0.3.13 -module load scipy/1.5.4-python-3.8.9 -module load cuda/11.0 - -source <VENV_NAME>/bin/activate -``` - -which you can then run by entering: -``` -source init.sh -``` - -and this will prepare everything +> __Pro tip:__ To make life easy, put these commands in a bash script called `init.sh`: +> ``` +> #!/bin/bash +> module load python3/3.8.9 +> module load numpy/1.19.5-python-3.8.9-openblas-0.3.13 +> module load scipy/1.5.4-python-3.8.9 +> module load cuda/11.0 +> +> source <VENV_NAME>/bin/activate +> ``` +> +> which you can then run by entering: +> ``` +> source init.sh +> ``` +> +> and this will prepare everything ## IV. Jupyter notebooks on ThinLinc @@ -122,12 +122,12 @@ and this will prepare everything jupyter lab ``` This should open a browser with the Jupyter lab interface. - Sometimes this has some issues and one then need to revert to Jupyter notebooks. + > __Troubleshooting:__ Sometimes Jupyter lab has some issues and you need to revert to Jupyter notebooks. ## V. Jupyter notebooks on the cluster in your own browser -**WARNING:** This will be a bit involved... -Credit goes to Niels Jeppesen who figured all this out. +> __WARNING:__ This will be a bit involved... +> Credit goes to Niels Jeppesen who figured all this out. 1. Open a terminal on the cluster, either through ThinLinc or ssh. @@ -136,12 +136,12 @@ Credit goes to Niels Jeppesen who figured all this out. ``` tmux ``` - This way, _**if you lose your internet connection**_ your notebook will keep running. - You can _**reconnect**_ to the tmux session by running: - ``` - tmux attach - ``` - in a terminal on the cluster. + > _**If you lose your internet connection**_ your notebook will keep running. + > You can _**reconnect**_ to the tmux session by running: + > ``` + > tmux attach + > ``` + > in a terminal on the cluster. 3. Take note of the node's hostname. You can see this by running: ``` @@ -176,14 +176,14 @@ Credit goes to Niels Jeppesen who figured all this out. This should open the Jupyter interface. Any commands you run will be executed on the HPC cluster. - **NOTE:** If no URL beginning with `127.0.0.1` was printed in step 5, change the first part - manually to `127.0.0.1` before entering it in your browser. In the example from step 5, you - would change `n-62-20-9` to `12.0.0.1`. + > **NOTE:** If no URL beginning with `127.0.0.1` was printed in step 5, change the first part + > manually to `127.0.0.1` before entering it in your browser. In the example from step 5, you + > would change `n-62-20-9` to `12.0.0.1`. If you close your browser, you can reconnnect by entering the URL again. If you lose your internet connection, you can reconnect by repeating steps 5 and 6. -**NOTE:** You can make inline plots in the notebook, but cannot open new windows for plotting. -The closest you can get is by starting the server on a ThinLinc node with X11 forwarding. -This will allow you to have the notebook in your own browser, but new windows will be opened -in ThinLinc. +> **NOTE:** You can make inline plots in the notebook, but cannot open new windows for plotting. +> The closest you can get is by starting the server on a ThinLinc node with X11 forwarding. +> This will allow you to have the notebook in your own browser, but new windows will be opened +> in ThinLinc. -- GitLab