CSC 5001– High Performance Systems

Portail informatique

Software configuration

During this course, you will use a cluster of computer to run experiments. This platform is managed by Albator.

SSH configuration

You will have to connect to the starfighter cluster using ssh. By default ssh requires you to type your password whenever you connect to a machine, which is cumbersome when running MPI application. Instead, we will use ssh keys that allow to connect to a machine without typing your password.

Creating an ssh key

First, you need an ssh key. If you don't have one, generate it with:

$ ssh-keygen$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/student/.ssh/id_rsa): Created directory '/home/student/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/student/.ssh/id_rsa Your public key has been saved in /home/student/.ssh/id_rsa.pub The key fingerprint is: SHA256:9a0YRBGllulLZFnbb+nRycVZRIxJbItVoq9/fQYIGcM student@9b380233fc88 The key's randomart image is: +---[RSA 3072]----+ | .++oooB=| | .E* +*o+| | @+o+.oo| | Bo..oo.=| | S +...o=+| | . +.oo..| | o o o.| | . =| | .o.| +----[SHA256]-----+

This generates a pair of ssh keys that consist of:

  • /home/student/.ssh/id_rsa: a private key (that you should never share !)
  • /home/student/.ssh/id_rsa.pub: a public key (that you can share)

ssh config

The lab machines are only accessible from the TSP network. To connect directly to one of the lab machines, set up a SSH proxy jump. Add the following lines to the file $HOME/.ssh/config (you may need to create this file).
ServerAliveInterval 300 SendEnv LANG LC_* Host * ForwardAgent yes ForwardX11 yes ForwardX11Trusted yes Host tsp User trahay_f Hostname ssh1.imtbs-tsp.eu Host arcadia-slurm-controller HostName 157.159.104.128 User trahay_f ProxyJump tsp
Of course, you have to replace trahay_f with your TSP login. Now, you should be able to connect to the cluster frontend by running ssh arcadia-slurm-controller. If the machine asks for your password, you should copy your ssh public key with the following command:
$ ssh-copy-id arcadia-slurm-controller /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/student/.ssh/id_rsa.pub" /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys trahay_f@ssh1.imtbs-tsp.eu's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'arcadia-slurm-controller'" and check to make sure that only the key(s) you wanted were added.
The IP address of the frontend node may have changed. If you cannot connect to it, take a look at Albator's connection webpage.

Slurm

In order to arbitrate access of many students to the computing resources, we use the SLURM job scheduler. This allows you to run a program on a set of computing resource without being disturbed by other students.

My first slurm job

To submit a slurm job, you first need to connect to arcadia-slurm-controller:

[MyLaptop] $ arcadia-slurm-controller [arcadia-slurm-controller] $

You can now run the hostname command through slurm by running:

[arcadia-slurm-controller] $ srun --account=csc_5001 --partition=starfighter --time=00:10:00 --cpus-per-task=8 hostname starfighter-slurm-node-01-1

The srun command asks slurm to allocate computing resources and run a command. In this example, we srun with several parameters:

  • --account=csc_5001 is used so that the cluster admimnistrators know the resource usage of the different groups of students
  • --partition=starfighter asks for computing resources on the starfighter cluster
  • --time=00:10:00 specifies the duration of the job (10 minutes). If the command takes more than this duration, it will be automatically killed by Slurm
  • --cpus-per-task=8 specify the number of requested CPUs
  • hostname is the command to run on the allocated computing resource. This command simply prints the hostname of the machine

You may specify other options to srun, including:

  • -o output_file redirects the command stdout to a file
  • -N 5 asks for 5 different compute node (useful for running MPI programs)
  • -n 20 runs 20 differents processes (useful for running MPI programs)
  • --pty bash requests an interactive shell (useful for debugging !)
  • -gres=gpu:1 ask for a GPU