summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5D.c131
-rw-r--r--src/H5Distore.c323
-rw-r--r--src/H5Dseq.c274
-rw-r--r--src/H5Farray.c175
-rw-r--r--src/H5Fistore.c323
-rw-r--r--src/H5Fpkg.h27
-rw-r--r--src/H5Fprivate.h61
-rw-r--r--src/H5Fseq.c274
-rw-r--r--src/H5Ppkg.h10
-rw-r--r--src/H5Pprivate.h4
-rw-r--r--src/H5S.c88
-rw-r--r--src/H5Sall.c38
-rw-r--r--src/H5Shyper.c138
-rw-r--r--src/H5Smpio.c30
-rw-r--r--src/H5Spkg.h8
-rw-r--r--src/H5Spoint.c56
-rw-r--r--src/H5Sprivate.h27
-rw-r--r--src/H5Sselect.c2
18 files changed, 836 insertions, 1153 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 563cb67..7505040 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -2233,7 +2233,6 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
#ifdef H5S_DEBUG
H5_timer_t timer;
#endif
- H5O_pline_t pline; /* I/O Pipeline info */
H5O_efl_t efl; /* External File List info */
H5O_fill_t fill; /* Fill value info */
H5D_fill_time_t fill_time; /* When to write the fill values */
@@ -2303,8 +2302,6 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest data spaces have different sizes");
/* Retrieve dataset properties */
- if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve data pipeline");
if(H5P_fill_value_defined(dc_plist, &fill_status)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't tell if fill value defined");
if((fill_status==H5D_FILL_VALUE_DEFAULT || fill_status==H5D_FILL_VALUE_USER_DEFINED)
@@ -2385,7 +2382,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
/* Sanity check dataset, then read it */
assert(dataset->layout.addr!=HADDR_UNDEF || efl.nused>0);
status = (sconv->read)(dataset->ent.file, &(dataset->layout),
- &pline, &fill, &efl, H5T_get_size(dataset->type),
+ dc_plist, H5T_get_size(dataset->type),
file_space, mem_space, dxpl_id, buf/*out*/);
#ifdef H5S_DEBUG
H5_timer_end(&(sconv->stats[1].read_timer), &timer);
@@ -2492,7 +2489,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
/* Sanity check that space is allocated, then read data from it */
assert(dataset->layout.addr!=HADDR_UNDEF || efl.nused > 0);
n = (sconv->f->gath)(dataset->ent.file, &(dataset->layout),
- &pline, &fill, &efl, src_type_size, file_space,
+ dc_plist, src_type_size, file_space,
&file_iter, smine_nelmts, dxpl_id, tconv_buf/*out*/);
#ifdef H5S_DEBUG
@@ -2651,7 +2648,6 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
#ifdef H5S_DEBUG
H5_timer_t timer;
#endif
- H5O_pline_t pline; /* I/O Pipeline info */
H5O_efl_t efl; /* External File List info */
H5O_fill_t fill; /* Fill value info */
H5D_fill_time_t fill_time; /* When to write the fill values */
@@ -2740,8 +2736,6 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest data spaces have different sizes");
/* Retrieve dataset properties */
- if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve data 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_FILL_TIME_NAME, &fill_time) < 0)
@@ -2814,9 +2808,9 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
#ifdef H5S_DEBUG
H5_timer_begin(&timer);
#endif
- status = (sconv->write)(dataset->ent.file, &(dataset->layout), &pline,
- &fill, &efl, H5T_get_size(dataset->type), file_space,
- mem_space, dxpl_id, buf/*out*/);
+ status = (sconv->write)(dataset->ent.file, &(dataset->layout),
+ dc_plist, H5T_get_size(dataset->type),
+ file_space, mem_space, dxpl_id, buf);
#ifdef H5S_DEBUG
H5_timer_end(&(sconv->stats[0].write_timer), &timer);
sconv->stats[0].write_nbytes += nelmts * H5T_get_size(mem_type);
@@ -2932,8 +2926,8 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
#ifdef H5S_DEBUG
H5_timer_begin(&timer);
#endif
- n = (sconv->f->gath)(dataset->ent.file, &(dataset->layout), &pline,
- &fill, &efl, dst_type_size, file_space,
+ n = (sconv->f->gath)(dataset->ent.file, &(dataset->layout),
+ dc_plist, dst_type_size, file_space,
&bkg_iter, smine_nelmts, dxpl_id,
bkg_buf/*out*/);
@@ -2959,7 +2953,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
H5_timer_begin(&timer);
#endif
status = (sconv->f->scat)(dataset->ent.file, &(dataset->layout),
- &pline, &fill, &efl, dst_type_size,
+ dc_plist, dst_type_size,
file_space, &file_iter, smine_nelmts,
dxpl_id, tconv_buf);
@@ -3205,8 +3199,6 @@ H5D_init_storage(H5D_t *dset, const H5S_t *space)
haddr_t addr; /* Offset in dataset */
void *buf = NULL; /* Buffer for fill value writing */
H5O_fill_t fill; /* Fill value information */
- H5O_efl_t efl; /* External File List information */
- H5O_pline_t pline; /* I/O pipeline information */
H5P_genplist_t *plist; /* Property list */
herr_t ret_value = SUCCEED; /* Return value */
@@ -3219,10 +3211,6 @@ H5D_init_storage(H5D_t *dset, const H5S_t *space)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list");
if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fill value");
- if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get external file list");
- if(H5P_get(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data pipeline");
switch (dset->layout.type) {
case H5D_CONTIGUOUS:
@@ -3258,8 +3246,7 @@ H5D_init_storage(H5D_t *dset, const H5S_t *space)
while (npoints>0) {
size = MIN(ptsperbuf, npoints) * fill.size;
if (H5F_seq_write(dset->ent.file, H5P_DATASET_XFER_DEFAULT,
- &(dset->layout), &pline, &fill, &efl, space,
- fill.size, size, addr, buf)<0)
+ &(dset->layout), plist, space, fill.size, size, addr, buf)<0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to write fill value to dataset");
npoints -= MIN(ptsperbuf, npoints);
addr += size;
@@ -3283,8 +3270,8 @@ H5D_init_storage(H5D_t *dset, const H5S_t *space)
dim[ndims] = dset->layout.dim[ndims];
ndims++;
- if (H5F_istore_allocate(dset->ent.file,
- H5P_DATASET_XFER_DEFAULT, &(dset->layout), dim, &pline, &fill)<0)
+ if (H5F_istore_allocate(dset->ent.file, H5P_DATASET_XFER_DEFAULT,
+ &(dset->layout), dim, plist)<0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to allocate all chunks of dataset");
} /* end if */
#endif /*H5_HAVE_PARALLEL*/
@@ -3884,18 +3871,14 @@ H5Dset_extent(hid_t dset_id, const hsize_t *size)
/* Check args */
if(H5I_DATASET != H5I_get_type(dset_id)
- || NULL == (dset = H5I_object(dset_id))) {
+ || NULL == (dset = H5I_object(dset_id)))
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset");
- }
- if(!size) {
+ if(!size)
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified");
- }
/* Private function */
- if(H5D_set_extent(dset, size) < 0) {
- HRETURN_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
- "unable to set extend dataset");
- }
+ if(H5D_set_extent(dset, size) < 0)
+ HRETURN_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set extend dataset");
FUNC_LEAVE(SUCCEED);
}
@@ -3925,12 +3908,9 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size)
{
hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /* Current dimension sizes */
int rank; /* Dataspace # of dimensions */
- herr_t changed;
herr_t ret_value = FAIL;
H5S_t *space = NULL;
H5P_genplist_t *plist;
- H5O_fill_t fill;
- H5O_pline_t pline;
int u;
int shrink = 0;
@@ -3944,19 +3924,15 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size)
* Get the data space
*-------------------------------------------------------------------------
*/
-
- if(NULL == (space = H5S_read(&(dset->ent)))) {
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
- "unable to read data space info from dset header");
- }
+ if(NULL == (space = H5S_read(&(dset->ent))))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read data space info from dset header");
/*-------------------------------------------------------------------------
* Check if we are shrinking in any of the dimensions
*-------------------------------------------------------------------------
*/
if((rank = H5S_get_simple_extent_dims(space, curr_dims, NULL)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL,
- "can't get dataset dimensions");
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions");
for(u = 0; u < rank; u++) {
if(size[u] < curr_dims[u]) {
@@ -3969,43 +3945,20 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size)
* Modify the size of the data space
*-------------------------------------------------------------------------
*/
-
- if((changed = H5S_set_extent(space, size)) < 0) {
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
- "unable to modify size of data space");
- }
+ if(H5S_set_extent(space, size) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space");
/*-------------------------------------------------------------------------
- * Modify the dataset storage if changed space
+ * Modify the dataset storage
*-------------------------------------------------------------------------
*/
+ /* Save the new dataspace in the file if necessary */
+ if(H5S_modify(&(dset->ent), space) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update file with new dataspace");
- if(changed > 0) {
- /* Save the new dataspace in the file if necessary */
- if(H5S_modify(&(dset->ent), space) < 0) {
- HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL,
- "unable to update file with new dataspace");
- }
-
- /* Initialize the new parts of the dset */
- if(NULL == (plist = H5I_object(dset->dcpl_id))) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
- "not a dset creation property list");
- }
- if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) {
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL,
- "can't get fill value");
- }
- if(H5D_CONTIGUOUS == dset->layout.type && fill.buf) {
- HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL,
- "unable to select fill value region");
- }
- if(H5D_init_storage(dset, space) < 0) {
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
- "unable to initialize dset with fill value");
- }
-
- } /* end if changed */
+ /* Initialize the new parts of the dset */
+ if(H5D_init_storage(dset, space) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset storage");
/*-------------------------------------------------------------------------
@@ -4013,37 +3966,29 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size)
* This removal takes place only in case we are shrinking the dateset
*-------------------------------------------------------------------------
*/
-
- if(changed > 0 && shrink && H5D_CHUNKED == dset->layout.type) {
-
+ if(shrink && H5D_CHUNKED == dset->layout.type) {
#if defined (PVN)
H5F_istore_dump_btree(dset->ent.file, stdout, dset->layout.ndims,
dset->layout.addr);
#endif
- if(H5F_istore_prune_by_extent(dset->ent.file, &dset->layout,
- space) < 0) {
- HRETURN_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL,
- "unable to remove chunks ");
- }
+ /* Remove excess chunks */
+ if(H5F_istore_prune_by_extent(dset->ent.file, &dset->layout, space) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to remove chunks ");
#if defined (PVN)
H5F_istore_dump_btree(dset->ent.file, stdout, dset->layout.ndims,
dset->layout.addr);
#endif
- if(H5P_get(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) {
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get pipeline");
- }
-
-
- if(H5F_istore_initialize_by_extent(dset->ent.file, &dset->layout,
- &pline, &fill, space) < 0) {
- HRETURN_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL,
- "unable to initialize chunks ");
- }
+ /* Get the dataset creation property list */
+ if(NULL == (plist = H5I_object(dset->dcpl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dset creation property list");
- }
+ /* Reset the elements outsize the new dimensions, but in existing chunks */
+ if(H5F_istore_initialize_by_extent(dset->ent.file, &dset->layout, plist, space) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to initialize chunks ");
+ } /* end if */
ret_value = SUCCEED;
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 54b2fd2..1c2b137 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -1774,7 +1774,7 @@ H5F_istore_unlock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
*/
herr_t
H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
- const H5O_pline_t *pline, const H5O_fill_t *fill,
+ H5P_genplist_t *dc_plist,
const hsize_t size_m[], const hssize_t offset_m[],
const hssize_t offset_f[], const hsize_t size[], void *buf)
{
@@ -1792,6 +1792,9 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
unsigned idx_hint=0; /*cache index hint */
hsize_t chunk_size; /* Bytes in chunk */
haddr_t chunk_addr; /* Chunk address on disk */
+ H5O_pline_t pline; /* I/O pipeline information */
+ H5O_fill_t fill; /* Fill value information */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER(H5F_istore_read, FAIL);
@@ -1806,6 +1809,12 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
assert(size);
assert(buf);
+ /* Get necessary properties from property list */
+ if(H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fill value");
+ if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data pipeline");
+
/* Compute chunk size */
for (u=0, chunk_size=1; u<layout->ndims; u++)
chunk_size *= layout->dim[u];
@@ -1832,7 +1841,8 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
}
/* Loop over all chunks */
- while (1) {
+ carry=0;
+ while (carry==0) {
for (u=0, naccessed=1; u<layout->ndims; u++) {
/* The location and size of the chunk being accessed */
assert(layout->dim[u] < HSSIZET_MAX);
@@ -1860,7 +1870,7 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
* for the chunk has been defined, then don't load the chunk into the
* cache, just read the data from it directly.
*/
- if ((chunk_size>f->shared->rdcc_nbytes && pline->nfilters==0 &&
+ if ((chunk_size>f->shared->rdcc_nbytes && pline.nfilters==0 &&
chunk_addr!=HADDR_UNDEF)
#ifdef H5_HAVE_PARALLEL
@@ -1876,8 +1886,8 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
#ifdef H5_HAVE_PARALLEL
/* Additional sanity checks when operating in parallel */
- if (chunk_addr==HADDR_UNDEF || pline->nfilters>0)
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to locate raw data chunk");
+ if (chunk_addr==HADDR_UNDEF || pline.nfilters>0)
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to locate raw data chunk");
#endif /* H5_HAVE_PARALLEL */
/*
@@ -1890,29 +1900,24 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
for (u=l.ndims; u-- > 0; /*void*/)
l.dim[u] = layout->dim[u];
l.addr = chunk_addr;
- if (H5F_arr_read(f, H5P_DATASET_XFER_DEFAULT, &l, pline, fill, NULL/*no efl*/,
+ if (H5F_arr_read(f, H5P_DATASET_XFER_DEFAULT, &l, dc_plist,
sub_size, size_m, sub_offset_m, offset_wrt_chunk, buf)<0)
- HRETURN_ERROR (H5E_IO, H5E_READERROR, FAIL, "unable to read raw data from file");
+ HGOTO_ERROR (H5E_IO, H5E_READERROR, FAIL, "unable to read raw data from file");
} /* end if */
else {
/*
* Lock the chunk, transfer data to the application, then unlock
* the chunk.
*/
- if (NULL==(chunk=H5F_istore_lock(f, dxpl_id, layout, pline, fill,
- chunk_offset, FALSE, &idx_hint))) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "unable to read raw data chunk");
- }
+ if (NULL==(chunk=H5F_istore_lock(f, dxpl_id, layout, &pline, &fill,
+ chunk_offset, FALSE, &idx_hint)))
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk");
H5V_hyper_copy(layout->ndims, sub_size, size_m, sub_offset_m,
(void*)buf, layout->dim, offset_wrt_chunk, chunk);
H5_CHECK_OVERFLOW(naccessed,hsize_t,size_t);
- if (H5F_istore_unlock(f, dxpl_id, layout, pline, FALSE,
- chunk_offset, &idx_hint, chunk,
- (size_t)naccessed)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "unable to unlock raw data chunk");
- }
+ if (H5F_istore_unlock(f, dxpl_id, layout, &pline, FALSE,
+ chunk_offset, &idx_hint, chunk, (size_t)naccessed)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk");
} /* end else */
/* Increment indices */
@@ -1922,10 +1927,10 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
else
carry = 0;
}
- if (carry)
- break;
}
- FUNC_LEAVE(SUCCEED);
+
+done:
+ FUNC_LEAVE(ret_value);
}
@@ -1951,7 +1956,7 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
*/
herr_t
H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
- const H5O_pline_t *pline, const H5O_fill_t *fill,
+ H5P_genplist_t *dc_plist,
const hsize_t size_m[], const hssize_t offset_m[],
const hssize_t offset_f[], const hsize_t size[],
const void *buf)
@@ -1969,6 +1974,9 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
unsigned idx_hint=0;
hsize_t chunk_size, naccessed;
haddr_t chunk_addr; /* Chunk address on disk */
+ H5O_pline_t pline; /* I/O pipeline information */
+ H5O_fill_t fill; /* Fill value information */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER(H5F_istore_write, FAIL);
@@ -1983,6 +1991,12 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
assert(size);
assert(buf);
+ /* Get necessary properties from property list */
+ if(H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fill value");
+ if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data pipeline");
+
/* Compute chunk size */
for (u=0, chunk_size=1; u<layout->ndims; u++)
chunk_size *= layout->dim[u];
@@ -2010,7 +2024,8 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
/* Loop over all chunks */
- while (1) {
+ carry=0;
+ while (carry==0) {
for (u=0, naccessed=1; u<layout->ndims; u++) {
/* The location and size of the chunk being accessed */
assert(layout->dim[u] < HSSIZET_MAX);
@@ -2038,7 +2053,7 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
* for the chunk has been defined, then don't load the chunk into the
* cache, just write the data to it directly.
*/
- if ((chunk_size>f->shared->rdcc_nbytes && pline->nfilters==0 &&
+ if ((chunk_size>f->shared->rdcc_nbytes && pline.nfilters==0 &&
chunk_addr!=HADDR_UNDEF)
#ifdef H5_HAVE_PARALLEL
@@ -2054,8 +2069,8 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
#ifdef H5_HAVE_PARALLEL
/* Additional sanity check when operating in parallel */
- if (chunk_addr==HADDR_UNDEF || pline->nfilters>0)
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to locate raw data chunk");
+ if (chunk_addr==HADDR_UNDEF || pline.nfilters>0)
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to locate raw data chunk");
#endif /* H5_HAVE_PARALLEL */
/*
@@ -2068,24 +2083,24 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
for (u=l.ndims; u-- > 0; /*void*/)
l.dim[u] = layout->dim[u];
l.addr = chunk_addr;
- if (H5F_arr_write(f, H5P_DATASET_XFER_DEFAULT, &l, pline, fill, NULL/*no efl*/,
+ if (H5F_arr_write(f, H5P_DATASET_XFER_DEFAULT, &l, dc_plist,
sub_size, size_m, sub_offset_m, offset_wrt_chunk, buf)<0)
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file");
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file");
} /* end if */
else {
/*
* Lock the chunk, copy from application to chunk, then unlock the
* chunk.
*/
- if (NULL==(chunk=H5F_istore_lock(f, dxpl_id, layout, pline, fill,
+ if (NULL==(chunk=H5F_istore_lock(f, dxpl_id, layout, &pline, &fill,
chunk_offset, (hbool_t)(naccessed==chunk_size), &idx_hint)))
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to read raw data chunk");
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to read raw data chunk");
H5V_hyper_copy(layout->ndims, sub_size,
layout->dim, offset_wrt_chunk, chunk, size_m, sub_offset_m, buf);
H5_CHECK_OVERFLOW(naccessed,hsize_t,size_t);
- if (H5F_istore_unlock(f, dxpl_id, layout, pline, TRUE,
+ if (H5F_istore_unlock(f, dxpl_id, layout, &pline, TRUE,
chunk_offset, &idx_hint, chunk, (size_t)naccessed)<0)
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "uanble to unlock raw data chunk");
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "uanble to unlock raw data chunk");
} /* end else */
/* Increment indices */
@@ -2095,11 +2110,10 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
else
carry = 0;
}
- if (carry)
- break;
- }
+ } /* end while */
- FUNC_LEAVE(SUCCEED);
+done:
+ FUNC_LEAVE(ret_value);
}
@@ -2403,33 +2417,34 @@ done:
*/
herr_t
H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
- const hsize_t *space_dim, const H5O_pline_t *pline,
- const H5O_fill_t *fill)
+ const hsize_t *space_dim, H5P_genplist_t *dc_plist)
{
int i, carry;
- unsigned u;
- hssize_t chunk_offset[H5O_LAYOUT_NDIMS];
- uint8_t *chunk=NULL;
- unsigned idx_hint=0;
- hsize_t chunk_size;
-#ifdef AKC
- H5F_istore_ud1_t udata;
-#endif
+ unsigned u;
+ hssize_t chunk_offset[H5O_LAYOUT_NDIMS];
+ uint8_t *chunk=NULL;
+ unsigned idx_hint=0;
+ hsize_t chunk_size;
+ H5O_pline_t pline; /* I/O pipeline information */
+ H5O_fill_t fill; /* Fill value information */
+ herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER(H5F_istore_allocate, FAIL);
-#ifdef AKC
- printf("Enter %s:\n", FUNC);
-#endif
/* Check args */
assert(f);
assert(space_dim);
- assert(pline);
assert(layout && H5D_CHUNKED==layout->type);
assert(layout->ndims>0 && layout->ndims<=H5O_LAYOUT_NDIMS);
assert(H5F_addr_defined(layout->addr));
+ /* Get necessary properties from property list */
+ if(H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fill value");
+ if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data pipeline");
+
/*
* Setup indice to go through all chunks. (Future improvement
* should allocate only chunks that have no file space assigned yet.
@@ -2437,65 +2452,37 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
for (u=0, chunk_size=1; u<layout->ndims; u++) {
chunk_offset[u]=0;
chunk_size *= layout->dim[u];
- }
+ } /* end for */
/* Loop over all chunks */
- while (1) {
-
-#ifdef AKC
- printf("Checking allocation for chunk( ");
- for (u=0; u<layout->ndims; u++){
- printf("%ld ", chunk_offset[u]);
- }
- printf(")\n");
-#endif
-#ifdef NO
- if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)<0) {
-#endif
- /* No file space assigned yet. Allocate it. */
- /* The following needs improvement like calling the */
- /* allocation directly rather than indirectly using the */
- /* allocation effect in the unlock process. */
+ carry=0;
+ while (carry==0) {
+ /* No file space assigned yet. Allocate it. */
+ /* The following needs improvement like calling the */
+ /* allocation directly rather than indirectly using the */
+ /* allocation effect in the unlock process. */
-#ifdef AKC
- printf("need allocation\n");
-#endif
- /*
- * Lock the chunk, copy from application to chunk, then unlock the
- * chunk.
- */
+ /*
+ * Lock the chunk, copy from application to chunk, then unlock the
+ * chunk.
+ */
#ifdef H5_HAVE_PARALLEL
- /* rky 981207 Serialize access to this critical region. */
- if (SUCCEED!= H5FD_mpio_wait_for_left_neighbor(f->shared->lf)) {
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to lock the data chunk");
- }
+ /* rky 981207 Serialize access to this critical region. */
+ if (SUCCEED!= H5FD_mpio_wait_for_left_neighbor(f->shared->lf))
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to lock the data chunk");
#endif
- if (NULL==(chunk=H5F_istore_lock(f, dxpl_id, layout, pline,
- fill, chunk_offset, FALSE, &idx_hint))) {
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to read raw data chunk");
- }
- H5_CHECK_OVERFLOW(chunk_size,hsize_t,size_t);
- if (H5F_istore_unlock(f, dxpl_id, layout, pline, TRUE,
- chunk_offset, &idx_hint, chunk, (size_t)chunk_size)<0) {
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
- "uanble to unlock raw data chunk");
- }
+ if (NULL==(chunk=H5F_istore_lock(f, dxpl_id, layout, &pline,
+ &fill, chunk_offset, FALSE, &idx_hint)))
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to read raw data chunk");
+
+ H5_CHECK_OVERFLOW(chunk_size,hsize_t,size_t);
+ if (H5F_istore_unlock(f, dxpl_id, layout, &pline, TRUE,
+ chunk_offset, &idx_hint, chunk, (size_t)chunk_size)<0)
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "uanble to unlock raw data chunk");
#ifdef H5_HAVE_PARALLEL
- if (SUCCEED!= H5FD_mpio_signal_right_neighbor(f->shared->lf)) {
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to unlock the data chunk");
- }
-#endif
-#ifdef NO
- } else {
-#ifdef AKC
- printf("NO need for allocation\n");
- HDfprintf(stdout, "udata.addr=%a\n", udata.addr);
-#endif
- }
+ if (SUCCEED!= H5FD_mpio_signal_right_neighbor(f->shared->lf))
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to unlock the data chunk");
#endif
/* Increment indices */
@@ -2506,10 +2493,8 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
} else {
carry = 0;
}
- }
- if (carry)
- break;
- }
+ } /* end for */
+ } /* end while */
#ifdef H5_HAVE_PARALLEL
/*
@@ -2522,12 +2507,12 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
* removed, when H5D_init_storage is changed to call H5MF_alloc directly
* to allocate space, instead of calling H5F_istore_unlock.
*/
- if (MPI_Barrier(H5FD_mpio_communicator(f->shared->lf))) {
- HRETURN_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Barrier failed");
- }
+ if (MPI_Barrier(H5FD_mpio_communicator(f->shared->lf)))
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Barrier failed");
#endif
- FUNC_LEAVE(SUCCEED);
+done:
+ FUNC_LEAVE(ret_value);
}
@@ -2632,7 +2617,7 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
*-------------------------------------------------------------------------
*/
herr_t
-H5F_istore_prune_by_extent(H5F_t *f, H5O_layout_t *layout, H5S_t * space)
+H5F_istore_prune_by_extent(H5F_t *f, const H5O_layout_t *layout, const H5S_t * space)
{
H5F_rdcc_t *rdcc = &(f->shared->rdcc); /*raw data chunk cache */
H5F_rdcc_ent_t *ent = NULL, *next = NULL; /*cache entry */
@@ -2652,16 +2637,13 @@ H5F_istore_prune_by_extent(H5F_t *f, H5O_layout_t *layout, H5S_t * space)
/* Go get the rank & dimensions */
if(H5S_get_simple_extent_dims(space, curr_dims, NULL) < 0)
- HRETURN_ERROR(H5E_DATASET, H5E_CANTGET, FAIL,
- "can't get dataset dimensions");
-
+ HRETURN_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions");
/*-------------------------------------------------------------------------
* Figure out what chunks are no longer in use for the specified extent
* and release them from the linked list raw data cache
*-------------------------------------------------------------------------
*/
-
for(ent = rdcc->head; ent; ent = next) {
next = ent->next;
@@ -2830,8 +2812,8 @@ H5F_istore_remove(H5F_t *f, haddr_t addr, void *_lt_key /*in,out */ ,
*-------------------------------------------------------------------------
*/
herr_t
-H5F_istore_initialize_by_extent(H5F_t *f, H5O_layout_t *layout,
- H5O_pline_t * pline, H5O_fill_t * fill, H5S_t * space)
+H5F_istore_initialize_by_extent(H5F_t *f, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist, const H5S_t * space)
{
hid_t dxpl_id; /*dataset transfer property list */
uint8_t *chunk = NULL; /*the file chunk */
@@ -2853,6 +2835,9 @@ H5F_istore_initialize_by_extent(H5F_t *f, H5O_layout_t *layout,
int i, carry; /*counters */
unsigned u;
int found = 0; /*initialize this entry */
+ H5O_pline_t pline; /* I/O pipeline information */
+ H5O_fill_t fill; /* Fill value information */
+ herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER(H5F_istore_initialize_by_extent, FAIL);
@@ -2862,20 +2847,24 @@ H5F_istore_initialize_by_extent(H5F_t *f, H5O_layout_t *layout,
assert(layout->ndims > 0 && layout->ndims <= H5O_LAYOUT_NDIMS);
assert(H5F_addr_defined(layout->addr));
assert(space);
- assert(pline);
- assert(fill);
+ /* Get necessary properties from property list */
+ if(H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fill value");
+ if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data pipeline");
+
+ /* Reset start & count arrays */
HDmemset(start, 0, sizeof(start));
HDmemset(count, 0, sizeof(count));
/* Go get the rank & dimensions */
if((rank = H5S_get_simple_extent_dims(space, curr_dims, NULL)) < 0)
- HRETURN_ERROR(H5E_DATASET, H5E_CANTGET, FAIL,
- "can't get dataset dimensions");
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions");
- for(i = 0; i < rank; i++) {
+ /* Copy current dimensions */
+ for(i = 0; i < rank; i++)
size[i] = curr_dims[i];
- }
size[i] = layout->dim[i];
elm_size = size[i];
@@ -2883,15 +2872,10 @@ H5F_istore_initialize_by_extent(H5F_t *f, H5O_layout_t *layout,
dxpl_id = H5P_DATASET_XFER_DEFAULT;
/* Create a data space for a chunk & set the extent */
- if(NULL == (space_chunk = H5S_create(H5S_SIMPLE))) {
- HRETURN_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL,
- "can't create simple dataspace");
- }
- if(H5S_set_extent_simple(space_chunk, (unsigned)rank, layout->dim,
- NULL) < 0) {
- HRETURN_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL,
- "can't set dimensions");
- }
+ if(NULL == (space_chunk = H5S_create(H5S_SIMPLE)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace");
+ if(H5S_set_extent_simple(space_chunk, (unsigned)rank, layout->dim, NULL) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't set dimensions");
/*
* Set up multi-dimensional counters (idx_min, idx_max, and idx_cur) and
@@ -2902,87 +2886,68 @@ H5F_istore_initialize_by_extent(H5F_t *f, H5O_layout_t *layout,
idx_min[u] = 0;
idx_max[u] = (size[u] - 1) / layout->dim[u] + 1;
idx_cur[u] = idx_min[u];
- }
+ } /* end for */
/* Loop over all chunks */
- while(1) {
+ carry=0;
+ while(carry==0) {
for(u = 0, naccessed = 1; u < layout->ndims; u++) {
/* The location and size of the chunk being accessed */
chunk_offset[u] = idx_cur[u] * (hssize_t)(layout->dim[u]);
- sub_size[u] =
- MIN((idx_cur[u] + 1) * layout->dim[u],
+ sub_size[u] = MIN((idx_cur[u] + 1) * layout->dim[u],
size[u]) - chunk_offset[u];
naccessed *= sub_size[u];
- }
+ } /* end for */
/*
* Figure out what chunks have to be initialized. These are the chunks where the database
* extent boundary is within the chunk
*/
-
for(u = 0, found = 0; u < layout->ndims - 1; u++) {
end_chunk = chunk_offset[u] + layout->dim[u];
if(end_chunk > size[u]) {
found = 1;
break;
}
- }
+ } /* end for */
if(found) {
- if(NULL == (chunk =
- H5F_istore_lock(f, dxpl_id, layout, pline, fill,
- chunk_offset, FALSE, &idx_hint))) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to read raw data chunk");
- }
+ if(NULL == (chunk = H5F_istore_lock(f, dxpl_id, layout, &pline, &fill,
+ chunk_offset, FALSE, &idx_hint)))
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to read raw data chunk");
- if(H5S_select_all(space_chunk) < 0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to select space");
- }
+ if(H5S_select_all(space_chunk) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to select space");
- for(i = 0; i < rank; i++) {
- count[i] =
- MIN((idx_cur[i] + 1) * layout->dim[i],
- size[i] - chunk_offset[i]);
- }
+ for(i = 0; i < rank; i++)
+ count[i] = MIN((idx_cur[i] + 1) * layout->dim[i], size[i] - chunk_offset[i]);
#if defined (H5F_ISTORE_DEBUG)
HDfputs("cache:initialize:offset:[", stdout);
- for(u = 0; u < layout->ndims - 1; u++) {
+ for(u = 0; u < layout->ndims - 1; u++)
HDfprintf(stdout, "%s%Hd", u ? ", " : "", chunk_offset[u]);
- }
HDfputs("]", stdout);
HDfputs(":count:[", stdout);
- for(u = 0; u < layout->ndims - 1; u++) {
+ for(u = 0; u < layout->ndims - 1; u++)
HDfprintf(stdout, "%s%Hd", u ? ", " : "", count[u]);
- }
HDfputs("]\n", stdout);
#endif
if(H5S_select_hyperslab(space_chunk, H5S_SELECT_NOTB, start, NULL,
- count, NULL) < 0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to select hyperslab");
- }
+ count, NULL) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to select hyperslab");
/* Fill the selection in the memory buffer */
- if(H5S_select_fill(fill->buf, fill->size, space_chunk, chunk) < 0) {
- HRETURN_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL,
- "filling selection failed");
- }
-
- if(H5F_istore_unlock(f, dxpl_id, layout, pline, TRUE,
- chunk_offset, &idx_hint, chunk,
- (size_t)naccessed) < 0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to unlock raw data chunk");
- }
+ if(H5S_select_fill(fill.buf, fill.size, space_chunk, chunk) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed");
- } /*found */
+ if(H5F_istore_unlock(f, dxpl_id, layout, &pline, TRUE,
+ chunk_offset, &idx_hint, chunk, (size_t)naccessed) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to unlock raw data chunk");
+ } /*found */
/* Increment indices */
for(i = layout->ndims - 1, carry = 1; i >= 0 && carry; --i) {
@@ -2990,14 +2955,12 @@ H5F_istore_initialize_by_extent(H5F_t *f, H5O_layout_t *layout,
idx_cur[i] = idx_min[i];
else
carry = 0;
- }
- if(carry)
- break;
-
- }
+ } /* end for */
+ } /* end while */
+done:
if(space_chunk)
H5S_close(space_chunk);
- FUNC_LEAVE(SUCCEED);
+ FUNC_LEAVE(ret_value);
}
diff --git a/src/H5Dseq.c b/src/H5Dseq.c
index 20c71a7..2714174 100644
--- a/src/H5Dseq.c
+++ b/src/H5Dseq.c
@@ -57,10 +57,10 @@ static int interface_initialize_g = 0;
*-------------------------------------------------------------------------
*/
herr_t
-H5F_seq_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
- const struct H5O_pline_t *pline, const H5O_fill_t *fill,
- const struct H5O_efl_t *efl, const H5S_t *file_space, size_t elmt_size,
- size_t seq_len, hsize_t file_offset, void *buf/*out*/)
+H5F_seq_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist,
+ const H5S_t *file_space, size_t elmt_size,
+ size_t seq_len, hsize_t file_offset, void *buf/*out*/)
{
FUNC_ENTER(H5F_seq_read, FAIL);
@@ -69,7 +69,7 @@ H5F_seq_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
assert(layout);
assert(buf);
- if (H5F_seq_readv(f, dxpl_id, layout, pline, fill, efl, file_space, elmt_size, 1, &seq_len, &file_offset, buf)<0)
+ if (H5F_seq_readv(f, dxpl_id, layout, dc_plist, file_space, elmt_size, 1, &seq_len, &file_offset, buf)<0)
HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "vector read failed");
FUNC_LEAVE(SUCCEED);
@@ -98,10 +98,10 @@ H5F_seq_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
*-------------------------------------------------------------------------
*/
herr_t
-H5F_seq_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
- const struct H5O_pline_t *pline, const H5O_fill_t *fill,
- const struct H5O_efl_t *efl, const H5S_t *file_space, size_t elmt_size,
- size_t seq_len, hsize_t file_offset, const void *buf)
+H5F_seq_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist,
+ const H5S_t *file_space, size_t elmt_size,
+ size_t seq_len, hsize_t file_offset, const void *buf)
{
FUNC_ENTER(H5F_seq_write, FAIL);
@@ -110,7 +110,7 @@ H5F_seq_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
assert(layout);
assert(buf);
- if (H5F_seq_writev(f, dxpl_id, layout, pline, fill, efl, file_space, elmt_size, 1, &seq_len, &file_offset, buf)<0)
+ if (H5F_seq_writev(f, dxpl_id, layout, dc_plist, file_space, elmt_size, 1, &seq_len, &file_offset, buf)<0)
HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vector write failed");
FUNC_LEAVE(SUCCEED);
@@ -141,11 +141,11 @@ H5F_seq_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
*-------------------------------------------------------------------------
*/
herr_t
-H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
- const struct H5O_pline_t *pline, const H5O_fill_t *fill,
- const struct H5O_efl_t *efl, const H5S_t *file_space, size_t elmt_size,
- size_t nseq, size_t seq_len_arr[], hsize_t file_offset_arr[],
- void *_buf/*out*/)
+H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist,
+ const H5S_t *file_space, size_t elmt_size,
+ size_t nseq, size_t seq_len_arr[], hsize_t file_offset_arr[],
+ void *_buf/*out*/)
{
unsigned char *real_buf=(unsigned char *)_buf; /* Local pointer to buffer to fill */
unsigned char *buf; /* Local pointer to buffer to fill */
@@ -163,10 +163,12 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
unsigned u; /*counters */
size_t v; /*counters */
int i,j; /*counters */
+ struct H5O_efl_t efl; /* External File List info */
#ifdef H5_HAVE_PARALLEL
H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT;
H5P_genplist_t *plist=NULL; /* Property list */
#endif
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER(H5F_seq_readv, FAIL);
@@ -186,17 +188,17 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Get the plist structure */
if(NULL == (plist = H5I_object(dxpl_id)))
- HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID");
/* Get the driver ID */
if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
- HRETURN_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
/* Check if we are using the MPIO driver */
if(H5FD_MPIO==driver_id) {
/* Get the driver information */
if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &dx)<0)
- HRETURN_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
/* Check if we are not using independent I/O */
if(H5FD_MPIO_INDEPENDENT!=dx->xfer_mode)
@@ -206,54 +208,49 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Collective MPIO access is unsupported for non-contiguous datasets */
if (H5D_CONTIGUOUS!=layout->type && H5FD_MPIO_COLLECTIVE==xfer_mode)
- HRETURN_ERROR (H5E_DATASET, H5E_READERROR, FAIL, "collective access on non-contiguous datasets not supported yet");
+ HGOTO_ERROR (H5E_DATASET, H5E_READERROR, FAIL, "collective access on non-contiguous datasets not supported yet");
#endif
+ /* Get necessary properties from property list */
+ if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get EFL value");
+
switch (layout->type) {
case H5D_CONTIGUOUS:
- /* Filters cannot be used for contiguous data. */
- if (pline && pline->nfilters>0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "filters are not allowed for contiguous data");
- }
-
-
/* Read directly from file if the dataset is in an external file */
- if (efl && efl->nused>0) {
+ if (efl.nused>0) {
/* Iterate through the sequence vectors */
for(v=0; v<nseq; v++) {
#ifdef H5_HAVE_PARALLEL
- if (H5FD_MPIO_COLLECTIVE==xfer_mode) {
- /*
- * Currently supports same number of collective access. Need to
- * be changed LATER to combine all reads into one collective MPIO
- * call.
- */
- unsigned long max, min, temp;
-
- temp = seq_len_arr[v];
- assert(temp==seq_len_arr[v]); /* verify no overflow */
- MPI_Allreduce(&temp, &max, 1, MPI_UNSIGNED_LONG, MPI_MAX,
- H5FD_mpio_communicator(f->shared->lf));
- MPI_Allreduce(&temp, &min, 1, MPI_UNSIGNED_LONG, MPI_MIN,
- H5FD_mpio_communicator(f->shared->lf));
+ if (H5FD_MPIO_COLLECTIVE==xfer_mode) {
+ /*
+ * Currently supports same number of collective access. Need to
+ * be changed LATER to combine all reads into one collective MPIO
+ * call.
+ */
+ unsigned long max, min, temp;
+
+ temp = seq_len_arr[v];
+ assert(temp==seq_len_arr[v]); /* verify no overflow */
+ MPI_Allreduce(&temp, &max, 1, MPI_UNSIGNED_LONG, MPI_MAX,
+ H5FD_mpio_communicator(f->shared->lf));
+ MPI_Allreduce(&temp, &min, 1, MPI_UNSIGNED_LONG, MPI_MIN,
+ H5FD_mpio_communicator(f->shared->lf));
#ifdef AKC
- printf("seq_len=%lu, min=%lu, max=%lu\n", temp, min, max);
+ printf("seq_len=%lu, min=%lu, max=%lu\n", temp, min, max);
#endif
- if (max != min)
- HRETURN_ERROR(H5E_DATASET, H5E_READERROR, FAIL,
- "collective access with unequal number of blocks not supported yet");
- }
+ if (max != min)
+ HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL,
+ "collective access with unequal number of blocks not supported yet");
+ }
#endif
/* Note: We can't use data sieve buffers for datasets in external files
* because the 'addr' of all external files is set to 0 (above) and
* all datasets in external files would alias to the same set of
* file offsets, totally mixing up the data sieve buffer information. -QAK
*/
- if (H5O_efl_read(f, efl, file_offset_arr[v], seq_len_arr[v], real_buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "external data read failed");
- }
+ if (H5O_efl_read(f, &efl, file_offset_arr[v], seq_len_arr[v], real_buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "external data read failed");
/* Increment offset in buffer */
real_buf += seq_len_arr[v];
@@ -264,10 +261,8 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
max_data *= layout->dim[u];
/* Pass along the vector of sequences to read */
- if (H5F_contig_readv(f, max_data, H5FD_MEM_DRAW, layout->addr, nseq, seq_len_arr, file_offset_arr, dxpl_id, real_buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "block read failed");
- }
+ if (H5F_contig_readv(f, max_data, H5FD_MEM_DRAW, layout->addr, nseq, seq_len_arr, file_offset_arr, dxpl_id, real_buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed");
} /* end else */
break;
@@ -275,13 +270,12 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/*
* This method is unable to access external raw data files
*/
- if (efl && efl->nused>0) {
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL,
- "chunking and external files are mutually exclusive");
- }
+ if (efl.nused>0)
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "chunking and external files are mutually exclusive");
+
/* Compute the file offset coordinates and hyperslab size */
if((ndims=H5S_get_simple_extent_dims(file_space,dset_dims,NULL))<0)
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unable to retrieve dataspace dimensions");
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unable to retrieve dataspace dimensions");
/* Build the array of cumulative hyperslab sizes */
/* (And set the memory offset to zero) */
@@ -340,11 +334,10 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Read in the partial hyperslab */
- if (H5F_istore_read(f, dxpl_id, layout, pline, fill,
+ if (H5F_istore_read(f, dxpl_id, layout, dc_plist,
hslab_size, mem_offset, coords, hslab_size,
- buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
- }
+ buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
/* Increment the buffer offset */
buf=(unsigned char *)buf+(partial_size*elmt_size);
@@ -401,10 +394,9 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Read the full hyperslab in */
- if (H5F_istore_read(f, dxpl_id, layout, pline, fill,
- hslab_size, mem_offset, coords, hslab_size, buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
- }
+ if (H5F_istore_read(f, dxpl_id, layout, dc_plist,
+ hslab_size, mem_offset, coords, hslab_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
/* Increment the buffer offset */
buf=(unsigned char *)buf+(full_size*elmt_size);
@@ -448,11 +440,9 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Read in the partial hyperslab */
- if (H5F_istore_read(f, dxpl_id, layout, pline,
- fill, hslab_size, mem_offset, coords,
- hslab_size, buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
- }
+ if (H5F_istore_read(f, dxpl_id, layout, dc_plist,
+ hslab_size, mem_offset, coords, hslab_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
/* Increment the buffer offset */
buf=(unsigned char *)buf+(partial_size*elmt_size);
@@ -484,11 +474,9 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Read in the partial hyperslab */
- if (H5F_istore_read(f, dxpl_id, layout, pline, fill,
- hslab_size, mem_offset, coords, hslab_size,
- buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
- }
+ if (H5F_istore_read(f, dxpl_id, layout, dc_plist,
+ hslab_size, mem_offset, coords, hslab_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
/* Double-check the amount read in */
assert(seq_len==partial_size);
@@ -503,10 +491,11 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
default:
assert("not implemented yet" && 0);
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout");
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout");
} /* end switch() */
- FUNC_LEAVE(SUCCEED);
+done:
+ FUNC_LEAVE(ret_value);
} /* H5F_seq_readv() */
@@ -534,11 +523,11 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
*-------------------------------------------------------------------------
*/
herr_t
-H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
- const struct H5O_pline_t *pline, const H5O_fill_t *fill,
- const struct H5O_efl_t *efl, const H5S_t *file_space, size_t elmt_size,
- size_t nseq, size_t seq_len_arr[], hsize_t file_offset_arr[],
- const void *_buf)
+H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist,
+ const H5S_t *file_space, size_t elmt_size,
+ size_t nseq, size_t seq_len_arr[], hsize_t file_offset_arr[],
+ const void *_buf)
{
const unsigned char *real_buf=(const unsigned char *)_buf; /* Local pointer to buffer to fill */
const unsigned char *buf; /* Local pointer to buffer to fill */
@@ -556,10 +545,12 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
unsigned u; /*counters */
size_t v; /*counters */
int i,j; /*counters */
+ struct H5O_efl_t efl; /* External File List info */
#ifdef H5_HAVE_PARALLEL
H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT;
H5P_genplist_t *plist=NULL; /* Property list */
#endif
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER(H5F_seq_writev, FAIL);
@@ -579,17 +570,17 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Get the plist structure */
if(NULL == (plist = H5I_object(dxpl_id)))
- HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID");
/* Get the driver ID */
if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
- HRETURN_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
/* Check if we are using the MPIO driver */
if(H5FD_MPIO==driver_id) {
/* Get the driver information */
if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &dx)<0)
- HRETURN_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
/* Check if we are not using independent I/O */
if(H5FD_MPIO_INDEPENDENT!=dx->xfer_mode)
@@ -599,56 +590,50 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Collective MPIO access is unsupported for non-contiguous datasets */
if (H5D_CONTIGUOUS!=layout->type && H5FD_MPIO_COLLECTIVE==xfer_mode) {
- HRETURN_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL,
+ HGOTO_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL,
"collective access on non-contiguous datasets not supported yet");
}
#endif
+ /* Get necessary properties from property list */
+ if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get EFL value");
+
switch (layout->type) {
case H5D_CONTIGUOUS:
- /* Filters cannot be used for contiguous data. */
- if (pline && pline->nfilters>0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "filters are not allowed for contiguous data");
- }
-
-
/* Write directly to file if the dataset is in an external file */
- if (efl && efl->nused>0) {
+ if (efl.nused>0) {
/* Iterate through the sequence vectors */
for(v=0; v<nseq; v++) {
#ifdef H5_HAVE_PARALLEL
- if (H5FD_MPIO_COLLECTIVE==xfer_mode) {
- /*
- * Currently supports same number of collective access. Need to
- * be changed LATER to combine all reads into one collective MPIO
- * call.
- */
- unsigned long max, min, temp;
-
- temp = seq_len_arr[v];
- assert(temp==seq_len_arr[v]); /* verify no overflow */
- MPI_Allreduce(&temp, &max, 1, MPI_UNSIGNED_LONG, MPI_MAX,
- H5FD_mpio_communicator(f->shared->lf));
- MPI_Allreduce(&temp, &min, 1, MPI_UNSIGNED_LONG, MPI_MIN,
- H5FD_mpio_communicator(f->shared->lf));
+ if (H5FD_MPIO_COLLECTIVE==xfer_mode) {
+ /*
+ * Currently supports same number of collective access. Need to
+ * be changed LATER to combine all reads into one collective MPIO
+ * call.
+ */
+ unsigned long max, min, temp;
+
+ temp = seq_len_arr[v];
+ assert(temp==seq_len_arr[v]); /* verify no overflow */
+ MPI_Allreduce(&temp, &max, 1, MPI_UNSIGNED_LONG, MPI_MAX,
+ H5FD_mpio_communicator(f->shared->lf));
+ MPI_Allreduce(&temp, &min, 1, MPI_UNSIGNED_LONG, MPI_MIN,
+ H5FD_mpio_communicator(f->shared->lf));
#ifdef AKC
- printf("seq_len=%lu, min=%lu, max=%lu\n", temp, min, max);
+ printf("seq_len=%lu, min=%lu, max=%lu\n", temp, min, max);
#endif
- if (max != min)
- HRETURN_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL,
- "collective access with unequal number of blocks not supported yet");
- }
+ if (max != min)
+ HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "collective access with unequal number of blocks not supported yet");
+ }
#endif
/* Note: We can't use data sieve buffers for datasets in external files
* because the 'addr' of all external files is set to 0 (above) and
* all datasets in external files would alias to the same set of
* file offsets, totally mixing up the data sieve buffer information. -QAK
*/
- if (H5O_efl_write(f, efl, file_offset_arr[v], seq_len_arr[v], real_buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "external data write failed");
- }
+ if (H5O_efl_write(f, &efl, file_offset_arr[v], seq_len_arr[v], real_buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "external data write failed");
/* Increment offset in buffer */
real_buf += seq_len_arr[v];
@@ -659,10 +644,8 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
max_data *= layout->dim[u];
/* Pass along the vector of sequences to write */
- if (H5F_contig_writev(f, max_data, H5FD_MEM_DRAW, layout->addr, nseq, seq_len_arr, file_offset_arr, dxpl_id, real_buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "block write failed");
- }
+ if (H5F_contig_writev(f, max_data, H5FD_MEM_DRAW, layout->addr, nseq, seq_len_arr, file_offset_arr, dxpl_id, real_buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed");
} /* end else */
break;
@@ -670,13 +653,12 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/*
* This method is unable to access external raw data files
*/
- if (efl && efl->nused>0) {
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL,
- "chunking and external files are mutually exclusive");
- }
+ if (efl.nused>0)
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "chunking and external files are mutually exclusive");
+
/* Compute the file offset coordinates and hyperslab size */
if((ndims=H5S_get_simple_extent_dims(file_space,dset_dims,NULL))<0)
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unable to retrieve dataspace dimensions");
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unable to retrieve dataspace dimensions");
/* Build the array of cumulative hyperslab sizes */
/* (And set the memory offset to zero) */
@@ -735,11 +717,9 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Write out the partial hyperslab */
- if (H5F_istore_write(f, dxpl_id, layout, pline, fill,
- hslab_size, mem_offset,coords, hslab_size,
- buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
- }
+ if (H5F_istore_write(f, dxpl_id, layout, dc_plist,
+ hslab_size, mem_offset,coords, hslab_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
/* Increment the buffer offset */
buf=(const unsigned char *)buf+(partial_size*elmt_size);
@@ -796,10 +776,9 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Write the full hyperslab in */
- if (H5F_istore_write(f, dxpl_id, layout, pline, fill,
- hslab_size, mem_offset, coords, hslab_size, buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
- }
+ if (H5F_istore_write(f, dxpl_id, layout, dc_plist,
+ hslab_size, mem_offset, coords, hslab_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
/* Increment the buffer offset */
buf=(const unsigned char *)buf+(full_size*elmt_size);
@@ -843,11 +822,9 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Write out the partial hyperslab */
- if (H5F_istore_write(f, dxpl_id, layout, pline,
- fill, hslab_size, mem_offset, coords,
- hslab_size, buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
- }
+ if (H5F_istore_write(f, dxpl_id, layout, dc_plist,
+ hslab_size, mem_offset, coords, hslab_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
/* Increment the buffer offset */
buf=(const unsigned char *)buf+(partial_size*elmt_size);
@@ -879,11 +856,9 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Write out the final partial hyperslab */
- if (H5F_istore_write(f, dxpl_id, layout, pline, fill,
- hslab_size, mem_offset, coords, hslab_size,
- buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
- }
+ if (H5F_istore_write(f, dxpl_id, layout, dc_plist,
+ hslab_size, mem_offset, coords, hslab_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
/* Double-check the amount read in */
assert(seq_len==partial_size);
@@ -898,9 +873,10 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
default:
assert("not implemented yet" && 0);
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout");
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout");
} /* end switch() */
- FUNC_LEAVE(SUCCEED);
+done:
+ FUNC_LEAVE(ret_value);
} /* H5F_seq_writev() */
diff --git a/src/H5Farray.c b/src/H5Farray.c
index 58d8558..6469c05 100644
--- a/src/H5Farray.c
+++ b/src/H5Farray.c
@@ -53,8 +53,9 @@ static int interface_initialize_g = 0;
herr_t
H5F_arr_create (H5F_t *f, struct H5O_layout_t *layout/*in,out*/)
{
- unsigned u;
- hsize_t nbytes;
+ unsigned u;
+ hsize_t nbytes;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER (H5F_arr_create, FAIL);
@@ -69,27 +70,24 @@ H5F_arr_create (H5F_t *f, struct H5O_layout_t *layout/*in,out*/)
for (u=0, nbytes=1; u<layout->ndims; u++)
nbytes *= layout->dim[u];
assert (nbytes>0);
- if (HADDR_UNDEF==(layout->addr=H5MF_alloc(f, H5FD_MEM_DRAW, nbytes))) {
- HRETURN_ERROR (H5E_IO, H5E_NOSPACE, FAIL,
- "unable to reserve file space");
- }
+ if (HADDR_UNDEF==(layout->addr=H5MF_alloc(f, H5FD_MEM_DRAW, nbytes)))
+ HGOTO_ERROR (H5E_IO, H5E_NOSPACE, FAIL, "unable to reserve file space");
break;
case H5D_CHUNKED:
/* Create the root of the B-tree that describes chunked storage */
- if (H5F_istore_create (f, layout/*out*/)<0) {
- HRETURN_ERROR (H5E_IO, H5E_CANTINIT, FAIL,
- "unable to initialize chunked storage");
- }
+ if (H5F_istore_create (f, layout/*out*/)<0)
+ HGOTO_ERROR (H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize chunked storage");
break;
default:
assert ("not implemented yet" && 0);
- HRETURN_ERROR (H5E_IO, H5E_UNSUPPORTED, FAIL,
+ HGOTO_ERROR (H5E_IO, H5E_UNSUPPORTED, FAIL,
"unsupported storage layout");
- }
+ } /* end switch */
- FUNC_LEAVE (SUCCEED);
+done:
+ FUNC_LEAVE (ret_value);
}
@@ -127,11 +125,10 @@ H5F_arr_create (H5F_t *f, struct H5O_layout_t *layout/*in,out*/)
*-------------------------------------------------------------------------
*/
herr_t
-H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
- const struct H5O_pline_t *pline, const H5O_fill_t *fill,
- const struct H5O_efl_t *efl, const hsize_t _hslab_size[],
- const hsize_t mem_size[], const hssize_t mem_offset[],
- const hssize_t file_offset[], void *_buf/*out*/)
+H5F_arr_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist, const hsize_t _hslab_size[],
+ const hsize_t mem_size[], const hssize_t mem_offset[],
+ const hssize_t file_offset[], void *_buf/*out*/)
{
uint8_t *buf = (uint8_t*)_buf; /*cast for arithmetic */
hssize_t file_stride[H5O_LAYOUT_NDIMS]; /*strides through file */
@@ -148,13 +145,15 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
int j; /*counters */
unsigned u; /*counters */
hbool_t carray; /*carry for subtraction */
+ struct H5O_efl_t efl; /* External File List info */
#ifdef H5_HAVE_PARALLEL
H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT;
H5P_genplist_t *plist=NULL; /* Property list */
#endif
#ifdef COALESCE_READS
- hsize_t gather_reads; /* # of MPIO reads to gather */
+ hsize_t gather_reads; /* # of MPIO reads to gather */
#endif
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER(H5F_arr_read, FAIL);
@@ -181,17 +180,17 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Get the plist structure */
if(NULL == (plist = H5I_object(dxpl_id)))
- HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID");
/* Get the driver ID */
if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
- HRETURN_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
/* Check if we are using the MPIO driver */
if(H5FD_MPIO==driver_id) {
/* Get the driver information */
if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &dx)<0)
- HRETURN_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
/* Check if we are not using independent I/O */
if(H5FD_MPIO_INDEPENDENT!=dx->xfer_mode)
@@ -201,7 +200,7 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Collective MPIO access is unsupported for non-contiguous datasets */
if (H5D_CONTIGUOUS!=layout->type && H5FD_MPIO_COLLECTIVE==xfer_mode)
- HRETURN_ERROR (H5E_DATASET, H5E_READERROR, FAIL, "collective access on non-contiguous datasets not supported yet");
+ HGOTO_ERROR (H5E_DATASET, H5E_READERROR, FAIL, "collective access on non-contiguous datasets not supported yet");
#endif
#ifdef QAK
{
@@ -216,6 +215,10 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
}
#endif /* QAK */
+ /* Get necessary properties from property list */
+ if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get EFL value");
+
switch (layout->type) {
case H5D_CONTIGUOUS:
ndims = layout->ndims;
@@ -223,21 +226,11 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
* Offsets must not be negative for this type of storage.
*/
for (u=0; u<ndims; u++) {
- if (mem_offset[u]<0 || file_offset[u]<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "negative offsets are not valid");
- }
+ if (mem_offset[u]<0 || file_offset[u]<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "negative offsets are not valid");
}
/*
- * Filters cannot be used for contiguous data.
- */
- if (pline && pline->nfilters>0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "filters are not allowed for contiguous data");
- }
-
- /*
* Calculate the strides needed to walk through the array on disk
* and memory. Optimize the strides to result in the fewest number of
* I/O requests.
@@ -256,7 +249,7 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
*/
H5V_vector_cpy(ndims, idx, hslab_size);
nelmts = H5V_vector_reduce_product(ndims, hslab_size);
- if (efl && efl->nused>0) {
+ if (efl.nused>0) {
addr = 0;
} else {
addr = layout->addr;
@@ -276,7 +269,7 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
* memory.
*/
#ifdef H5_HAVE_PARALLEL
- if (H5FD_MPIO_COLLECTIVE==xfer_mode){
+ if (H5FD_MPIO_COLLECTIVE==xfer_mode) {
/*
* Currently supports same number of collective access. Need to
* be changed LATER to combine all reads into one collective MPIO
@@ -294,9 +287,7 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
printf("nelmts=%lu, min=%lu, max=%lu\n", temp, min, max);
#endif
if (max != min)
- HRETURN_ERROR(H5E_DATASET, H5E_READERROR, FAIL,
- "collective access with unequal number of "
- "blocks not supported yet");
+ HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "collective access with unequal number of blocks not supported yet");
}
#endif
@@ -309,7 +300,7 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
for (z=0, gather_reads = nelmts - 1; z<nelmts; z++, gather_reads--) {
/* Track the number of reads to gather */
if(H5P_set(plist, H5D_XFER_GATHER_READS_NAME, &gather_reads)<0)
- HRETURN_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve gather reads");
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve gather reads");
#else
for (z=0; z<nelmts; z++) {
#endif
@@ -320,18 +311,14 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
* all datasets in external files would alias to the same set of
* file offsets, totally mixing up the data sieve buffer information. -QAK
*/
- if (efl && efl->nused>0) {
+ if (efl.nused>0) {
H5_CHECK_OVERFLOW(elmt_size,hsize_t,size_t);
- if (H5O_efl_read(f, efl, addr, (size_t)elmt_size, buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "external data read failed");
- }
+ if (H5O_efl_read(f, &efl, addr, (size_t)elmt_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "external data read failed");
} else {
H5_CHECK_OVERFLOW(elmt_size,hsize_t,size_t);
- if (H5F_contig_read(f, max_data, H5FD_MEM_DRAW, addr, (size_t)elmt_size, dxpl_id, buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "block read failed");
- }
+ if (H5F_contig_read(f, max_data, H5FD_MEM_DRAW, addr, (size_t)elmt_size, dxpl_id, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed");
} /* end else */
/* Decrement indices and advance pointers */
@@ -354,21 +341,22 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/*
* This method is unable to access external raw data files
*/
- if (efl && efl->nused>0)
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "chunking and external files are mutually exclusive");
+ if (efl.nused>0)
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "chunking and external files are mutually exclusive");
/* Go get the data from the chunks */
- if (H5F_istore_read(f, dxpl_id, layout, pline, fill, mem_size,
+ if (H5F_istore_read(f, dxpl_id, layout, dc_plist, mem_size,
mem_offset, file_offset, hslab_size, buf)<0)
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
break;
default:
assert("not implemented yet" && 0);
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout");
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout");
}
- FUNC_LEAVE(SUCCEED);
+done:
+ FUNC_LEAVE(ret_value);
}
@@ -406,12 +394,11 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
*-------------------------------------------------------------------------
*/
herr_t
-H5F_arr_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
- const struct H5O_pline_t *pline,
- const struct H5O_fill_t *fill, const struct H5O_efl_t *efl,
- const hsize_t _hslab_size[], const hsize_t mem_size[],
- const hssize_t mem_offset[], const hssize_t file_offset[],
- const void *_buf)
+H5F_arr_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist,
+ const hsize_t _hslab_size[], const hsize_t mem_size[],
+ const hssize_t mem_offset[], const hssize_t file_offset[],
+ const void *_buf)
{
const uint8_t *buf = (const uint8_t *)_buf; /*cast for arithmetic */
hssize_t file_stride[H5O_LAYOUT_NDIMS]; /*strides through file */
@@ -428,10 +415,12 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
int j; /*counters */
unsigned u; /*counters */
hbool_t carray; /*carry for subtraction */
+ struct H5O_efl_t efl; /* External File List info */
#ifdef H5_HAVE_PARALLEL
H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT;
H5P_genplist_t *plist=NULL; /* Property list */
#endif
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER(H5F_arr_write, FAIL);
@@ -458,17 +447,17 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Get the plist structure */
if(NULL == (plist = H5I_object(dxpl_id)))
- HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID");
/* Get the driver ID */
if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
- HRETURN_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
/* Check if we are using the MPIO driver */
if(H5FD_MPIO==driver_id) {
/* Get the driver information */
if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &dx)<0)
- HRETURN_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
/* Check if we are not using independent I/O */
if(H5FD_MPIO_INDEPENDENT!=dx->xfer_mode)
@@ -477,7 +466,7 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
}
if (H5D_CONTIGUOUS!=layout->type && H5FD_MPIO_COLLECTIVE==xfer_mode)
- HRETURN_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL, "collective access on non-contiguous datasets not supported yet");
+ HGOTO_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL, "collective access on non-contiguous datasets not supported yet");
#endif
#ifdef QAK
@@ -496,6 +485,10 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
}
#endif /* QAK */
+ /* Get necessary properties from property list */
+ if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get EFL value");
+
switch (layout->type) {
case H5D_CONTIGUOUS:
ndims = layout->ndims;
@@ -503,21 +496,11 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
* Offsets must not be negative for this type of storage.
*/
for (u=0; u<ndims; u++) {
- if (mem_offset[u]<0 || file_offset[u]<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "negative offsets are not valid");
- }
+ if (mem_offset[u]<0 || file_offset[u]<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "negative offsets are not valid");
}
/*
- * Filters cannot be used for contiguous data
- */
- if (pline && pline->nfilters>0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "filters are not allowed for contiguous data");
- }
-
- /*
* Calculate the strides needed to walk through the array on disk.
* Optimize the strides to result in the fewest number of I/O
* requests.
@@ -538,7 +521,7 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
H5V_vector_cpy(ndims, idx, hslab_size);
nelmts = H5V_vector_reduce_product(ndims, hslab_size);
- if (efl && efl->nused>0) {
+ if (efl.nused>0) {
addr = 0;
} else {
addr = layout->addr;
@@ -575,29 +558,22 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
#ifdef AKC
printf("nelmts=%lu, min=%lu, max=%lu\n", temp, min, max);
#endif
- if (max != min) {
- HRETURN_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL,
- "collective access with unequal number of "
- "blocks not supported yet");
- }
+ if (max != min)
+ HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "collective access with unequal number of blocks not supported yet");
}
#endif
for (z=0; z<nelmts; z++) {
/* Write to file */
- if (efl && efl->nused>0) {
+ if (efl.nused>0) {
H5_CHECK_OVERFLOW(elmt_size,hsize_t,size_t);
- if (H5O_efl_write(f, efl, addr, (size_t)elmt_size, buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "external data write failed");
- }
+ if (H5O_efl_write(f, &efl, addr, (size_t)elmt_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "external data write failed");
} else {
H5_CHECK_OVERFLOW(elmt_size,hsize_t,size_t);
- if (H5F_contig_write(f, max_data, H5FD_MEM_DRAW, addr, (size_t)elmt_size, dxpl_id, buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "block write failed");
- }
+ if (H5F_contig_write(f, max_data, H5FD_MEM_DRAW, addr, (size_t)elmt_size, dxpl_id, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed");
} /* end else */
/* Decrement indices and advance pointers */
@@ -621,19 +597,20 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/*
* This method is unable to access external raw data files
*/
- if (efl && efl->nused>0)
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "chunking and external files are mutually exclusive");
+ if (efl.nused>0)
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "chunking and external files are mutually exclusive");
/* Write the read to the chunks */
- if (H5F_istore_write(f, dxpl_id, layout, pline, fill, mem_size,
+ if (H5F_istore_write(f, dxpl_id, layout, dc_plist, mem_size,
mem_offset, file_offset, hslab_size, buf)<0)
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
break;
default:
assert("not implemented yet" && 0);
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout");
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout");
}
- FUNC_LEAVE (SUCCEED);
+done:
+ FUNC_LEAVE (ret_value);
}
diff --git a/src/H5Fistore.c b/src/H5Fistore.c
index 54b2fd2..1c2b137 100644
--- a/src/H5Fistore.c
+++ b/src/H5Fistore.c
@@ -1774,7 +1774,7 @@ H5F_istore_unlock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
*/
herr_t
H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
- const H5O_pline_t *pline, const H5O_fill_t *fill,
+ H5P_genplist_t *dc_plist,
const hsize_t size_m[], const hssize_t offset_m[],
const hssize_t offset_f[], const hsize_t size[], void *buf)
{
@@ -1792,6 +1792,9 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
unsigned idx_hint=0; /*cache index hint */
hsize_t chunk_size; /* Bytes in chunk */
haddr_t chunk_addr; /* Chunk address on disk */
+ H5O_pline_t pline; /* I/O pipeline information */
+ H5O_fill_t fill; /* Fill value information */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER(H5F_istore_read, FAIL);
@@ -1806,6 +1809,12 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
assert(size);
assert(buf);
+ /* Get necessary properties from property list */
+ if(H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fill value");
+ if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data pipeline");
+
/* Compute chunk size */
for (u=0, chunk_size=1; u<layout->ndims; u++)
chunk_size *= layout->dim[u];
@@ -1832,7 +1841,8 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
}
/* Loop over all chunks */
- while (1) {
+ carry=0;
+ while (carry==0) {
for (u=0, naccessed=1; u<layout->ndims; u++) {
/* The location and size of the chunk being accessed */
assert(layout->dim[u] < HSSIZET_MAX);
@@ -1860,7 +1870,7 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
* for the chunk has been defined, then don't load the chunk into the
* cache, just read the data from it directly.
*/
- if ((chunk_size>f->shared->rdcc_nbytes && pline->nfilters==0 &&
+ if ((chunk_size>f->shared->rdcc_nbytes && pline.nfilters==0 &&
chunk_addr!=HADDR_UNDEF)
#ifdef H5_HAVE_PARALLEL
@@ -1876,8 +1886,8 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
#ifdef H5_HAVE_PARALLEL
/* Additional sanity checks when operating in parallel */
- if (chunk_addr==HADDR_UNDEF || pline->nfilters>0)
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to locate raw data chunk");
+ if (chunk_addr==HADDR_UNDEF || pline.nfilters>0)
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to locate raw data chunk");
#endif /* H5_HAVE_PARALLEL */
/*
@@ -1890,29 +1900,24 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
for (u=l.ndims; u-- > 0; /*void*/)
l.dim[u] = layout->dim[u];
l.addr = chunk_addr;
- if (H5F_arr_read(f, H5P_DATASET_XFER_DEFAULT, &l, pline, fill, NULL/*no efl*/,
+ if (H5F_arr_read(f, H5P_DATASET_XFER_DEFAULT, &l, dc_plist,
sub_size, size_m, sub_offset_m, offset_wrt_chunk, buf)<0)
- HRETURN_ERROR (H5E_IO, H5E_READERROR, FAIL, "unable to read raw data from file");
+ HGOTO_ERROR (H5E_IO, H5E_READERROR, FAIL, "unable to read raw data from file");
} /* end if */
else {
/*
* Lock the chunk, transfer data to the application, then unlock
* the chunk.
*/
- if (NULL==(chunk=H5F_istore_lock(f, dxpl_id, layout, pline, fill,
- chunk_offset, FALSE, &idx_hint))) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "unable to read raw data chunk");
- }
+ if (NULL==(chunk=H5F_istore_lock(f, dxpl_id, layout, &pline, &fill,
+ chunk_offset, FALSE, &idx_hint)))
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk");
H5V_hyper_copy(layout->ndims, sub_size, size_m, sub_offset_m,
(void*)buf, layout->dim, offset_wrt_chunk, chunk);
H5_CHECK_OVERFLOW(naccessed,hsize_t,size_t);
- if (H5F_istore_unlock(f, dxpl_id, layout, pline, FALSE,
- chunk_offset, &idx_hint, chunk,
- (size_t)naccessed)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "unable to unlock raw data chunk");
- }
+ if (H5F_istore_unlock(f, dxpl_id, layout, &pline, FALSE,
+ chunk_offset, &idx_hint, chunk, (size_t)naccessed)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk");
} /* end else */
/* Increment indices */
@@ -1922,10 +1927,10 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
else
carry = 0;
}
- if (carry)
- break;
}
- FUNC_LEAVE(SUCCEED);
+
+done:
+ FUNC_LEAVE(ret_value);
}
@@ -1951,7 +1956,7 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
*/
herr_t
H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
- const H5O_pline_t *pline, const H5O_fill_t *fill,
+ H5P_genplist_t *dc_plist,
const hsize_t size_m[], const hssize_t offset_m[],
const hssize_t offset_f[], const hsize_t size[],
const void *buf)
@@ -1969,6 +1974,9 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
unsigned idx_hint=0;
hsize_t chunk_size, naccessed;
haddr_t chunk_addr; /* Chunk address on disk */
+ H5O_pline_t pline; /* I/O pipeline information */
+ H5O_fill_t fill; /* Fill value information */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER(H5F_istore_write, FAIL);
@@ -1983,6 +1991,12 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
assert(size);
assert(buf);
+ /* Get necessary properties from property list */
+ if(H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fill value");
+ if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data pipeline");
+
/* Compute chunk size */
for (u=0, chunk_size=1; u<layout->ndims; u++)
chunk_size *= layout->dim[u];
@@ -2010,7 +2024,8 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
/* Loop over all chunks */
- while (1) {
+ carry=0;
+ while (carry==0) {
for (u=0, naccessed=1; u<layout->ndims; u++) {
/* The location and size of the chunk being accessed */
assert(layout->dim[u] < HSSIZET_MAX);
@@ -2038,7 +2053,7 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
* for the chunk has been defined, then don't load the chunk into the
* cache, just write the data to it directly.
*/
- if ((chunk_size>f->shared->rdcc_nbytes && pline->nfilters==0 &&
+ if ((chunk_size>f->shared->rdcc_nbytes && pline.nfilters==0 &&
chunk_addr!=HADDR_UNDEF)
#ifdef H5_HAVE_PARALLEL
@@ -2054,8 +2069,8 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
#ifdef H5_HAVE_PARALLEL
/* Additional sanity check when operating in parallel */
- if (chunk_addr==HADDR_UNDEF || pline->nfilters>0)
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to locate raw data chunk");
+ if (chunk_addr==HADDR_UNDEF || pline.nfilters>0)
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to locate raw data chunk");
#endif /* H5_HAVE_PARALLEL */
/*
@@ -2068,24 +2083,24 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
for (u=l.ndims; u-- > 0; /*void*/)
l.dim[u] = layout->dim[u];
l.addr = chunk_addr;
- if (H5F_arr_write(f, H5P_DATASET_XFER_DEFAULT, &l, pline, fill, NULL/*no efl*/,
+ if (H5F_arr_write(f, H5P_DATASET_XFER_DEFAULT, &l, dc_plist,
sub_size, size_m, sub_offset_m, offset_wrt_chunk, buf)<0)
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file");
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file");
} /* end if */
else {
/*
* Lock the chunk, copy from application to chunk, then unlock the
* chunk.
*/
- if (NULL==(chunk=H5F_istore_lock(f, dxpl_id, layout, pline, fill,
+ if (NULL==(chunk=H5F_istore_lock(f, dxpl_id, layout, &pline, &fill,
chunk_offset, (hbool_t)(naccessed==chunk_size), &idx_hint)))
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to read raw data chunk");
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to read raw data chunk");
H5V_hyper_copy(layout->ndims, sub_size,
layout->dim, offset_wrt_chunk, chunk, size_m, sub_offset_m, buf);
H5_CHECK_OVERFLOW(naccessed,hsize_t,size_t);
- if (H5F_istore_unlock(f, dxpl_id, layout, pline, TRUE,
+ if (H5F_istore_unlock(f, dxpl_id, layout, &pline, TRUE,
chunk_offset, &idx_hint, chunk, (size_t)naccessed)<0)
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "uanble to unlock raw data chunk");
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "uanble to unlock raw data chunk");
} /* end else */
/* Increment indices */
@@ -2095,11 +2110,10 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
else
carry = 0;
}
- if (carry)
- break;
- }
+ } /* end while */
- FUNC_LEAVE(SUCCEED);
+done:
+ FUNC_LEAVE(ret_value);
}
@@ -2403,33 +2417,34 @@ done:
*/
herr_t
H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
- const hsize_t *space_dim, const H5O_pline_t *pline,
- const H5O_fill_t *fill)
+ const hsize_t *space_dim, H5P_genplist_t *dc_plist)
{
int i, carry;
- unsigned u;
- hssize_t chunk_offset[H5O_LAYOUT_NDIMS];
- uint8_t *chunk=NULL;
- unsigned idx_hint=0;
- hsize_t chunk_size;
-#ifdef AKC
- H5F_istore_ud1_t udata;
-#endif
+ unsigned u;
+ hssize_t chunk_offset[H5O_LAYOUT_NDIMS];
+ uint8_t *chunk=NULL;
+ unsigned idx_hint=0;
+ hsize_t chunk_size;
+ H5O_pline_t pline; /* I/O pipeline information */
+ H5O_fill_t fill; /* Fill value information */
+ herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER(H5F_istore_allocate, FAIL);
-#ifdef AKC
- printf("Enter %s:\n", FUNC);
-#endif
/* Check args */
assert(f);
assert(space_dim);
- assert(pline);
assert(layout && H5D_CHUNKED==layout->type);
assert(layout->ndims>0 && layout->ndims<=H5O_LAYOUT_NDIMS);
assert(H5F_addr_defined(layout->addr));
+ /* Get necessary properties from property list */
+ if(H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fill value");
+ if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data pipeline");
+
/*
* Setup indice to go through all chunks. (Future improvement
* should allocate only chunks that have no file space assigned yet.
@@ -2437,65 +2452,37 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
for (u=0, chunk_size=1; u<layout->ndims; u++) {
chunk_offset[u]=0;
chunk_size *= layout->dim[u];
- }
+ } /* end for */
/* Loop over all chunks */
- while (1) {
-
-#ifdef AKC
- printf("Checking allocation for chunk( ");
- for (u=0; u<layout->ndims; u++){
- printf("%ld ", chunk_offset[u]);
- }
- printf(")\n");
-#endif
-#ifdef NO
- if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)<0) {
-#endif
- /* No file space assigned yet. Allocate it. */
- /* The following needs improvement like calling the */
- /* allocation directly rather than indirectly using the */
- /* allocation effect in the unlock process. */
+ carry=0;
+ while (carry==0) {
+ /* No file space assigned yet. Allocate it. */
+ /* The following needs improvement like calling the */
+ /* allocation directly rather than indirectly using the */
+ /* allocation effect in the unlock process. */
-#ifdef AKC
- printf("need allocation\n");
-#endif
- /*
- * Lock the chunk, copy from application to chunk, then unlock the
- * chunk.
- */
+ /*
+ * Lock the chunk, copy from application to chunk, then unlock the
+ * chunk.
+ */
#ifdef H5_HAVE_PARALLEL
- /* rky 981207 Serialize access to this critical region. */
- if (SUCCEED!= H5FD_mpio_wait_for_left_neighbor(f->shared->lf)) {
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to lock the data chunk");
- }
+ /* rky 981207 Serialize access to this critical region. */
+ if (SUCCEED!= H5FD_mpio_wait_for_left_neighbor(f->shared->lf))
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to lock the data chunk");
#endif
- if (NULL==(chunk=H5F_istore_lock(f, dxpl_id, layout, pline,
- fill, chunk_offset, FALSE, &idx_hint))) {
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to read raw data chunk");
- }
- H5_CHECK_OVERFLOW(chunk_size,hsize_t,size_t);
- if (H5F_istore_unlock(f, dxpl_id, layout, pline, TRUE,
- chunk_offset, &idx_hint, chunk, (size_t)chunk_size)<0) {
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
- "uanble to unlock raw data chunk");
- }
+ if (NULL==(chunk=H5F_istore_lock(f, dxpl_id, layout, &pline,
+ &fill, chunk_offset, FALSE, &idx_hint)))
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to read raw data chunk");
+
+ H5_CHECK_OVERFLOW(chunk_size,hsize_t,size_t);
+ if (H5F_istore_unlock(f, dxpl_id, layout, &pline, TRUE,
+ chunk_offset, &idx_hint, chunk, (size_t)chunk_size)<0)
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "uanble to unlock raw data chunk");
#ifdef H5_HAVE_PARALLEL
- if (SUCCEED!= H5FD_mpio_signal_right_neighbor(f->shared->lf)) {
- HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to unlock the data chunk");
- }
-#endif
-#ifdef NO
- } else {
-#ifdef AKC
- printf("NO need for allocation\n");
- HDfprintf(stdout, "udata.addr=%a\n", udata.addr);
-#endif
- }
+ if (SUCCEED!= H5FD_mpio_signal_right_neighbor(f->shared->lf))
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to unlock the data chunk");
#endif
/* Increment indices */
@@ -2506,10 +2493,8 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
} else {
carry = 0;
}
- }
- if (carry)
- break;
- }
+ } /* end for */
+ } /* end while */
#ifdef H5_HAVE_PARALLEL
/*
@@ -2522,12 +2507,12 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
* removed, when H5D_init_storage is changed to call H5MF_alloc directly
* to allocate space, instead of calling H5F_istore_unlock.
*/
- if (MPI_Barrier(H5FD_mpio_communicator(f->shared->lf))) {
- HRETURN_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Barrier failed");
- }
+ if (MPI_Barrier(H5FD_mpio_communicator(f->shared->lf)))
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Barrier failed");
#endif
- FUNC_LEAVE(SUCCEED);
+done:
+ FUNC_LEAVE(ret_value);
}
@@ -2632,7 +2617,7 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
*-------------------------------------------------------------------------
*/
herr_t
-H5F_istore_prune_by_extent(H5F_t *f, H5O_layout_t *layout, H5S_t * space)
+H5F_istore_prune_by_extent(H5F_t *f, const H5O_layout_t *layout, const H5S_t * space)
{
H5F_rdcc_t *rdcc = &(f->shared->rdcc); /*raw data chunk cache */
H5F_rdcc_ent_t *ent = NULL, *next = NULL; /*cache entry */
@@ -2652,16 +2637,13 @@ H5F_istore_prune_by_extent(H5F_t *f, H5O_layout_t *layout, H5S_t * space)
/* Go get the rank & dimensions */
if(H5S_get_simple_extent_dims(space, curr_dims, NULL) < 0)
- HRETURN_ERROR(H5E_DATASET, H5E_CANTGET, FAIL,
- "can't get dataset dimensions");
-
+ HRETURN_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions");
/*-------------------------------------------------------------------------
* Figure out what chunks are no longer in use for the specified extent
* and release them from the linked list raw data cache
*-------------------------------------------------------------------------
*/
-
for(ent = rdcc->head; ent; ent = next) {
next = ent->next;
@@ -2830,8 +2812,8 @@ H5F_istore_remove(H5F_t *f, haddr_t addr, void *_lt_key /*in,out */ ,
*-------------------------------------------------------------------------
*/
herr_t
-H5F_istore_initialize_by_extent(H5F_t *f, H5O_layout_t *layout,
- H5O_pline_t * pline, H5O_fill_t * fill, H5S_t * space)
+H5F_istore_initialize_by_extent(H5F_t *f, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist, const H5S_t * space)
{
hid_t dxpl_id; /*dataset transfer property list */
uint8_t *chunk = NULL; /*the file chunk */
@@ -2853,6 +2835,9 @@ H5F_istore_initialize_by_extent(H5F_t *f, H5O_layout_t *layout,
int i, carry; /*counters */
unsigned u;
int found = 0; /*initialize this entry */
+ H5O_pline_t pline; /* I/O pipeline information */
+ H5O_fill_t fill; /* Fill value information */
+ herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER(H5F_istore_initialize_by_extent, FAIL);
@@ -2862,20 +2847,24 @@ H5F_istore_initialize_by_extent(H5F_t *f, H5O_layout_t *layout,
assert(layout->ndims > 0 && layout->ndims <= H5O_LAYOUT_NDIMS);
assert(H5F_addr_defined(layout->addr));
assert(space);
- assert(pline);
- assert(fill);
+ /* Get necessary properties from property list */
+ if(H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fill value");
+ if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data pipeline");
+
+ /* Reset start & count arrays */
HDmemset(start, 0, sizeof(start));
HDmemset(count, 0, sizeof(count));
/* Go get the rank & dimensions */
if((rank = H5S_get_simple_extent_dims(space, curr_dims, NULL)) < 0)
- HRETURN_ERROR(H5E_DATASET, H5E_CANTGET, FAIL,
- "can't get dataset dimensions");
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions");
- for(i = 0; i < rank; i++) {
+ /* Copy current dimensions */
+ for(i = 0; i < rank; i++)
size[i] = curr_dims[i];
- }
size[i] = layout->dim[i];
elm_size = size[i];
@@ -2883,15 +2872,10 @@ H5F_istore_initialize_by_extent(H5F_t *f, H5O_layout_t *layout,
dxpl_id = H5P_DATASET_XFER_DEFAULT;
/* Create a data space for a chunk & set the extent */
- if(NULL == (space_chunk = H5S_create(H5S_SIMPLE))) {
- HRETURN_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL,
- "can't create simple dataspace");
- }
- if(H5S_set_extent_simple(space_chunk, (unsigned)rank, layout->dim,
- NULL) < 0) {
- HRETURN_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL,
- "can't set dimensions");
- }
+ if(NULL == (space_chunk = H5S_create(H5S_SIMPLE)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace");
+ if(H5S_set_extent_simple(space_chunk, (unsigned)rank, layout->dim, NULL) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't set dimensions");
/*
* Set up multi-dimensional counters (idx_min, idx_max, and idx_cur) and
@@ -2902,87 +2886,68 @@ H5F_istore_initialize_by_extent(H5F_t *f, H5O_layout_t *layout,
idx_min[u] = 0;
idx_max[u] = (size[u] - 1) / layout->dim[u] + 1;
idx_cur[u] = idx_min[u];
- }
+ } /* end for */
/* Loop over all chunks */
- while(1) {
+ carry=0;
+ while(carry==0) {
for(u = 0, naccessed = 1; u < layout->ndims; u++) {
/* The location and size of the chunk being accessed */
chunk_offset[u] = idx_cur[u] * (hssize_t)(layout->dim[u]);
- sub_size[u] =
- MIN((idx_cur[u] + 1) * layout->dim[u],
+ sub_size[u] = MIN((idx_cur[u] + 1) * layout->dim[u],
size[u]) - chunk_offset[u];
naccessed *= sub_size[u];
- }
+ } /* end for */
/*
* Figure out what chunks have to be initialized. These are the chunks where the database
* extent boundary is within the chunk
*/
-
for(u = 0, found = 0; u < layout->ndims - 1; u++) {
end_chunk = chunk_offset[u] + layout->dim[u];
if(end_chunk > size[u]) {
found = 1;
break;
}
- }
+ } /* end for */
if(found) {
- if(NULL == (chunk =
- H5F_istore_lock(f, dxpl_id, layout, pline, fill,
- chunk_offset, FALSE, &idx_hint))) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to read raw data chunk");
- }
+ if(NULL == (chunk = H5F_istore_lock(f, dxpl_id, layout, &pline, &fill,
+ chunk_offset, FALSE, &idx_hint)))
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to read raw data chunk");
- if(H5S_select_all(space_chunk) < 0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to select space");
- }
+ if(H5S_select_all(space_chunk) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to select space");
- for(i = 0; i < rank; i++) {
- count[i] =
- MIN((idx_cur[i] + 1) * layout->dim[i],
- size[i] - chunk_offset[i]);
- }
+ for(i = 0; i < rank; i++)
+ count[i] = MIN((idx_cur[i] + 1) * layout->dim[i], size[i] - chunk_offset[i]);
#if defined (H5F_ISTORE_DEBUG)
HDfputs("cache:initialize:offset:[", stdout);
- for(u = 0; u < layout->ndims - 1; u++) {
+ for(u = 0; u < layout->ndims - 1; u++)
HDfprintf(stdout, "%s%Hd", u ? ", " : "", chunk_offset[u]);
- }
HDfputs("]", stdout);
HDfputs(":count:[", stdout);
- for(u = 0; u < layout->ndims - 1; u++) {
+ for(u = 0; u < layout->ndims - 1; u++)
HDfprintf(stdout, "%s%Hd", u ? ", " : "", count[u]);
- }
HDfputs("]\n", stdout);
#endif
if(H5S_select_hyperslab(space_chunk, H5S_SELECT_NOTB, start, NULL,
- count, NULL) < 0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to select hyperslab");
- }
+ count, NULL) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to select hyperslab");
/* Fill the selection in the memory buffer */
- if(H5S_select_fill(fill->buf, fill->size, space_chunk, chunk) < 0) {
- HRETURN_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL,
- "filling selection failed");
- }
-
- if(H5F_istore_unlock(f, dxpl_id, layout, pline, TRUE,
- chunk_offset, &idx_hint, chunk,
- (size_t)naccessed) < 0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to unlock raw data chunk");
- }
+ if(H5S_select_fill(fill.buf, fill.size, space_chunk, chunk) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed");
- } /*found */
+ if(H5F_istore_unlock(f, dxpl_id, layout, &pline, TRUE,
+ chunk_offset, &idx_hint, chunk, (size_t)naccessed) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to unlock raw data chunk");
+ } /*found */
/* Increment indices */
for(i = layout->ndims - 1, carry = 1; i >= 0 && carry; --i) {
@@ -2990,14 +2955,12 @@ H5F_istore_initialize_by_extent(H5F_t *f, H5O_layout_t *layout,
idx_cur[i] = idx_min[i];
else
carry = 0;
- }
- if(carry)
- break;
-
- }
+ } /* end for */
+ } /* end while */
+done:
if(space_chunk)
H5S_close(space_chunk);
- FUNC_LEAVE(SUCCEED);
+ FUNC_LEAVE(ret_value);
}
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 5c81dfc..bb36ba6 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -183,24 +183,21 @@ __DLL__ herr_t H5F_istore_stats (H5F_t *f, hbool_t headers);
__DLL__ herr_t H5F_istore_create(H5F_t *f,
struct H5O_layout_t *layout/*in,out*/);
__DLL__ herr_t H5F_istore_read(H5F_t *f, hid_t dxpl_id,
- const struct H5O_layout_t *layout,
- const struct H5O_pline_t *pline,
- const struct H5O_fill_t *fill,
- const hsize_t size_m[], const hssize_t offset_m[],
- const hssize_t offset_f[], const hsize_t size[],
- void *buf/*out*/);
+ const struct H5O_layout_t *layout,
+ struct H5P_genplist_t *dc_plist,
+ const hsize_t size_m[], const hssize_t offset_m[],
+ const hssize_t offset_f[], const hsize_t size[],
+ void *buf/*out*/);
__DLL__ herr_t H5F_istore_write(H5F_t *f, hid_t dxpl_id,
- const struct H5O_layout_t *layout,
- const struct H5O_pline_t *pline,
- const struct H5O_fill_t *fill,
+ const struct H5O_layout_t *layout,
+ struct H5P_genplist_t *dc_plist,
const hsize_t size_m[], const hssize_t offset_m[],
- const hssize_t offset[], const hsize_t size[],
- const void *buf);
+ const hssize_t offset[], const hsize_t size[],
+ const void *buf);
__DLL__ herr_t H5F_istore_allocate (H5F_t *f, hid_t dxpl_id,
- const struct H5O_layout_t *layout,
- const hsize_t *space_dim,
- const struct H5O_pline_t *pline,
- const struct H5O_fill_t *fill);
+ const struct H5O_layout_t *layout,
+ const hsize_t *space_dim,
+ struct H5P_genplist_t *dc_plist);
/* Functions that operate on contiguous storage wrt boot block */
__DLL__ herr_t H5F_contig_read(H5F_t *f, hsize_t max_data, H5FD_mem_t type, haddr_t addr,
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 898da84..42af604 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -321,11 +321,12 @@ __DLL__ size_t H5F_sizeof_size(const H5F_t *f);
#define H5F_MNT_SYM_LOCAL_DEF FALSE
/* Forward declarations for prototypes arguments */
+struct H5G_entry_t;
struct H5O_layout_t;
struct H5O_efl_t;
struct H5O_pline_t;
struct H5O_fill_t;
-struct H5G_entry_t;
+struct H5P_genplist_t;
struct H5S_t;
/* Private functions, not part of the publicly documented API */
@@ -338,23 +339,19 @@ __DLL__ herr_t H5F_get_fileno(const H5F_t *f, unsigned long *filenum);
__DLL__ herr_t H5F_arr_create(H5F_t *f,
struct H5O_layout_t *layout /*in,out*/);
__DLL__ herr_t H5F_arr_read (H5F_t *f, hid_t dxpl_id,
- const struct H5O_layout_t *layout,
- const struct H5O_pline_t *pline,
- const struct H5O_fill_t *fill,
- const struct H5O_efl_t *efl,
- const hsize_t _hslab_size[],
- const hsize_t mem_size[],
- const hssize_t mem_offset[],
- const hssize_t file_offset[], void *_buf/*out*/);
+ const struct H5O_layout_t *layout,
+ struct H5P_genplist_t *dc_plist,
+ const hsize_t _hslab_size[],
+ const hsize_t mem_size[],
+ const hssize_t mem_offset[],
+ const hssize_t file_offset[], void *_buf/*out*/);
__DLL__ herr_t H5F_arr_write (H5F_t *f, hid_t dxpl_id,
- const struct H5O_layout_t *layout,
- const struct H5O_pline_t *pline,
- const struct H5O_fill_t *fill,
- const struct H5O_efl_t *efl,
- const hsize_t _hslab_size[],
- const hsize_t mem_size[],
- const hssize_t mem_offset[],
- const hssize_t file_offset[], const void *_buf);
+ const struct H5O_layout_t *layout,
+ struct H5P_genplist_t *dc_plist,
+ const hsize_t _hslab_size[],
+ const hsize_t mem_size[],
+ const hssize_t mem_offset[],
+ const hssize_t file_offset[], const void *_buf);
/* Functions that operate on blocks of bytes wrt boot block */
__DLL__ herr_t H5F_block_read(H5F_t *f, H5FD_mem_t type, haddr_t addr,
@@ -364,25 +361,25 @@ __DLL__ herr_t H5F_block_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
/* Functions that operate on byte sequences */
__DLL__ herr_t H5F_seq_read(H5F_t *f, hid_t dxpl_id,
- const struct H5O_layout_t *layout, const struct H5O_pline_t *pline,
- const struct H5O_fill_t *fill, const struct H5O_efl_t *efl,
+ const struct H5O_layout_t *layout,
+ struct H5P_genplist_t *dc_plist,
const struct H5S_t *file_space, size_t elmt_size, size_t seq_len,
hsize_t file_offset, void *_buf/*out*/);
__DLL__ herr_t H5F_seq_write (H5F_t *f, hid_t dxpl_id,
- const struct H5O_layout_t *layout, const struct H5O_pline_t *pline,
- const struct H5O_fill_t *fill, const struct H5O_efl_t *efl,
+ const struct H5O_layout_t *layout,
+ struct H5P_genplist_t *dc_plist,
const struct H5S_t *file_space, size_t elmt_size, size_t seq_len,
hsize_t file_offset, const void *_buf);
/* Functions that operate on vectors of byte sequences */
__DLL__ herr_t H5F_seq_readv(H5F_t *f, hid_t dxpl_id,
- const struct H5O_layout_t *layout, const struct H5O_pline_t *pline,
- const struct H5O_fill_t *fill, const struct H5O_efl_t *efl,
+ const struct H5O_layout_t *layout,
+ struct H5P_genplist_t *dc_plist,
const struct H5S_t *file_space, size_t elmt_size, size_t nseq,
size_t seq_len[], hsize_t file_offset[], void *_buf/*out*/);
__DLL__ herr_t H5F_seq_writev(H5F_t *f, hid_t dxpl_id,
- const struct H5O_layout_t *layout, const struct H5O_pline_t *pline,
- const struct H5O_fill_t *fill, const struct H5O_efl_t *efl,
+ const struct H5O_layout_t *layout,
+ struct H5P_genplist_t *dc_plist,
const struct H5S_t *file_space, size_t elmt_size, size_t nseq,
size_t seq_len[], hsize_t file_offset[], const void *_buf);
@@ -390,16 +387,12 @@ __DLL__ herr_t H5F_seq_writev(H5F_t *f, hid_t dxpl_id,
/* Functions that operate on indexed storage */
__DLL__ hsize_t H5F_istore_allocated(H5F_t *f, unsigned ndims, haddr_t addr);
__DLL__ herr_t H5F_istore_dump_btree(H5F_t *f, FILE *stream, unsigned ndims,
- haddr_t addr);
-
-__DLL__ herr_t H5F_istore_prune_by_extent( H5F_t *f,
- struct H5O_layout_t *layout,
- struct H5S_t *space );
+ haddr_t addr);
+__DLL__ herr_t H5F_istore_prune_by_extent( H5F_t *f,
+ const struct H5O_layout_t *layout, const struct H5S_t *space);
__DLL__ herr_t H5F_istore_initialize_by_extent( H5F_t *f,
- struct H5O_layout_t *layout,
- struct H5O_pline_t *pline,
- struct H5O_fill_t *fill,
- struct H5S_t *space );
+ const struct H5O_layout_t *layout, struct H5P_genplist_t *dc_plist,
+ const struct H5S_t *space );
/* Functions for allocation/releasing chunks */
__DLL__ void * H5F_istore_chunk_alloc(size_t chunk_size);
diff --git a/src/H5Fseq.c b/src/H5Fseq.c
index 20c71a7..2714174 100644
--- a/src/H5Fseq.c
+++ b/src/H5Fseq.c
@@ -57,10 +57,10 @@ static int interface_initialize_g = 0;
*-------------------------------------------------------------------------
*/
herr_t
-H5F_seq_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
- const struct H5O_pline_t *pline, const H5O_fill_t *fill,
- const struct H5O_efl_t *efl, const H5S_t *file_space, size_t elmt_size,
- size_t seq_len, hsize_t file_offset, void *buf/*out*/)
+H5F_seq_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist,
+ const H5S_t *file_space, size_t elmt_size,
+ size_t seq_len, hsize_t file_offset, void *buf/*out*/)
{
FUNC_ENTER(H5F_seq_read, FAIL);
@@ -69,7 +69,7 @@ H5F_seq_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
assert(layout);
assert(buf);
- if (H5F_seq_readv(f, dxpl_id, layout, pline, fill, efl, file_space, elmt_size, 1, &seq_len, &file_offset, buf)<0)
+ if (H5F_seq_readv(f, dxpl_id, layout, dc_plist, file_space, elmt_size, 1, &seq_len, &file_offset, buf)<0)
HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "vector read failed");
FUNC_LEAVE(SUCCEED);
@@ -98,10 +98,10 @@ H5F_seq_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
*-------------------------------------------------------------------------
*/
herr_t
-H5F_seq_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
- const struct H5O_pline_t *pline, const H5O_fill_t *fill,
- const struct H5O_efl_t *efl, const H5S_t *file_space, size_t elmt_size,
- size_t seq_len, hsize_t file_offset, const void *buf)
+H5F_seq_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist,
+ const H5S_t *file_space, size_t elmt_size,
+ size_t seq_len, hsize_t file_offset, const void *buf)
{
FUNC_ENTER(H5F_seq_write, FAIL);
@@ -110,7 +110,7 @@ H5F_seq_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
assert(layout);
assert(buf);
- if (H5F_seq_writev(f, dxpl_id, layout, pline, fill, efl, file_space, elmt_size, 1, &seq_len, &file_offset, buf)<0)
+ if (H5F_seq_writev(f, dxpl_id, layout, dc_plist, file_space, elmt_size, 1, &seq_len, &file_offset, buf)<0)
HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vector write failed");
FUNC_LEAVE(SUCCEED);
@@ -141,11 +141,11 @@ H5F_seq_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
*-------------------------------------------------------------------------
*/
herr_t
-H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
- const struct H5O_pline_t *pline, const H5O_fill_t *fill,
- const struct H5O_efl_t *efl, const H5S_t *file_space, size_t elmt_size,
- size_t nseq, size_t seq_len_arr[], hsize_t file_offset_arr[],
- void *_buf/*out*/)
+H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist,
+ const H5S_t *file_space, size_t elmt_size,
+ size_t nseq, size_t seq_len_arr[], hsize_t file_offset_arr[],
+ void *_buf/*out*/)
{
unsigned char *real_buf=(unsigned char *)_buf; /* Local pointer to buffer to fill */
unsigned char *buf; /* Local pointer to buffer to fill */
@@ -163,10 +163,12 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
unsigned u; /*counters */
size_t v; /*counters */
int i,j; /*counters */
+ struct H5O_efl_t efl; /* External File List info */
#ifdef H5_HAVE_PARALLEL
H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT;
H5P_genplist_t *plist=NULL; /* Property list */
#endif
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER(H5F_seq_readv, FAIL);
@@ -186,17 +188,17 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Get the plist structure */
if(NULL == (plist = H5I_object(dxpl_id)))
- HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID");
/* Get the driver ID */
if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
- HRETURN_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
/* Check if we are using the MPIO driver */
if(H5FD_MPIO==driver_id) {
/* Get the driver information */
if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &dx)<0)
- HRETURN_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
/* Check if we are not using independent I/O */
if(H5FD_MPIO_INDEPENDENT!=dx->xfer_mode)
@@ -206,54 +208,49 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Collective MPIO access is unsupported for non-contiguous datasets */
if (H5D_CONTIGUOUS!=layout->type && H5FD_MPIO_COLLECTIVE==xfer_mode)
- HRETURN_ERROR (H5E_DATASET, H5E_READERROR, FAIL, "collective access on non-contiguous datasets not supported yet");
+ HGOTO_ERROR (H5E_DATASET, H5E_READERROR, FAIL, "collective access on non-contiguous datasets not supported yet");
#endif
+ /* Get necessary properties from property list */
+ if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get EFL value");
+
switch (layout->type) {
case H5D_CONTIGUOUS:
- /* Filters cannot be used for contiguous data. */
- if (pline && pline->nfilters>0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "filters are not allowed for contiguous data");
- }
-
-
/* Read directly from file if the dataset is in an external file */
- if (efl && efl->nused>0) {
+ if (efl.nused>0) {
/* Iterate through the sequence vectors */
for(v=0; v<nseq; v++) {
#ifdef H5_HAVE_PARALLEL
- if (H5FD_MPIO_COLLECTIVE==xfer_mode) {
- /*
- * Currently supports same number of collective access. Need to
- * be changed LATER to combine all reads into one collective MPIO
- * call.
- */
- unsigned long max, min, temp;
-
- temp = seq_len_arr[v];
- assert(temp==seq_len_arr[v]); /* verify no overflow */
- MPI_Allreduce(&temp, &max, 1, MPI_UNSIGNED_LONG, MPI_MAX,
- H5FD_mpio_communicator(f->shared->lf));
- MPI_Allreduce(&temp, &min, 1, MPI_UNSIGNED_LONG, MPI_MIN,
- H5FD_mpio_communicator(f->shared->lf));
+ if (H5FD_MPIO_COLLECTIVE==xfer_mode) {
+ /*
+ * Currently supports same number of collective access. Need to
+ * be changed LATER to combine all reads into one collective MPIO
+ * call.
+ */
+ unsigned long max, min, temp;
+
+ temp = seq_len_arr[v];
+ assert(temp==seq_len_arr[v]); /* verify no overflow */
+ MPI_Allreduce(&temp, &max, 1, MPI_UNSIGNED_LONG, MPI_MAX,
+ H5FD_mpio_communicator(f->shared->lf));
+ MPI_Allreduce(&temp, &min, 1, MPI_UNSIGNED_LONG, MPI_MIN,
+ H5FD_mpio_communicator(f->shared->lf));
#ifdef AKC
- printf("seq_len=%lu, min=%lu, max=%lu\n", temp, min, max);
+ printf("seq_len=%lu, min=%lu, max=%lu\n", temp, min, max);
#endif
- if (max != min)
- HRETURN_ERROR(H5E_DATASET, H5E_READERROR, FAIL,
- "collective access with unequal number of blocks not supported yet");
- }
+ if (max != min)
+ HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL,
+ "collective access with unequal number of blocks not supported yet");
+ }
#endif
/* Note: We can't use data sieve buffers for datasets in external files
* because the 'addr' of all external files is set to 0 (above) and
* all datasets in external files would alias to the same set of
* file offsets, totally mixing up the data sieve buffer information. -QAK
*/
- if (H5O_efl_read(f, efl, file_offset_arr[v], seq_len_arr[v], real_buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "external data read failed");
- }
+ if (H5O_efl_read(f, &efl, file_offset_arr[v], seq_len_arr[v], real_buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "external data read failed");
/* Increment offset in buffer */
real_buf += seq_len_arr[v];
@@ -264,10 +261,8 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
max_data *= layout->dim[u];
/* Pass along the vector of sequences to read */
- if (H5F_contig_readv(f, max_data, H5FD_MEM_DRAW, layout->addr, nseq, seq_len_arr, file_offset_arr, dxpl_id, real_buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,
- "block read failed");
- }
+ if (H5F_contig_readv(f, max_data, H5FD_MEM_DRAW, layout->addr, nseq, seq_len_arr, file_offset_arr, dxpl_id, real_buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed");
} /* end else */
break;
@@ -275,13 +270,12 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/*
* This method is unable to access external raw data files
*/
- if (efl && efl->nused>0) {
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL,
- "chunking and external files are mutually exclusive");
- }
+ if (efl.nused>0)
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "chunking and external files are mutually exclusive");
+
/* Compute the file offset coordinates and hyperslab size */
if((ndims=H5S_get_simple_extent_dims(file_space,dset_dims,NULL))<0)
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unable to retrieve dataspace dimensions");
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unable to retrieve dataspace dimensions");
/* Build the array of cumulative hyperslab sizes */
/* (And set the memory offset to zero) */
@@ -340,11 +334,10 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Read in the partial hyperslab */
- if (H5F_istore_read(f, dxpl_id, layout, pline, fill,
+ if (H5F_istore_read(f, dxpl_id, layout, dc_plist,
hslab_size, mem_offset, coords, hslab_size,
- buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
- }
+ buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
/* Increment the buffer offset */
buf=(unsigned char *)buf+(partial_size*elmt_size);
@@ -401,10 +394,9 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Read the full hyperslab in */
- if (H5F_istore_read(f, dxpl_id, layout, pline, fill,
- hslab_size, mem_offset, coords, hslab_size, buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
- }
+ if (H5F_istore_read(f, dxpl_id, layout, dc_plist,
+ hslab_size, mem_offset, coords, hslab_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
/* Increment the buffer offset */
buf=(unsigned char *)buf+(full_size*elmt_size);
@@ -448,11 +440,9 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Read in the partial hyperslab */
- if (H5F_istore_read(f, dxpl_id, layout, pline,
- fill, hslab_size, mem_offset, coords,
- hslab_size, buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
- }
+ if (H5F_istore_read(f, dxpl_id, layout, dc_plist,
+ hslab_size, mem_offset, coords, hslab_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
/* Increment the buffer offset */
buf=(unsigned char *)buf+(partial_size*elmt_size);
@@ -484,11 +474,9 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Read in the partial hyperslab */
- if (H5F_istore_read(f, dxpl_id, layout, pline, fill,
- hslab_size, mem_offset, coords, hslab_size,
- buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
- }
+ if (H5F_istore_read(f, dxpl_id, layout, dc_plist,
+ hslab_size, mem_offset, coords, hslab_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
/* Double-check the amount read in */
assert(seq_len==partial_size);
@@ -503,10 +491,11 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
default:
assert("not implemented yet" && 0);
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout");
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout");
} /* end switch() */
- FUNC_LEAVE(SUCCEED);
+done:
+ FUNC_LEAVE(ret_value);
} /* H5F_seq_readv() */
@@ -534,11 +523,11 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
*-------------------------------------------------------------------------
*/
herr_t
-H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
- const struct H5O_pline_t *pline, const H5O_fill_t *fill,
- const struct H5O_efl_t *efl, const H5S_t *file_space, size_t elmt_size,
- size_t nseq, size_t seq_len_arr[], hsize_t file_offset_arr[],
- const void *_buf)
+H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist,
+ const H5S_t *file_space, size_t elmt_size,
+ size_t nseq, size_t seq_len_arr[], hsize_t file_offset_arr[],
+ const void *_buf)
{
const unsigned char *real_buf=(const unsigned char *)_buf; /* Local pointer to buffer to fill */
const unsigned char *buf; /* Local pointer to buffer to fill */
@@ -556,10 +545,12 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
unsigned u; /*counters */
size_t v; /*counters */
int i,j; /*counters */
+ struct H5O_efl_t efl; /* External File List info */
#ifdef H5_HAVE_PARALLEL
H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT;
H5P_genplist_t *plist=NULL; /* Property list */
#endif
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER(H5F_seq_writev, FAIL);
@@ -579,17 +570,17 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Get the plist structure */
if(NULL == (plist = H5I_object(dxpl_id)))
- HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID");
/* Get the driver ID */
if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
- HRETURN_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
/* Check if we are using the MPIO driver */
if(H5FD_MPIO==driver_id) {
/* Get the driver information */
if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &dx)<0)
- HRETURN_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
/* Check if we are not using independent I/O */
if(H5FD_MPIO_INDEPENDENT!=dx->xfer_mode)
@@ -599,56 +590,50 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Collective MPIO access is unsupported for non-contiguous datasets */
if (H5D_CONTIGUOUS!=layout->type && H5FD_MPIO_COLLECTIVE==xfer_mode) {
- HRETURN_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL,
+ HGOTO_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL,
"collective access on non-contiguous datasets not supported yet");
}
#endif
+ /* Get necessary properties from property list */
+ if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get EFL value");
+
switch (layout->type) {
case H5D_CONTIGUOUS:
- /* Filters cannot be used for contiguous data. */
- if (pline && pline->nfilters>0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "filters are not allowed for contiguous data");
- }
-
-
/* Write directly to file if the dataset is in an external file */
- if (efl && efl->nused>0) {
+ if (efl.nused>0) {
/* Iterate through the sequence vectors */
for(v=0; v<nseq; v++) {
#ifdef H5_HAVE_PARALLEL
- if (H5FD_MPIO_COLLECTIVE==xfer_mode) {
- /*
- * Currently supports same number of collective access. Need to
- * be changed LATER to combine all reads into one collective MPIO
- * call.
- */
- unsigned long max, min, temp;
-
- temp = seq_len_arr[v];
- assert(temp==seq_len_arr[v]); /* verify no overflow */
- MPI_Allreduce(&temp, &max, 1, MPI_UNSIGNED_LONG, MPI_MAX,
- H5FD_mpio_communicator(f->shared->lf));
- MPI_Allreduce(&temp, &min, 1, MPI_UNSIGNED_LONG, MPI_MIN,
- H5FD_mpio_communicator(f->shared->lf));
+ if (H5FD_MPIO_COLLECTIVE==xfer_mode) {
+ /*
+ * Currently supports same number of collective access. Need to
+ * be changed LATER to combine all reads into one collective MPIO
+ * call.
+ */
+ unsigned long max, min, temp;
+
+ temp = seq_len_arr[v];
+ assert(temp==seq_len_arr[v]); /* verify no overflow */
+ MPI_Allreduce(&temp, &max, 1, MPI_UNSIGNED_LONG, MPI_MAX,
+ H5FD_mpio_communicator(f->shared->lf));
+ MPI_Allreduce(&temp, &min, 1, MPI_UNSIGNED_LONG, MPI_MIN,
+ H5FD_mpio_communicator(f->shared->lf));
#ifdef AKC
- printf("seq_len=%lu, min=%lu, max=%lu\n", temp, min, max);
+ printf("seq_len=%lu, min=%lu, max=%lu\n", temp, min, max);
#endif
- if (max != min)
- HRETURN_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL,
- "collective access with unequal number of blocks not supported yet");
- }
+ if (max != min)
+ HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "collective access with unequal number of blocks not supported yet");
+ }
#endif
/* Note: We can't use data sieve buffers for datasets in external files
* because the 'addr' of all external files is set to 0 (above) and
* all datasets in external files would alias to the same set of
* file offsets, totally mixing up the data sieve buffer information. -QAK
*/
- if (H5O_efl_write(f, efl, file_offset_arr[v], seq_len_arr[v], real_buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "external data write failed");
- }
+ if (H5O_efl_write(f, &efl, file_offset_arr[v], seq_len_arr[v], real_buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "external data write failed");
/* Increment offset in buffer */
real_buf += seq_len_arr[v];
@@ -659,10 +644,8 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
max_data *= layout->dim[u];
/* Pass along the vector of sequences to write */
- if (H5F_contig_writev(f, max_data, H5FD_MEM_DRAW, layout->addr, nseq, seq_len_arr, file_offset_arr, dxpl_id, real_buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "block write failed");
- }
+ if (H5F_contig_writev(f, max_data, H5FD_MEM_DRAW, layout->addr, nseq, seq_len_arr, file_offset_arr, dxpl_id, real_buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed");
} /* end else */
break;
@@ -670,13 +653,12 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/*
* This method is unable to access external raw data files
*/
- if (efl && efl->nused>0) {
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL,
- "chunking and external files are mutually exclusive");
- }
+ if (efl.nused>0)
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "chunking and external files are mutually exclusive");
+
/* Compute the file offset coordinates and hyperslab size */
if((ndims=H5S_get_simple_extent_dims(file_space,dset_dims,NULL))<0)
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unable to retrieve dataspace dimensions");
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unable to retrieve dataspace dimensions");
/* Build the array of cumulative hyperslab sizes */
/* (And set the memory offset to zero) */
@@ -735,11 +717,9 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Write out the partial hyperslab */
- if (H5F_istore_write(f, dxpl_id, layout, pline, fill,
- hslab_size, mem_offset,coords, hslab_size,
- buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
- }
+ if (H5F_istore_write(f, dxpl_id, layout, dc_plist,
+ hslab_size, mem_offset,coords, hslab_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
/* Increment the buffer offset */
buf=(const unsigned char *)buf+(partial_size*elmt_size);
@@ -796,10 +776,9 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Write the full hyperslab in */
- if (H5F_istore_write(f, dxpl_id, layout, pline, fill,
- hslab_size, mem_offset, coords, hslab_size, buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
- }
+ if (H5F_istore_write(f, dxpl_id, layout, dc_plist,
+ hslab_size, mem_offset, coords, hslab_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
/* Increment the buffer offset */
buf=(const unsigned char *)buf+(full_size*elmt_size);
@@ -843,11 +822,9 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Write out the partial hyperslab */
- if (H5F_istore_write(f, dxpl_id, layout, pline,
- fill, hslab_size, mem_offset, coords,
- hslab_size, buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
- }
+ if (H5F_istore_write(f, dxpl_id, layout, dc_plist,
+ hslab_size, mem_offset, coords, hslab_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
/* Increment the buffer offset */
buf=(const unsigned char *)buf+(partial_size*elmt_size);
@@ -879,11 +856,9 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
hslab_size[ndims]=elmt_size; /* basic hyperslab size is the element */
/* Write out the final partial hyperslab */
- if (H5F_istore_write(f, dxpl_id, layout, pline, fill,
- hslab_size, mem_offset, coords, hslab_size,
- buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
- }
+ if (H5F_istore_write(f, dxpl_id, layout, dc_plist,
+ hslab_size, mem_offset, coords, hslab_size, buf)<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
/* Double-check the amount read in */
assert(seq_len==partial_size);
@@ -898,9 +873,10 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
default:
assert("not implemented yet" && 0);
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout");
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout");
} /* end switch() */
- FUNC_LEAVE(SUCCEED);
+done:
+ FUNC_LEAVE(ret_value);
} /* H5F_seq_writev() */
diff --git a/src/H5Ppkg.h b/src/H5Ppkg.h
index b97ebb6..a8609f3 100644
--- a/src/H5Ppkg.h
+++ b/src/H5Ppkg.h
@@ -39,7 +39,7 @@ typedef enum {
} H5P_class_mod_t;
/* Define structure to hold property information */
-typedef struct H5P_genprop_tag {
+typedef struct H5P_genprop_t {
/* Values for this property */
unsigned xor_val; /* XOR'ed version of the name, for faster comparisons */
char *name; /* Name of property */
@@ -55,12 +55,12 @@ typedef struct H5P_genprop_tag {
H5P_prp_copy_func_t copy; /* Function to call when a property is copied */
H5P_prp_close_func_t close; /* Function to call when a property is closed */
- struct H5P_genprop_tag *next; /* Pointer to the next property in this list */
+ struct H5P_genprop_t *next; /* Pointer to the next property in this list */
} H5P_genprop_t;
/* Define structure to hold class information */
-struct H5P_genclass_tag {
- struct H5P_genclass_tag *parent; /* Pointer to parent class */
+struct H5P_genclass_t {
+ struct H5P_genclass_t *parent; /* Pointer to parent class */
char *name; /* Name of property list class */
size_t nprops; /* Number of properties in class */
unsigned hashsize; /* Hash table size */
@@ -82,7 +82,7 @@ struct H5P_genclass_tag {
};
/* Define structure to hold property list information */
-struct H5P_genplist_tag {
+struct H5P_genplist_t {
H5P_genclass_t *pclass; /* Pointer to class info */
hid_t plist_id; /* Copy of the property list ID (for use in close callback) */
size_t nprops; /* Number of properties in class */
diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h
index ba054e3..c7b555b 100644
--- a/src/H5Pprivate.h
+++ b/src/H5Pprivate.h
@@ -22,8 +22,8 @@
#include "H5private.h"
/* Forward declarations for anonymous H5P objects */
-typedef struct H5P_genplist_tag H5P_genplist_t;
-typedef struct H5P_genclass_tag H5P_genclass_t;
+typedef struct H5P_genplist_t H5P_genplist_t;
+typedef struct H5P_genclass_t H5P_genclass_t;
/* Private functions, not part of the publicly documented API */
__DLL__ herr_t H5P_init(void);
diff --git a/src/H5S.c b/src/H5S.c
index 076155f..029a5df 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -1931,6 +1931,51 @@ H5Soffset_simple(hid_t space_id, const hssize_t *offset)
/*-------------------------------------------------------------------------
+ * Function: H5S_set_extent
+ *
+ * Purpose: Modify the dimensions of a data space. Based on H5S_extend
+ *
+ * Return: Success: Non-negative
+ *
+ * Failure: Negative
+ *
+ * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ *
+ * Date: March 13, 2002
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5S_set_extent( H5S_t *space, const hsize_t *size )
+{
+ herr_t ret_value=SUCCEED;
+ unsigned u;
+
+ FUNC_ENTER( H5S_set_extent, FAIL );
+
+ /* Check args */
+ assert( space && H5S_SIMPLE==space->extent.type );
+ assert( size);
+
+ /* Check for changing dimensions of a scalar dataspace */
+ if(space->extent.u.simple.rank==0)
+
+ /* Verify that the dimensions being changed are allowed to change */
+ for ( u = 0; u < space->extent.u.simple.rank; u++ )
+ if ( space->extent.u.simple.max &&
+ H5S_UNLIMITED != space->extent.u.simple.max[u] &&
+ space->extent.u.simple.max[u]<size[u] )
+ HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL,"dimension cannot be modified");
+
+ /* Update dimensions with new values */
+ for ( u = 0; u < space->extent.u.simple.rank; u++ )
+ space->extent.u.simple.size[u] = size[u];
+
+ FUNC_LEAVE( ret_value );
+}
+
+
+/*-------------------------------------------------------------------------
* Function: H5S_debug
*
* Purpose: Prints debugging information about a data space.
@@ -1973,46 +2018,3 @@ H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth)
FUNC_LEAVE(SUCCEED);
}
-
-/*-------------------------------------------------------------------------
- * Function: H5S_set_extent
- *
- * Purpose: Modify the dimensions of a data space. Based on H5S_extend
- *
- * Return: Success: Number of dimensions whose size increased.
- *
- * Failure: Negative
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: March 13, 2002
- *
- *-------------------------------------------------------------------------
- */
-int H5S_set_extent( H5S_t *space, const hsize_t *size )
-{
- int ret_value;
- unsigned u;
-
- FUNC_ENTER( H5S_set_extent, FAIL );
-
- /* Check args */
- assert( space && H5S_SIMPLE==space->extent.type );
- assert( size);
-
- for ( u = 0; u < space->extent.u.simple.rank; u++ )
- if ( space->extent.u.simple.max &&
- H5S_UNLIMITED != space->extent.u.simple.max[u] &&
- space->extent.u.simple.max[u]<size[u] )
- HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL,"dimension cannot be modified");
-
- /* Update dimensions with new values */
- for ( u = 0; u < space->extent.u.simple.rank; u++ )
- space->extent.u.simple.size[u] = size[u];
-
- /* Set return value */
- ret_value=space->extent.u.simple.rank;
-
- FUNC_LEAVE( ret_value );
-}
-
diff --git a/src/H5Sall.c b/src/H5Sall.c
index a511cb8..2efdfc9 100644
--- a/src/H5Sall.c
+++ b/src/H5Sall.c
@@ -27,16 +27,12 @@ static herr_t H5S_all_init (const H5S_t *space, size_t elmt_size, H5S_sel_iter_t
static hsize_t H5S_all_favail (const H5S_t *space, const H5S_sel_iter_t *iter,
hsize_t max);
static hsize_t H5S_all_fgath (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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space,
H5S_sel_iter_t *file_iter, hsize_t nelmts,
hid_t dxpl_id, void *buf/*out*/);
static herr_t H5S_all_fscat (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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space,
H5S_sel_iter_t *file_iter, hsize_t nelmts,
hid_t dxpl_id, const void *buf);
@@ -158,8 +154,7 @@ H5S_all_favail (const H5S_t * UNUSED space, const H5S_sel_iter_t *sel_iter, hsiz
*/
static hsize_t
H5S_all_fgath (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,
+ H5P_genplist_t *dc_plist,
size_t elmt_size, const H5S_t *file_space,
H5S_sel_iter_t *file_iter, hsize_t nelmts, hid_t dxpl_id,
void *buf/*out*/)
@@ -186,7 +181,7 @@ H5S_all_fgath (H5F_t *f, const struct H5O_layout_t *layout,
* Read piece from file.
*/
H5_CHECK_OVERFLOW(actual_bytes,hsize_t,size_t);
- if (H5F_seq_read(f, dxpl_id, layout, pline, fill, efl, file_space,
+ if (H5F_seq_read(f, dxpl_id, layout, dc_plist, file_space,
elmt_size, (size_t)actual_bytes, buf_off, buf/*out*/)<0) {
HRETURN_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error");
}
@@ -221,8 +216,7 @@ H5S_all_fgath (H5F_t *f, const struct H5O_layout_t *layout,
*/
static herr_t
H5S_all_fscat (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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, H5S_sel_iter_t *file_iter,
hsize_t nelmts, hid_t dxpl_id, const void *buf)
{
@@ -248,7 +242,7 @@ H5S_all_fscat (H5F_t *f, const struct H5O_layout_t *layout,
* Write piece from file.
*/
H5_CHECK_OVERFLOW(actual_bytes,hsize_t,size_t);
- if (H5F_seq_write(f, dxpl_id, layout, pline, fill, efl, file_space,
+ if (H5F_seq_write(f, dxpl_id, layout, dc_plist, file_space,
elmt_size, (size_t)actual_bytes, buf_off, buf/*out*/)<0) {
HRETURN_ERROR(H5E_DATASPACE, H5E_WRITEERROR, 0, "write error");
}
@@ -443,10 +437,9 @@ done:
*-------------------------------------------------------------------------
*/
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*/)
+H5S_all_read(H5F_t *f, const H5O_layout_t *layout, H5P_genplist_t *dc_plist,
+ size_t elmt_size, const H5S_t *file_space,
+ const H5S_t *mem_space, hid_t dxpl_id, void *_buf/*out*/)
{
H5S_hyper_span_t *file_span=NULL,*mem_span=NULL; /* Hyperslab span node */
char *buf=(char*)_buf; /* Get pointer to buffer */
@@ -544,13 +537,13 @@ 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, fill, efl, size,
+ if (H5F_arr_read(f, dxpl_id, layout, dc_plist, size,
mem_size, mem_offset, file_offset, buf/*out*/)<0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read data from the file");
done:
FUNC_LEAVE(ret_value);
-}
+} /* end H5S_all_read() */
/*-------------------------------------------------------------------------
@@ -578,10 +571,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5S_all_write(H5F_t *f, const struct H5O_layout_t *layout,
- const H5O_pline_t *pline,
- const struct H5O_fill_t *fill,
- const H5O_efl_t *efl,
+H5S_all_write(H5F_t *f, const struct H5O_layout_t *layout, H5P_genplist_t *dc_plist,
size_t elmt_size, const H5S_t *file_space,
const H5S_t *mem_space, hid_t dxpl_id, const void *_buf)
{
@@ -682,13 +672,13 @@ 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 */
/* Write data to the file */
- if (H5F_arr_write(f, dxpl_id, layout, pline, fill, efl, size,
+ if (H5F_arr_write(f, dxpl_id, layout, dc_plist, size,
mem_size, mem_offset, file_offset, buf)<0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write data to the file");
done:
FUNC_LEAVE(ret_value);
-}
+} /* end H5S_all_write() */
/*--------------------------------------------------------------------------
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 30a1331..6663d98 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -44,15 +44,11 @@ static herr_t H5S_hyper_init (const H5S_t *space, size_t elmt_size, H5S_sel_iter
static hsize_t H5S_hyper_favail (const H5S_t UNUSED *space,
const H5S_sel_iter_t *sel_iter, hsize_t max);
static hsize_t H5S_hyper_fgath (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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, H5S_sel_iter_t *file_iter,
hsize_t nelmts, hid_t dxpl_id, void *_buf/*out*/);
static herr_t H5S_hyper_fscat (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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, H5S_sel_iter_t *file_iter,
hsize_t nelmts, hid_t dxpl_id, const void *_buf);
static hsize_t H5S_hyper_mgath (const void *_buf, size_t elmt_size,
@@ -396,9 +392,7 @@ H5S_hyper_iter_next (const H5S_t *file_space, H5S_sel_iter_t *file_iter)
*/
static hsize_t
H5S_hyper_fread (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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *space, H5S_sel_iter_t *iter,
hsize_t nelem, hid_t dxpl_id, void *_buf/*out*/)
{
@@ -432,9 +426,6 @@ printf("%s: Called!\n",FUNC);
/* Check args */
assert(f);
assert(layout);
- assert(pline);
- assert(fill);
- assert(efl);
assert(elmt_size>0);
assert(space);
assert(iter);
@@ -492,10 +483,9 @@ printf("%s: Called!\n",FUNC);
if(span_size>io_bytes_left)
span_size=io_bytes_left;
- if (H5F_seq_read(f, dxpl_id, layout, pline, fill, efl, space,
- elmt_size, span_size, loc_off, dst/*out*/)<0) {
+ if (H5F_seq_read(f, dxpl_id, layout, dc_plist, space,
+ elmt_size, span_size, loc_off, dst/*out*/)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error");
- }
/* Increment offset in destination */
dst+=span_size;
@@ -653,10 +643,9 @@ partial_done: /* Yes, goto's are evil, so sue me... :-) */
/* If the sequence & offset arrays are full, read them in */
if(nseq>=vector_size) {
/* Read in the sequences */
- if (H5F_seq_readv(f, dxpl_id, layout, pline, fill, efl, space,
- elmt_size, nseq, seq_len_arr, buf_off_arr, dst/*out*/)<0) {
+ if (H5F_seq_readv(f, dxpl_id, layout, dc_plist, space,
+ elmt_size, nseq, seq_len_arr, buf_off_arr, dst/*out*/)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error");
- } /* end if */
/* Increment the offset of the destination buffer */
dst+=(last_io_bytes_left-io_bytes_left);
@@ -685,10 +674,9 @@ partial_done: /* Yes, goto's are evil, so sue me... :-) */
/* If the sequence & offset arrays are full, read them in */
if(nseq>=vector_size) {
/* Read in the sequences */
- if (H5F_seq_readv(f, dxpl_id, layout, pline, fill, efl, space,
- elmt_size, nseq, seq_len_arr, buf_off_arr, dst/*out*/)<0) {
+ if (H5F_seq_readv(f, dxpl_id, layout, dc_plist, space,
+ elmt_size, nseq, seq_len_arr, buf_off_arr, dst/*out*/)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error");
- } /* end if */
/* Increment the offset of the destination buffer */
dst+=(last_io_bytes_left-io_bytes_left);
@@ -805,10 +793,9 @@ partial_done: /* Yes, goto's are evil, so sue me... :-) */
/* Check for any stored sequences which need to be flushed */
if(nseq>0) {
/* Read in the sequence */
- if (H5F_seq_readv(f, dxpl_id, layout, pline, fill, efl, space,
- elmt_size, nseq, seq_len_arr, buf_off_arr, dst/*out*/)<0) {
+ if (H5F_seq_readv(f, dxpl_id, layout, dc_plist, space,
+ elmt_size, nseq, seq_len_arr, buf_off_arr, dst/*out*/)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error");
- } /* end if */
} /* end if */
/* Increment amount of I/O performed */
@@ -846,9 +833,7 @@ done:
*/
static hsize_t
H5S_hyper_fread_opt (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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, H5S_sel_iter_t *file_iter,
hsize_t nelmts, hid_t dxpl_id, void *_buf/*out*/)
{
@@ -977,10 +962,9 @@ printf("%s: buf_off=%ld, actual_read=%d, actual_bytes=%d\n",FUNC,(long)buf_off,(
#endif /* QAK */
/* Read in the rest of the sequence */
- if (H5F_seq_read(f, dxpl_id, layout, pline, fill, efl, file_space,
- elmt_size, actual_bytes, buf_off, buf/*out*/)<0) {
+ if (H5F_seq_read(f, dxpl_id, layout, dc_plist, file_space,
+ elmt_size, actual_bytes, buf_off, buf/*out*/)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error");
- }
/* Increment the offset of the buffer */
buf+=actual_bytes;
@@ -1205,10 +1189,9 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
/* If the sequence & offset arrays are full, read them in */
if(nseq>=vector_size) {
/* Read in the sequences */
- if (H5F_seq_readv(f, dxpl_id, layout, pline, fill, efl, file_space,
- elmt_size, nseq, seq_len_arr, buf_off_arr, buf/*out*/)<0) {
+ if (H5F_seq_readv(f, dxpl_id, layout, dc_plist, file_space,
+ elmt_size, nseq, seq_len_arr, buf_off_arr, buf/*out*/)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error");
- } /* end if */
/* Increment the offset of the destination buffer */
buf+=tot_buf_size;
@@ -1277,10 +1260,9 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
/* If the sequence & offset arrays are full, read them in */
if(nseq>=vector_size) {
/* Read in the sequences */
- if (H5F_seq_readv(f, dxpl_id, layout, pline, fill, efl, file_space,
- elmt_size, nseq, seq_len_arr, buf_off_arr, buf/*out*/)<0) {
+ if (H5F_seq_readv(f, dxpl_id, layout, dc_plist, file_space,
+ elmt_size, nseq, seq_len_arr, buf_off_arr, buf/*out*/)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error");
- } /* end if */
/* Increment the offset of the destination buffer */
buf+=tot_buf_size;
@@ -1321,10 +1303,9 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
/* If the sequence & offset arrays are full, read them in */
if(nseq>=vector_size) {
/* Read in the sequences */
- if (H5F_seq_readv(f, dxpl_id, layout, pline, fill, efl, file_space,
- elmt_size, nseq, seq_len_arr, buf_off_arr, buf/*out*/)<0) {
+ if (H5F_seq_readv(f, dxpl_id, layout, dc_plist, file_space,
+ elmt_size, nseq, seq_len_arr, buf_off_arr, buf/*out*/)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error");
- } /* end if */
/* Increment the offset of the destination buffer */
buf+=tot_buf_size;
@@ -1386,10 +1367,9 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
/* Check for any stored sequences which need to be flushed */
if(nseq>0) {
/* Read in the sequence */
- if (H5F_seq_readv(f, dxpl_id, layout, pline, fill, efl, file_space,
- elmt_size, nseq, seq_len_arr, buf_off_arr, buf/*out*/)<0) {
+ if (H5F_seq_readv(f, dxpl_id, layout, dc_plist, file_space,
+ elmt_size, nseq, seq_len_arr, buf_off_arr, buf/*out*/)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error");
- } /* end if */
} /* end if */
/* Subtract out the selection offset */
@@ -1443,9 +1423,7 @@ done:
*/
static hsize_t
H5S_hyper_fgath (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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, H5S_sel_iter_t *file_iter,
hsize_t nelmts, hid_t dxpl_id, void *_buf/*out*/)
{
@@ -1466,11 +1444,11 @@ H5S_hyper_fgath (H5F_t *f, const struct H5O_layout_t *layout,
/* Check for the special case of just one H5Sselect_hyperslab call made */
if(file_space->select.sel_info.hslab.diminfo!=NULL) {
/* Use optimized call to read in regular hyperslab */
- num_read=H5S_hyper_fread_opt(f,layout,pline,fill,efl,elmt_size,file_space,file_iter,nelmts,dxpl_id,_buf);
+ num_read=H5S_hyper_fread_opt(f,layout,dc_plist,elmt_size,file_space,file_iter,nelmts,dxpl_id,_buf);
} /* end if */
else {
/* Perform generic hyperslab operation */
- num_read=H5S_hyper_fread(f,layout,pline,fill,efl,elmt_size,file_space,file_iter,nelmts,dxpl_id,_buf);
+ num_read=H5S_hyper_fread(f,layout,dc_plist,elmt_size,file_space,file_iter,nelmts,dxpl_id,_buf);
} /* end else */
FUNC_LEAVE (ret_value==SUCCEED ? num_read : 0);
@@ -1495,9 +1473,7 @@ H5S_hyper_fgath (H5F_t *f, const struct H5O_layout_t *layout,
*/
static hsize_t
H5S_hyper_fwrite (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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *space, H5S_sel_iter_t *iter,
hsize_t nelem, hid_t dxpl_id, const void *_buf)
{
@@ -1531,9 +1507,6 @@ printf("%s: Called!\n",FUNC);
/* Check args */
assert(f);
assert(layout);
- assert(pline);
- assert(fill);
- assert(efl);
assert(elmt_size>0);
assert(space);
assert(iter);
@@ -1591,10 +1564,9 @@ printf("%s: Called!\n",FUNC);
if(span_size>io_bytes_left)
span_size=io_bytes_left;
- if (H5F_seq_write(f, dxpl_id, layout, pline, fill, efl, space,
- elmt_size, span_size, loc_off, src)<0) {
+ if (H5F_seq_write(f, dxpl_id, layout, dc_plist, space,
+ elmt_size, span_size, loc_off, src)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, 0, "write error");
- } /* end if */
/* Increment offset in destination */
src+=span_size;
@@ -1752,10 +1724,9 @@ partial_done: /* Yes, goto's are evil, so sue me... :-) */
/* If the sequence & offset arrays are full, read them in */
if(nseq>=vector_size) {
/* Write out the sequences */
- if (H5F_seq_writev(f, dxpl_id, layout, pline, fill, efl, space,
- elmt_size, nseq, seq_len_arr, buf_off_arr, src)<0) {
+ if (H5F_seq_writev(f, dxpl_id, layout, dc_plist, space,
+ elmt_size, nseq, seq_len_arr, buf_off_arr, src)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, 0, "write error");
- } /* end if */
/* Increment the offset of the destination buffer */
src+=(last_io_bytes_left-io_bytes_left);
@@ -1784,10 +1755,9 @@ partial_done: /* Yes, goto's are evil, so sue me... :-) */
/* If the sequence & offset arrays are full, read them in */
if(nseq>=vector_size) {
/* Write out the sequences */
- if (H5F_seq_writev(f, dxpl_id, layout, pline, fill, efl, space,
- elmt_size, nseq, seq_len_arr, buf_off_arr, src)<0) {
+ if (H5F_seq_writev(f, dxpl_id, layout, dc_plist, space,
+ elmt_size, nseq, seq_len_arr, buf_off_arr, src)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, 0, "write error");
- } /* end if */
/* Increment the offset of the destination buffer */
src+=(last_io_bytes_left-io_bytes_left);
@@ -1904,10 +1874,9 @@ partial_done: /* Yes, goto's are evil, so sue me... :-) */
/* Check for any stored sequences which need to be flushed */
if(nseq>0) {
/* Write out the sequence */
- if (H5F_seq_writev(f, dxpl_id, layout, pline, fill, efl, space,
- elmt_size, nseq, seq_len_arr, buf_off_arr, src)<0) {
+ if (H5F_seq_writev(f, dxpl_id, layout, dc_plist, space,
+ elmt_size, nseq, seq_len_arr, buf_off_arr, src)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, 0, "write error");
- } /* end if */
} /* end if */
/* Increment amount of I/O performed */
@@ -1945,9 +1914,7 @@ done:
*/
static hsize_t
H5S_hyper_fwrite_opt (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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, H5S_sel_iter_t *file_iter,
hsize_t nelmts, hid_t dxpl_id, const void *_buf)
{
@@ -2076,10 +2043,9 @@ printf("%s: buf_off=%ld, actual_write=%d, actual_bytes=%d\n",FUNC,(long)buf_off,
#endif /* QAK */
/* Write out the rest of the sequence */
- if (H5F_seq_write(f, dxpl_id, layout, pline, fill, efl, file_space,
- elmt_size, actual_bytes, buf_off, buf)<0) {
+ if (H5F_seq_write(f, dxpl_id, layout, dc_plist, file_space,
+ elmt_size, actual_bytes, buf_off, buf)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, 0, "write error");
- }
/* Increment the offset of the buffer */
buf+=actual_bytes;
@@ -2304,10 +2270,9 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
/* If the sequence & offset arrays are full, write them out */
if(nseq>=vector_size) {
/* Write out the sequences */
- if (H5F_seq_writev(f, dxpl_id, layout, pline, fill, efl, file_space,
- elmt_size, nseq, seq_len_arr, buf_off_arr, buf)<0) {
- HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, 0, "write error");
- } /* end if */
+ if (H5F_seq_writev(f, dxpl_id, layout, dc_plist, file_space,
+ elmt_size, nseq, seq_len_arr, buf_off_arr, buf)<0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, 0, "write error");
/* Increment the offset of the destination buffer */
buf+=tot_buf_size;
@@ -2376,10 +2341,9 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
/* If the sequence & offset arrays are full, write them out */
if(nseq>=vector_size) {
/* Write out the sequences */
- if (H5F_seq_writev(f, dxpl_id, layout, pline, fill, efl, file_space,
- elmt_size, nseq, seq_len_arr, buf_off_arr, buf)<0) {
+ if (H5F_seq_writev(f, dxpl_id, layout, dc_plist, file_space,
+ elmt_size, nseq, seq_len_arr, buf_off_arr, buf)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, 0, "write error");
- } /* end if */
/* Increment the offset of the destination buffer */
buf+=tot_buf_size;
@@ -2420,10 +2384,9 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
/* If the sequence & offset arrays are full, write them out */
if(nseq>=vector_size) {
/* Write out the sequences */
- if (H5F_seq_writev(f, dxpl_id, layout, pline, fill, efl, file_space,
- elmt_size, nseq, seq_len_arr, buf_off_arr, buf)<0) {
+ if (H5F_seq_writev(f, dxpl_id, layout, dc_plist, file_space,
+ elmt_size, nseq, seq_len_arr, buf_off_arr, buf)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, 0, "write error");
- } /* end if */
/* Increment the offset of the destination buffer */
buf+=tot_buf_size;
@@ -2485,10 +2448,9 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
/* Check for any stored sequences which need to be flushed */
if(nseq>0) {
/* Write out the sequence */
- if (H5F_seq_writev(f, dxpl_id, layout, pline, fill, efl, file_space,
- elmt_size, nseq, seq_len_arr, buf_off_arr, buf)<0) {
+ if (H5F_seq_writev(f, dxpl_id, layout, dc_plist, file_space,
+ elmt_size, nseq, seq_len_arr, buf_off_arr, buf)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, 0, "write error");
- } /* end if */
} /* end if */
/* Subtract out the selection offset */
@@ -2536,9 +2498,7 @@ done:
*/
static herr_t
H5S_hyper_fscat (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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, H5S_sel_iter_t *file_iter,
hsize_t nelmts, hid_t dxpl_id, const void *_buf)
{
@@ -2559,11 +2519,11 @@ H5S_hyper_fscat (H5F_t *f, const struct H5O_layout_t *layout,
/* Check for the special case of just one H5Sselect_hyperslab call made */
if(file_space->select.sel_info.hslab.diminfo!=NULL) {
/* Use optimized call to write out regular hyperslab */
- num_written=H5S_hyper_fwrite_opt(f,layout,pline,fill,efl,elmt_size,file_space,file_iter,nelmts,dxpl_id,_buf);
+ num_written=H5S_hyper_fwrite_opt(f,layout,dc_plist,elmt_size,file_space,file_iter,nelmts,dxpl_id,_buf);
} /* end if */
else {
/* Perform generic hyperslab operation */
- num_written=H5S_hyper_fwrite(f,layout,pline,fill,efl,elmt_size,file_space,file_iter,nelmts,dxpl_id,_buf);
+ num_written=H5S_hyper_fwrite(f,layout,dc_plist,elmt_size,file_space,file_iter,nelmts,dxpl_id,_buf);
} /* end else */
FUNC_LEAVE (ret_value==FAIL ? ret_value : (num_written >0) ? SUCCEED : FAIL);
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index 6cfb4bc..2f2bd89 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -58,10 +58,8 @@ H5S_mpio_space_type( const H5S_t *space, const size_t elmt_size,
size_t *count,
hbool_t *is_derived_type );
static 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,
+H5S_mpio_spaces_xfer(H5F_t *f, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
hid_t dxpl_id, void *buf/*out*/, const hbool_t do_write);
@@ -549,11 +547,9 @@ 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,
+static herr_t
+H5S_mpio_spaces_xfer(H5F_t *f, const H5O_layout_t *layout,
+ H5P_genplist_t UNUSED *dc_plist, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
hid_t dxpl_id, void *buf /*out*/,
const hbool_t do_write )
@@ -703,10 +699,8 @@ 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,
+H5S_mpio_spaces_read(H5F_t *f, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
hid_t dxpl_id, void *buf/*out*/)
{
@@ -714,7 +708,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, fill, efl, elmt_size,
+ ret_value = H5S_mpio_spaces_xfer(f, layout, dc_plist, elmt_size,
file_space, mem_space, dxpl_id,
buf, 0/*read*/);
@@ -743,10 +737,8 @@ 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,
+H5S_mpio_spaces_write(H5F_t *f, const H5O_layout_t *layout,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
hid_t dxpl_id, const void *buf)
{
@@ -754,7 +746,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, fill, efl, elmt_size,
+ ret_value = H5S_mpio_spaces_xfer(f, layout, dc_plist, elmt_size,
file_space, mem_space, dxpl_id,
(void*)buf, 1/*write*/);
diff --git a/src/H5Spkg.h b/src/H5Spkg.h
index bc88e6e..1ab7dd6 100644
--- a/src/H5Spkg.h
+++ b/src/H5Spkg.h
@@ -148,15 +148,11 @@ __DLL__ herr_t H5S_all_select_serialize(const H5S_t *space, uint8_t *buf);
__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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
hid_t dxpl_id, void *buf/*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_fill_t *fill,
- const struct H5O_efl_t *efl, size_t elmt_size,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
hid_t dxpl_id, const void *buf);
__DLL__ herr_t H5S_all_select_iterate(void *buf, hid_t type_id, H5S_t *space,
diff --git a/src/H5Spoint.c b/src/H5Spoint.c
index de5d875..2fa6a2d 100644
--- a/src/H5Spoint.c
+++ b/src/H5Spoint.c
@@ -28,17 +28,13 @@ static herr_t H5S_point_init (const H5S_t *space, size_t elmt_size, H5S_sel_iter
static hsize_t H5S_point_favail (const H5S_t *space, const H5S_sel_iter_t *iter,
hsize_t max);
static hsize_t H5S_point_fgath (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,
+ H5P_genplist_t *dc_plist,
+ size_t elmt_size, const H5S_t *file_space,
H5S_sel_iter_t *file_iter, hsize_t nelmts,
hid_t dxpl_id, void *buf/*out*/);
static herr_t H5S_point_fscat (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,
+ H5P_genplist_t *dc_plist,
+ size_t elmt_size, const H5S_t *file_space,
H5S_sel_iter_t *file_iter, hsize_t nelmts,
hid_t dxpl_id, const void *buf);
static hsize_t H5S_point_mgath (const void *_buf, size_t elmt_size,
@@ -283,8 +279,7 @@ H5S_point_favail (const H5S_t * UNUSED space,
*/
static hsize_t
H5S_point_fgath (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,
+ H5P_genplist_t *dc_plist,
size_t elmt_size, const H5S_t *file_space,
H5S_sel_iter_t *file_iter, hsize_t nelmts, hid_t dxpl_id,
void *_buf/*out*/)
@@ -335,18 +330,9 @@ H5S_point_fgath (H5F_t *f, const struct H5O_layout_t *layout,
file_offset[u] += file_space->select.offset[u];
/* Go read the point */
- if (H5F_arr_read(f, dxpl_id, layout, pline, fill, efl, hsize, hsize, zero, file_offset, buf/*out*/)<0) {
+ if (H5F_arr_read(f, dxpl_id, layout, dc_plist, hsize, hsize, zero, file_offset, buf/*out*/)<0)
HRETURN_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error");
- }
-#ifdef QAK
- printf("%s: check 3.0\n",FUNC);
- for(u=0; u<ndims; u++) {
- printf("%s: %u - pnt=%d\n", FUNC, (unsigned)u, (int)file_iter->pnt.curr->pnt[u]);
- printf("%s: %u - file_offset=%d\n", FUNC, (unsigned)u, (int)file_offset[u]);
- }
- printf("%s: *buf=%u\n",FUNC,(unsigned)*buf);
-#endif /* QAK */
/* Increment the offset of the buffer */
buf+=elmt_size;
@@ -386,8 +372,7 @@ H5S_point_fgath (H5F_t *f, const struct H5O_layout_t *layout,
*/
static herr_t
H5S_point_fscat (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,
+ H5P_genplist_t *dc_plist,
size_t elmt_size, const H5S_t *file_space,
H5S_sel_iter_t *file_iter, hsize_t nelmts, hid_t dxpl_id,
const void *_buf)
@@ -411,10 +396,9 @@ H5S_point_fscat (H5F_t *f, const struct H5O_layout_t *layout,
assert (nelmts>0);
assert (buf);
-#ifdef QAK
- printf("%s: check 1.0, layout->ndims=%d\n",FUNC,(int)layout->ndims);
-#endif /* QAK */
+ /* Hold the number of dimensions of the dataspace */
ndims=file_space->extent.u.simple.rank;
+
/* initialize hyperslab size and offset in memory buffer */
for(u=0; u<ndims+1; u++) {
hsize[u]=1; /* hyperslab size is 1, except for last element */
@@ -428,14 +412,6 @@ H5S_point_fscat (H5F_t *f, const struct H5O_layout_t *layout,
*/
num_written=0;
while(num_written<nelmts && file_iter->pnt.elmt_left>0) {
-#ifdef QAK
- printf("%s: check 2.0\n",FUNC);
- {
- for(u=0; u<ndims; u++) {
- printf("%s: %u - pnt=%d\n", FUNC, (unsigned)u, (int)file_iter->pnt.curr->pnt[u]);
- }
- }
-#endif /* QAK */
/* Copy the location of the point to get */
HDmemcpy(file_offset,file_iter->pnt.curr->pnt,ndims*sizeof(hssize_t));
file_offset[ndims] = 0;
@@ -444,18 +420,9 @@ H5S_point_fscat (H5F_t *f, const struct H5O_layout_t *layout,
for(u=0; u<file_space->extent.u.simple.rank; u++)
file_offset[u] += file_space->select.offset[u];
-#ifdef QAK
- printf("%s: check 3.0\n",FUNC);
- for(u=0; u<ndims; u++) {
- printf("%s: %u - pnt=%d\n", FUNC,(unsigned)u,(int)file_iter->pnt.curr->pnt[u]);
- printf("%s: %u - file_offset=%d\n", FUNC,(unsigned)u,(int)file_offset[u]);
- }
- printf("%s: *buf=%u\n",FUNC,(unsigned)*buf);
-#endif /* QAK */
/* Go write the point */
- if (H5F_arr_write(f, dxpl_id, layout, pline, fill, efl, hsize, hsize, zero, file_offset, buf)<0) {
+ if (H5F_arr_write(f, dxpl_id, layout, dc_plist, hsize, hsize, zero, file_offset, buf)<0)
HRETURN_ERROR(H5E_DATASPACE, H5E_WRITEERROR, 0, "write error");
- }
/* Increment the offset of the buffer */
buf+=elmt_size;
@@ -466,9 +433,6 @@ H5S_point_fscat (H5F_t *f, const struct H5O_layout_t *layout,
/* Advance the point iterator */
file_iter->pnt.elmt_left--;
file_iter->pnt.curr=file_iter->pnt.curr->next;
-#ifdef QAK
- printf("%s: check 5.0, file_iter->pnt.curr=%p\n", FUNC,file_iter->pnt.curr);
-#endif
} /* end while */
FUNC_LEAVE (num_written>0 ? SUCCEED : FAIL);
diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h
index 12faf49..bb3e594 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -23,6 +23,7 @@
#include "H5Dpublic.h"
#include "H5Fprivate.h"
#include "H5Oprivate.h"
+#include "H5Pprivate.h"
#define H5S_RESERVED_ATOMS 2
@@ -93,17 +94,13 @@ typedef struct H5S_fconv_t {
/* Gather elements from disk to type conversion buffer */
hsize_t (*gath)(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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, H5S_sel_iter_t *file_iter,
hsize_t nelmts, hid_t dxpl_id, void *tconv_buf/*out*/);
/* Scatter elements from type conversion buffer to disk */
herr_t (*scat)(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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, H5S_sel_iter_t *file_iter,
hsize_t nelmts, hid_t dxpl_id, const void *tconv_buf);
} H5S_fconv_t;
@@ -139,18 +136,14 @@ 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,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
hid_t dxpl_id, void *buf/*out*/);
/* 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_fill_t *fill,
- const struct H5O_efl_t *efl, size_t elmt_size,
+ H5P_genplist_t *dc_plist, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
hid_t dxpl_id, const void *buf);
@@ -210,7 +203,7 @@ __DLL__ herr_t H5S_extent_release(H5S_t *space);
__DLL__ herr_t H5S_select_release(H5S_t *space);
__DLL__ hssize_t H5S_get_select_npoints(const H5S_t *space);
__DLL__ int H5S_extend(H5S_t *space, const hsize_t *size);
-__DLL__ int H5S_set_extent(H5S_t *space, const hsize_t *size);
+__DLL__ herr_t H5S_set_extent(H5S_t *space, const hsize_t *size);
__DLL__ htri_t H5S_select_valid(const H5S_t *space);
__DLL__ herr_t H5S_debug(H5F_t *f, const void *_mesg, FILE *stream,
int indent, int fwidth);
@@ -243,9 +236,7 @@ __DLL__ htri_t H5S_all_opt_possible(const H5S_t *mem_space,
/* MPI-IO function to read directly from app buffer to file rky980813 */
__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,
+ H5P_genplist_t *dc_plist,
size_t elmt_size, const H5S_t *file_space,
const H5S_t *mem_space, hid_t dxpl_id,
void *buf/*out*/);
@@ -253,9 +244,7 @@ __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_fill_t *fill,
- const struct H5O_efl_t *efl,
+ H5P_genplist_t *dc_plist,
size_t elmt_size, const H5S_t *file_space,
const H5S_t *mem_space, hid_t dxpl_id,
const void *buf);
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index e282006..32bf3ff 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -1567,7 +1567,7 @@ H5S_select_regular(const H5S_t *space)
herr_t
H5S_select_fill(const void *_fill, size_t fill_size, const H5S_t *space, void *buf)
{
- const void *fill=_fill; /* Alias for fill-value buffer */
+ void *fill=_fill; /* Alias for fill-value buffer */
herr_t ret_value=FAIL; /* return value */
FUNC_ENTER (H5S_select_fill, FAIL);