Abstract
The ExaStar project aims to deliver an efficient, versatile, and portable software ecosystem for multi-physics astrophysics simulations run on exascale machines. The code suite is a component-based multi-physics toolkit, built on the capabilities of current simulation codes (in particular
Keywords
1. Introduction
The creation of the chemical elements of which our planet, and ourselves, are made links our existence to the lives and deaths of stars. The abundance patterns of the elements, which have accumulated gradually over nearly 14 billion years of cosmic time, reveal both the physics of stars and of atomic nuclei. Nearly a century after it was suggested that stars could be powered by the transmutation of nuclei, our understanding of this chemical evolution has matured greatly. Yet fundamental questions remain, chief among them: What is the source of the heaviest elements? These questions are the primary focus of the Exascale Computing Project (ECP) ExaStar application development project.
On the basis of fundamental nuclear physics and observed cosmic abundances (Burbidge et al., 1957; Cameron 1957), we know that roughly half of the isotopes heavier than iron were formed via a slow neutron capture process (the s-process) with most of the remaining half due to a rapid neutron capture process (the r-process), and with a scattering of rarer isotopes ascribed to what was originally thought to be a proton capture process (the p-process). We have considerable confidence that the s-process occurs within the stable burning shells of giant stars (Käppeler et al., 2011). In contrast, our incomplete understanding of the r- and p-processes represents one of the long-standing open problems in physics; addressing it requires new experimental measurements of highly radioactive isotopes coupled to mature computational models of the potential astrophysical sites.
Production of the observed pattern of r-process nuclei requires an explosive event that ejects high-entropy and neutron-rich material on a timescale of seconds. The appearance of r-process elements in the spectra of extremely old stars indicates that these elements began forming very early in Galactic history. This suggests that the r-process occurs during the death throes of short-lived, massive stars (Argast et al., 2004). These and other observations (Wasserburg et al., 1996) further suggest that the production site of lighter r-process species (mass number A < 125) is distinct from that of the main r-process (130 < A < 195).
Several astrophysical environments are suspected to produce the conditions needed for r-process nucleosynthesis. The most prominent scenarios are: (1) the collapse of oxygen/neon/magnesium or iron stellar cores, with their associated supernovae; (2) the decompression of nuclear matter ejected during the violent merger of two neutron stars (or a neutron star and a black hole); and (3) the winds from gaseous disks accreting onto black holes formed in failed supernovae or neutron star mergers. The extremes of density, velocities, and temperature realized in these environments also give rise to a rich set of other observables, including high-energy photons, neutrinos, and gravitational waves.
Simulations of each of these scenarios with quantitative physical fidelity rely on similar toolkits: magnetohydrodynamics (MHD), thermonuclear kinetics, the equation of state (EoS) of nuclear matter, radiation transport of neutrinos and photons, and a general relativistic description of gravity. Current models that rely on approximations to all of this physics already tax petascale architectures. To overcome these approximations and to perform definitive simulations at the exascale will require improved radiation transport solver technologies, elliptic and hyperbolic solvers for gravity, and techniques for load balancing multi-physics applications on a dynamically adaptive hierarchical mesh. In addition, a comprehensive suite of new physics implementations is needed, designed to take maximal advantage of hybrid multi-core and many-core architectures.
A comparison of the typical parameters that characterize the current state of the art for supernova simulation on petascale platforms and the ExaStar targets for our exascale challenge problem. Note that the neutrino phase-space resolution remains constant between the petascale and exascale, as the current resolution has been shown to be adequate for correct results.
aThe implementation of a full GR solver is a stretch goal for our development effort and is not discussed in this article.
ExaStar’s approach to attack this challenge includes substantially increasing the capabilities of two widely used stellar astrophysics codes:
2. Code descriptions
2.1. Flash-X
Weak scaling analysis on Summit of 
2.2. AMReX
In
AMR is a particularly salient capability of
3. Physics modules
3.1. Nuclear burning
We use
3.1.1. Methods
The fully implicit nature of
This is done using the Newton–Raphson method, based on the Taylor series expansion of
N
A
is Avogadro’s number, λ
j
is the decay-rate, and ⟨j, k⟩ and ⟨j, k, l⟩ are cross-sections for two- and three-body reactions, respectively.
Each Newton–Raphson iteration requires computing the full set of abundance derivatives, calculating all reaction rates, evaluating the Jacobian, evaluating the right-hand side, and then performing one LU decomposition (
Traditionally, a simple backward Euler (BE) integration has proven to be the most computationally efficient choice, so long as the time being evolved by the network is limited to less than 10−4 seconds such that the benefit of larger step-sizes from higher-order integration methods is not realized since the burning module takes many sub-timesteps (burning timesteps) to evolve through a single hydrodynamic (global) timestep.
Motivated by the results of Longland et al. (2014), we can now use an implicit ODE solver in
3.1.2. Parallelization strategy
Within the burning module there is a set of nested do loops used to iterate over the grid zones within all blocks local to an MPI rank. Without any threading, each iteration of this loop structure sends a single zone of thermodynamic (temperature and density) and composition (mass fractions of all species) data to the burner. Inside the burner, these data are used to build a system of ODEs representing the evolution of the N
s
species. The solution of this system gives the updated composition and nuclear energy release for the zone. To reduce the time spent computing the nuclear kinetics (and so the overall simulation time), we apply
In order to take advantage of GPUs, we primarily rely on optimized batched linear algebra libraries. The batched library calls are used to solve multiple systems of ODEs (i.e., burn multiple zones) in parallel on the GPU. For each model, we initialize our simulations by allocating (for each thread) memory on the host and pinning it to a corresponding memory allocation on the GPU (pinned memory is required to allow asynchronous data transfers). This block of memory is allocated for the data structure that holds the batched thermodynamic and composition data sent to the burner each hydrodynamic timestep which includes the
When simulating stellar explosions, there is often a natural load imbalance imposed by the presence of a burning front moving through the stellar material. This process of load balancing is particularly important for nuclear burning because of there is a high degree of variability in the computational cost that is very sensitive to initial conditions. However, the mechanism we use to weight the space-filling curve is generalizable to other physics modules and provided by the AMR framework. Burning that occurs within the front takes many more sub-timesteps than burning that occurs behind it or ahead of it (where no burning occurs). Therefore, if one MPI rank is assigned several blocks where a significant amount of burning takes place and another MPI rank is assigned only blocks where no burning occurs, then a load imbalance will be present. To improve this load balancing, we weight each block based on the average number of burning timesteps taken by any zone within it. By doing so, MPI ranks assigned blocks with many burning timesteps are given fewer total blocks to compute.
For large numbers of MPI ranks, we must balance improved homogeneity in the burning cost with increased communication costs related to guardcell filling (the process of getting the values for halo cells surrounding computational domain in stencil computations) required by hydrodynamics and shock detection. By heavily weighting the block redistribution using the total sum of sub-timesteps required per block, we can reduce the load imbalance of the burning even further, but this results in a much more expensive simulation due to the additional incurred communication. On Summit, we find weighting each block by the average number of burning timesteps required per batch (i.e., the maximum number of timesteps for any cell within the batch) results in better overall load balance than other measures.
3.1.3. Example simulation
With the goal of understanding the observable impacts of the central engine and convective mixing on CCSN ejecta, we have taken a 3D model of the central engine for a 9.6 M⊙ progenitor star evolved by the
In addition to hydrodynamics, self-gravity was included via CCSN model evolved to ∼17 h after the onset of the explosion by 
3.2. Radiation transport
The toolkit for high-order neutrino radiation hydrodynamics
4
(
3.2.1. Methods
The neutrino radiation hydrodynamics equations are discretized in phase-space using a combination of FV; Leveque (2002)) and discontinuous Galerkin (DG; Hesthaven and Warburton (2008)) methods. Specifically, the convection and gravitational source terms in the hydrodynamics equations are discretized with FV methods. The semi-discrete system evolved with FV methods can then be written as a system of ODEs
We pause here to point out the relative size of the solution vectors
Since neutrino-matter interactions are frequent in high-density regions of the computational domain, and thus introduce stiffness, we use implicit–explicit (IMEX; Ascher et al. (1997); Pareschi and Russo (2005)) time integration to stably integrate with timesteps that can greatly exceed the shortest timescales associated with neutrino-matter coupling using implicit methods, while we integrate the convection and transport operators (
The extension to higher-order temporal accuracy with multi-stage, diagonally implicit Runge–Kutta methods (Pareschi and Russo, 2005) is relatively straightforward, but is omitted here for brevity. Since the radiation transport timestep is smaller and independent of the global timestep (i.e., the timestep used by the main
3.2.2. Implementation
Notice that the implicit solve modeling neutrino-matter interactions in the coupled system in equations (11) and (12) requires a mapping (reconstruction) of the fluid variables from the FV representation Division of a DG element 
Then, knowing the cell averages
∀ S
i
∈
The reconstruction step then amounts to inverting to find
After obtaining the DG representation
From the definitions above, it is obvious that RP = I, that is, we do not lose any accuracy when switching between DG and FV representations.
Due to the nature of neutrino-matter interactions, the coupled implicit system given by equations (11) and (12) is completely local in position space. However, inelastic scattering and other neutrino interactions result in global coupling in momentum space as well as across neutrino species. Moreover, since neutrino opacities and associated interactions kernels depend nonlinearly on local thermodynamic conditions, and because of the presence of blocking factors inside integral collision operators to account for Pauli’s exclusion principle, which applies to neutrinos (fermions), an iterative procedure is needed for the implicit step. On the one hand, nonlinearity and global coupling in momentum space make the implicit solve one of the most compute intensive aspects of neutrino radiation hydrodynamics simulations. On the other hand, spatial locality makes this part of the solve more easily parallelizable.
We have developed and tested various strategies for solving this nonlinear system. With a slight abuse of notation, we let
The coupled fixed-point method requires evaluation of the neutrino opacities in each iteration (i.e., each time
We use Anderson acceleration also for this nested scheme to accelerate both the inner and outer iteration sequences separately.
As a third option, we have developed an alternative to the nested fixed-point algorithm, where we have replaced the inner fixed-point iteration sequence with a Newton iteration sequence. This algorithm can be formulated as (Laiu et al., 2021)
Since the matter state is kept fixed in equation (30), the Jacobian matrix
3.2.3. Example core-collapse supernova simulation
To demonstrate the coupling between the FV hydrodynamics in
Figure 4 shows the evolution of the electron fraction versus radius during a critical epoch in the simulation; namely from 15 ms before to 100 ms after core bounce. (The time of bounce, t
b
, is defined as the time when the central density reaches its maximum value.) The simulation exhibits the characteristic features of spherically symmetric supernova simulations (e.g., Liebendörfer et al., 2001). During the collapse phase (t < t
b
; blueish lines), the core electron fraction is reduced due to electron capture processes. Once the central density reaches sufficiently high values (>1012 g cm−3), neutrinos become trapped in the fluid, and the electron fraction remains relatively unchanged. After bounce and shock formation (t > t
b
; reddish lines), once the shock reaches low enough densities, neutrinos can again escape from the core—producing a “burst” of electron neutrinos. This results in a reduction in the electron fraction below the shock. At t = 100 ms, the initial bounce shock has stalled at about 100 km from the center of the star. We note that this model was computed without including relativistic observer corrections in the neutrino transport equations. This results in a lower core electron fraction than is seen in relativistic models (Lentz et al., 2012). We are currently working to extend our neutrino transport scheme to include these relativistic effects. Results from a spherically symmetric core-collapse supernova simulation using 
3.2.4. Parallelization strategy
Example of interface for matrix–matrix multiplication to be performed by an optimized linear algebra library. The
Example of array permutation using tightly nested loops that are common throughout
Example of opacity interpolation kernel.
Due to the large number of degrees of freedom evolved, radiation transport is usually the computational bottleneck in astrophysical simulations that include it. For this reason, it is important to have a highly optimized implementation. The stand-alone nature of Comparison of 
In addition to showing a significant overall speedup of Comparison of different programming models’ speedup relative to the CPU in 
3.3. Magnetohydrodynamics
The nuclear kinetics and neutrino transport modules described above are coupled to an accurate solver for the dynamics of the plasma. In the ExaStar application, magnetohydrodynamics (MHD) is handled by the Spark code being developed independently in
3.3.1. Solution approach
For the ExaStar application, Spark solves the equations of ideal MHD
The
3.3.2. Parallelization strategy
Parallelization of
Within and AMR patch,
3.4. Equation of state
The MHD equations are closed with the addition of an EoS, which relates, for instance, the pressure of the fluid to its density and temperature. A polytropic EoS can be used to describe simple gases
These non-trivial EOSes typically require integrals of transcendental functions in evaluating the thermodynamic quantities of interest, and routines for these calculations typically are designed for accuracy and thermodynamic consistency at the expense of speed. A common way to reduce this time is by creating a table of desired quantities using the full, detailed EoS and then using a scheme that interpolates thermodynamic quantities from the table. The Helmholtz EoS FLASH module (suitable for electron-degenerate stellar environments) uses a biquintic Hermite interpolant over a table of the Helmholtz free energy
All partial derivatives of the pressure, entropy, and internal energy are formed analytically. Searches through the free energy table are avoided by computing hash indices from the values of any given
The neutron-degenerate environment found in the PNS in core-collapse supernovae is an even more complex situation, not the least because matter undergoes a first-order phase transition at very high densities (several times 1014 g/cm3) from a mix of nuclei and nucleons to uniform nuclear matter. Deploying a more realistic EoS also has a non-trivial computational cost. For this reason, we use the tabulated equations of state provided by the
3.5. Gravity
For self-gravitating systems, the need arises to solve in a distributed manner the underlying elliptic equations governing the determination and evolution of the gravitational potential or its relativistic counterpart. In the Newtonian case, a solution of the three-dimensional, elliptic Poisson equation gives the gravitational potential, and extensions to more general relativistic treatments of gravity can be made in stages. For centrally concentrated problems (like CCSNe), FLASH uses the multi-pole expansion of the potential which is suitable for mass distributions dominated by high degrees of spherical symmetry. Broadly speaking, the calculation can be divided into three parts: determining the center of mass, computing the multi-pole moments, and finding the final gravitational potential. The center of mass and multi-pole moment calculations both involve local computation followed by an MPI collective. The multi-pole moment collective is more expensive by orders of magnitude due to the larger amount of data, so it is the primary target of our optimization efforts to this point. Our approach involves splitting the multi-pole calculation into two components: the first performs the local calculation to obtain the moments and makes a non-blocking collective call. Other point-wise physics can then be performed (e.g., local transport or nuclear burning). Once these local calculations have finished, the collective will have made progress. Once the communication is finished, each rank computes the gravitational potential at each point. We continue to fine-tune this approach, and the orchestration system (OS) described in Section 4 will significantly enhance its efficacy.
4. Orchestration
In high performance computing (HPC), two schools of thoughts have existed for almost the entire history of the field regarding how to deal with the orthogonal axes of complexity: the target system and the domain science. One school has been represented by the science code developers who have taken on both axes of complexity in order to avoid hard dependencies on third-party tools. The other school is represented by the abstraction and tool developers that seek to hide the platform complexity from the scientific components of the software. Historically, the first approach has been dominant in the absence of a strong incentive to consider high-level abstractions in the code. This has changed with increases in platform heterogeneity, and several abstraction tools have come into existence with varying degrees of success (Bianco and Benedicic, 2020; Edwards and Sunderland, 2012; Hornung and Keasler, 2020). Opportunities also exist to design between these two extremes a domain-specific performance portability system that is suitable for tuning codes to platforms without having to program at low levels of the code for every specific platform. The ExaStar team is designing one such system that will allow Steps in translating a physics module implemented with key-value dictionary and 
The
The configuration toolchain takes its inspiration from the setup tool of
We begin by casting every non-trivial function in the physics operators of the code as a collection of code blocks. Some code blocks may be declarations, some may implement the control logic, and some will implement the numerics of the function. Sometimes arithmetic and logic blocks cannot be separated out; some code blocks have both. These code blocks become components in a hierarchical composability through the use of key-value dictionary where values are code snippets of arbitrary length and complexity. Keys are user defined with a provision for multiple alternative definitions which lets them mimic the template meta-programming in C++ where a single expression of an algorithm can have specializations through alternative definitions of the keys. For more detailed description of key-value feature of the CFT, see Couch et al. (2021).
The information encoded in the directives is utilized by the
The design goal of the
Note that no part of our design limits itself to using manually built task graphs nor requires extreme simplicity in them. The interfaces are designed to be robust enough that the
5. Software engineering
This section highlights the design, development, testing, verification, and validation practices of the
5.1. Design
The highest level software architecture of the code recognizes that there are two types of capabilities in a multi-physics scientific code that have fundamentally different functionalities and lifecycles. The infrastructure and the book-keeping parts of the code need to be more stable and robustly designed to provide a strong backbone for the code. These functionalities cover discretization methods, coarse-grain data movement between nodes, I/O, runtime environment, and orchestration of physics solvers. These components are also at the heart of any extensibility in the physics capabilities of the code. The second type of capabilities is the physics and numerical solvers. These can be made to act as clients to the infrastructure without any need to know the details of infrastructure implementation. This approach is necessary because these components are likely to be subject of research and more likely to undergo non-trivial changes during the lifetime of the code. Therefore, they should be able to localize their modifications without impacting other parts of the code. These design principles are firmly encoded in
5.2. Development
All feature branches are based of master. When development on a feature branch is finished, the feature branch is first merged into the development branch. The merge can be done directly by the author or by a pull request assigned to a different developer. When the author has successfully executed on the development branch all manual tests related to changes made in the feature branch and believes that the feature branch is ready for inclusion in One can trigger a code review at this point if so desired. If all changes made in the feature branch are made to a portion of the code that is not yet under automated testing and if it is believed that the changes cannot break any automated tests, then the pull request can be managed fully by the creator and new tests may be added to the test suite. If the pull request is accepted, then the merge can be made and the developer that executes the merge must launch the Jenkins staged test suite (Flash-Staged). If all tests in Flash-Staged have passed, then the developer who performed the merge into the staged branch issues a pull request from the feature branch to the master branch. This same individual accepts the request and subsequently launches the Jenkins master test suite (Flash-Master). The developer who triggered the Flash-Master test run follows up to confirm that the master branch was not broken by the feature branch. If at any point during the previous steps errors are discovered that need to be fixed, the best way to go about it is this: Fix code in the feature branch; test there; then go back to point 2 above. Repeat until no test errors. The development and staged branches should never be merged into any other branch.
5.3. Testing, verification, and validation
We view testing as critical to our software development process, and use continuous integration (CI) where possible for early detection of bugs. Testing is performed on the
6. Summary and future work
We have developed a strategy for incorporating fully functional applications into the ExaStar software ecosystem as modules that can be used within a larger multi-physics framework (e.g.,
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
This manuscript has been authored by UT-Battelle, LLC under Contract No. DE-AC05-00OR22725 with the US Department of Energy. The United States Government retains and the publisher, by accepting the article for publication, acknowledges that the United States Government retains a non-exclusive, paid-up, irrevocable, world-wide license to publish or reproduce the published form of this manuscript, or allow others to do so, for United States Government purposes. The Department of Energy will provide public access to these results of federally sponsored research in accordance with the DOE Public Access Plan (
).FLASH was developed, in part, by the DOE NNSA ASC- and DOE Office of Science ASCR-supported Flash Center for Computational Science at the University of Chicago. Funding for
Notes
Author biographies
J. Austin Harris is a staff scientist in the National Center for Computational Sciences at Oak Ridge National Laboratory. He received his PhD in physics from the University of Tennessee in 2015. His research interests include stellar astrophysics, reaction kinetics, and high performance computing.
Ran Chu is a PhD student in computational astrophysics at the University of Tennessee. She works as a research assistant at Oak Ridge National Laboratory since 2014. She received her master’s degree in nuclear physics in 2016. Her research interests include supernova simulation, neutrino transport, and developing next-generation supernova simulation code.
Sean M. Couch is an assistant professor at Michigan State University in the Department of Physics and Astronomy and the Department of Computational Mathematics, Science, and Engineering. He specializes in large-scale numerical simulations of astrophysical processes, especially aspects of core-collapse supernovae and massive stars. He received his PhD from the University of Texas at Austin in 2010 and was a Hubble Fellow at the Flash Center of the University of Chicago Department of Astronomy and Astrophysics from August 2011 through September 2014. Couch was then a Senior Postdoctoral Scholar at the TAPIR Walter Burke Institute for Theoretical Physics at Caltech before joining MSU in June 2015.
Anshu Dubey is a computer scientist in the mathematics and computer science division at Argonne National Laboratory and a Senior Scientist in the Department of Computer Science at the University of Chicago. She is the chief software architect for FLASH, multi-physics multiscale HPC software that is used by multiple science and engineering domains as their community code. She is interested in all aspects of HPC scientific software, with special emphasis on design, productivity, and sustainability issues.
Eirik Endeve is a staff scientist in the Multiscale Methods group at the Oak Ridge National Laboratory. He obtained his PhD in 2003 from the Institute of Theoretical Astrophysics at the University of Oslo, Norway. Eirik’s research interests include the development of numerical algorithms for hyperbolic conservation laws, including kinetic equations, and their application to problems in computational astrophysics.
Antigoni Georgiadou is an OLCF Postdoctoral Research Associate in the Advanced Computing for Nuclear, Particles, and Astrophysics Group at Oak Ridge National Laboratory. She received her PhD degree in Applied and Computational Mathematics from Florida State University in 2019. Her research interests include optimization, stellar evolution, cosmology, and high performance computing.
Rajeev Jain received his first masters in Structural Engineering from Arizona State University in 2009 and his second masters in Computer Science from University of Chicago in 2020. He has been working at Argonne National Lab. (ANL), since 2009, developing simulation software tools tailored for high performance systems. Over the past 11 years at ANL, he has been a part of development of tools for mesh generation, simulation of nuclear reactors, urban infrastructure, and astrophysics. He also develops testing infrastructure and optimization routines for exascale deep-learning-enabled precision medicine for cancer treatment.
Daniel Kasen is a faculty scientist at Lawrence Berkeley National Laboratory and a professor in the departments of physics and astronomy at UC Berkeley. He obtained his PhD from UC Berkeley. His research focuses on modeling supernovae, neutron star mergers, and other astrophysical transients.
M. Paul Laiu is a staff mathematician in the Multiscale Methods Group at Oak Ridge National Laboratory. He received his Ph.D. degree in Electrical and Computer Engineering from University of Maryland, College Park in 2016. His research interests include numerical optimization, surrogate modeling, and numerical schemes for multiscale kinetic PDEs.
O.E. Bronson Messer is Distinguished Scientist and Director of Science at the Oak Ridge Leadership Computing Facility. He received his Ph.D. in physics from the University of Tennessee in 2000. His research interests include supernovae, stellar evolution, radiative transfer, astrophysical combustion, high performance computing, and numerical relativity.
Jared O’Neal is a scientific software developer in Argonne National Laboratory’s Mathematics and Computer Science division. He currently works on computational mathematics and science applications with an eye on improving processes to ensure productivity while maintaining scientific rigor. Jared received an M.A. in physics from Boston University in 2001 and an M.M.S. in mathematics from The Ohio State University in 2017.
Michael A. Sandoval is a PhD student in computational astrophysics at the University of Tennessee. He received his bachelor’s degree in physics from San José State University in 2015. His research interests include stellar astrophysics, high performance computing, and data visualization.
Klaus Weide received a doctoral degree in physics from the University of Göttingen in Germany in 1992. He has worked as a staff member at the Flash Center at the University of Chicago since 2006, where he shared responsibility for developing and maintaining the FLASH code, adding new features, investigating and improving performance, and supporting internal and external users. As a Sr. Research Analyst, a joint appointee at Argonne National Laboratory, and a member of the Exascale Computing Project, he now focuses on portable refactoring of simulation code for new computer architectures.
