Published: May 20, 2025 by Liam Pattinson
Project info
FELTOR (Full-F ELectromagnetic code in TORoidal geometry) is a physics simulation package that uses discontinuous galerkin methods to solve plasma physics problems. As a modular system, it has a large range of potential applications, but it is primarily used to investigate plasma turbulence via gyrofluid equations.
One of the most impressive features of FELTOR is its use of Nvidia’s Thrust library to achieve multithreaded or GPU parallelisation. Combinging this with MPI-based multiprocessing, FELTOR can be efficiently run on a wide range of machines from personal laptops up to the latest GPU-based supercomputers.
Our work on FELTOR was focused on upgrading its build system to make use of
CMake, as it was previously built using a collection of Makefiles that
limited its portability across some systems. Upgrading to CMake also allowed us
to streamline the dependency management of FELTOR, as previously the user was
required to install a number of external libraries to a precise location in
order to compile the project. With the upgrades, these libraries could be
automatically downloaded from GitHub and installed to a local build/
directory, reducing the installation steps to just two instructions on the
command line:
cmake -Bbuild . -DFELTOR_FETCH_DEPS=ON
cmake --build build
In addition, FELTOR’s tests and benchmarks were previously built one-by-one via its Makefiles, and this meant they weren’t always being checked for compatibility with the latest code changes. With CMake, it was easy to define custom targets so that all tests could be built with one command:
cmake --build build --target dg_tests
Combining this with the automatic dependency management, it was then straightforward to add CI jobs to ensure all tests would build correctly across a range of platforms and for all combinations of parallelisation strategies. Following our recommendations, Matthias also upgraded FELTOR’s tests to use the Catch2 testing framework. Previously, the tests would require manual inspection to see if they were passing or failing, but with this upgrade it became possible to run all tests in a CI job (although sadly we weren’t able to set up GPU testing with the GitHub action runners).
Finally, Matthias updated FETLOR’s dependencies to later versions, and has
since made significant further upgrades to the CMake system, including the use
of CPM, a CMake package manager that combines the features of
find_package
and FetchContent
into a single cohesive dependency manager.