summaryrefslogtreecommitdiffstats
path: root/src/H5Sselect.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2015-03-18 21:53:49 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2015-03-18 21:53:49 (GMT)
commit4cfe53284bb6c3f7f57ff70af6ceb7396683aaa4 (patch)
treea9660134778d77babb6adb93286015836044ddb5 /src/H5Sselect.c
parent424826d0dd492cb734e166b7154e2db456f6a13a (diff)
downloadhdf5-4cfe53284bb6c3f7f57ff70af6ceb7396683aaa4.zip
hdf5-4cfe53284bb6c3f7f57ff70af6ceb7396683aaa4.tar.gz
hdf5-4cfe53284bb6c3f7f57ff70af6ceb7396683aaa4.tar.bz2
[svn-r26476] Add support for I/O in all cases with fixed size datasets and no point
selections. Add source dataspace extent patching (should allow closing the source file). Note fill values and various other features are not yet supported. Note there are still some code coverage assertions in the selection matching algorithm - if you hit these try taking them out. Note make check still fails in h5dump test (unrelated to this checkin). Tested: ummon
Diffstat (limited to 'src/H5Sselect.c')
-rw-r--r--src/H5Sselect.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index 24ec7bb..ed384e5 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -2128,6 +2128,7 @@ H5S_select_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
const H5S_t *src_intersect_space, H5S_t **new_space_ptr)
{
H5S_t *new_space = NULL; /* New dataspace constructed */
+ unsigned i;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -2144,6 +2145,11 @@ H5S_select_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
if(H5S_extent_copy_real(&new_space->extent, &dst_space->extent, TRUE) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy destination space extent")
+ /* Set offset to zeros */
+ for(i = 0; i < new_space->extent.rank; i++)
+ new_space->select.offset[i] = 0;
+ new_space->select.offset_changed = FALSE;
+
/* If the intersecting space is "all", the intersection must be equal to the
* source space and the projection must be equal to the destination space */
if(src_intersect_space->select.type->type == H5S_SEL_ALL) {
@@ -2163,26 +2169,14 @@ H5S_select_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
*/
else if((src_intersect_space->select.type->type == H5S_SEL_POINTS)
|| (src_space->select.type->type == H5S_SEL_POINTS)
- || (dst_space->select.type->type == H5S_SEL_POINTS)) {
+ || (dst_space->select.type->type == H5S_SEL_POINTS))
HDassert(0 && "Not yet implemented...");//VDSINC
else {
HDassert(src_intersect_space->select.type->type == H5S_SEL_HYPERSLABS);
- /* Intersecting space is hyperslab selection. If source space is set to
- * all, use simpler algorithm, otherwise use general hyperslab algorithm
- * (in either case if the destination space is al; the hyperslab
- * routines will convert the destination selection to a span tree to use
- * the same algorithm as with hyperslabs). */
- if(dst_space->select.type->type == H5S_SEL_ALL) {
- HDassert(0 && "Checking code coverage...");//VDSINC
- /* Project src_intersect_space onto dst_space selection */
- if(H5S_hyper_project_to_hs(src_intersect_space, dst_space, new_space) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't project hyperslab ondot destination selection")
- } /* end if */
- else {
- HDassert(dst_space->select.type->type == H5S_SEL_HYPERSLABS);
-
- HDassert(0 && "Not yet implemented...");//VDSINC
- } /* end else */
+ /* Intersecting space is hyperslab selection. Call the hyperslab
+ * routine to project to another hyperslab selection. */
+ if(H5S__hyper_project_intersection(src_space, dst_space, src_intersect_space, new_space) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't project hyperslab ondot destination selection")
} /* end else */
/* load the address of the new space into *new_space_ptr */