Setting Up Programming Environment

This module does not include any hands-on programming exercises, so participants are not required to install any software packages or libraries on their personal computers. The material is entirely conceptual and can be followed without a programming environment. However, for instructors who would like to complement the lecture with live code demonstrations, we provide a simple procedure for logging in to the LUMI HPC cluster, preparing the software environment, and submitting example jobs. These optional instructions can be used to illustrate the concepts discussed in the module using a real high-performance computing system.

Login to LUMI Cluster

Follow practical instructions HERE to get your access to LUMI cluster.

  • On Step 5, you can login to LUMI cluster through terminal using SSH.

  • On Step 6, you can login to LUMI cluster from the web-interface.

Running Jobs on LUMI Cluster

To launch an interactive job requesting 1 compute node, 1 GPU, and a 1-hour allocation, run the following command.

$ salloc -A project_465001310 -N 1 -t 1:00:00 -p standard-g --gpus-per-node=1
$ srun <some-command>

Note

When you have finished your interactive session, type exit to release the allocated resources.

Once the job starts, you will be connected to an interactive terminal session on the compute node:

$ srun --account=project_465001310 --partition=standard-g --nodes=1 --cpus-per-task=1 --ntasks-per-node=1 --gpus-per-node=1 --time=1:00:00 --pty bash
$ <some-command>

You can also submit your job as a batch job using the submission script submit.sh:

#!/bin/bash -l
#SBATCH --account=project_465001310
#SBATCH --job-name=example-job
#SBATCH --output=examplejob.o%j
#SBATCH --error=examplejob.e%j
#SBATCH --partition=standard-g
#SBATCH --nodes=1
#SBATCH --gpus-per-node=1
#SBATCH --ntasks-per-node=1
#SBATCH --time=1:00:00

srun <some_command> 

Some commonly used SLURM commands are listed below:

  • Submit a batch job: sbatch submit.sh

  • Monitor your jobs: squeue --me

  • Cancel a job: scancel <JOB_ID>