Skip to content

Update EXP IC routines for HDF5 output - #229

Open
The9Cat wants to merge 21 commits into
develfrom
generateHDF5ICs
Open

Update EXP IC routines for HDF5 output#229
The9Cat wants to merge 21 commits into
develfrom
generateHDF5ICs

Conversation

@The9Cat

@The9Cat The9Cat commented Aug 14, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a new helper class to create particle ICs files using the new HDF5 schema
  • Updated gensph, gendisk, gendisk2d, zangics, cubeics, slabics with an -5,--hdf5 option for producing HDF5
  • The helper class makes these changes moderately non-invasive. None of the algorithms change, on the call to write bodies

Why

  • HDF5 read/write is much more efficient on network file systems. E.g. ascii read write slows down ceph by more than an order of magnitude in write time.
  • Compressed, float32 saves approximately a factor of 5 in disk space relative to ascii.

Tests

  • Added CTest tests to check that the HDF5 files have the expected metadata and have particles masses that sum to some userspecificed expected value. Default is 1. Tests passed for gensph, slabics and cubeics.
  • Test slabics IC generation
  • Perform a simulation from slabics generated ICs
  • Test gendisk IC generation
  • Perform a simulation from gendisk generated ICs

TBD

Consider setting HDF5 output to the default after all tests are successfully completed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds HDF5 output support to EXP initial-condition generators using the runtime particle schema.

Changes:

  • Introduces a shared HDF5 particle writer with MPI gathering, compression, and precision options.
  • Integrates HDF5 output across six IC generators.
  • Centralizes 1D mass models and adds HDF5 smoke tests.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
utils/ICs/ZangICs.cc Adds HDF5 output options.
utils/ICs/ParticleHDF5.H Implements the shared writer.
utils/ICs/massmodel1d.H Removes the local model header.
utils/ICs/initial2d.cc Adds gendisk2d HDF5 output.
utils/ICs/initial.cc Adds gendisk HDF5 output.
utils/ICs/gensph.cc Adds distributed HDF5 output.
utils/ICs/genslab.cc Reworks slab generation and output.
utils/ICs/cubeICs.cc Adds cube HDF5 output.
utils/ICs/CMakeLists.txt Uses centralized mass models.
tests/CMakeLists.txt Registers HDF5 smoke tests.
tests/check_hdf5_particles.py Validates particle schemas.
include/massmodel1d.H Centralizes and expands 1D models.
exputil/massmodel1d.cc Implements centralized models.
exputil/CMakeLists.txt Adds models to exputil.
Suppressed comments (3)

exputil/massmodel1d.cc:375

  • setDF(..., nint) stores a requested quadrature size, but compute_model ignores it and always uses 400 points. Use the member so the public tuning parameter has an effect.
    exputil/massmodel1d.cc:4
  • This source still constructs std::ifstream at line 26 but no longer includes <fstream>. Compilation now depends on an unrelated transitive include from SLGridMP2.H; include the defining standard header directly.
    include/massmodel1d.H:706
  • The default constructor leaves both epsilon and dist_defined indeterminate, although distf immediately uses epsilon and callers inspect dist_defined. Initialize a deliberate regularization value and mark the completed model as defined, as the other constructors do.
    H = 1.0;
    Omega = std::sqrt(2.0*M_PI/H);
    norm  = std::sqrt(2/Omega)/(M_PI*2.0*H);
    Jmax  = 0.5*Omega*H*H;
    ModelID = "Uniform";

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread utils/ICs/ParticleHDF5.H Outdated
Comment thread utils/ICs/ParticleHDF5.H Outdated
Comment thread utils/ICs/ParticleHDF5.H
Comment thread utils/ICs/genslab.cc
Comment thread utils/ICs/genslab.cc
Comment thread tests/check_hdf5_particles.py Outdated
Comment thread utils/ICs/initial.cc
Comment thread utils/ICs/initial2d.cc
Comment thread utils/ICs/ZangICs.cc
Comment thread utils/ICs/ParticleHDF5.H
The9Cat and others added 6 commits August 14, 2026 16:36
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Copilot AI and others added 2 commits August 14, 2026 22:29
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants