A benchmark is a particular known and specified workload which can be repeated on different systems and the performance compared.
A typical weather related one is WRF running the CONUS 2.5km configuration.
HPL
LINPACK is a software library for performing numerical linear algebra
LINPACK makes use of the BLAS (Basic Linear Algebra Subprograms) libraries for performing basic vector and matrix operations.
The LINPACK benchmarks appeared initially as part of the LINPACK user’s manual. The parallel LINPACK benchmark implementation called HPL (High Performance Linpack) is used to benchmark and rank supercomputers for the TOP500 list.
Top500 list
Exercise 1
Got to the Top500 site at https://top500.org/
Use the sublist generator to find the largest HPC systems in your country
What is the ratio of Rmax performance between the number 1 system in June 1993 and the June 2026 number 1
Cluster architecture
Before we get to the computing infrastructure there is the underpinning building and plant (power, cooling) required
Cluster architecture
Nodes
The name comes from the terminology of mathematical graphs - nodes and edges.
You can think of a node as a single server - one computer that an instance of an operating system
Login Nodes
These are your entry point on to the cluster
Usually accessable from the outside world.
Often more than one (sometimes multiple login nodes use the same DNS name, e.g . login.hpc.cam.ac.uk)
Shared with multiple users.
DO NOT RUN COMPUTE JOBS ON THE LOGIN NODE
Compute nodes
These are the nodes that do the heavy lifting computing work.
Normally managed by the job scheduler - you don’t usually log in to them directly.
Quite often for the exclusive use of one user for the duration of their job.
N.B. On some clusters compute nodes can be of a different architecture to the login nodes.
Shared storage
Compute nodes sometimes have on node disk storage.
Ther is normally some large storage that is visible to all the compute nodes.
Since this is a shared resource an anti-social user can affect the performance of other users.
Interconnect
Connects the compute nodes, login nodes and storage
Usually faster (higher bandwidth, lower latency) than comoddity ethernet networking.
The scheduler takes requests to run jobs with particular cluster resources, fits these in around other user’s jobs according to some policy, launches the job, terminates the job if it is overrunning, does accounting.
Examples:
PBSpro
Platform LSF
Flux
Slurm (today, on CSD3)
Job Scripts
A shell script with shell comments that are directives to the sheduler about how the jobs should be run
Can you predict what the output will be with 4 threads?
Note
To change the number of threads we need to set environment variable OMP_NUM_THREADS e.g., export OMP_NUM_THREADS=1
Exercise 7
Build the OpenMP hello world
Run with varying numbers of threads
hello OpenMP
What happens when we run the following code?
$ gcc -fopenmp-O3 hello.c -o hello.exe$ ./hello.exehello from process 1hello from process 3hello from process 0hello from process 2
OpenMP Scaling
Try running the pi.c example (in directory example-code/)
To compile pi.c use command:
cd example-codegcc-fopenmp-O3 pi.c -o pi.exe
What might be causing this?
The problem is “pleasingly parallel”
Process pinning
NUMA
Non-unifrom memory architecture
Differing latencies from cores to main memory
First touch placement policy.
ls-topo
programming HPC
distributed (multi-node)
MPI (Message Passing Interface)
One of the most common methods of distributed compute
Distributed memory multiprocessing programming model
Implementations (openMPI, MPICH, Intel MPI)
MPI Hello World
#include <mpi.h>#include <stdio.h>int main(int argc,char** argv){// Initialize the MPI environment MPI_Init(argc, argv);// Get the number of processesint world_size; MPI_Comm_size(MPI_COMM_WORLD,&world_size);// Get the rank of the processint world_rank; MPI_Comm_rank(MPI_COMM_WORLD,&world_rank);// Get the name of the processorchar processor_name[MPI_MAX_PROCESSOR_NAME];int name_len; MPI_Get_processor_name(processor_name,&name_len);// Print off a hello world message printf("Hello world from processor %s, rank %d out of %d processors\n", processor_name, world_rank, world_size);// Finalize the MPI environment. MPI_Finalize();}
Building MPI Programs
Build:
mpicc mpi-hello.c -o mpi-hello.exe
Run a small test on login node:
mpiexec -np 4 ./mpi-hello.exe
Exercise 8
Build mpi-hello.c
Write a job script to run on 2 nodes, 3 cores per node
(-np would be 2*3 = 6)
programming HPC
GPU offloading
There are a range of GPU offloading programming models
We introduce a small simple OpenMP example. Precisely, we introduce dense-Matrix vector multiplication example, where we implement element wise multiplication.
We consider parallelization across row indices using multiple threads.
Compilation step (Notice the use of scorep-g++ instead of g++)