Abstract
Simulating plasma dynamics in tokamaks is a critical task for the development of fusion energy, yet it presents immense computational challenges due to the extreme spatial anisotropy of the plasma. This paper introduces a scalable, toroidal semi-coarsening geometric multigrid (MG) solver for the M3D-C1 fusion code. By leveraging the PETSc framework and optimizing for GPU architectures, the authors demonstrate significant performance improvements in the "velocity solve" phase of implicit time-stepping simulations. Results from high-fidelity SPARC disruption simulations show that the MG solver provides superior scaling and stability compared to traditional Block Jacobi methods.
Introduction
The development of fusion reactors like the upcoming SPARC device relies heavily on accurate Magnetohydrodynamic (MHD) simulations. Tokamaks, which use magnetic fields to confine plasma in a toroidal shape, exhibit highly anisotropic physics: plasma behavior is much smoother along the toroidal magnetic field lines than in the poloidal cross-section. Existing simulation codes, such as M3D-C1, utilize high-order finite elements to capture this complexity. However, as these simulations scale to higher resolutions with more toroidal planes, traditional linear solvers like Block Jacobi become a major bottleneck. This work specifically targets the velocity solve, the most computationally expensive component of these simulations, to enable faster and more detailed fusion modeling.
Methodology
The authors implemented a toroidal semi-coarsening geometric multigrid (MG) solver designed to exploit the specific structure of tokamak geometry.
Toroidal Semi-Coarsening
Since the toroidal direction in M3D-C1 uses a regular grid, the solver applies multigrid coarsening exclusively in that direction (1D semi-coarsening). To avoid the prohibitive cost of re-computing the Jacobian matrix on coarse grids, an algebraic Galerkin construction is used to automatically generate coarse-level operators from the fine-level math.
GPU-Optimized Smoothing
To eliminate high-frequency errors, the solver employs Point Block Jacobi (PBJ) smoothers. PBJ is particularly well-suited for GPU acceleration as it involves numerous small, dense matrix inversions—a workload that aligns perfectly with the parallel processing capabilities of modern GPUs.
PETSc Integration
The solver is built into the Portable, Extensible Toolkit for Scientific Computation (PETSc). It utilizes the FieldSplit preconditioner to manage the different physical variables (plasma waves) within the system. To prevent communication bottlenecks during the coarsest solve, the problem is solved redundantly across multiple processors at the bottom of the multigrid hierarchy.
Experimental Setup
The solver's performance was evaluated using a high-fidelity simulation of a SPARC disruption scenario, specifically a thermal quench leading to runaway electron generation.
Benchmarks were conducted on the Perlmutter supercomputer at NERSC, using configurations ranging from 4 to 64 toroidal planes. Each plane contained approximately 14,200 vertices, resulting in over 500,000 equations per plane. The hardware setup included both AMD CPUs and NVIDIA A100 GPUs.
Results and Discussion
The MG solver demonstrated clear advantages over the standard production Block Jacobi (BJ) solver in terms of both scaling and raw speed.
Solver Performance and Scaling
As the number of toroidal planes increased, the MG solver maintained high efficiency. In a 64-plane test case, the MG solver completed the velocity solve in 825 seconds, whereas the Block Jacobi solver required 1,704 seconds—representing a speedup of more than 2x. Furthermore, the MG solver exhibited remarkable iteration stability; the number of iterations required for convergence remained nearly constant, while the BJ solver's iteration count grew significantly with problem size.
GPU Efficiency
The implementation showed strong scaling on NVIDIA A100 GPUs. Notably, the setup phase for the multigrid hierarchy was found to be 5x faster on GPUs than on CPUs, primarily due to efficient GPU-based matrix triple products.
Conclusion
This work represents a significant advancement in the application of multigrid methods to fusion plasma simulations. By exploiting the inherent anisotropy of the tokamak and leveraging GPU-optimized algorithms within PETSc, the authors have developed a solver that significantly outperforms traditional methods. Future research will focus on extending these techniques to the unstructured poloidal plane to create a full 3D multigrid solver and exploring higher-order interpolation methods to further enhance convergence.
Summary updated