summaryrefslogtreecommitdiffstats
path: root/src/H5Dchunk.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-04-16 08:42:48 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-04-16 08:42:48 (GMT)
commit81ef260f6bfcf7aae3d55b3672d8c4e07021a906 (patch)
tree0c64b4a0c8f7dddfb7d8eed82d57955522aa27c5 /src/H5Dchunk.c
parenta916ea97b879b8ce1662d3772032022ae07eed31 (diff)
downloadhdf5-81ef260f6bfcf7aae3d55b3672d8c4e07021a906.zip
hdf5-81ef260f6bfcf7aae3d55b3672d8c4e07021a906.tar.gz
hdf5-81ef260f6bfcf7aae3d55b3672d8c4e07021a906.tar.bz2
[svn-r29717] Description:
Correct chunk index computation for earrays and farrays, particularly when copying datasets with H5Ocopy() and other operations (like H5Dget_storage_size) that require iterating over all chunks. Tested on: MacOSX/64 10.11.4 (amazon) w/serial & parallel (h5committest forthcoming)
Diffstat (limited to 'src/H5Dchunk.c')
-rw-r--r--src/H5Dchunk.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index c3a3d9d..0acb385 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -506,7 +506,10 @@ H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims,
for(u = 0, layout->nchunks = 1, layout->max_nchunks = 1; u < ndims; u++) {
/* Round up to the next integer # of chunks, to accomodate partial chunks */
layout->chunks[u] = ((curr_dims[u] + layout->dim[u]) - 1) / layout->dim[u];
- layout->max_chunks[u] = ((max_dims[u] + layout->dim[u]) - 1) / layout->dim[u];
+ if(H5S_UNLIMITED == max_dims[u])
+ layout->max_chunks[u] = H5S_UNLIMITED;
+ else
+ layout->max_chunks[u] = ((max_dims[u] + layout->dim[u]) - 1) / layout->dim[u];
/* Accumulate the # of chunks */
layout->nchunks *= layout->chunks[u];
@@ -5520,7 +5523,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
} /* end if */
udata_dst.chunk_idx = H5VM_array_offset_pre(udata_dst.common.layout->ndims - 1,
- udata_dst.common.layout->down_chunks, udata_dst.common.scaled);
+ udata_dst.common.layout->max_down_chunks, udata_dst.common.scaled);
/* Allocate chunk in the file */
if(H5D__chunk_file_alloc(udata->idx_info_dst, NULL, &udata_dst.chunk_block, &need_insert) < 0)
@@ -5772,6 +5775,8 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src,
udata.buf_space = buf_space;
udata.nelmts = nelmts;
udata.pline = pline;
+ udata.dset_ndims = (unsigned)sndims;
+ udata.dset_dims = curr_dims;
udata.cpy_info = cpy_info;
/* Iterate over chunks to copy data */