From 91213082b5e6353cb4767f2281f85abbc4c5c9de Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 4 Sep 2020 08:07:30 -0500 Subject: Correct COPYING path --- CMakeInstallation.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 94d3139..a3b9632 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -278,7 +278,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_PACKAGE_VERSION_PATCH "") if (EXISTS "${HDF5_SOURCE_DIR}/release_docs") set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") - set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING") + set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") endif () set (CPACK_PACKAGE_RELOCATABLE TRUE) -- cgit v0.12 From 6b71d6dc9453e8f94ac82732496ee59ca6495587 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 4 Sep 2020 15:44:33 -0500 Subject: Add zllib and szip pages --- config/cmake/README.txt.cmake.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index 3afebc2..f621515 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -17,6 +17,18 @@ The contents of this directory are: README.txt - This file @HDF5_PACKAGE_NAME@-@HDF5_PACKAGE_VERSION@-@BINARY_SYSTEM_NAME@.@BINARY_INSTALL_ENDING@ - HDF5 Install Package +This binary was built with the ZLIB and SZIP/Libaec external libraries and are +included for convenience. Libaec is an unrestricted open-source replacement for SZIP +(version 1.0.4, Encoder ENABLED). + +The official ZLIB and SZIP/Libaec pages are at: + + ZLIB: https://git.savannah.gnu.org/cgit/gzip.git/ + https://git.savannah.gnu.org/cgit/gzip.git/tree/COPYING + SZIP/Libaec: https://gitlab.dkrz.de/k202009/libaec + https://gitlab.dkrz.de/k202009/libaec/-/blob/master/Copyright.txt + + Installation =========================================================================== 1. Execute @HDF5_PACKAGE_NAME@-@HDF5_PACKAGE_VERSION@-@BINARY_SYSTEM_NAME@.@BINARY_INSTALL_ENDING@ -- cgit v0.12 From ce0f87fb351c1aa0e7842e40ca5ea5e7d1c3da2b Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 18 Sep 2020 00:12:37 -0500 Subject: Add H5Ssel_iter_init API call to reset a selection iterator --- src/H5Spublic.h | 1 + src/H5Sselect.c | 46 +++++++++++++++ test/tselect.c | 174 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 221 insertions(+) diff --git a/src/H5Spublic.h b/src/H5Spublic.h index 1ca79ea..6e5c652 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -178,6 +178,7 @@ H5_DLL hid_t H5Sselect_project_intersection(hid_t src_space_id, H5_DLL hid_t H5Ssel_iter_create(hid_t spaceid, size_t elmt_size, unsigned flags); H5_DLL herr_t H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq, size_t maxbytes, size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len); +H5_DLL herr_t H5Ssel_iter_reset(hid_t sel_iter_id, hid_t space_id); H5_DLL herr_t H5Ssel_iter_close(hid_t sel_iter_id); /* Symbols defined for compatibility with previous versions of the HDF5 API. diff --git a/src/H5Sselect.c b/src/H5Sselect.c index eb5cf1c..d021f0c 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -3116,6 +3116,52 @@ done: } /* end H5Ssel_iter_get_seq_list() */ +/*-------------------------------------------------------------------------- + NAME + H5Ssel_iter_reset + PURPOSE + Resets a dataspace selection iterator back to an initial state. + USAGE + herr_t H5Ssel_iter_reset(sel_iter_id) + hid_t sel_iter_id; IN: ID of the dataspace selection iterator to + reset + hid_t space_id; IN: ID of the dataspace with selection to + iterate over + RETURNS + Non-negative on success / Negative on failure + DESCRIPTION + Resets a dataspace selection iterator back to an initial state so that + the iterator may be used for iteration once again. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +herr_t +H5Ssel_iter_reset(hid_t sel_iter_id, hid_t space_id) +{ + H5S_sel_iter_t *sel_iter; + H5S_t *space; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "ii", sel_iter_id, space_id); + + /* Check args */ + if(NULL == (sel_iter = (H5S_sel_iter_t *)H5I_object_verify(sel_iter_id, H5I_SPACE_SEL_ITER))) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "not a dataspace selection iterator") + if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "not a dataspace") + + /* Simply re-initialize iterator */ + if(H5S_select_iter_init(sel_iter, space, sel_iter->elmt_size, sel_iter->flags) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to re-initialize selection iterator") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Ssel_iter_reset() */ + + /*------------------------------------------------------------------------- * Function: H5S_sel_iter_close * diff --git a/test/tselect.c b/test/tselect.c index c98db5d..cdf0ba5 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -14990,6 +14990,16 @@ test_sel_iter(void) iter_id = H5Ssel_iter_create(sid, (size_t)1, (unsigned)sel_iter_flags); CHECK(iter_id, FAIL, "H5Ssel_iter_create"); + /* Try resetting selection iterator with bad parameters */ + H5E_BEGIN_TRY { + ret = H5Ssel_iter_reset(H5I_INVALID_HID, sid); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Ssel_iter_reset"); + H5E_BEGIN_TRY { + ret = H5Ssel_iter_reset(iter_id, H5I_INVALID_HID); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Ssel_iter_reset"); + /* Try retrieving sequences, with bad parameters */ H5E_BEGIN_TRY { /* Invalid ID */ ret = H5Ssel_iter_get_seq_list(H5I_INVALID_HID, (size_t)1, (size_t)1, &nseq, &nbytes, off, len); @@ -15115,6 +15125,150 @@ test_sel_iter(void) CHECK(ret, FAIL, "H5Ssel_iter_close"); } /* end for */ + /* Create selection iterator object */ + iter_id = H5Ssel_iter_create(sid, (size_t)1, (unsigned)sel_iter_flags); + CHECK(iter_id, FAIL, "H5Ssel_iter_create"); + + /* Test iterators on various basic selection types using + * H5Ssel_iter_reset instead of creating multiple iterators */ + for(sel_type = H5S_SEL_NONE; sel_type <= H5S_SEL_ALL; sel_type = (H5S_sel_type)(sel_type + 1)) { + switch(sel_type) { + case H5S_SEL_NONE: /* "None" selection */ + ret = H5Sselect_none(sid); + CHECK(ret, FAIL, "H5Sselect_none"); + break; + + case H5S_SEL_POINTS: /* Point selection */ + /* Select sequence of ten points */ + coord1[0][0] = 0; coord1[0][1] = 9; + coord1[1][0] = 1; coord1[1][1] = 2; + coord1[2][0] = 2; coord1[2][1] = 4; + coord1[3][0] = 0; coord1[3][1] = 6; + coord1[4][0] = 1; coord1[4][1] = 8; + coord1[5][0] = 2; coord1[5][1] = 10; + coord1[6][0] = 0; coord1[6][1] = 11; + coord1[7][0] = 1; coord1[7][1] = 4; + coord1[8][0] = 2; coord1[8][1] = 1; + coord1[9][0] = 0; coord1[9][1] = 3; + ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1); + CHECK(ret, FAIL, "H5Sselect_elements"); + break; + + case H5S_SEL_HYPERSLABS: /* Hyperslab selection */ + /* Select regular hyperslab */ + start[0] = 3; start[1] = 0; + stride[0] = 2; stride[1] = 2; + count[0] = 2; count[1] = 5; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + break; + + case H5S_SEL_ALL: /* "All" selection */ + ret = H5Sselect_all(sid); + CHECK(ret, FAIL, "H5Sselect_all"); + break; + + case H5S_SEL_ERROR: + case H5S_SEL_N: + default: + HDassert(0 && "Can't occur"); + break; + } /* end switch */ + + /* Try retrieving no sequences, with 0 for maxseq & maxbytes */ + ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)0, (size_t)1, &nseq, &nbytes, off, len); + CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list"); + VERIFY(nseq, 0, "H5Ssel_iter_get_seq_list"); + VERIFY(nbytes, 0, "H5Ssel_iter_get_seq_list"); + ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)1, (size_t)0, &nseq, &nbytes, off, len); + CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list"); + VERIFY(nseq, 0, "H5Ssel_iter_get_seq_list"); + VERIFY(nbytes, 0, "H5Ssel_iter_get_seq_list"); + + /* Reset iterator */ + ret = H5Ssel_iter_reset(iter_id, sid); + CHECK(ret, FAIL, "H5Ssel_iter_reset"); + + /* Try retrieving all sequences */ + ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)SEL_ITER_MAX_SEQ, (size_t)(1024 * 1024), &nseq, &nbytes, off, len); + CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list"); + + /* Check results from retrieving sequence list */ + switch(sel_type) { + case H5S_SEL_NONE: /* "None" selection */ + VERIFY(nseq, 0, "H5Ssel_iter_get_seq_list"); + VERIFY(nbytes, 0, "H5Ssel_iter_get_seq_list"); + break; + + case H5S_SEL_POINTS: /* Point selection */ + VERIFY(nseq, 10, "H5Ssel_iter_get_seq_list"); + VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list"); + break; + + case H5S_SEL_HYPERSLABS: /* Hyperslab selection */ + VERIFY(nseq, 10, "H5Ssel_iter_get_seq_list"); + VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list"); + break; + + case H5S_SEL_ALL: /* "All" selection */ + VERIFY(nseq, 1, "H5Ssel_iter_get_seq_list"); + VERIFY(nbytes, 72, "H5Ssel_iter_get_seq_list"); + break; + + case H5S_SEL_ERROR: + case H5S_SEL_N: + default: + HDassert(0 && "Can't occur"); + break; + } /* end switch */ + + /* Reset iterator */ + ret = H5Ssel_iter_reset(iter_id, sid); + CHECK(ret, FAIL, "H5Ssel_iter_reset"); + + /* Try retrieving all sequences again */ + ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)SEL_ITER_MAX_SEQ, (size_t)(1024 * 1024), &nseq, &nbytes, off, len); + CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list"); + + /* Check results from retrieving sequence list */ + switch(sel_type) { + case H5S_SEL_NONE: /* "None" selection */ + VERIFY(nseq, 0, "H5Ssel_iter_get_seq_list"); + VERIFY(nbytes, 0, "H5Ssel_iter_get_seq_list"); + break; + + case H5S_SEL_POINTS: /* Point selection */ + VERIFY(nseq, 10, "H5Ssel_iter_get_seq_list"); + VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list"); + break; + + case H5S_SEL_HYPERSLABS: /* Hyperslab selection */ + VERIFY(nseq, 10, "H5Ssel_iter_get_seq_list"); + VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list"); + break; + + case H5S_SEL_ALL: /* "All" selection */ + VERIFY(nseq, 1, "H5Ssel_iter_get_seq_list"); + VERIFY(nbytes, 72, "H5Ssel_iter_get_seq_list"); + break; + + case H5S_SEL_ERROR: + case H5S_SEL_N: + default: + HDassert(0 && "Can't occur"); + break; + } /* end switch */ + + /* Reset iterator */ + ret = H5Ssel_iter_reset(iter_id, sid); + CHECK(ret, FAIL, "H5Ssel_iter_reset"); + } /* end for */ + + /* Close selection iterator */ + ret = H5Ssel_iter_close(iter_id); + CHECK(ret, FAIL, "H5Ssel_iter_close"); + /* Point selection which will merge into smaller # of sequences */ coord1[0][0] = 0; coord1[0][1] = 9; coord1[1][0] = 0; coord1[1][1] = 10; @@ -15139,6 +15293,16 @@ test_sel_iter(void) VERIFY(nseq, 6, "H5Ssel_iter_get_seq_list"); VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list"); + /* Reset iterator */ + ret = H5Ssel_iter_reset(iter_id, sid); + CHECK(ret, FAIL, "H5Ssel_iter_reset"); + + /* Try retrieving all sequences again */ + ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)SEL_ITER_MAX_SEQ, (size_t)(1024 * 1024), &nseq, &nbytes, off, len); + CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list"); + VERIFY(nseq, 6, "H5Ssel_iter_get_seq_list"); + VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list"); + /* Close selection iterator */ ret = H5Ssel_iter_close(iter_id); CHECK(ret, FAIL, "H5Ssel_iter_close"); @@ -15169,6 +15333,16 @@ test_sel_iter(void) VERIFY(nseq, 6, "H5Ssel_iter_get_seq_list"); VERIFY(nbytes, 20, "H5Ssel_iter_get_seq_list"); + /* Reset iterator */ + ret = H5Ssel_iter_reset(iter_id, sid); + CHECK(ret, FAIL, "H5Ssel_iter_reset"); + + /* Try retrieving all sequences again */ + ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)SEL_ITER_MAX_SEQ, (size_t)(1024 * 1024), &nseq, &nbytes, off, len); + CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list"); + VERIFY(nseq, 6, "H5Ssel_iter_get_seq_list"); + VERIFY(nbytes, 20, "H5Ssel_iter_get_seq_list"); + /* Close selection iterator */ ret = H5Ssel_iter_close(iter_id); CHECK(ret, FAIL, "H5Ssel_iter_close"); -- cgit v0.12 From 9b3a3445dbb72a95b2b9355e0196efdaa5b0f452 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 18 Sep 2020 13:31:50 -0500 Subject: Add release note for new H5Ssel_iter_reset function --- release_docs/RELEASE.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index dbf55a9..9577fbd 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -382,6 +382,16 @@ New Features Library: -------- + - Add new public function H5Ssel_iter_reset + + This function resets a dataspace selection iterator back to an + initial state so that it may be used for iteration once more. + This can be useful when needing to iterate over a selection + multiple times without having to repeatedly create/destroy + a selection iterator for that dataspace selection. + + (JTH - 2020/09/18) + - Remove HDFS VFD stubs The original implementation of the HDFS VFD included non-functional -- cgit v0.12 From c15f8674d9600c72b33823c55587051cf66811ef Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 23 Sep 2020 09:37:35 -0500 Subject: Free selection type-specific info when resetting selection iterators --- src/H5Sselect.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/H5Sselect.c b/src/H5Sselect.c index d021f0c..5ba0f8d 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -3153,6 +3153,10 @@ H5Ssel_iter_reset(hid_t sel_iter_id, hid_t space_id) if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "not a dataspace") + /* Call selection type-specific release routine */ + if(H5S_SELECT_ITER_RELEASE(sel_iter) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "problem releasing a selection iterator's type-specific info") + /* Simply re-initialize iterator */ if(H5S_select_iter_init(sel_iter, space, sel_iter->elmt_size, sel_iter->flags) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to re-initialize selection iterator") -- cgit v0.12 From 739cd5723fe3435818075481687770996af42ef5 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 23 Sep 2020 18:23:14 -0500 Subject: Fix memory sanity check option in CMake --- config/cmake/H5pubconf.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 600b046..a4d07fc 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -518,7 +518,7 @@ #cmakedefine H5_LT_OBJDIR @H5_LT_OBJDIR@ /* Define to enable internal memory allocation sanity checking. */ -/* #cmakedefine H5_MEMORY_ALLOC_SANITY_CHECK @H5_MEMORY_ALLOC_SANITY_CHECK@ ** Define in CMakeLists.txt */ +#cmakedefine H5_MEMORY_ALLOC_SANITY_CHECK @H5_MEMORY_ALLOC_SANITY_CHECK@ /* Define if we can violate pointer alignment restrictions */ #cmakedefine H5_NO_ALIGNMENT_RESTRICTIONS @H5_NO_ALIGNMENT_RESTRICTIONS@ -- cgit v0.12