From 522b380bb5e4bf1e4472ad4c633ef1992a126560 Mon Sep 17 00:00:00 2001 From: Junmin Gu Date: Sun, 3 Apr 2022 21:43:32 -0700 Subject: [PATCH] added check H5_USE_1xx_API to make sure H5 is not using older API. --- source/adios2/toolkit/interop/hdf5/HDF5Common.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp b/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp index 04fff625b9..46f02cea1e 100644 --- a/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp +++ b/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp @@ -1629,7 +1629,11 @@ void HDF5Common::ReadAttrToIO(core::IO &io) H5O_info_t oinfo; #if H5_VERSION_GE(1, 11, 0) +#if (defined H5_USE_16_API || defined H5_USE_18_API) + herr_t ret = H5Oget_info(m_FileId, &oinfo); +#else herr_t ret = H5Oget_info(m_FileId, &oinfo, H5O_INFO_ALL); +#endif #else herr_t ret = H5Oget_info(m_FileId, &oinfo); #endif @@ -1685,7 +1689,11 @@ void HDF5Common::ReadNativeAttrToIO(core::IO &io, hid_t datasetId, H5O_info_t oinfo; #if H5_VERSION_GE(1, 11, 0) +#if (defined H5_USE_16_API || defined H5_USE_18_API) + herr_t ret = H5Oget_info(datasetId, &oinfo); +#else herr_t ret = H5Oget_info(datasetId, &oinfo, H5O_INFO_ALL); +#endif #else herr_t ret = H5Oget_info(datasetId, &oinfo); #endif