From ca3d8c10f4fd69a4c7a4068baca5a1ab241868a5 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 7 Jan 2021 14:30:05 -0600 Subject: [PATCH 01/11] fixed H5O_info_t incompatiblity with H5Oget_info_by_idx3 --- h5_test/tst_h_atts3.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/h5_test/tst_h_atts3.c b/h5_test/tst_h_atts3.c index 48693768dd..924967ef79 100644 --- a/h5_test/tst_h_atts3.c +++ b/h5_test/tst_h_atts3.c @@ -209,7 +209,11 @@ main() hid_t file_typeid1[NUM_OBJ_1], native_typeid1[NUM_OBJ_1]; hid_t file_typeid2, native_typeid2; hsize_t num_obj; +#if H5_VERSION_GE(1,12,0) + H5O_info2_t obj_info; +#else H5O_info_t obj_info; +#endif char obj_name[STR_LEN + 1]; hsize_t dims[1] = {ATT_LEN}; /* netcdf attributes always 1-D. */ From c4279a68b005471653c2228d4054ccdf346c6baa Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Fri, 8 Jan 2021 11:15:10 -0600 Subject: [PATCH 02/11] Allow for the HDF5 file format to be compatible with features greater than HDF5 1.8, which may require to have a superblock greater than v2. Ref: Update HDF5 format compatibility #951 --- libhdf5/hdf5create.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libhdf5/hdf5create.c b/libhdf5/hdf5create.c index 27a99405c9..73bfda70bf 100644 --- a/libhdf5/hdf5create.c +++ b/libhdf5/hdf5create.c @@ -168,12 +168,11 @@ nc4_create_file(const char *path, int cmode, size_t initialsz, #ifdef HAVE_H5PSET_LIBVER_BOUNDS #if H5_VERSION_GE(1,10,2) - if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18) < 0) + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) #else - if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, - H5F_LIBVER_LATEST) < 0) + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0) #endif - BAIL(NC_EHDFERR); + BAIL(NC_EHDFERR); #endif /* Create the property list. */ From efb9b7120bfb3aca89871e9693590a75f0c2d3ce Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Fri, 8 Jan 2021 11:24:15 -0600 Subject: [PATCH 03/11] reverted past fix --- h5_test/tst_h_atts3.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/h5_test/tst_h_atts3.c b/h5_test/tst_h_atts3.c index 924967ef79..48693768dd 100644 --- a/h5_test/tst_h_atts3.c +++ b/h5_test/tst_h_atts3.c @@ -209,11 +209,7 @@ main() hid_t file_typeid1[NUM_OBJ_1], native_typeid1[NUM_OBJ_1]; hid_t file_typeid2, native_typeid2; hsize_t num_obj; -#if H5_VERSION_GE(1,12,0) - H5O_info2_t obj_info; -#else H5O_info_t obj_info; -#endif char obj_name[STR_LEN + 1]; hsize_t dims[1] = {ATT_LEN}; /* netcdf attributes always 1-D. */ From 388bbf4e732acc58c7923f228b1bc39328aeb856 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 11 Jan 2021 09:48:04 -0600 Subject: [PATCH 04/11] Allow for the HDF5 file format to be compatible with features greater than HDF5 1.8. This will allow for HDF5 features (VDS, SWMR, new references, etc...) which may require to have a superblock greater than v2. See for discussion Ref: Update HDF5 format compatibility Unidata#951 --- libhdf5/hdf5create.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libhdf5/hdf5create.c b/libhdf5/hdf5create.c index 73bfda70bf..4238df2e95 100644 --- a/libhdf5/hdf5create.c +++ b/libhdf5/hdf5create.c @@ -167,10 +167,16 @@ nc4_create_file(const char *path, int cmode, size_t initialsz, } #ifdef HAVE_H5PSET_LIBVER_BOUNDS -#if H5_VERSION_GE(1,10,2) - if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) +#if H5_VERSION_LT(1,10,0) + /* all HDF5 1.8 lib versions */ + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0); #else - if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0) +#if H5_VERSION_LE(1,10,1) + /* lib versions 1.10.0, 1.10.1 */ + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0); +#else + /* lib versions 1.10.2 and higher */ + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0); #endif BAIL(NC_EHDFERR); #endif From e5cb3c2a45de3c67c8e0598de9127e7187ca5cef Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 11 Jan 2021 10:19:59 -0600 Subject: [PATCH 05/11] fixed #def --- libhdf5/hdf5create.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libhdf5/hdf5create.c b/libhdf5/hdf5create.c index 4238df2e95..44b5504a0c 100644 --- a/libhdf5/hdf5create.c +++ b/libhdf5/hdf5create.c @@ -177,6 +177,7 @@ nc4_create_file(const char *path, int cmode, size_t initialsz, #else /* lib versions 1.10.2 and higher */ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0); +#endif #endif BAIL(NC_EHDFERR); #endif From 7bec179038bb51824dd6d052974914a4e197aa55 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 11 Jan 2021 10:22:18 -0600 Subject: [PATCH 06/11] fixed syntax --- libhdf5/hdf5create.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libhdf5/hdf5create.c b/libhdf5/hdf5create.c index 44b5504a0c..21e43f385c 100644 --- a/libhdf5/hdf5create.c +++ b/libhdf5/hdf5create.c @@ -169,14 +169,14 @@ nc4_create_file(const char *path, int cmode, size_t initialsz, #ifdef HAVE_H5PSET_LIBVER_BOUNDS #if H5_VERSION_LT(1,10,0) /* all HDF5 1.8 lib versions */ - if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0); + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) #else #if H5_VERSION_LE(1,10,1) /* lib versions 1.10.0, 1.10.1 */ - if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0); + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0) #else /* lib versions 1.10.2 and higher */ - if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0); + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) #endif #endif BAIL(NC_EHDFERR); From 46b2e1d6664b773dd4cbc4c71aa8b3a50131ed6f Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 11 Jan 2021 10:36:53 -0600 Subject: [PATCH 07/11] removed the use of H5_VERSION_LT --- libhdf5/hdf5create.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libhdf5/hdf5create.c b/libhdf5/hdf5create.c index 21e43f385c..3a7eeb388e 100644 --- a/libhdf5/hdf5create.c +++ b/libhdf5/hdf5create.c @@ -167,16 +167,16 @@ nc4_create_file(const char *path, int cmode, size_t initialsz, } #ifdef HAVE_H5PSET_LIBVER_BOUNDS -#if H5_VERSION_LT(1,10,0) - /* all HDF5 1.8 lib versions */ - if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) +#if H5_VERSION_GE(1,10,2) + /* lib versions 1.10.2 and higher */ + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) #else -#if H5_VERSION_LE(1,10,1) +#if H5_VERSION_GE(1,10,0) /* lib versions 1.10.0, 1.10.1 */ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0) #else - /* lib versions 1.10.2 and higher */ - if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) + /* all HDF5 1.8 lib versions */ + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) #endif #endif BAIL(NC_EHDFERR); From a002ec4c9f99d6308d3fe1efa163485455b4e437 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 11 Jan 2021 11:17:25 -0600 Subject: [PATCH 08/11] Updated the superblock value for reference ncdumps --- ncdump/ref_tst_ncf213.cdl | 2 +- ncdump/ref_tst_special_atts.cdl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ncdump/ref_tst_ncf213.cdl b/ncdump/ref_tst_ncf213.cdl index 291e689015..9d395adeb8 100644 --- a/ncdump/ref_tst_ncf213.cdl +++ b/ncdump/ref_tst_ncf213.cdl @@ -45,7 +45,7 @@ variables: // global attributes: :_NCProperties = "version=2,netcdf=4.6.2-development,hdf5=1.10.1" ; - :_SuperblockVersion = 0 ; + :_SuperblockVersion = 2 ; :_IsNetcdf4 = 1 ; :_Format = "netCDF-4" ; } diff --git a/ncdump/ref_tst_special_atts.cdl b/ncdump/ref_tst_special_atts.cdl index 41ca757cfc..552e0a4677 100644 --- a/ncdump/ref_tst_special_atts.cdl +++ b/ncdump/ref_tst_special_atts.cdl @@ -52,7 +52,7 @@ variables: // global attributes: :_NCProperties = "version=2,netcdf=4.7.4-development,hdf5=1.10.4," ; - :_SuperblockVersion = 0 ; + :_SuperblockVersion = 2 ; :_IsNetcdf4 = 1 ; :_Format = "netCDF-4" ; data: From 4de0046f1e98192c8de1196b5240f17adbb48598 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 11 Jan 2021 14:43:44 -0600 Subject: [PATCH 09/11] reverted changes superblock values --- ncdump/ref_tst_ncf213.cdl | 2 +- ncdump/ref_tst_special_atts.cdl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ncdump/ref_tst_ncf213.cdl b/ncdump/ref_tst_ncf213.cdl index 9d395adeb8..291e689015 100644 --- a/ncdump/ref_tst_ncf213.cdl +++ b/ncdump/ref_tst_ncf213.cdl @@ -45,7 +45,7 @@ variables: // global attributes: :_NCProperties = "version=2,netcdf=4.6.2-development,hdf5=1.10.1" ; - :_SuperblockVersion = 2 ; + :_SuperblockVersion = 0 ; :_IsNetcdf4 = 1 ; :_Format = "netCDF-4" ; } diff --git a/ncdump/ref_tst_special_atts.cdl b/ncdump/ref_tst_special_atts.cdl index 552e0a4677..41ca757cfc 100644 --- a/ncdump/ref_tst_special_atts.cdl +++ b/ncdump/ref_tst_special_atts.cdl @@ -52,7 +52,7 @@ variables: // global attributes: :_NCProperties = "version=2,netcdf=4.7.4-development,hdf5=1.10.4," ; - :_SuperblockVersion = 2 ; + :_SuperblockVersion = 0 ; :_IsNetcdf4 = 1 ; :_Format = "netCDF-4" ; data: From 991bf075d929a0048efdb424f65b6de51002c187 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 11 Jan 2021 15:13:21 -0600 Subject: [PATCH 10/11] updated ncdump scripts to handle different versions of superblock values --- ncdump/tst_netcdf4.sh | 2 +- ncdump/tst_netcdf4_4.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ncdump/tst_netcdf4.sh b/ncdump/tst_netcdf4.sh index d3737e3592..d13464587c 100755 --- a/ncdump/tst_netcdf4.sh +++ b/ncdump/tst_netcdf4.sh @@ -14,7 +14,7 @@ cleanncprops() { rm -f $dst cat $src \ | sed -e '/:_Endianness/d' \ - | sed -e 's/_SuperblockVersion = 1/_SuperblockVersion = 0/' \ + | sed -e 's/_SuperblockVersion = [12]/_SuperblockVersion = 0/' \ | sed -e 's/\(netcdflibversion\|netcdf\)=.*|/\1=NNNN|/' \ | sed -e 's/\(hdf5libversion\|hdf5\)=.*"/\1=HHHH"/' \ | grep -v '_NCProperties' \ diff --git a/ncdump/tst_netcdf4_4.sh b/ncdump/tst_netcdf4_4.sh index dd9fb88362..620d7c6638 100755 --- a/ncdump/tst_netcdf4_4.sh +++ b/ncdump/tst_netcdf4_4.sh @@ -14,7 +14,7 @@ cleanncprops() { rm -f $dst cat $src \ | sed -e '/:_Endianness/d' \ - | sed -e 's/_SuperblockVersion = 1/_SuperblockVersion = 0/' \ + | sed -e 's/_SuperblockVersion = [12]/_SuperblockVersion = 0/' \ | sed -e 's/\(netcdflibversion\|netcdf\)=.*|/\1=NNNN|/' \ | sed -e 's/\(hdf5libversion\|hdf5\)=.*"/\1=HHHH"/' \ | grep -v '_NCProperties' \ From a464bea84bbee096c64e6f839e2e642d96c158b4 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 11 Jan 2021 16:36:23 -0600 Subject: [PATCH 11/11] removed the check for H5Pset_libver_bounds (HAVE_H5PSET_LIBVER_BOUNDS) since API function was introduced in 1.8.0 (and some tests used H5Pset_libver_bounds without checking HAVE_H5PSET_LIBVER_BOUNDS. --- CMakeLists.txt | 1 - config.h.cmake.in | 3 --- configure.ac | 2 +- libhdf5/hdf5create.c | 2 -- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0fdc29c40..b56224299c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -767,7 +767,6 @@ IF(USE_HDF5) #Check to see if HDF5 library has collective metadata APIs, (HDF5 >= 1.10.0) CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Pset_all_coll_metadata_ops "" HDF5_HAS_COLL_METADATA_OPS) - CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Pset_libver_bounds "" HAVE_H5PSET_LIBVER_BOUNDS) CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5free_memory "" HAVE_H5FREE_MEMORY) CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5allocate_memory "" HAVE_H5ALLOCATE_MEMORY) CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5resize_memory "" HAVE_H5RESIZE_MEMORY) diff --git a/config.h.cmake.in b/config.h.cmake.in index 16acff835a..a6cd6bb79b 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -253,9 +253,6 @@ are set when opening a binary file on Windows. */ /* Define to 1 if you have the `gettimeofday' function. */ #cmakedefine HAVE_STRUCT_TIMESPEC 1 -/* if true, netcdf4 file properties will be set using H5Pset_libver_bounds */ -#cmakedefine HAVE_H5PSET_LIBVER_BOUNDS 1 - /* Define to 1 if you have the `H5Z_SZIP' function. */ #cmakedefine HAVE_H5Z_SZIP 1 diff --git a/configure.ac b/configure.ac index 77406dd346..720db94622 100644 --- a/configure.ac +++ b/configure.ac @@ -1196,7 +1196,7 @@ if test "x$enable_hdf5" = xyes; then # H5Pset_fapl_mpiposix and H5Pget_fapl_mpiposix have been removed since HDF5 1.8.12. # Use H5Pset_fapl_mpio and H5Pget_fapl_mpio, instead. - AC_CHECK_FUNCS([H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5free_memory H5resize_memory H5allocate_memory H5Pset_libver_bounds H5Pset_all_coll_metadata_ops]) + AC_CHECK_FUNCS([H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5free_memory H5resize_memory H5allocate_memory H5Pset_all_coll_metadata_ops]) # Check to see if HDF5 library has collective metadata APIs, (HDF5 >= 1.10.0) if test "x$ac_cv_func_H5Pset_all_coll_metadata_ops" = xyes; then diff --git a/libhdf5/hdf5create.c b/libhdf5/hdf5create.c index 3a7eeb388e..76595116e4 100644 --- a/libhdf5/hdf5create.c +++ b/libhdf5/hdf5create.c @@ -166,7 +166,6 @@ nc4_create_file(const char *path, int cmode, size_t initialsz, nc4_chunk_cache_preemption)); } -#ifdef HAVE_H5PSET_LIBVER_BOUNDS #if H5_VERSION_GE(1,10,2) /* lib versions 1.10.2 and higher */ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) @@ -180,7 +179,6 @@ nc4_create_file(const char *path, int cmode, size_t initialsz, #endif #endif BAIL(NC_EHDFERR); -#endif /* Create the property list. */ if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0)