summaryrefslogtreecommitdiffstats
path: root/src/H5Dchunk.c
diff options
context:
space:
mode:
authorvchoi-hdfgroup <55293060+vchoi-hdfgroup@users.noreply.github.com>2023-08-04 21:36:50 (GMT)
committerGitHub <noreply@github.com>2023-08-04 21:36:50 (GMT)
commitede4987b636df78637d9357d00dba172278c2362 (patch)
treed8143cc1ed6fd489e42f5898b4c630d28fdfee54 /src/H5Dchunk.c
parent915cadb44f11b9875ec13c7396d3f5b17def1785 (diff)
downloadhdf5-ede4987b636df78637d9357d00dba172278c2362.zip
hdf5-ede4987b636df78637d9357d00dba172278c2362.tar.gz
hdf5-ede4987b636df78637d9357d00dba172278c2362.tar.bz2
Fix for the bug exposed from running test/set_extent.c when selection… (#3319)
* Fix for the bug exposed from running test/set_extent.c when selection I/O is enabled. This is a fix from Neil. The test/set_extent.c is modified to test for selection I/O enabled.
Diffstat (limited to 'src/H5Dchunk.c')
-rw-r--r--src/H5Dchunk.c44
1 files changed, 32 insertions, 12 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index be8ded4..8f34c2f 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -2731,11 +2731,20 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info)
}
} /* end if */
else if (!skip_missing_chunks) {
+ /* Set up nonexistent dataset info for (fill value) read from nonexistent chunk */
+ nonexistent_dset_info.layout_io_info.contig_piece_info = chunk_info;
+ nonexistent_dset_info.file_space = chunk_info->fspace;
+ nonexistent_dset_info.mem_space = chunk_info->mspace;
+ nonexistent_dset_info.nelmts = chunk_info->piece_points;
+
+ /* Set request_nelmts. This is not normally set by the upper layers because selection I/O
+ * usually does not use strip mining (H5D__scatgath_write), and instead allocates buffers
+ * large enough for the entire I/O. Set request_nelmts to be large enough for all selected
+ * elements in this chunk because it must be at least that large */
+ nonexistent_dset_info.type_info.request_nelmts = nonexistent_dset_info.nelmts;
+
/* Perform the actual read operation from the nonexistent chunk
*/
- nonexistent_dset_info.file_space = chunk_info->fspace;
- nonexistent_dset_info.mem_space = chunk_info->mspace;
- nonexistent_dset_info.nelmts = chunk_info->piece_points;
if ((dset_info->io_ops.single_read)(&nonexistent_io_info, &nonexistent_dset_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked read failed");
} /* end if */
@@ -2866,9 +2875,10 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info)
/* Perform the actual read operation */
assert(chk_io_info->count == 1);
- chk_io_info->dsets_info[0].file_space = chunk_info->fspace;
- chk_io_info->dsets_info[0].mem_space = chunk_info->mspace;
- chk_io_info->dsets_info[0].nelmts = chunk_info->piece_points;
+ chk_io_info->dsets_info[0].layout_io_info.contig_piece_info = chunk_info;
+ chk_io_info->dsets_info[0].file_space = chunk_info->fspace;
+ chk_io_info->dsets_info[0].mem_space = chunk_info->mspace;
+ chk_io_info->dsets_info[0].nelmts = chunk_info->piece_points;
if ((dset_info->io_ops.single_read)(chk_io_info, &chk_io_info->dsets_info[0]) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked read failed");
@@ -3055,10 +3065,19 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info)
/* Set up the storage buffer information for this chunk */
cpt_store.compact.buf = chunk;
+ /* Set up compact dataset info for write to cached chunk */
+ cpt_dset_info.layout_io_info.contig_piece_info = chunk_info;
+ cpt_dset_info.file_space = chunk_info->fspace;
+ cpt_dset_info.mem_space = chunk_info->mspace;
+ cpt_dset_info.nelmts = chunk_info->piece_points;
+
+ /* Set request_nelmts. This is not normally set by the upper layers because selection I/O
+ * usually does not use strip mining (H5D__scatgath_write), and instead allocates buffers
+ * large enough for the entire I/O. Set request_nelmts to be large enough for all selected
+ * elements in this chunk because it must be at least that large */
+ cpt_dset_info.type_info.request_nelmts = cpt_dset_info.nelmts;
+
/* Perform the actual write operation */
- cpt_dset_info.file_space = chunk_info->fspace;
- cpt_dset_info.mem_space = chunk_info->mspace;
- cpt_dset_info.nelmts = chunk_info->piece_points;
if ((dset_info->io_ops.single_write)(&cpt_io_info, &cpt_dset_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked write failed");
@@ -3253,9 +3272,10 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info)
/* Perform the actual write operation */
assert(chk_io_info->count == 1);
- chk_io_info->dsets_info[0].file_space = chunk_info->fspace;
- chk_io_info->dsets_info[0].mem_space = chunk_info->mspace;
- chk_io_info->dsets_info[0].nelmts = chunk_info->piece_points;
+ chk_io_info->dsets_info[0].layout_io_info.contig_piece_info = chunk_info;
+ chk_io_info->dsets_info[0].file_space = chunk_info->fspace;
+ chk_io_info->dsets_info[0].mem_space = chunk_info->mspace;
+ chk_io_info->dsets_info[0].nelmts = chunk_info->piece_points;
if ((dset_info->io_ops.single_write)(chk_io_info, &chk_io_info->dsets_info[0]) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked write failed");