summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-10-13 21:39:51 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-10-13 21:39:51 (GMT)
commitb76762fab1c9ef6b2496859c349cec0a3e5439d6 (patch)
treeab73bd91c809c891dc24e4127b5590eb2d0c9156 /src
parent39220e7a3055735e4dfced3a3b4d07c91c386447 (diff)
downloadhdf5-b76762fab1c9ef6b2496859c349cec0a3e5439d6.zip
hdf5-b76762fab1c9ef6b2496859c349cec0a3e5439d6.tar.gz
hdf5-b76762fab1c9ef6b2496859c349cec0a3e5439d6.tar.bz2
[svn-r11558] Purpose:
Bug fix Description: Check in Kent's fixes to hyperslab rebuilding code that should correctly detect situation when different sub-hyperslabs exist in a higher dimension. Solution: Remember previous sub-hyperslab information and compare that with newly generated sub-hyperslab to make certain they are the same. Platforms tested: FreeBSD 4.11 (sleipnir) Too minor to require h5committest
Diffstat (limited to 'src')
-rw-r--r--src/H5Shyper.c34
-rw-r--r--src/H5Spkg.h1
-rw-r--r--src/H5Stest.c35
3 files changed, 55 insertions, 15 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 6cc6cdd..1f75af4 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -5371,7 +5371,8 @@ H5S_hyper_rebuild_helper(const H5S_hyper_span_t *span, H5S_hyper_dim_t span_slab
hsize_t curr_start;
hsize_t curr_low;
int outcount;
- H5S_hyper_dim_t canon_down_span_slab_info;
+ int i;
+ H5S_hyper_dim_t canon_down_span_slab_info[H5S_MAX_RANK];
hbool_t ret_value = TRUE;
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_rebuild_helper)
@@ -5391,7 +5392,7 @@ H5S_hyper_rebuild_helper(const H5S_hyper_span_t *span, H5S_hyper_dim_t span_slab
if(!H5S_hyper_rebuild_helper(span->down->head, span_slab_info, rank - 1))
HGOTO_DONE(FALSE)
- canon_down_span_slab_info = span_slab_info[rank - 2];
+ HDmemcpy(canon_down_span_slab_info, span_slab_info, sizeof(H5S_hyper_dim_t) * rank);
} /* end if */
/* Assign the initial starting point & block size */
@@ -5410,19 +5411,22 @@ H5S_hyper_rebuild_helper(const H5S_hyper_span_t *span, H5S_hyper_dim_t span_slab
if(!H5S_hyper_rebuild_helper(span->down->head, span_slab_info, rank - 1))
HGOTO_DONE(FALSE)
- /* Point to hyperslab span information set up by recursive call */
- curr_down_span_slab_info = &span_slab_info[rank - 2];
-
- /* Compare the slab information of the adjacent spans in the down span tree.*/
- if(curr_down_span_slab_info->count > 0 && canon_down_span_slab_info.count > 0) {
- if(curr_down_span_slab_info->start != canon_down_span_slab_info.start
- || curr_down_span_slab_info->stride != canon_down_span_slab_info.stride
- || curr_down_span_slab_info->block != canon_down_span_slab_info.block
- || curr_down_span_slab_info->count != canon_down_span_slab_info.count)
- HGOTO_DONE(FALSE)
- } /* end if */
- else if (!((curr_down_span_slab_info->count == 0) && (canon_down_span_slab_info.count == 0)))
- HGOTO_DONE(FALSE)
+ /* Compare the slab information of the adjacent spans in the down span tree.
+ We have to compare all the sub-tree slab information with the canon_down_span_slab_info.*/
+
+ for( i = 0; i < rank - 1; i++) {
+ curr_down_span_slab_info = &span_slab_info[i];
+
+ if(curr_down_span_slab_info->count > 0 && canon_down_span_slab_info[i].count > 0) {
+ if(curr_down_span_slab_info->start != canon_down_span_slab_info[i].start
+ || curr_down_span_slab_info->stride != canon_down_span_slab_info[i].stride
+ || curr_down_span_slab_info->block != canon_down_span_slab_info[i].block
+ || curr_down_span_slab_info->count != canon_down_span_slab_info[i].count)
+ HGOTO_DONE(FALSE)
+ } /* end if */
+ else if (!((curr_down_span_slab_info->count == 0) && (canon_down_span_slab_info[i].count == 0)))
+ HGOTO_DONE(FALSE)
+ }
} /* end if */
} /* end if */
diff --git a/src/H5Spkg.h b/src/H5Spkg.h
index c32032d..2cb8499 100644
--- a/src/H5Spkg.h
+++ b/src/H5Spkg.h
@@ -223,6 +223,7 @@ H5_DLL herr_t H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src);
/* Testing functions */
#ifdef H5S_TESTING
H5_DLL htri_t H5S_select_shape_same_test(hid_t sid1, hid_t sid2);
+H5_DLL htri_t H5S_inquiry_rebuild_status(hid_t space_id);
#endif /* H5S_TESTING */
#endif /*_H5Spkg_H*/
diff --git a/src/H5Stest.c b/src/H5Stest.c
index 2eef919..83fbd96 100644
--- a/src/H5Stest.c
+++ b/src/H5Stest.c
@@ -71,3 +71,38 @@ done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_select_shape_same_test() */
+/*--------------------------------------------------------------------------
+ NAME
+ H5S_inquiry_rebuild_status
+ PURPOSE
+ Determine the status of rebuild
+ USAGE
+ htri_t H5S_inquiry_rebuild_status(hid_t space_id)
+ hid_t space_id; IN: dataspace id
+ RETURNS
+ Non-negative TRUE/FALSE on success, negative on failure
+ DESCRIPTION
+ Query the status of rebuilding the hyperslab
+ GLOBAL VARIABLES
+ COMMENTS, BUGS, ASSUMPTIONS
+ DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING H5P_get_class_path()
+ EXAMPLES
+ REVISION LOG
+--------------------------------------------------------------------------*/
+htri_t
+H5S_inquiry_rebuild_status(hid_t space_id)
+{
+ static htri_t ret_value = FAIL; /* return value */
+
+ H5S_t *space1 = NULL; /* Pointer to 1st dataspace */
+
+ FUNC_ENTER_NOAPI(H5S_inquiry_rebuild_status, FAIL);
+ /* Get dataspace structures */
+if (NULL == (space1=H5I_object_verify(space_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace");
+
+ ret_value= space1->select.sel_info.hslab->diminfo_valid;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* H5S_inquiry_rebuild_status() */