MATLAB: HDF5 V1.10

hdf5swmr

Can Matlab read/write HDF5 v1.10 files? If not, are there plans to add that support? I'm particularly interested in SWMR (Single Write Multiple Read) functionality, but I have not found any mention of that in the Matlab docs.

Best Answer

MATLAB as of R2018a cannot read v1.10 HDF5 files and therefore support SWMR. The HDF5 library version used in either R2017b or R2018a:
>> [ver_major,ver_minor,ver_patch] = H5.get_libversion
ver_major =
1
ver_minor =
8
ver_patch =
12
"Word of Caution: Please note that HDF5 files created with SWMR access cannot not be read by the tools based on the HDF5 1.8 libraries due to the file format changes in the HDF5 1.10 version of the library. [...] One can use the h5repack or h5format_convert tools to convert an HDF5 file created by the HDF5 Library version 1.10.0 to be accessible by the HDF5 Library version 1.8. The h5repack tool rewrites the whole file; h5format_convert modifies the file “in place” by rewriting only metadata information according to the 1.8 format while leaving raw data intact."
Here's what happens if you try to query a SWMR-enabled file:
>> h5disp('swmr_test.h5')
Error using h5infoc
The filename specified was either not found on the MATLAB path or it contains unsupported characters.
Error in h5info (line 102)
hinfo = h5infoc(filename,location, useUtf8);
Error in h5disp>display_hdf5 (line 112)
hinfo = h5info(options.Filename,options.Location);
Error in h5disp (line 90)
display_hdf5(options);
Using the commandline tool provided with the official library:
>> !h5ls swmr_test.h5
x Dataset {64, 64, 1, 1000/Inf}
It would be terrific if MathWorks considered reaching feature parity with the HDF5 library or leading wrappers like h5py within at least 1-2 years of breaking changes :)...