In this tutorial, you will run an interactive Anaconda Jupyter notebook environment within on SLURM. Make sure you have opened a FastX terminal and are logged in to the fx1 node.

To run interactive jobs, we have use the srun
command to log in to an interactive job node. You can see what nodes are available using sinfo
:

For GPU tasks, you should use one of the gpu nodes as shown on the left column: either comp7gpu1 or turingvm. You can specify what node to use using the --nodelist=comp7gpu1
parameter in srun
.
For now, we will not request a specific node.
srun --pty --mem=8gb --time=1:00:00 --cpus-per-task=1 --nodes=1 /bin/bash
srun
: Command to submit a job to the Slurm scheduler.--pty
: Allocate a pseudo-terminal for interactive job execution.--mem=8gb
: Request 8 gigabytes of memory for the job.--time=1:00:00
: Set a time limit of 1 hour for the job’s execution.--cpus-per-task=1
: Request 1 CPU core per task.--nodes=1
: Request 1 compute node for the job./bin/bash
: Execute the Bash shell as the job’s command.
You will see that you are logged in to one of the interactive nodes.

Check what modules are installed:
module av
# OR
# module avail

To load the Anaconda environment, type in the following command:
module load anaconda3/py3.9
Now run the following command to load the Jupyter Notebook:
jupyter-notebook
You will see a Jupyter notebook open up in Chromium Browser.

Navigate to your Jupyter notebook that you created previously or create a new one using the “New” button and then clicking on “Python 3 (ipykernel).

Once inside the Jupyter notebook, type Python code in the cells and click the “Run” button to execute the code.
