diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-12-13 18:14:36 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-12-13 18:14:36 (GMT) |
commit | a8161177b98fb2a85c92288294efe3fbace2fbeb (patch) | |
tree | 86cd881bd3f6294015588df4fa38d15101cc35d5 /src/H5Dio.c | |
parent | 15830ae10ac760ee46777f7bba6c9e10ed0e5906 (diff) | |
download | hdf5-a8161177b98fb2a85c92288294efe3fbace2fbeb.zip hdf5-a8161177b98fb2a85c92288294efe3fbace2fbeb.tar.gz hdf5-a8161177b98fb2a85c92288294efe3fbace2fbeb.tar.bz2 |
[svn-r7943] 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.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c index 1e6dcaf..562ee22 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -2293,6 +2293,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; @@ -2339,6 +2343,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. */ @@ -2743,11 +2751,11 @@ H5D_create_chunk_mem_map_hyper(const fm_map *fm) assert(fm->f_ndims>0); /* 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 */ |