-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encapsulate HDF5 module #5031
Encapsulate HDF5 module #5031
Conversation
Drop support for Intel Classic. Provide a clear error message when an unsupported compiler is detected. Also update C++ code to leverage C++20 and address build issues with Clang compiler toolchains.
Rewrite h5xx and hdf5 bindings such that they no longer propagate their compiler flags to the entire codebase.
if (!mass_unit().empty() and (m_fields & H5MD_OUT_MASS)) { | ||
h5xx::write_attribute(datasets["particles/atoms/mass/value"], "unit", | ||
h5xx::write_attribute(datasets.at("particles/atoms/mass/value"), "unit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a benefit to making it a bound-checked access?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Muscle memory. I didn't think too much about it.
Marginal benefit: if the key doesn't exist, a default-constructed hdf5 dataset is created and returned by reference by operator[]
. Your file then contains a dataset with no elements. Since this method is called only once per simulation, at file creation, overhead of exceptions isn't relevant, and is probably smaller than default-constructing an empty dataset. Plus, we get notified that the map isn't properly initialized.
Whether we need bound-checked accesses in the hot loop (File::write()
) is debatable. The h5xx module will be removed from ESPResSo eventually, in favor of a yet-to-be-determined C++ wrapper library for hdf5. Whether that new library will offer bound-checked access is likely, but not guaranteed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description of changes:
--recursive