libyt: an In Situ Interface Connecting Simulations with yt, Python, and Jupyter Workflows
arXiv:2512.11142 · doi:10.3847/1538-4365/ae5640
Abstract
In the exascale computing era, handling and analyzing massive datasets have become extremely challenging. In situ analysis, which processes data during simulation runtime and bypasses costly intermediate disk input and output steps, offers a promising solution. We present libyt (https://github.com/yt-project/libyt), an open-source C library that enables astrophysical simulations to analyze and visualize data in parallel computation with yt or other Python packages. libyt can invoke Python routines automatically or provide interactive entry points via a Python prompt or a Jupyter Notebook. It requires minimal intervention in researchers' workflow, allowing users to reuse job submission scripts and Python routines. We describe libyt's architecture for parallel computing in high-performance computing environments, including its bidirectional connection between simulation codes and Python, and its integration into the Jupyter ecosystem. We detail its methods for reading patch-based adaptive mesh refinement (AMR) simulations and handling in-memory data with minimal overhead, and procedures for yielding data when requested by Python. We describe how libyt maps simulation data to yt frontends, allowing post-processing scripts to be converted into in situ analysis with just two lines of change. We document libyt's API and demonstrate its integration into two astrophysical simulation codes, GAMER and Enzo, using examples including core-collapse supernovae, isolated dwarf galaxies, fuzzy dark matter, the Sod shock tube test, Kelvin-Helmholtz instability, and the AGORA galaxy simulation. Finally, we discuss libyt's performance, limitations related to data redistribution, extensibility, architecture, and comparisons with traditional post-processing approaches.
Accepted for publication in the Astrophysical Journal Supplement Series (ApJS). 36 pages with 12 figures and 5 tables
References in corpus (19)
- Array Programming with NumPy
- Modeling feedback from stars and black holes in galaxy mergers
- A Multi-Code Analysis Toolkit for Astrophysical Simulation Data
- Athena: A New Code for Astrophysical MHD
- Enzo: An Adaptive Mesh Refinement Code for Astrophysics
- Core-collapse supernova equations of state based on neutron star observations
- Nucleosynthesis and Remnants in Massive Stars of Solar Metallicity
- Mayavi: a package for 3D visualization of scientific data
- Grackle: a Chemistry and Cooling Library for Astrophysics
- A New Open-Source Code for Spherically-Symmetric Stellar Collapse to Neutron Stars and Black Holes
- Exploring the relativistic regime with Newtonian hydrodynamics: An improved effective gravitational potential for supernova simulations
- Gravitational Bose-Einstein condensation in the kinetic regime
- A simple parameterization of the consequences of deleptonization for simulations of stellar core collapse
- The AGORA High-Resolution Galaxy Simulations Comparison Project. II: Isolated Disk Test
- GAMER-2: a GPU-accelerated adaptive mesh refinement code -- accuracy, performance, and scalability
- Self-consistent construction of virialized wave dark matter halos
- Tangos: the agile numerical galaxy organization system
- Understanding the Impact of Synchronous, Asynchronous, and Hybrid In-Situ Techniques in Computational Fluid Dynamics Applications
- In-Situ Techniques on GPU-Accelerated Data-Intensive Applications