Preliminary Work on PHANTOM Code: Setting Up Testing Framework and Performance Profiling

Published: Dec. 18, 2021

2021B

PHANTOM is a publicly available smoothed particle hydrodynamics and magnetohydrodynamics code for astrophysics, developed by Prof. Daniel Price’s research group at Monash University. It features implementations of hydrodynamics, magnetohydrodynamics, self-gravity, sink particles, general relativistic hydrodynamics, radiation hydrodynamics, multiple species dust-gas hydrodynamics, and more. While the science team continually strives to enhance the code’s capabilities with a focus on scientific applications, less scientific aspects like improving MPI scaling often receive lower priority compared to physics improvements.

The primary aim of this project was to scope out the necessary work to improve the MPI scaling of the PHANTOM code. Achieving this required the development of an extensive testing framework to verify results throughout code changes, and profiling to establish a performance baseline for future optimisations.

A key achievement of this project was transitioning the entire PHANTOM test suite to the GitHub Actions Continuous Integration framework. This transition integrates testing processes into the developers’ Pull Request workflow. Now, every proposed code change undergoes automatic testing, ensuring new contributions maintain the code’s integrity and functionality.

To support the rigorous testing demands, custom GitHub runners were deployed. These runners, supported by the Swinburne Openstack cluster, execute the test suite and benchmarks. A dedicated web server was set up to host PHANTOM data files and display nightly build and benchmarking results. This server serves as a centralised location for accessing essential data and tracking the performance and stability of the PHANTOM code through regular updates.

During the project, several critical issues in the existing PHANTOM code were identified and resolved. These issues, previously unknown, caused incorrect results when running in MPI mode. Resolving these issues was crucial for conducting accurate scaling tests and ensuring the code’s reliability in parallel computing environments. Leveraging their extensive experience with developing and debugging scientific codes, ADACS developers effectively handled these issues and contributed changes back to the main codebase, benefiting all PHANTOM users.

Comprehensive scaling tests were conducted on the OzSTAR and Gadi supercomputers, using hybrid OpenMP and MPI configurations. These tests evaluated the performance and scalability of the PHANTOM code, providing valuable insights for future optimisations and improvements.

This preliminary work sets a foundation for future efforts to optimise the PHANTOM code. By establishing a robust testing framework and addressing critical issues, the project has created a performance baseline that will guide further enhancements.


Project Image: PHANTOM logo.

Project Details

Project Length: 6 weeks
Development Team:
  • Conrad Chan (project lead)
  • David Liptai
  • Ray Seikel
Research Scientist: Daniel Price

Check out some of our other projects.

See all projects.