HDF5 H5L.visit is broken in 2015a

I regularly write HDF5 files in Fortran and read them in Matlab. This took some time to get right, but it's worked for years. The way I read the files in Matlab is to use H5L.visit to iterate over every link in the file and collect information about each one. I have a callback named hdf5_sds_iter to get the information I need and then I call something like this:
[status, SD] = H5L.visit(fid, 'H5_INDEX_NAME', 'H5_ITER_NATIVE', @hdf5_sds_iter, SD);
This has always worked great. Now, in Matlab 2015a, it does not. I get an error, MATLAB:imagesci:hdf5lib:linkVisitFailure, with the message, "Link visitation failed. Failed before callback function could be called." I cannot figure out what the problem is.
I've tried this again in 2014b and there is no problem, despite reading the same file or different ones. In 2015a, I've tried a variety of files in a variety of locations with no luck. I can use other Matlab HDF5 calls to open and read the file, but the visit call does not work. What could I be doing wrong? Is this a bug?

4 Comments

Ashish Uthama
Ashish Uthama on 30 Jul 2015
Edited: Ashish Uthama on 30 Jul 2015
Hi Patrick, mind posting a runnable snippet using the shipping example.h5 file? This might be an issue with the upgraded HDF5 library in 15a ( release notes under "Scientific File Format Libraries: Upgrades")
Further research indicates that the issue may be caused by calling H5.close() in my code. This never caused problems for me before except when trying to save files in the '-v7.3' format (see here). If I remove those close statements, the problem seems to go away (after I restart Matlab, naturally). This still seems like a problem to me, since calling H5.open() should do the trick, but it does not.
Hi Patrick, Can you please comment on the reasoning for using H5.close() within your code? As Ashish mentioned, this is a possible issue with the upgraded HDF5 library in R2015a. Thank you, Ellen
Ellen, much like with my Fortran code, I close the HDF5 interface when I'm done with it and reopen it when I need it. This does appear to be rather unnecessary, but it's worked for years in both languages. It would seem best to just remove the logic that closes and reopens the library, but it still should be possible to do, right? Thanks.

Sign in to comment.

Answers (0)

Asked:

on 29 Jul 2015

Commented:

on 10 Aug 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!