[Nexus] HDF error log
Le Goc Yannick
legoc at ill.fr
Mon Dec 10 14:51:32 GMT 2012
Hi,
When writing quite big datasets with Nexus HDF5, I realized that
sometimes the gzip compression wasn't applied.
I wanted to go into details and try to understand why the library was
behaving like this.
As Nexus is a thin layer on top of HDF, I supposed it was due to the HDF
library.
I tried to log the HDF5 errors, but I found no way to do it with Nexus.
Then I introduced HDF5 calls in my code like this:
herr_t my_hdf5_error_handler(hid_t err_stack, void *unused) {
H5Eprint1(stderr);
return 0;
}
NXstatus ret = NXopen(const_cast<char *>(m_fileName.c_str()),
NXACC_CREATE5, &file_id);
H5Eset_auto(H5E_DEFAULT, my_hdf5_error_handler, NULL);
This gave me the error message as expected, but I also had the following
errors :
"H5Aopen_by_name(): can't open attribute" for many attributes called
"napimount" and some "signal" attributes.
As my file seems correctly written, I have the impression that this is a
bad use of HDF5. The attribute existence should be tested before its
request.
My wishes:
- fix the "napimount" and "signal" attribute error as they do not seem
to be real errors
- have the possibility to log HDF errors, maybe by adding a function
NXsethdferrorhandler to the Nexus API that unifies HDF5/HDF4 error logs.
Or at least, add a small section in the documentation on error handling
including HDF error handling (maybe with the above code example).
I'm using Nexus version 4.3.0
Regards,
Yannick
More information about the NeXus
mailing list