I do serial HDF5 with ZFP compression on thousands of files. I can get compression ratios from 3D arrays by using h5ls -rv on individual files (and piping the output to some shell tools), but I’m looking for a way to get them from calling HDF5 routines from within C or Fortran, which h5ls must do. I want to collect statistics on how much compression is happening with ZFP on each array/file, as I am using the accuracy parameter which does dynamic compression. I’d like to be able to collect this information from the same code (written in C) that reads from the ZFP compressed files. Is there a straightforward way to do this?
Leigh, how about H5Dget_storage_size (https://portal.hdfgroup.org/display/HDF5/H5D_GET_STORAGE_SIZE)? This is per dataset and you’d still have to compare the output to H5Sget_simple_extent_npoints * H5Tget_size and do the iteration over all relevant datasets.
Hi Gerd, nice to talk to you again
That is exactly what I was looking for. It’s trivial to get the uncompressed size, so this call was the missing link. Thanks!