Proposed HDF5 input format and draft implementation#224
Open
The9Cat wants to merge 43 commits into
Open
Conversation
added 7 commits
June 2, 2026 17:49
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an HDF5-based format for EXP particle “body” input data, along with a converter utility and initial integration into Component so EXP can initialize from either ASCII or HDF5 while preserving backward compatibility.
Changes:
- Added
hdf5bodsutility to convert EXP ASCII body files to compressed HDF5 (and back), with optional round-trip verification. - Updated
Componentinitialization to detect HDF5 body files and read/distribute particles from HDF5 when applicable (fallback to existing ASCII reader otherwise). - Bumped project/documentation version to 7.11.0.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/PhaseSpace/hdf5bods.cc | New ASCII↔HDF5 body-file converter using HighFive + OpenMP; writes proposed schema attributes/datasets. |
| utils/PhaseSpace/CMakeLists.txt | Builds/installs the new hdf5bods executable. |
| src/Component.H | Adds declarations for HDF5 initialization/read helpers. |
| src/Component.cc | Adds HDF5 detection and HDF5-based body ingest + MPI distribution. |
| include/ScopeTimer.H | New simple scope-based timing helper used by the converter. |
| doc/exp.cfg.breathe | Version bump for generated docs. |
| doc/exp.cfg | Version bump for generated docs. |
| CMakeLists.txt | Project version bump to 7.11.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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: 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: 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
History and intent
This started as a initial body file compressor. Using HDF5 to exploit the intrinsic stuctural similarities in a body file seemed like a good way to go. After completing the standalone routine, I realized that I was more than half way to an implementation of a reader for the
Componentclass.This is low priority and does not fix any bugs. But the ugly and inefficient ASCII tables should probably be replaced by HDF5 now that most of EXP is reading/writing using HDF5.
Implementation details
/
├── Attributes
│ ├── num_particles (int)
│ ├── num_aux_ints (int)
│ └── num_aux_floats (int)
└── particles/ (Group)
├── index (Dataset, unsigned long)
├── m (Dataset, float/double)
├── x, y, z (Datasets, float/double)
├── u, v, w (Datasets, float/double)
├── aux_int_0, aux_int_1, ... (Datasets, int)
└── aux_float_0, aux_float_1, ... (Datasets, float/double)
indexandaux_int_*,aux_float_*fields are optional.posintox, y, z(andvelintou, v, w) to simply thestd::variantcoding to allow bothfloatanddoublearrays. It is possible that consolidating into 2d arrays could be more efficient. But this is easier to code.mdataset. We do more sanity checks, e.g. make sure that every dataset has the same datatype but this seems like overkill.hdf5bodswas initially designed to compress body files and it achieves that goal. It is implemented with OpenMP which gives some modest performance gains (but not MPI). AComponentclass checks whether the specified body file is HDF5 and reverts to the original ascii method if not; so all of the prior behavior is retained for compatibility.indexfield (unsigned long) exists, it will populate the EXPParticle.indxfield. Similarly, the stand-along conversion routine has can read and write theindexfield for consistency with the original ASCII body table format.hdf5bodsconverter has support for multiple HDF5 compression filters for testing. The default GZip has the highest compression ratio but it also takes the most CPU time.Tests so far
hdf5bods, has built in round-trip verification which passesexpcan read the new HDF5 files and produce the same run for a simple case