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

Groups examples doesn't compile, some functions are missing #77

Open
scontini76 opened this issue Jan 12, 2022 · 1 comment
Open

Groups examples doesn't compile, some functions are missing #77

scontini76 opened this issue Jan 12, 2022 · 1 comment

Comments

@scontini76
Copy link

From the documentation seems that there should be two functions:

parent ::= fd_t | gr_t;

[open]
h5::gr_t gopen(parent, const std::string& path [, const h5::gapl_t& gapl]);

[create]
h5::gr_t  gcreate(const L& parent, const std::string& path,
	[, h5::lcpl_t lcpl] [, h5::gcpl_t gcpl] [, h5::gapl_t gapl]);

but I can't use them, I don't find them declared anywhere an the groups examples doesn't compile:

groups.cpp:15:21: error: no member named 'gcreate' in namespace 'h5'
                h5::gr_t gr = h5::gcreate(fd, "my-group/sub/path");
                              ~~~~^
groups.cpp:18:7: error: no member named 'gcreate' in namespace 'h5'
                h5::gcreate(fd, "/mygroup", lcpl); // passing lcpl type explicitly
                ~~~~^
groups.cpp:23:8: error: no member named 'gcreate' in namespace 'h5'
                        h5::gcreate(fd, "/mygroup", h5::dont_create_path);
                        ~~~~^
groups.cpp:24:34: error: no member named 'group' in namespace 'h5::error::io'
                }catch (  const h5::error::io::group::create& e){
                                ~~~~~~~~~~~~~~~^
groups.cpp:30:8: error: no member named 'gcreate' in namespace 'h5'
                        h5::gcreate(fd, "/mygroup", h5::dont_create_path);
                        ~~~~^
groups.cpp:37:13: error: no member named 'gopen' in namespace 'h5'; did you mean 'fdopen'?
                auto gr = h5::gopen(fd, "/mygroup");
                          ^~~~~~~~~
                          fdopen

What's wrong?

At the moment I'm using a workaround in my code which is just using the C API:

h5::gr_t root{H5Gopen(fd,"/", H5P_DEFAULT)};

but I'm not sure how good is this:

  • is the group lifespan handled by the h5cpp library?
  • is the use of h5::fd_t in C API calls safe and portable?

Anyway I wish there are a different way to avoid to call the C API directly for common task.

Please let me know if I'm doing something wrong! Thank you!

@steven-varga
Copy link
Owner

The documentation is for an unreleased version; which has features related to groups and an improved architecture. Less fortunately for the community I've been held up with a related project: H5CLUSTER and as of now I am unable to release the new version of h5cpp. (and unable to accept any modifications, since they are not relevant)

Yes, the mechanism is general, and will manage the passed hid_t: h5::gr_t root{hid hid_t}; it is you responsibility using the correct CAPI call. In fact H5CPP does the following:

Yes, all CAPI calls are safe and portable; it was a design feature not to re-implement what is done -- but to enhance it. In fact H5CPP features a seamless integration with the CAPI with the exception of h5::append internals. h5::append is custom slim code with an order of magnitude better IO than the HDF5 HL append implementation.

  1. RAII
  2. seamless integration with HDF5 C API
  3. tuned compile time generated code from templates
  4. compiler assisted static reflection with LLVM
  5. zero copy linear algebra and std:vector support

If you want to talk we could schedule a meeting, where you cab tell me what you want to do -- and I tell you the how. Let me know.

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