summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-03-26 19:55:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-03-26 19:55:28 (GMT)
commitccfdf1f9e4aac5da498f919775805f24c800e9ba (patch)
tree416209b89722b82d605a1fdaba2039939bfa09c9 /src
parent27f0b5a267d461be3014a2d02a7b744a005fe826 (diff)
downloadhdf5-ccfdf1f9e4aac5da498f919775805f24c800e9ba.zip
hdf5-ccfdf1f9e4aac5da498f919775805f24c800e9ba.tar.gz
hdf5-ccfdf1f9e4aac5da498f919775805f24c800e9ba.tar.bz2
[svn-r5082] Purpose:
Bug Fix Description: When reading a contiguous hyperslab that spanned the entire dataset and was larger that the type conversion buffer, the hyperslab routines need to fill the type conversion buffer and then return to the I/O routines. When the I/O routines resume the hyperslab operation, it was possible to have a combination of coordinates which caused the hyperslab iterator to incorrectly advance in the file, causing some data to be re-read or re-written. Solution: Corrected the H5S_hyper_iter_next routine to correctly handle contiguous hyperslabs that span the entire dataset dimensions. Platforms tested: Linux (eirene)
Diffstat (limited to 'src')
-rw-r--r--src/H5Shyper.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 17381ec..54738ff 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -325,8 +325,14 @@ H5S_hyper_iter_next (const H5S_t *file_space, H5S_sel_iter_t *file_iter)
/* Calculate the offset and block count for each dimension */
for(i=0; i<ndims; i++) {
- iter_offset[i]=(file_iter->hyp.pos[i]-file_space->select.sel_info.hslab.diminfo[i].start)%file_space->select.sel_info.hslab.diminfo[i].stride;
- iter_count[i]=(file_iter->hyp.pos[i]-file_space->select.sel_info.hslab.diminfo[i].start)/file_space->select.sel_info.hslab.diminfo[i].stride;
+ if(file_space->select.sel_info.hslab.diminfo[i].stride==1) {
+ iter_offset[i]=file_iter->hyp.pos[i]-file_space->select.sel_info.hslab.diminfo[i].start;
+ iter_count[i]=0;
+ } /* end if */
+ else {
+ iter_offset[i]=(file_iter->hyp.pos[i]-file_space->select.sel_info.hslab.diminfo[i].start)%file_space->select.sel_info.hslab.diminfo[i].stride;
+ iter_count[i]=(file_iter->hyp.pos[i]-file_space->select.sel_info.hslab.diminfo[i].start)/file_space->select.sel_info.hslab.diminfo[i].stride;
+ } /* end else */
} /* end for */
/* Start with the fastest changing dimension */