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 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, summarize 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.
翻译:数值模拟已成为天体物理与宇宙学各领域理论研究者不可或缺的关键工具之一。因此,开发适配现有最大规模计算系统、并利用最先进数值方法与算法的新一代工具至关重要。本文介绍了完全开源的、高度并行、灵活且模块化的耦合流体动力学、引力、宇宙学及星系形成代码Swift。该软件包采用基于混合任务并行、异步通信以及基于工作负载(而非数据)均衡的区域分解算法,以高效利用现代高性能计算集群架构。引力求解采用快速多极子方法,并可选配傅里叶空间粒子网格求解器处理周期边界条件。在气体演化方面,实现了多种现代光滑粒子流体动力学方案。Swift还利用基于粒子的前沿方法演化中微子。代码同时发布了两种互为补充的星系形成亚网格模型网络及行星物理模拟扩展模块。软件提供丰富的输出选项,包括快照、光锥、功率谱以及与结构识别程序的耦合接口。本文描述了整体代码架构,总结了所执行的一致性与精度测试,并通过一个包含约3000亿粒子的代表性宇宙流体动力学算例展示了代码优异的弱扩展性。代码随附详尽的使用与开发文档、大量示例测试问题及辅助分析大规模模拟结果的工具套件,已向社区公开发布。