summaryrefslogtreecommitdiffstats
path: root/src/H5Dcontig.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Dcontig.c')
-rw-r--r--src/H5Dcontig.c58
1 files changed, 26 insertions, 32 deletions
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index b5b9b0d..a24abe6 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -195,8 +195,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id)
+H5D__contig_fill(const H5D_io_info_t *io_info)
{
+ const H5D_t *dset = io_info->dset; /* the dataset pointer */
H5D_io_info_t ioinfo; /* Dataset I/O info */
H5D_storage_t store; /* Union of storage info for dataset */
H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */
@@ -211,15 +212,17 @@ H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id)
hbool_t blocks_written = FALSE; /* Flag to indicate that chunk was actually written */
hbool_t using_mpi = FALSE; /* Flag to indicate that the file is being accessed with an MPI-capable file driver */
#endif /* H5_HAVE_PARALLEL */
+ hid_t md_dxpl_id = io_info->md_dxpl_id;
+ hid_t raw_dxpl_id = io_info->raw_dxpl_id;
H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */
hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */
- hid_t my_dxpl_id; /* DXPL ID to use for this operation */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
/* Check args */
- HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER));
+ HDassert(TRUE == H5P_isa_class(md_dxpl_id, H5P_DATASET_XFER));
+ HDassert(TRUE == H5P_isa_class(raw_dxpl_id, H5P_DATASET_XFER));
HDassert(dset && H5D_CONTIGUOUS == dset->shared->layout.type);
HDassert(H5F_addr_defined(dset->shared->layout.storage.u.contig.addr));
HDassert(dset->shared->layout.storage.u.contig.size > 0);
@@ -239,20 +242,11 @@ H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id)
/* Set the MPI-capable file driver flag */
using_mpi = TRUE;
-
- /* Use the internal "independent" DXPL */
- my_dxpl_id = H5AC_ind_dxpl_id;
} /* end if */
- else {
-#endif /* H5_HAVE_PARALLEL */
- /* Use the DXPL we were given */
- my_dxpl_id = dxpl_id;
-#ifdef H5_HAVE_PARALLEL
- } /* end else */
#endif /* H5_HAVE_PARALLEL */
/* Fill the DXPL cache values for later use */
- if(H5D__get_dxpl_cache(my_dxpl_id, &dxpl_cache) < 0)
+ if(H5D__get_dxpl_cache(raw_dxpl_id, &dxpl_cache) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache")
/* Initialize storage info for this dataset */
@@ -268,7 +262,7 @@ H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id)
if(H5D__fill_init(&fb_info, NULL, NULL, NULL, NULL, NULL,
&dset->shared->dcpl_cache.fill,
dset->shared->type, dset->shared->type_id, npoints,
- dxpl_cache->max_temp_buf, my_dxpl_id) < 0)
+ dxpl_cache->max_temp_buf, md_dxpl_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info")
fb_info_init = TRUE;
@@ -276,7 +270,7 @@ H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id)
offset = 0;
/* Simple setup for dataset I/O info struct */
- H5D_BUILD_IO_INFO_WRT(&ioinfo, dset, dxpl_cache, my_dxpl_id, &store, fb_info.fill_buf);
+ H5D_BUILD_IO_INFO_WRT(&ioinfo, dset, dxpl_cache, H5AC_ind_read_dxpl_id, raw_dxpl_id, &store, fb_info.fill_buf);
/*
* Fill the entire current extent with the fill value. We can do
@@ -296,7 +290,7 @@ H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id)
/* Check for VL datatype & non-default fill value */
if(fb_info.has_vlen_fill_type)
/* Re-fill the buffer to use for this I/O operation */
- if(H5D__fill_refill_vl(&fb_info, curr_points, my_dxpl_id) < 0)
+ if(H5D__fill_refill_vl(&fb_info, curr_points, md_dxpl_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer")
#ifdef H5_HAVE_PARALLEL
@@ -940,7 +934,7 @@ H5D__contig_readvv(const H5D_io_info_t *io_info,
udata.dset_contig = &(io_info->dset->shared->cache.contig);
udata.store_contig = &(io_info->store->contig);
udata.rbuf = (unsigned char *)io_info->u.rbuf;
- udata.dxpl_id = io_info->dxpl_id;
+ udata.dxpl_id = io_info->raw_dxpl_id;
/* Call generic sequence operation routine */
if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
@@ -955,7 +949,7 @@ H5D__contig_readvv(const H5D_io_info_t *io_info,
udata.file = io_info->dset->oloc.file;
udata.dset_addr = io_info->store->contig.dset_addr;
udata.rbuf = (unsigned char *)io_info->u.rbuf;
- udata.dxpl_id = io_info->dxpl_id;
+ udata.dxpl_id = io_info->raw_dxpl_id;
/* Call generic sequence operation routine */
if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
@@ -1026,10 +1020,9 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
if(NULL == (dset_contig->sieve_buf = H5FL_BLK_CALLOC(sieve_buf, dset_contig->sieve_buf_size)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "memory allocation failed")
-#ifdef H5_CLEAR_MEMORY
-if(dset_contig->sieve_size > len)
- HDmemset(dset_contig->sieve_buf + len, 0, (dset_contig->sieve_size - len));
-#endif /* H5_CLEAR_MEMORY */
+ /* Clear memory */
+ if(dset_contig->sieve_size > len)
+ HDmemset(dset_contig->sieve_buf + len, 0, (dset_contig->sieve_size - len));
/* Determine the new sieve buffer size & location */
dset_contig->sieve_loc = addr;
@@ -1267,7 +1260,7 @@ H5D__contig_writevv(const H5D_io_info_t *io_info,
udata.dset_contig = &(io_info->dset->shared->cache.contig);
udata.store_contig = &(io_info->store->contig);
udata.wbuf = (const unsigned char *)io_info->u.wbuf;
- udata.dxpl_id = io_info->dxpl_id;
+ udata.dxpl_id = io_info->raw_dxpl_id;
/* Call generic sequence operation routine */
if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
@@ -1282,7 +1275,7 @@ H5D__contig_writevv(const H5D_io_info_t *io_info,
udata.file = io_info->dset->oloc.file;
udata.dset_addr = io_info->store->contig.dset_addr;
udata.wbuf = (const unsigned char *)io_info->u.wbuf;
- udata.dxpl_id = io_info->dxpl_id;
+ udata.dxpl_id = io_info->raw_dxpl_id;
/* Call generic sequence operation routine */
if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
@@ -1309,7 +1302,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D__contig_flush(H5D_t *dset, hid_t dxpl_id)
+H5D__contig_flush(H5D_t *dset, hid_t H5_ATTR_UNUSED dxpl_id)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -1318,8 +1311,9 @@ H5D__contig_flush(H5D_t *dset, hid_t dxpl_id)
/* Sanity check */
HDassert(dset);
- /* Flush any data in sieve buffer */
- if(H5D__flush_sieve_buf(dset, dxpl_id) < 0)
+ /* Flush any data in sieve buffer - use the raw data dxpl since
+ the one passed in is a metadata dxpl. */
+ if(H5D__flush_sieve_buf(dset, H5AC_rawdata_dxpl_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush sieve buffer")
done:
@@ -1518,8 +1512,8 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src,
dst_nbytes = mem_nbytes = src_nbytes;
} /* end if */
- /* Read raw data from source file */
- if(H5F_block_read(f_src, H5FD_MEM_DRAW, addr_src, src_nbytes, H5P_DATASET_XFER_DEFAULT, buf) < 0)
+ /* Read raw data from source file - use raw dxpl because passed in one is metadata */
+ if(H5F_block_read(f_src, H5FD_MEM_DRAW, addr_src, src_nbytes, H5AC_rawdata_dxpl_id, buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to read raw data")
/* Perform datatype conversion, if necessary */
@@ -1539,7 +1533,7 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src,
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed")
/* Reclaim space from variable length data */
- if(H5D_vlen_reclaim(tid_mem, buf_space, H5P_DATASET_XFER_DEFAULT, reclaim_buf) < 0)
+ if(H5D_vlen_reclaim(tid_mem, buf_space, dxpl_id, reclaim_buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to reclaim variable-length data")
} /* end if */
else if(fix_ref) {
@@ -1562,8 +1556,8 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src,
HDmemset(buf, 0, src_nbytes);
} /* end if */
- /* Write raw data to destination file */
- if(H5F_block_write(f_dst, H5FD_MEM_DRAW, addr_dst, dst_nbytes, H5P_DATASET_XFER_DEFAULT, buf) < 0)
+ /* Write raw data to destination file - use raw dxpl because passed in one is metadata */
+ if(H5F_block_write(f_dst, H5FD_MEM_DRAW, addr_dst, dst_nbytes, H5AC_rawdata_dxpl_id, buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data")
/* Adjust loop variables */