This repo is a fork of the Official HPCG Benchmark repo. Here, we implement the HPCG benchmark using the C++ stdpar and experimental NVIDIA stdexec libraries. The stdpar library provides functions such as std::for_each and std::transform_reduce which allow common patterns of computation to be performed in parallel. The stdexec library introduces the abstractions of senders and receivers which allow the construction and execution of asynchronous task graphs. Within such graphs parallel computations may be performed using sender adaptors such as stdexec::bulk and stdexec::then.
Our HPCG implementations parallelise the symmetric Gauss-Seidel kernel using a simple multi-colouring approach with eight colours. Further, the implementations are capable of compilation for both CPU and GPU targets using the NVIDIA nvc++ compiler.
All source code is within the src folder. Files associated with the stdpar implementation are suffixed with _stdpar whereas those associated with stdexec are suffixed _stdexec. An accompanying masters thesis for this project is located in the abhalerao_thesis folder.
To run and build the code the following are required:
- Linux installation (since
nvc++compiler only supports Linux) nvc++compiler version 23.3+- MPI installation
Since nvc++ compiler is only available for Linux, these instructions only apply to Linux-based systems. Compilation steps to produce and run the xhpcg executable are:
-
Clone the GitHub repo (using
--recursiveto also clone thestdexecsubmodule):
git clone --recursive https://github.com/ab2163/hpcg -
Install NVIDIA
nvc++compiler and an MPI implementation. -
Modify the
Make.brisfile within thesetupsubdirectory of the repo such that:- The
CXXvariable points to the correct location of thenvc++compiler e.g.:CXX = /opt/nvidia/hpc_sdk/Linux_x86_64/2025/compilers/bin/nvc++ - The
MPincandMPlibvariables point to theincludeandlibdirectories of the MPI installation e.g.:MPinc = -I/usr/lib/x86_64-linux-gnu/openmpi/include MPlib = /usr/lib/x86_64-linux-gnu/openmpi/lib
- In
CXXFLAGS, the include path for thestdexec/includefolder within the HPCG repo is correctly set e.g.:CXXFLAGS = ... -I/root/hpcg/stdexec/include
- The
-
Change the relevant line in
bris_build.sh(which calls theconfigurefile within the HPCG repo) to match the location of theconfigurefile on the system e.g.:/root/hpcg/configure bris
-
Run one of the commands below to build the code:
Code Implementation Build Command Baseline bris_build.sh baselineBaseline with Parallel SYMGS bris_build.sh baseline_parstdpar(CPU execution)bris_build.sh stdpar_cpustdpar(GPU execution)bris_build.sh stdpar_gpustdexec(CPU execution)bris_build.sh stdexec_cpustdexec(GPU execution)bris_build.sh stdexec_gpu -
Adjust the environment variables in
bris_run.sh:OMP_NUM_THREADSshould equal the number of available hardware coresOMP_PROC_BIND=spreadOMP_PLACES=coresforstdexecimplementation andOMP_PLACES=threadsotherwise
-
Adjust the HPCG problem size in the
hpcg.datfile within thebuild/binfolder. -
Run the
bris_run.shscript, after which an output file will be produced in thebuild/binfolder containing the benchmark results. -
To remove all files generated during building and execution of the program, run
bris_clean.sh.
Thanks to Dr Tom Deakin and the University of Bristol HPC team for their support.