summaryrefslogtreecommitdiffstats
path: root/src/H5Dio.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-12-13 18:14:39 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-12-13 18:14:39 (GMT)
commitff328b54b9312a70dbcf904a99a3cba13b5d435f (patch)
tree70e79edcdb8a82dbe03d83cfccaecb9f431b63dd /src/H5Dio.c
parent05194784fd3be6c0aea577e766a78e831f10bfd2 (diff)
downloadhdf5-ff328b54b9312a70dbcf904a99a3cba13b5d435f.zip
hdf5-ff328b54b9312a70dbcf904a99a3cba13b5d435f.tar.gz
hdf5-ff328b54b9312a70dbcf904a99a3cba13b5d435f.tar.bz2
[svn-r7944] Purpose:
Bug fix. Description: Using a selection offset with hyperslab selections in chunked datasets was getting into an infinite loop and hanging the application. Solution: Apply the selection offset to the hyperslab selection properly. Platforms tested: FreeBSD 4.9 (sleipnir) w & w/o parallel h5committest
Diffstat (limited to 'src/H5Dio.c')
-rw-r--r--src/H5Dio.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 3a25059..17382dd 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -2230,6 +2230,10 @@ H5D_create_chunk_map(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *file_sp
if(H5S_hyper_convert(fm->file_space)<0)
HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to convert selection to span trees")
+ /* Normalize the hyperslab selections by adjusting them by the offset */
+ if(H5S_hyper_normalize_offset(fm->file_space)<0)
+ HGOTO_ERROR (H5E_DATASET, H5E_BADSELECT, FAIL, "unable to normalize dataspace by offset")
+
#ifdef QAK
{
int mpi_rank;
@@ -2276,6 +2280,10 @@ H5D_create_chunk_map(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *file_sp
if(H5S_hyper_convert(fm->mem_space)<0)
HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to convert selection to span trees")
+ /* Normalize the hyperslab selections by adjusting them by the offset */
+ if(H5S_hyper_normalize_offset(fm->mem_space)<0)
+ HGOTO_ERROR (H5E_DATASET, H5E_BADSELECT, FAIL, "unable to normalize dataspace by offset")
+
/* If the selections are the same shape, use the file chunk information
* to generate the memory chunk information quickly.
*/
@@ -2667,11 +2675,11 @@ H5D_create_chunk_mem_map_hyper(const fm_map *fm)
#endif /* QAK */
/* Get offset of first block in file selection */
- if(H5S_get_select_hyper_blocklist(fm->file_space, (hsize_t)0, (hsize_t)1, file_off)<0)
+ if(H5S_get_select_hyper_blocklist(fm->file_space, 1, (hsize_t)0, (hsize_t)1, file_off)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection block info");
/* Get offset of first block in memory selection */
- if(H5S_get_select_hyper_blocklist(fm->mem_space, (hsize_t)0, (hsize_t)1, mem_off)<0)
+ if(H5S_get_select_hyper_blocklist(fm->mem_space, 1, (hsize_t)0, (hsize_t)1, mem_off)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection block info");
/* Calculate the adjustment for memory selection from file selection */