Skip to content
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

handle h5 group check in hdf_archive #4547

Closed
ye-luo opened this issue Apr 10, 2023 · 2 comments
Closed

handle h5 group check in hdf_archive #4547

ye-luo opened this issue Apr 10, 2023 · 2 comments
Assignees

Comments

@ye-luo
Copy link
Contributor

ye-luo commented Apr 10, 2023

Is your feature request related to a problem? Please describe.
See comment
https://github.com/QMCPACK/qmcpack/pull/4541/files#r1158964516

@ye-luo ye-luo changed the title handle h5 group check in hdf_archieve handle h5 group check in hdf_archive Apr 13, 2023
@markdewing
Copy link
Contributor

The comment is asking for the error to be handled in the call to push.

To be clear, the desired behavior is:
If the group name is not present and createit is false, then the push call should throw an exception.

@markdewing markdewing self-assigned this May 1, 2023
@ye-luo
Copy link
Contributor Author

ye-luo commented May 1, 2023

I don't feel right returning hid_t type outside hdf_archive which should hid details of the hdf5 library.
Example: hid_t should not appear in src/QMCWaveFunctions/RotatedSPOs.cpp
So I'm thinking of

  1. push(name, createit). Throw an exception when creation is requested and failed or whgen creation is not requested and open group failed.
  2. is_group can be used to inspect group existence.
  3. if the group tid_t is actually needed use top() after a successful push().

markdewing added a commit to markdewing/qmcpack that referenced this issue May 3, 2023
Addresses issue QMCPACK#4547 (handle h5 group check in hdf_archive)

When 'push' is called with the createit flag set to false, and the group
does not exist, throw an exception.

Also throw an exception if the file is not open.

Remove the return value (use 'top' to get the value if it's really
needed)

Store the hdf archive filename so it can be included in the error message
in the exception.
@ye-luo ye-luo closed this as completed May 9, 2023
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

No branches or pull requests

2 participants