Enhancing HORMONE: MPI Parallelisation and Workflow Modernisation

Published: July 2, 2024

2024A

Self-gravity is a critical effect in astrophysical hydrodynamic simulations, yet it often becomes a bottleneck for computational efficiency due to the nature of the equations involved. HORMONE, a Godunov-type magnetohydrodynamics code developed by lead researcher Ryosuke Hirai of Monash University, addresses this issue by implementing a novel "hyperbolic" self-gravity solver (Hirai et al. 2016). This significantly enhances computational efficiency by altering the equation to scale linearly with the simulation size.

Prior to the work done by the ADACS team, HORMONE was only parallelised on shared memory with OpenMP, limiting it to run on single compute nodes. This in turn limited the scope of the astrophysical simulations that could be conducted. "One of the research plans was to carry out 3D simulations of the long-term evolution of merger products. Based on a previous test, I estimated a run-time of almost a year on 64 cores to perform the simulation for the desired timescale" said Dr Hirai.

Recognising the need to fully harness the benefits of the hyperbolic self-gravity solver, ADACS in collaboration with Dr Hirai adapted the existing codebase to efficiently distribute computations across multiple compute nodes, thereby overcoming the limitations of shared memory parallelization. The transition to MPI enabled HORMONE to scale effectively, handling much larger and more complex simulations than previously possible. Dr Hirai noted, "Now that HORMONE is capable of utilizing many more cores with MPI, it allows me to compute much higher-resolution, larger-scale, longer-timescale problems that I had hoped to carry out... It should now be possible to compute (the 3D simulations of long-term evolution of merger products) within a month by utilizing more cores. It will also allow me to distribute memory over several cores, enabling higher resolution runs to resolve the gravitational instabilities I aim to study."

Parallel to this, the project also focused on modernizing the development workflow. GitHub Actions were introduced to automate continuous integration (CI), providing a framework for automated testing and validation of code changes. Combined with the introduction of a Feature Branch and Pull Request workflow, this reduces the likelihood of code regression, ensures the stability of the main branch, and allows developers to document and discuss code changes. The testing framework was vital for ensuring that changes made as part of MPI parallelisation did not alter the results of the code.

Reflecting on the workflow improvements, Dr Hirai shared, "My workflow has been drastically transformed. Previously, all changes were directly pushed to my main GitHub branch, essentially using GitHub as just an external storage space. Now with the continuous testing implemented, I am able to catch bugs and errors much more efficiently than before. It is also good to have all the changes documented in the form of Pull Requests and Issues on GitHub so that I can always go back to check why certain changes were implemented. I am now much more comfortable sharing my code to other people, and I have already started collaborating with students in Australia and the US on projects using HORMONE."

Regarding his collaboration with the ADACS developers, Dr Hirai added, "Overall, I had a fantastic time working with the ADACS developers on this project. They were quick, efficient, and very knowledgeable people, and I learned a lot through our interactions. I did not provide much input on the code structure other than basic instructions on how to use it, but they managed to grasp the essential features within the first week and started identifying problems immediately. Not only on the coding side, but their project management and communication skills were very professional. They also responded very swiftly to some emergencies that happened in the process, even though it was not part of the original plan. I would definitely consider applying for a future ADACS project in order to further extend the capability of HORMONE and expand the user base."


Project Image: 3D hydrodynamical simulations of the collision between a new-born neutron star and its binary companion (Hirai & Podsiadlowski 2022).

Project Details

Node: Swinburne University of Technology
Project Length: 12 weeks
Development Team:
  • Conrad Chan
  • David Liptai
Research Scientist: Ryosuke Hirai

Check out some of our other projects.

See all projects.