Project title:

Forwarding GADGET to exa-scale


Eduardo Quintana Miranda

Defense Year: 2020-2021

This thesis will focus on one particular code for cosmological simulations named gadget, an acronym that stands for GAlaxies with Dark matter and Gas intEracT, whose lastest public version is gadget-2. Its relevance to the scientific community can be judged by the 3’690 citations (according to the Web of Science) to the paper [Springel V. 2005] that presented it. The gadget code has been publicy available since the beginning, and that has lead to a large number of custom versions by several different groups that developed special features of their own interest. The mainline and the custom codes have been used to perform many of the most advanced stateof-the-art cosmological simulations since almost 20 years, bringing results that were, and still are, at the cuting edge of the research in cosmology. In spite of several efforts in recent years, gadget is still conceived and written as a monolithic code, meaning that:

  • the details of the tree data structure are profoundly and explicitly intertwined in all the parts that rely on the tree itself for their operations;
  • in order to develop any new physical module that needs to interact with fundamental data structures and routines, every developer must add, or modify parts of, code situated in core parts like domain decomposition, tree routines etc—he or she also has to add new variables inside fundamental data structures;
  • a large number of intertwined #ifdef regions are used to switch on and off different features or competing implementations of some algorithm or code section;
  • there is significant code replication, specially in tree-based algorithms and all-to-all communication schemes.

Moreover, the overall code architecture does not allow it to efficiently scale to many thousands of processors when tackling exceptionally challenging problems at the current cutting edge of research. The most representative of those cases are the zoomed-in simulations of very massive single objects. The above points imply that both to maintain and to develop the code are increasingly difficult, as well as implementing different algorithms or experimenting with different implementation for the same algorithms in a clean way. The data layout for particle-related structures may quickly become sub-optimal in many respects due to the almost casual insertion of new variables and the considerable size of the data structures that host each particle’s data. In front of these issues, and of the need of updating the code’s design for the forthcoming exa-scale architectures, a thorough re-design of crucial parts of the code has been undergone by a core team of long-term developers of the code’s mainline.

As a general strategy, the re-design aims to enhance the modularity of the code, so to have a clear separation of different modules that should communicate through well-defined APIs. In turn, this would allow to easily develop, test and adopt different algorithms, or implementations of an algorithm, to solve a given problem. This thesis is part of that effort, focusing from some of its fundamental pillars: the domain decomposition and the tree building (see Chapter 2 for details). It analyzes their current behaviour and weaknesses, and proposes some well-motivated improvements.