From b63cdf8c0cd91f327ac80d54c35e2631edb12632 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 Feb 2002 10:30:09 -0500 Subject: [svn-r4961] Purpose: Bug Fix Description: If a non-zero fill-value is used for a chunked dataset, any non-existent chunked read with an "all" selection (or a contiguous hyperslab selection) will return zero for those instead of the user's fill-value. Solution: Fixed I/O code to pass down fill-value to "optimized" I/O routines, so it will be available to fill the user's buffer with. Platforms tested: FreeBSD 4.5 (sleipnir) --- src/H5D.c | 2 ++ src/H5Sall.c | 9 ++++++--- src/H5Smpio.c | 7 +++++-- src/H5Spkg.h | 12 +++++++----- src/H5Sprivate.h | 14 +++++++++----- 5 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/H5D.c b/src/H5D.c index f81c4c2..a389b59 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -1712,6 +1712,7 @@ printf("%s: check 1.1, \n",FUNC); #endif status = (sconv->read)(dataset->ent.file, &(dataset->layout), &(dataset->create_parms->pline), + &(dataset->create_parms->fill), &(dataset->create_parms->efl), H5T_get_size (dataset->type), file_space, mem_space, dxpl_id, buf/*out*/, @@ -2194,6 +2195,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, #endif status = (sconv->write)(dataset->ent.file, &(dataset->layout), &(dataset->create_parms->pline), + &(dataset->create_parms->fill), &(dataset->create_parms->efl), H5T_get_size (dataset->type), file_space, mem_space, dxpl_id, buf, &must_convert/*out*/); diff --git a/src/H5Sall.c b/src/H5Sall.c index 55c9e4a..7388070 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -391,6 +391,7 @@ H5S_all_mscat (const void *tconv_buf, size_t elmt_size, */ herr_t H5S_all_read(H5F_t *f, const H5O_layout_t *layout, const H5O_pline_t *pline, + const struct H5O_fill_t *fill, const H5O_efl_t *efl, size_t elmt_size, const H5S_t *file_space, const H5S_t *mem_space, hid_t dxpl_id, void *_buf/*out*/, hbool_t *must_convert/*out*/) @@ -582,7 +583,7 @@ printf("%s: check 1.0\n",FUNC); printf("%s: check 2.0\n",FUNC); #endif /* QAK */ /* Read data from the file */ - if (H5F_arr_read(f, dxpl_id, layout, pline, NULL, efl, size, + if (H5F_arr_read(f, dxpl_id, layout, pline, fill, efl, size, size, mem_offset, file_offset, buf/*out*/)<0) { HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read data from the file"); @@ -620,7 +621,9 @@ fall_through: */ herr_t H5S_all_write(H5F_t *f, const struct H5O_layout_t *layout, - const H5O_pline_t *pline, const H5O_efl_t *efl, + const H5O_pline_t *pline, + const struct H5O_fill_t *fill, + const H5O_efl_t *efl, size_t elmt_size, const H5S_t *file_space, const H5S_t *mem_space, hid_t dxpl_id, const void *_buf, hbool_t *must_convert/*out*/) @@ -806,7 +809,7 @@ H5S_all_write(H5F_t *f, const struct H5O_layout_t *layout, } /* end if */ /* Write data to the file */ - if (H5F_arr_write(f, dxpl_id, layout, pline, NULL, efl, size, + if (H5F_arr_write(f, dxpl_id, layout, pline, fill, efl, size, size, mem_offset, file_offset, buf)<0) { HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write data to the file"); diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 38442f1..ae2081e 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -550,6 +550,7 @@ H5S_mpio_space_type( const H5S_t *space, const size_t elmt_size, herr_t H5S_mpio_spaces_xfer(H5F_t *f, const struct H5O_layout_t *layout, const struct H5O_pline_t UNUSED *pline, + const struct H5O_fill_t UNUSED *fill, const struct H5O_efl_t UNUSED *efl, size_t elmt_size, const H5S_t *file_space, const H5S_t *mem_space, hid_t dxpl_id, void *buf /*out*/, @@ -709,6 +710,7 @@ done: herr_t H5S_mpio_spaces_read(H5F_t *f, const struct H5O_layout_t *layout, const struct H5O_pline_t *pline, + const struct H5O_fill_t *fill, const struct H5O_efl_t *efl, size_t elmt_size, const H5S_t *file_space, const H5S_t *mem_space, hid_t dxpl_id, void *buf/*out*/, @@ -718,7 +720,7 @@ H5S_mpio_spaces_read(H5F_t *f, const struct H5O_layout_t *layout, FUNC_ENTER (H5S_mpio_spaces_read, FAIL); - ret_value = H5S_mpio_spaces_xfer(f, layout, pline, efl, elmt_size, + ret_value = H5S_mpio_spaces_xfer(f, layout, pline, fill, efl, elmt_size, file_space, mem_space, dxpl_id, buf, must_convert/*out*/, 0/*read*/); @@ -745,6 +747,7 @@ H5S_mpio_spaces_read(H5F_t *f, const struct H5O_layout_t *layout, herr_t H5S_mpio_spaces_write(H5F_t *f, const struct H5O_layout_t *layout, const struct H5O_pline_t *pline, + const struct H5O_fill_t *fill, const struct H5O_efl_t *efl, size_t elmt_size, const H5S_t *file_space, const H5S_t *mem_space, hid_t dxpl_id, const void *buf, @@ -754,7 +757,7 @@ H5S_mpio_spaces_write(H5F_t *f, const struct H5O_layout_t *layout, FUNC_ENTER (H5S_mpio_spaces_write, FAIL); - ret_value = H5S_mpio_spaces_xfer(f, layout, pline, efl, elmt_size, + ret_value = H5S_mpio_spaces_xfer(f, layout, pline, fill, efl, elmt_size, file_space, mem_space, dxpl_id, (void*)buf, must_convert/*out*/, 1/*write*/); diff --git a/src/H5Spkg.h b/src/H5Spkg.h index d85f3be..b24345e 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -162,16 +162,18 @@ __DLL__ herr_t H5S_all_select_deserialize(H5S_t *space, const uint8_t *buf); __DLL__ herr_t H5S_all_bounds(H5S_t *space, hsize_t *start, hsize_t *end); __DLL__ herr_t H5S_all_read(H5F_t *f, const struct H5O_layout_t *layout, const struct H5O_pline_t *pline, + const struct H5O_fill_t *fill, const struct H5O_efl_t *efl, size_t elmt_size, const H5S_t *file_space, const H5S_t *mem_space, hid_t dxpl_id, void *buf/*out*/, hbool_t *must_convert/*out*/); __DLL__ herr_t H5S_all_write(H5F_t *f, const struct H5O_layout_t *layout, - const struct H5O_pline_t *pline, - const struct H5O_efl_t *efl, size_t elmt_size, - const H5S_t *file_space, const H5S_t *mem_space, - hid_t dxpl_id, const void *buf, - hbool_t *must_convert/*out*/); + const struct H5O_pline_t *pline, + const struct H5O_fill_t *fill, + const struct H5O_efl_t *efl, size_t elmt_size, + const H5S_t *file_space, const H5S_t *mem_space, + hid_t dxpl_id, const void *buf, + hbool_t *must_convert/*out*/); __DLL__ herr_t H5S_all_select_iterate(void *buf, hid_t type_id, H5S_t *space, H5D_operator_t op, void *operator_data); diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index ffc2f76..d818082 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -149,6 +149,7 @@ typedef struct H5S_conv_t { /* Read from file to application w/o intermediate scratch buffer */ herr_t (*read)(H5F_t *f, const struct H5O_layout_t *layout, const struct H5O_pline_t *pline, + const struct H5O_fill_t *fill, const struct H5O_efl_t *efl, size_t elmt_size, const H5S_t *file_space, const H5S_t *mem_space, hid_t dxpl_id, void *buf/*out*/, @@ -157,11 +158,12 @@ typedef struct H5S_conv_t { /* Write directly from app buffer to file */ herr_t (*write)(H5F_t *f, const struct H5O_layout_t *layout, - const struct H5O_pline_t *pline, - const struct H5O_efl_t *efl, size_t elmt_size, - const H5S_t *file_space, const H5S_t *mem_space, - hid_t dxpl_id, const void *buf, - hbool_t *must_convert/*out*/); + const struct H5O_pline_t *pline, + const struct H5O_fill_t *fill, + const struct H5O_efl_t *efl, size_t elmt_size, + const H5S_t *file_space, const H5S_t *mem_space, + hid_t dxpl_id, const void *buf, + hbool_t *must_convert/*out*/); #ifdef H5S_DEBUG struct { @@ -240,6 +242,7 @@ __DLL__ herr_t H5S_sel_iter_release(const H5S_t *space, __DLL__ herr_t H5S_mpio_spaces_read(H5F_t *f, const struct H5O_layout_t *layout, const struct H5O_pline_t *pline, + const struct H5O_fill_t *fill, const struct H5O_efl_t *efl, size_t elmt_size, const H5S_t *file_space, const H5S_t *mem_space, hid_t dxpl_id, @@ -250,6 +253,7 @@ __DLL__ herr_t H5S_mpio_spaces_read(H5F_t *f, __DLL__ herr_t H5S_mpio_spaces_write(H5F_t *f, const struct H5O_layout_t *layout, const struct H5O_pline_t *pline, + const struct H5O_fill_t *fill, const struct H5O_efl_t *efl, size_t elmt_size, const H5S_t *file_space, const H5S_t *mem_space, hid_t dxpl_id, -- cgit v0.12