diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2015-06-12 04:26:53 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2015-06-12 04:26:53 (GMT) |
commit | 9786fe2f6158cd13c5e1837dee58f99dcda8f58c (patch) | |
tree | 01141ce11b7356532515f7f5764b342127cad7a0 /src/H5Shyper.c | |
parent | aa4e3e3985e1e2715819c326d332e1569ac73c7b (diff) | |
download | hdf5-9786fe2f6158cd13c5e1837dee58f99dcda8f58c.zip hdf5-9786fe2f6158cd13c5e1837dee58f99dcda8f58c.tar.gz hdf5-9786fe2f6158cd13c5e1837dee58f99dcda8f58c.tar.bz2 |
[svn-r27192] Improve support for printf selections (support partial blocks with
H5_VDS_FIRST_MISSING)
Add test for this
Rework VDS code to not depend on unlimited selections having a "clipped" state
in preparation for removing the clipped state from unlimited selections.
Other bug fixes/cleanup
Tested: Kubuntu 64 (home computer)
Diffstat (limited to 'src/H5Shyper.c')
-rw-r--r-- | src/H5Shyper.c | 84 |
1 files changed, 72 insertions, 12 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 6cc78a9..db81211 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -9317,7 +9317,15 @@ H5S__hyper_project_intersection(const H5S_t *src_space, const H5S_t *dst_space, HDassert(proj_space); /* Assert that src_space and src_intersect_space have same extent and there - * are no point selections? */ + * are no point selections */ + HDassert(H5S_GET_EXTENT_NDIMS(src_space) + == H5S_GET_EXTENT_NDIMS(src_intersect_space)); + HDassert(!HDmemcmp(src_space->extent.size, src_intersect_space->extent.size, + (size_t)H5S_GET_EXTENT_NDIMS(src_space) + * sizeof(src_space->extent.size[0]))); + HDassert(H5S_GET_SELECT_TYPE(src_space) != H5S_SEL_POINTS); + HDassert(H5S_GET_SELECT_TYPE(dst_space) != H5S_SEL_POINTS); + HDassert(H5S_GET_SELECT_TYPE(src_intersect_space) != H5S_SEL_POINTS); /* Initialize prev_space, curr_span_tree, and curr_span_up_dim */ for(i = 0; i < H5S_MAX_RANK; i++) { @@ -9757,16 +9765,13 @@ done: Non-negative on success/Negative on failure. DESCRIPTION This function recalculates the internal description of the hyperslab - to make the unlimited dimension extend to the specified extent. if - superset is TRUE, then the hyperslab can be clipped to a size equal to - or greater than clip_size. + to make the unlimited dimension extend to the specified extent. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS - Note this function takes the offset into account. EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -static void +void H5S__hyper_get_clip_diminfo(hsize_t start, hsize_t stride, hsize_t *count, hsize_t *block, hssize_t offset, hsize_t clip_size) { @@ -9796,7 +9801,7 @@ H5S__hyper_get_clip_diminfo(hsize_t start, hsize_t stride, hsize_t *count, } /* end else */ FUNC_LEAVE_NOAPI_VOID -} /* end H5S__hyper_get_clip_diminfo() */ +} /* end H5S_hyper_get_clip_diminfo() */ /*-------------------------------------------------------------------------- @@ -9811,10 +9816,7 @@ H5S__hyper_get_clip_diminfo(hsize_t start, hsize_t stride, hsize_t *count, Non-negative on success/Negative on failure. DESCRIPTION This function recalculates the internal description of the hyperslab - to make the unlimited dimension extend to the specified extent. if - superset is TRUE, then the hyperslab can be clipped to a size equal to - or greater than clip_size. If include_offset is TRUE, then the offset - is taken into account. + to make the unlimited dimension extend to the specified extent. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS Note this function takes the offset into account. @@ -9882,7 +9884,7 @@ H5S_hyper_clip_unlim(H5S_t *space, hsize_t clip_size) /* Check if last block is partial. If superset is set, just keep the * last block complete to speed computation. */ if(((diminfo->stride * (diminfo->count - (hsize_t)1)) + diminfo->block) - > ((hsize_t)((hssize_t)clip_size - ((hssize_t)diminfo->start + > ((hsize_t)((hssize_t)clip_size - ((hssize_t)diminfo->start + space->select.offset[hslab->unlim_dim])))) { hsize_t start[H5S_MAX_RANK]; hsize_t block[H5S_MAX_RANK]; @@ -10147,6 +10149,64 @@ done: /*-------------------------------------------------------------------------- NAME + H5S_hyper_get_first_inc_block + PURPOSE + VDSINC + USAGE + VDSINC + RETURNS + Index of first incomplete block in clip_size (never fails). + DESCRIPTION + VDSINC + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + Note this assumes the offset has been normalized. + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +hsize_t +H5S_hyper_get_first_inc_block(const H5S_t *space, hsize_t clip_size, + hbool_t *partial) +{ + H5S_hyper_sel_t *hslab; /* Convenience pointer to hyperslab info */ + H5S_hyper_dim_t *diminfo; /* Convenience pointer to opt_diminfo in unlimited dimension */ + hsize_t ret_value; + + FUNC_ENTER_NOAPI_NOERR + + /* Check parameters */ + HDassert(space); + hslab = space->select.sel_info.hslab; + HDassert(hslab); + HDassert(hslab->unlim_dim >= 0); + HDassert(hslab->opt_unlim_diminfo[hslab->unlim_dim].count == H5S_UNLIMITED); + HDassert(partial); + + diminfo = &hslab->opt_unlim_diminfo[hslab->unlim_dim]; + + /* Check for selection outside of clip_size */ + if(diminfo->start >= clip_size) { + ret_value = 0; + partial = FALSE; + } /* end if */ + else { + /* Calculate index of first incomplete block */ + ret_value = (clip_size - diminfo->start + diminfo->stride + - diminfo->block) / diminfo->stride; + + /* Check for partial block */ + if((diminfo->stride * ret_value) < (clip_size - diminfo->start)) + *partial = TRUE; + else + *partial = FALSE; + } /* end else */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5S_hyper_get_first_inc_block */ + + +/*-------------------------------------------------------------------------- + NAME H5Sis_regular_hyperslab PURPOSE Determine if a hyperslab selection is regular |