[Paper Review] SWIFT: A modern highly-parallel gravity and smoothed particle hydrodynamics solver for astrophysical and cosmological applications
SWIFT is a fully open-source, highly parallel, task-based astrophysical simulation code that combines gravity, smoothed particle hydrodynamics (SPH), and cosmological physics using hybrid shared- and distributed-memory parallelism. It achieves excellent weak scaling on cosmological simulations with ~300 billion particles using fast-multipole and particle-mesh gravity solvers, multiple SPH variants, and modular sub-grid models for galaxy formation and planetary physics.
Numerical simulations have become one of the key tools used by theorists in all the fields of astrophysics and cosmology. The development of modern tools that target the largest existing computing systems and exploit state-of-the-art numerical methods and algorithms is thus crucial. In this paper, we introduce the fully open-source highly-parallel, versatile, and modular coupled hydrodynamics, gravity, cosmology, and galaxy-formation code SWIFT. The software package exploits hybrid shared- and distributed-memory task-based parallelism, asynchronous communications, and domain-decomposition algorithms based on balancing the workload, rather than the data, to efficiently exploit modern high-performance computing cluster architectures. Gravity is solved for using a fast-multipole-method, optionally coupled to a particle mesh solver in Fourier space to handle periodic volumes. For gas evolution, multiple modern flavours of Smoothed Particle Hydrodynamics are implemented. SWIFT also evolves neutrinos using a state-of-the-art particle-based method. Two complementary networks of sub-grid models for galaxy formation as well as extensions to simulate planetary physics are also released as part of the code. An extensive set of output options, including snapshots, light-cones, power spectra, and a coupling to structure finders are also included. We describe the overall code architecture, summarise the consistency and accuracy tests that were performed, and demonstrate the excellent weak-scaling performance of the code using a representative cosmological hydrodynamical problem with $\approx$$300$ billion particles. The code is released to the community alongside extensive documentation for both users and developers, a large selection of example test problems, and a suite of tools to aid in the analysis of large simulations run with SWIFT.
Motivation & Objective
- To develop a scalable, modular, and open-source simulation code for large-scale astrophysical and cosmological problems.
- To enable efficient use of modern high-performance computing architectures through task-based parallelism and workload-balanced domain decomposition.
- To support accurate and flexible modeling of gravity, hydrodynamics, neutrinos, and galaxy formation with extensible sub-grid physics.
- To facilitate reproducibility and community collaboration through public release, extensive documentation, and shared example problems.
Proposed method
- Employs hybrid shared- and distributed-memory task-based parallelism with asynchronous communication to scale efficiently on modern HPC clusters.
- Uses the fast-multipole method (FMM) for gravity, optionally coupled with a Fourier-space particle-mesh solver for periodic boundary conditions.
- Implements multiple modern SPH variants, including Sphenix, for accurate gas dynamics in astrophysical environments.
- Evolved neutrinos via a state-of-the-art particle-based method to model their impact on large-scale structure.
- Integrates two complementary sub-grid models for galaxy formation and supports extensions for planetary system physics.
- Supports diverse output formats including snapshots, light-cones, power spectra, and integration with structure finders for analysis.
Experimental results
Research questions
- RQ1How can a highly scalable, modular, and open-source simulation code be designed to handle the complexity of modern cosmological and astrophysical problems?
- RQ2What parallelization strategies enable optimal performance on modern CPU-based HPC systems for simulations with hundreds of billions of particles?
- RQ3How can multiple numerical methods—gravity, SPH, neutrino dynamics, and galaxy formation models—be efficiently coupled within a single, extensible framework?
- RQ4What performance and accuracy benchmarks can be achieved for large-scale cosmological hydrodynamics using this code?
- RQ5How can the code support reproducibility and community-driven development in computational astrophysics?
Key findings
- SWIFT achieves excellent weak-scaling performance on a cosmological hydrodynamical problem with approximately 300 billion particles, demonstrating scalability across large compute clusters.
- The code successfully integrates multiple SPH variants, including the Sphenix scheme, and supports advanced gravity solvers combining FMM and particle-mesh methods for periodic volumes.
- Neutrino evolution is accurately modeled using a particle-based approach, enabling inclusion of their cosmological effects in large-scale structure simulations.
- The modular design allows seamless integration of galaxy formation sub-grid models, with two complementary networks released alongside the core code.
- The code is publicly released with comprehensive documentation, example problems, and analysis tools, supporting reproducibility and community contributions.
- Extensive consistency and accuracy tests confirm the reliability of the numerical methods across a range of astrophysical test problems.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.