Skip to content

Introduce H5AttrWriter#481

Open
mabruzzo wants to merge 6 commits intocholla-hydro:devfrom
mabruzzo:h5-attr-writer
Open

Introduce H5AttrWriter#481
mabruzzo wants to merge 6 commits intocholla-hydro:devfrom
mabruzzo:h5-attr-writer

Conversation

@mabruzzo
Copy link
Collaborator

To be reviewed after #469 is merged


This PR introduces the H5AttrWriter type. This is a temporary type that wraps a hid_t that wraps an hdf5 file (or an hdf5 group). The intention is to provide a nicer interface for writing hdf5 attributes to disk.

This was initially intended to be short and quick, but after making a bunch of progress, I hit some subtle and very annoying bugs that took a surprisingly long time to debug. The resulting code is a little longer than I would like.

A side motivation: in a followup PR, we make this class inherit from an abstract AttrWriterAdaptor class so that we can unify the code for text headers and H5 headers


I have tested to confirm that the headers are identical to the earlier version of the code

void H5AttrRecorder::record_arr(const char *name, const double *arr, int length)
{
hid_t type_id = H5T_NATIVE_DOUBLE;
// is there a compelling reason why this is big endian?
Copy link
Collaborator

Choose a reason for hiding this comment

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

No, in fact there isn't and it has caused problems in the past. Perhaps we should change it?

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.

2 participants