diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Dearray.c | 15 | ||||
-rw-r--r-- | src/H5Oprivate.h | 1 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/H5Dearray.c b/src/H5Dearray.c index e9dbd0d..240afb7 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -1137,7 +1137,7 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim); /* Calculate the index of this chunk */ - idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks); + idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_max_down_chunks); } /* end if */ else { /* Calculate the index of this chunk */ @@ -1202,7 +1202,8 @@ H5D__earray_idx_resize(H5O_layout_chunk_t *layout) /* "Swizzle" constant dimensions for this dataset */ if(layout->u.earray.unlim_dim > 0) { - hsize_t swizzled_chunks[H5O_LAYOUT_NDIMS]; /* Swizzled form of # of chunks in each dimension */ + hsize_t swizzled_chunks[H5O_LAYOUT_NDIMS]; /* Swizzled form of # of chunks in each dimension */ + hsize_t swizzled_max_chunks[H5O_LAYOUT_NDIMS]; /* Swizzled form of max # of chunks in each dimension */ /* Get the swizzled chunk dimensions */ HDmemcpy(layout->u.earray.swizzled_dim, layout->dim, (layout->ndims - 1) * sizeof(layout->dim[0])); @@ -1215,6 +1216,14 @@ H5D__earray_idx_resize(H5O_layout_chunk_t *layout) /* Get the swizzled "down" sizes for each dimension */ if(H5VM_array_down((layout->ndims - 1), swizzled_chunks, layout->u.earray.swizzled_down_chunks) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute swizzled 'down' chunk size value") + + /* Get the swizzled max number of chunks in each dimension */ + HDmemcpy(swizzled_max_chunks, layout->max_chunks, (layout->ndims - 1) * sizeof(swizzled_max_chunks[0])); + H5VM_swizzle_coords(hsize_t, swizzled_max_chunks, layout->u.earray.unlim_dim); + + /* Get the swizzled max "down" sizes for each dimension */ + if(H5VM_array_down((layout->ndims - 1), swizzled_max_chunks, layout->u.earray.swizzled_max_down_chunks) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute swizzled 'down' chunk size value") } /* end if */ done: @@ -1414,7 +1423,7 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim); /* Calculate the index of this chunk */ - idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks); + idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_max_down_chunks); } /* end if */ else { /* Calculate the index of this chunk */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index f0fbe72..0a4ed74 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -584,6 +584,7 @@ typedef struct H5O_layout_chunk_earray_t { unsigned unlim_dim; /* Rank of unlimited dimension for dataset */ uint32_t swizzled_dim[H5O_LAYOUT_NDIMS]; /* swizzled chunk dimensions */ hsize_t swizzled_down_chunks[H5O_LAYOUT_NDIMS]; /* swizzled "down" size of number of chunks in each dimension */ + hsize_t swizzled_max_down_chunks[H5O_LAYOUT_NDIMS]; /* swizzled max "down" size of number of chunks in each dimension */ } H5O_layout_chunk_earray_t; typedef struct H5O_layout_chunk_bt2_t { |