summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-02-14 15:57:48 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-02-14 15:57:48 (GMT)
commit5883b9d67d32b3319f1ef5634acaa697733c07ed (patch)
tree937bcf76b9471c93db037fa3e588c980a869b964 /src
parenta1c37b6eb8c01cd87a1c442da76172e51da05b79 (diff)
downloadhdf5-5883b9d67d32b3319f1ef5634acaa697733c07ed.zip
hdf5-5883b9d67d32b3319f1ef5634acaa697733c07ed.tar.gz
hdf5-5883b9d67d32b3319f1ef5634acaa697733c07ed.tar.bz2
[svn-r4965] 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)
Diffstat (limited to 'src')
-rw-r--r--src/H5D.c13
-rw-r--r--src/H5Sall.c15
-rw-r--r--src/H5Smpio.c17
-rw-r--r--src/H5Spkg.h12
-rw-r--r--src/H5Sprivate.h28
5 files changed, 51 insertions, 34 deletions
diff --git a/src/H5D.c b/src/H5D.c
index bb4ba39..ca017c3 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -2238,11 +2238,13 @@ printf("%s: check 1.1, \n",FUNC);
#endif
if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get pipeline");
+ if(H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve fill value");
if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get external file list");
status = (sconv->read)(dataset->ent.file, &(dataset->layout), &pline,
- &efl, H5T_get_size(dataset->type), file_space,
- mem_space, dxpl_id, buf/*out*/, &must_convert);
+ &fill, &efl, H5T_get_size(dataset->type), file_space,
+ mem_space, dxpl_id, buf/*out*/, &must_convert);
/* Supports only no conversion, type or space, for now. */
if (status<0)
@@ -2725,11 +2727,14 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
#endif
if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get pipeline");
+ if(H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve fill value");
if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get external file list");
status = (sconv->write)(dataset->ent.file, &(dataset->layout), &pline,
- &efl, H5T_get_size(dataset->type), file_space,
- mem_space, dxpl_id, buf/*out*/, &must_convert);
+ &fill, &efl, H5T_get_size(dataset->type), file_space,
+ mem_space, dxpl_id, buf/*out*/, &must_convert);
+
/* Supports only no conversion, type or space, for now. */
if (status<0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "optimized write failed");
diff --git a/src/H5Sall.c b/src/H5Sall.c
index fed5d18..76fe0d6 100644
--- a/src/H5Sall.c
+++ b/src/H5Sall.c
@@ -393,6 +393,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*/)
@@ -623,7 +624,7 @@ for (u=0; u<=mem_space->extent.u.simple.rank; u++)
printf("file_offset[%u]=%lu\n",u,(unsigned long)file_offset[u]);
#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) {
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL,
"unable to read data from the file");
@@ -661,10 +662,12 @@ done:
*/
herr_t
H5S_all_write(H5F_t *f, const struct H5O_layout_t *layout,
- const H5O_pline_t *pline, 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*/)
+ 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*/)
{
H5S_hyper_span_t *file_span=NULL,*mem_span=NULL; /* Hyperslab span node */
const char *buf=(const char*)_buf; /* Get pointer to buffer */
@@ -880,7 +883,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) {
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
"unable to write data to the file");
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index e6cc074..ab15ad6 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -551,6 +551,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*/,
@@ -720,6 +721,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*/,
@@ -729,7 +731,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*/);
@@ -755,17 +757,18 @@ 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_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*/)
{
herr_t ret_value = FAIL;
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 9e44930..7e3da29 100644
--- a/src/H5Spkg.h
+++ b/src/H5Spkg.h
@@ -146,16 +146,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 42986d7..e024502 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -142,6 +142,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*/,
@@ -150,11 +151,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 {
@@ -227,6 +229,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,
@@ -235,13 +238,14 @@ __DLL__ herr_t H5S_mpio_spaces_read(H5F_t *f,
/* MPI-IO function to write directly from app buffer to file rky980813 */
__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_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_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,
+ hbool_t *must_convert /*out*/ );
#ifndef _H5S_IN_H5S_C
/* Global var whose value comes from environment variable */
__DLLVAR__ hbool_t H5_mpi_opt_types_g;