Accelerated Spectral code for TuRbulent plAsmas
Astra is a modern, high-performance spectral code designed for the simulation of turbulent plasmas. It serves as an accelerated and modernized evolution of the Snoopy code, using an input file format and internal structure similar to the Idefix code.
By leveraging modern C++ abstraction layers, Astra achieves performance portability across a wide range of high-performance computing architectures without compromising the numerical accuracy established by its predecessor.
The full documentation is automatically generated and available on GitHub Pages.
- Performance Portability: Built on top of Kokkos, allowing a single codebase to run efficiently on multicore CPUs and various GPU architectures.
- Spectral Solver: Utilizes Kokkos-fft to handle Fast Fourier Transforms across different hardware backends.
- Parallelization: Supports distributed memory parallelism via MPI utilizing a 1D slab decomposition strategy. No MPI support is required from the FFT library.
Thanks to the integration of Kokkos and Kokkos-fft, Astra supports the following hardware configurations:
- CPU: Parallel execution via OpenMP/Threads with FFTs handled by FFTW.
- Nvidia GPUs: Accelerated execution via CUDA with FFTs handled by cuFFT.
- AMD GPUs: Accelerated execution via HIP/ROCm with FFTs handled by rocFFT.
- CMake (3.16+)
- C++ Compiler (supporting C++20 or higher)
- Backend specific libraries:
- CPU: FFTW3
- Nvidia: CUDA Toolkit (cuFFT)
- AMD: ROCm (rocFFT)
- Optional: GPU-aware MPI Implementation (OpenMPI, MPICH, etc.)
It is recommended to directly clone Astra and its submodules (Kokkos and Kokkos-fft) from GitHub. In the directory of your choice:
git clone --recurse-submodules https://github.com/glesur/astra.git astra
cd astraAstra utilizes CMake for its build system. It is recommended to configure the build in a dedicated directory to keep the source tree clean.
-
Create a build directory:
mkdir build cd build -
Configure the project using CMake. Select the command below that matches your target hardware. Note that MPI is optional, and the associated option can be omitted to run in serial.
Option A: CPU (FFTW)
cmake .. -DAstra_MPI=ON
Option B: Nvidia GPU (CUDA + cuFFT)
cmake .. \ -DKokkos_ENABLE_CUDA=ON \ -DKokkos_ARCH_VOLTA70=ON \ # Change architecture flag as needed (e.g., AMPERE80) -DAstra_MPI=ONOption C: AMD GPU (ROCm + rocFFT)
cmake .. \ -DKokkos_ENABLE_HIP=ON \ -DAstra_MPI=ON -
Compile the code:
make -j
Once compiled, the executable can be run directly (without mpi) or using standard MPI launchers (mpirun). For example, to run on 4 processes:
mpirun -np 4 ./astra -i ../problem/hydro_turbulence.iniFor information regarding the original algorithm and physics, please refer to the original Snoopy code website.