summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-12-31 19:19:18 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-12-31 19:19:18 (GMT)
commit7bcc111c2b0db85b21c229dcf1e1f7a82f27b2fc (patch)
tree44c5a5f57689a65989e1d84504688b3db981fd31
parent738e808d262a79d43a4697bb731c5d2961a006a2 (diff)
downloadhdf5-7bcc111c2b0db85b21c229dcf1e1f7a82f27b2fc.zip
hdf5-7bcc111c2b0db85b21c229dcf1e1f7a82f27b2fc.tar.gz
hdf5-7bcc111c2b0db85b21c229dcf1e1f7a82f27b2fc.tar.bz2
[svn-r8000] Purpose:
Bug fix Description: Fixed bug in hyperslab iteration where certain combinations of flattened and non-flattened dimensions would cause incorrect locations to be iterated over. Platforms tested: FreeBSD 4.9 (sleipnir) too minor to require h5committest
-rw-r--r--release_docs/RELEASE.txt4
-rw-r--r--src/H5Shyper.c75
-rw-r--r--src/H5Sselect.c18
3 files changed, 82 insertions, 15 deletions
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index c2e23dd..81b7a74 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -93,6 +93,10 @@ Bug Fixes since HDF5-1.6.0 release
Library
-------
+ - Fixed bug with flattened hyperslab selections that would generate
+ incorrect hyperslab information with certain high-dimensionality
+ combinations of start/stride/count/block information.
+ QAK - 2003/12/31
- Fixed bug with variable-length datatypes used in compound datatypes.
SLU - 2003/12/29
- Fixed bug in parallel I/O routines that would cause reads from
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 7422de2..3e2e5d4 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -77,34 +77,79 @@ H5FL_ARR_DEFINE_STATIC(H5S_hyper_dim_t,H5S_MAX_RANK);
/* #define H5S_HYPER_DEBUG */
#ifdef H5S_HYPER_DEBUG
static herr_t
-H5S_hyper_print_spans_helper(struct H5S_hyper_span_t *span,unsigned depth)
+H5S_hyper_print_spans_helper(FILE *f, struct H5S_hyper_span_t *span,unsigned depth)
{
- struct H5S_hyper_span_t *tmp_span;
-
FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_print_spans_helper);
- tmp_span=span;
- while(tmp_span) {
- HDfprintf(stderr,"%s: depth=%u, span=%p, (%d, %d), nelem=%u, pstride=%u\n",FUNC,depth,tmp_span,(int)tmp_span->low,(int)tmp_span->high,(unsigned)tmp_span->nelem,(unsigned)tmp_span->pstride);
- if(tmp_span->down && tmp_span->down->head) {
- HDfprintf(stderr,"%s: spans=%p, count=%u, scratch=%p, head=%p\n",FUNC,tmp_span->down,tmp_span->down->count,tmp_span->down->scratch,tmp_span->down->head);
- H5S_hyper_print_spans_helper(tmp_span->down->head,depth+1);
+ while(span) {
+ HDfprintf(f,"%s: depth=%u, span=%p, (%d, %d), nelem=%u, pstride=%u\n",FUNC,depth,span,(int)span->low,(int)span->high,(unsigned)span->nelem,(unsigned)span->pstride);
+ if(span->down && span->down->head) {
+ HDfprintf(f,"%s: spans=%p, count=%u, scratch=%p, head=%p\n",FUNC,span->down,span->down->count,span->down->scratch,span->down->head);
+ H5S_hyper_print_spans_helper(f,span->down->head,depth+1);
} /* end if */
- tmp_span=tmp_span->next;
+ span=span->next;
} /* end while */
FUNC_LEAVE_NOAPI(SUCCEED);
}
-static herr_t
-H5S_hyper_print_spans(const struct H5S_hyper_span_info_t *span_lst)
+herr_t
+H5S_hyper_print_spans(FILE *f, const struct H5S_hyper_span_info_t *span_lst)
{
FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_print_spans);
if(span_lst!=NULL) {
- HDfprintf(stderr,"%s: spans=%p, count=%u, scratch=%p, head=%p\n",FUNC,span_lst,span_lst->count,span_lst->scratch,span_lst->head);
- H5S_hyper_print_spans_helper(span_lst->head,0);
+ HDfprintf(f,"%s: spans=%p, count=%u, scratch=%p, head=%p\n",FUNC,span_lst,span_lst->count,span_lst->scratch,span_lst->head);
+ H5S_hyper_print_spans_helper(f,span_lst->head,0);
+ } /* end if */
+
+ FUNC_LEAVE_NOAPI(SUCCEED);
+}
+
+herr_t
+H5S_space_print_spans(FILE *f, const H5S_t *space)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_space_print_spans);
+
+ H5S_hyper_print_spans(f,space->select.sel_info.hslab.span_lst);
+
+ FUNC_LEAVE_NOAPI(SUCCEED);
+}
+
+static herr_t
+H5S_hyper_print_diminfo_helper(FILE *f, const char *field, unsigned ndims, const H5S_hyper_dim_t *dinfo)
+{
+ unsigned u; /* Local index variable */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_print_diminfo_helper);
+
+ if(dinfo!=NULL) {
+ HDfprintf(f,"%s: %s: start=[",FUNC,field);
+ for(u=0; u<ndims; u++)
+ HDfprintf(f,"%Hd%s",dinfo[u].start, (u<(ndims-1) ? ", " : "]\n"));
+ HDfprintf(f,"%s: %s: stride=[",FUNC,field);
+ for(u=0; u<ndims; u++)
+ HDfprintf(f,"%Hu%s",dinfo[u].stride, (u<(ndims-1) ? ", " : "]\n"));
+ HDfprintf(f,"%s: %s: count=[",FUNC,field);
+ for(u=0; u<ndims; u++)
+ HDfprintf(f,"%Hu%s",dinfo[u].count, (u<(ndims-1) ? ", " : "]\n"));
+ HDfprintf(f,"%s: %s: block=[",FUNC,field);
+ for(u=0; u<ndims; u++)
+ HDfprintf(f,"%Hu%s",dinfo[u].block, (u<(ndims-1) ? ", " : "]\n"));
} /* end if */
+ else
+ HDfprintf(f,"%s: %s==NULL\n",FUNC,field);
+
+ FUNC_LEAVE_NOAPI(SUCCEED);
+}
+
+herr_t
+H5S_hyper_print_diminfo(FILE *f, const H5S_t *space)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_diminfo);
+
+ H5S_hyper_print_diminfo_helper(f,"diminfo",space->extent.u.simple.rank,space->select.sel_info.hslab.diminfo);
+ H5S_hyper_print_diminfo_helper(f,"app_diminfo",space->extent.u.simple.rank,space->select.sel_info.hslab.app_diminfo);
FUNC_LEAVE_NOAPI(SUCCEED);
}
@@ -220,7 +265,7 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space, size_t elmt_size)
/* First dimension after flattened dimensions */
iter->u.hyp.diminfo[curr_dim].start = tdiminfo[i].start*acc;
/* Special case for single block regular selections */
- if(tdiminfo[curr_dim].count==1)
+ if(tdiminfo[i].count==1)
iter->u.hyp.diminfo[curr_dim].stride = 1;
else
iter->u.hyp.diminfo[curr_dim].stride = tdiminfo[i].stride*acc;
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index 422e9ed..3128cb8 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -1205,6 +1205,24 @@ HDfprintf(stderr,"%s: Entering\n",FUNC);
unsigned first_block=1; /* Flag to indicate the first block */
#ifdef QAK
HDfprintf(stderr,"%s: Check 10.0\n",FUNC);
+HDfprintf(stderr,"%s: space1 selection type=%d\n",FUNC,(int)space1->select.type);
+if(space1->select.sel_info.hslab.span_lst) {
+ HDfprintf(stderr,"%s: Dumping space1 span list\n",FUNC);
+ H5S_hyper_print_spans(stderr,space1->select.sel_info.hslab.span_lst);
+} /* end if */
+else {
+ HDfprintf(stderr,"%s: Dumping space1 diminfo\n",FUNC);
+ H5S_hyper_print_diminfo(stderr,space1);
+} /* end else */
+HDfprintf(stderr,"%s: space2 selection type=%d\n",FUNC,(int)space2->select.type);
+if(space2->select.sel_info.hslab.span_lst) {
+ HDfprintf(stderr,"%s: Dumping space2 span list\n",FUNC);
+ H5S_hyper_print_spans(stderr,space2->select.sel_info.hslab.span_lst);
+} /* end if */
+else {
+ HDfprintf(stderr,"%s: Dumping space2 diminfo\n",FUNC);
+ H5S_hyper_print_diminfo(stderr,space2);
+} /* end else */
#endif /* QAK */
/* Initialize iterator for each dataspace selection