diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index f9547f3281..b8619148c9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -362,6 +362,19 @@ Bug Fixes since HDF5-1.10.3 release Library ------- + - Fixed the slowness of regular hyperslab selection in a chunked dataset + + It was reported that the selection of every 10th element from a 20G + chunked dataset was extremely slow and sometimes could hang the system. + The problem was due to the iteration and the building of the span tree + for all the selected elements in file space. + + As the selected elements are going to a 1-d contiguous single block + memory space, the problem was fixed by building regular hyperslab selections + in memory space for the selected elements in file space. + + (VC - 2019/09/26, HDFFV-10585) + - Fixed a bug caused by bad tag value when condensing object header messages diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 7154d0b476..ed82b3b274 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -255,7 +255,7 @@ static herr_t H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); static herr_t H5D__chunk_io_init_selections(const H5D_io_info_t *io_info, - const H5D_type_info_t *type_info, hsize_t nelmts, H5D_chunk_map_t *fm); + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm); static herr_t H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); @@ -1160,7 +1160,7 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf fm->file_space = file_space; fm->mem_space = mem_space; - if(H5D__chunk_io_init_selections(io_info, type_info, nelmts, fm) < 0) + if(H5D__chunk_io_init_selections(io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file and memory chunk selections") done: @@ -1189,8 +1189,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_io_init_selections(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - hsize_t nelmts, H5D_chunk_map_t *fm) +H5D__chunk_io_init_selections(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm) { const H5D_t *dataset = io_info->dset; /* Local pointer to dataset info */ const H5T_t *mem_type = type_info->mem_type; /* Local pointer to memory datatype */ diff --git a/test/tselect.c b/test/tselect.c index 808704d809..91da4c402b 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -15329,7 +15329,7 @@ test_select_intersect_block(void) ** test_hyper_io_1d(): ** Test to verify all the selected 10th element in the 1-d file ** dataspace is read correctly into the 1-d contiguous memory space. -** This is modeled after the test scenario described in HDFFV-20585 +** This is modeled after the test scenario described in HDFFV-10585 ** that demonstrated the hyperslab slowness. A fix to speed up ** performance is in place to handle the special case for 1-d disjoint ** file dataspace into 1-d single block contiguous memory space. @@ -15361,22 +15361,22 @@ test_hyper_io_1d(void) /* Create the file file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - CHECK(fid, FAIL, "H5Fcreate"); + CHECK(fid, H5I_INVALID_HID, "H5Fcreate"); /* Create file dataspace */ dims[0] = CHUNKSZ; maxdims[0] = H5S_UNLIMITED; sid = H5Screate_simple(RANK, dims, maxdims); - CHECK(sid, FAIL, "H5Pcreate"); + CHECK(sid, H5I_INVALID_HID, "H5Pcreate"); /* Create memory dataspace */ dimsm[0] = CHUNKSZ; mid = H5Screate_simple(RANK, dimsm, NULL); - CHECK(mid, FAIL, "H5Pcreate"); + CHECK(mid, H5I_INVALID_HID, "H5Pcreate"); /* Set up to create a chunked dataset */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - CHECK(dcpl, FAIL, "H5Pcreate"); + CHECK(dcpl, H5I_INVALID_HID, "H5Pcreate"); chunk_dims[0] = CHUNKSZ; ret = H5Pset_chunk(dcpl, RANK, chunk_dims); @@ -15384,7 +15384,7 @@ test_hyper_io_1d(void) /* Create a chunked dataset */ did = H5Dcreate2(fid, DNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate2"); + CHECK(did, H5I_INVALID_HID, "H5Dcreate2"); /* Set up hyperslab selection for file dataspace */ offset[0] = 0; @@ -15411,7 +15411,7 @@ test_hyper_io_1d(void) /* Get the dataset's current dataspace */ sid = H5Dget_space(did); - CHECK(sid, FAIL, "H5Dget_space"); + CHECK(sid, H5I_INVALID_HID, "H5Dget_space"); } } @@ -15429,11 +15429,11 @@ test_hyper_io_1d(void) /* Open the file */ fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT); - CHECK(fid, FAIL, "H5Fopen"); + CHECK(fid, H5I_INVALID_HID, "H5Fopen"); /* Open the dataset */ did = H5Dopen(fid, DNAME, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); + CHECK(did, H5I_INVALID_HID, "H5Dopen"); /* Set up to read every 10th element in file dataspace */ offset[0] = 1; @@ -15443,14 +15443,14 @@ test_hyper_io_1d(void) /* Get the dataset's dataspace */ sid = H5Dget_space(did); - CHECK(sid, FAIL, "H5Pcreate"); + CHECK(sid, H5I_INVALID_HID, "H5Pcreate"); ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Set up contiguous memory dataspace for the selected elements */ dimsm[0] = count[0]; mid = H5Screate_simple(RANK, dimsm, NULL); - CHECK(mid, FAIL, "H5Screate"); + CHECK(mid, H5I_INVALID_HID, "H5Screate"); /* Read all the selected 10th elements in the dataset into "rdata" */ ret = H5Dread(did, H5T_NATIVE_INT, mid, sid, H5P_DEFAULT, rdata);