[Paper Review] SWIFT: Maintaining weak-scalability with a dynamic range of $10^4$ in time-step size to harness extreme adaptivity
This paper presents SWIFT, a cosmological simulation code that achieves near-perfect weak-scaling across 4096 cores by combining adaptive mesh refinement, task-based parallelism with SIMD vectorization, and METIS-based domain decomposition. It maintains a 10⁴ dynamic range in time-step size, enabling extreme temporal adaptivity while delivering over 30x speedup over Gadget-2 and minimal performance loss during scaling.
Cosmological simulations require the use of a multiple time-stepping scheme. Without such a scheme, cosmological simulations would be impossible due to their high level of dynamic range; over eleven orders of magnitude in density. Such a large dynamic range leads to a range of over four orders of magnitude in time-step, which presents a significant load-balancing challenge. In this work, the extreme adaptivity that cosmological simulations present is tackled in three main ways through the use of the code SWIFT. First, an adaptive mesh is used to ensure that only the relevant particles are interacted in a given time-step. Second, task-based parallelism is used to ensure efficient load-balancing within a single node, using pthreads and SIMD vectorisation. Finally, a domain decomposition strategy is presented, using the graph domain decomposition library METIS, that bisects the work that must be performed by the simulation between nodes using MPI. These three strategies are shown to give SWIFT near-perfect weak-scaling characteristics, only losing 25% performance when scaling from 1 to 4096 cores on a representative problem, whilst being more than 30x faster than the de-facto standard Gadget-2 code.
Motivation & Objective
- Address the challenge of weak-scaling in cosmological simulations with extreme dynamic range in density and time-step size.
- Overcome load-balancing issues caused by a 10⁴ dynamic range in time-step sizes due to the Courant-Friedrichs-Lewy (CFL) condition.
- Develop a simulation framework that maintains high performance and scalability despite highly adaptive particle time-steps and non-uniform workloads.
- Enable efficient use of modern HPC architectures by integrating asynchronous communication and work-based decomposition.
- Provide a high-performance, open-source alternative to Gadget-2 for cosmological simulations with superior time-to-solution and weak-scaling characteristics.
Proposed method
- Employ an adaptive mesh to limit particle interactions to only relevant neighbors, reducing computational cost per time-step.
- Use task-based parallelism with pthreads and SIMD vectorization to balance work efficiently within a single node.
- Implement a METIS-based graph domain decomposition strategy that partitions computational work rather than particles, improving load balance across MPI nodes.
- Apply the CFL condition to determine local time-steps: Δtᵢ ∝ uᵢ⁻¹ᐟ²ρᵢ⁻¹ᐟ³, ensuring smaller steps for denser, hotter regions.
- Only drift and kick active particles at each time-step using a pseudo-Verlet list built on the adaptive mesh, minimizing redundant computation.
- Use a work-cost model in domain decomposition to ensure balanced work distribution, especially critical for highly adaptive time-stepping.
Experimental results
Research questions
- RQ1How can weak-scaling be maintained in cosmological simulations with a 10⁴ dynamic range in time-step size?
- RQ2What domain decomposition strategy best balances work in simulations with highly non-uniform particle activity and time-step distribution?
- RQ3Can task-based parallelism and SIMD vectorization effectively manage load imbalance in adaptive time-stepping simulations?
- RQ4How does the performance of SWIFT compare to the de-facto standard Gadget-2 in terms of time-to-solution and weak-scaling?
- RQ5To what extent does using an adaptive mesh and work-based decomposition reduce computational overhead in adaptive cosmological simulations?
Key findings
- SWIFT achieves near-perfect weak-scaling, losing only 25% of performance when scaling from 1 to 4096 cores on a representative cosmological problem.
- On 4096 cores with 25×10⁹ particles, SWIFT achieves 2.4×10⁻⁵ seconds per update per core, demonstrating high efficiency at scale.
- SWIFT is more than 30x faster than Gadget-2 in SPH-only mode, significantly reducing time-to-solution for adaptive cosmological simulations.
- The use of METIS-based domain decomposition reduces communication overhead and balances work, especially for particles on small time-steps.
- The adaptive mesh and task-based scheme reduce computation by only processing active particles, improving efficiency despite complex time-step hierarchies.
- Performance remains stable across different core counts, with only a slight increase in time-per-update from 1 core (5.8×10⁻⁶ s) to 32 cores (7.1×10⁻⁶ s), indicating excellent load balancing.
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.