summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5Dio.c90
-rw-r--r--src/H5Dpkg.h1
-rw-r--r--src/H5Sselect.c260
3 files changed, 162 insertions, 189 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 6a6d532..7dea928 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -2337,8 +2337,6 @@ H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *f
const H5S_t *mem_space, fm_map *fm)
{
H5S_t *tmp_mspace = NULL; /* Temporary memory dataspace */
- H5S_t *equiv_mspace = NULL; /* Equivalent memory dataspace */
- hbool_t equiv_mspace_init = FALSE;/* Equivalent memory dataspace was created */
hssize_t old_offset[H5O_LAYOUT_NDIMS]; /* Old selection offset */
hbool_t file_space_normalized = FALSE; /* File dataspace was normalized */
hid_t f_tid = (-1); /* Temporary copy of file datatype for iteration */
@@ -2361,27 +2359,8 @@ H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *f
/* Check if the memory space is scalar & make equivalent memory space */
if((sm_ndims = H5S_GET_EXTENT_NDIMS(mem_space)) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get dimension number")
- if(sm_ndims==0) {
- hsize_t dims[H5O_LAYOUT_NDIMS]; /* Temporary dimension information */
-
- /* Set up "equivalent" n-dimensional dataspace with size '1' in each dimension */
- for(u=0; u<dataset->shared->layout.u.chunk.ndims-1; u++)
- dims[u]=1;
- if((equiv_mspace = H5S_create_simple(dataset->shared->layout.u.chunk.ndims-1,dims,NULL))==NULL)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "unable to create equivalent dataspace for scalar space")
-
- /* Indicate that this space needs to be released */
- equiv_mspace_init = TRUE;
-
- /* Set the number of dimensions for the memory dataspace */
- fm->m_ndims = dataset->shared->layout.u.chunk.ndims - 1;
- } /* end else */
- else {
- equiv_mspace = (H5S_t *)mem_space; /* Casting away 'const' OK... */
-
- /* Set the number of dimensions for the memory dataspace */
- H5_ASSIGN_OVERFLOW(fm->m_ndims, sm_ndims, int, unsigned);
- } /* end else */
+ /* Set the number of dimensions for the memory dataspace */
+ H5_ASSIGN_OVERFLOW(fm->m_ndims, sm_ndims, int, unsigned);
/* Get dim number and dimensionality for each dataspace */
fm->f_ndims = f_ndims = dataset->shared->layout.u.chunk.ndims - 1;
@@ -2436,13 +2415,12 @@ H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *f
/* Point at the dataspaces */
fm->file_space = file_space;
- fm->mem_space = equiv_mspace;
- fm->mem_space_copy = equiv_mspace_init; /* Make certain to copy memory dataspace if necessary */
+ fm->mem_space = mem_space;
/* Get type of selection on disk & in memory */
if((fsel_type = H5S_GET_SELECT_TYPE(file_space)) < H5S_SEL_NONE)
HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to convert from file to memory data space")
- if((fm->msel_type = H5S_GET_SELECT_TYPE(equiv_mspace)) < H5S_SEL_NONE)
+ if((fm->msel_type = H5S_GET_SELECT_TYPE(mem_space)) < H5S_SEL_NONE)
HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to convert from file to memory data space")
/* If the selection is NONE or POINTS, set the flag to FALSE */
@@ -2451,21 +2429,8 @@ H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *f
else
sel_hyper_flag = TRUE;
- /* Check if file selection is a point selection */
- if(!sel_hyper_flag) {
- /* Create temporary datatypes for selection iteration */
- if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL))) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype")
-
- /* Spaces aren't the same shape, iterate over the memory selection directly */
- if(H5S_select_iterate(&bogus, f_tid, file_space, H5D_chunk_file_cb, fm) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections")
-
- /* Reset "last chunk" info */
- fm->last_index=(hsize_t)-1;
- fm->last_chunk_info=NULL;
- } /* end if */
- else {
+ /* Check if file selection is a not a hyperslab selection */
+ if(sel_hyper_flag) {
/* Build the file selection for each chunk */
if(H5D_create_chunk_file_map_hyper(fm,dataset) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections")
@@ -2486,12 +2451,25 @@ H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *f
/* Get the next chunk node in the skip list */
curr_node=H5SL_next(curr_node);
} /* end while */
+ } /* end if */
+ else {
+ /* Create temporary datatypes for selection iteration */
+ if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL))) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype")
+
+ /* Spaces might not be the same shape, iterate over the file selection directly */
+ if(H5S_select_iterate(&bogus, f_tid, file_space, H5D_chunk_file_cb, fm) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections")
+
+ /* Reset "last chunk" info */
+ fm->last_index=(hsize_t)-1;
+ fm->last_chunk_info=NULL;
} /* end else */
/* Build the memory selection for each chunk */
- if(sel_hyper_flag && H5S_select_shape_same(file_space,equiv_mspace)==TRUE) {
+ if(sel_hyper_flag && H5S_select_shape_same(file_space, mem_space) == TRUE) {
/* Reset chunk template information */
- fm->mchunk_tmpl=NULL;
+ fm->mchunk_tmpl = NULL;
/* If the selections are the same shape, use the file chunk information
* to generate the memory chunk information quickly.
@@ -2503,7 +2481,7 @@ H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *f
size_t elmt_size; /* Memory datatype size */
/* Make a copy of equivalent memory space */
- if((tmp_mspace = H5S_copy(equiv_mspace,TRUE))==NULL)
+ if((tmp_mspace = H5S_copy(mem_space, TRUE)) == NULL)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space")
/* De-select the mem space copy */
@@ -2522,7 +2500,7 @@ H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *f
/* Create selection iterator for memory selection */
if((elmt_size=H5T_get_size(mem_type))==0)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "datatype size invalid")
- if (H5S_select_iter_init(&(fm->mem_iter), equiv_mspace, elmt_size) < 0)
+ if(H5S_select_iter_init(&(fm->mem_iter), mem_space, elmt_size) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator")
iter_init = TRUE; /* Selection iteration info has been initialized */
@@ -2567,10 +2545,6 @@ done:
fm->file_space = NULL;
fm->mem_space = NULL;
- if(equiv_mspace_init && equiv_mspace) {
- if(H5S_close(equiv_mspace) < 0)
- HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "can't release memory chunk dataspace template")
- } /* end if */
if(iter_init) {
if(H5S_SELECT_ITER_RELEASE(&(fm->mem_iter)) < 0)
HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator")
@@ -2888,20 +2862,12 @@ H5D_create_chunk_mem_map_hyper(const fm_map *fm)
chunk_info=H5SL_item(curr_node);
assert(chunk_info);
- /* Check if it's OK to share dataspace */
- if(fm->mem_space_copy) {
- /* Copy the memory dataspace & selection to be the chunk's dataspace & selection */
- if((chunk_info->mspace = H5S_copy(fm->mem_space,FALSE))==NULL)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space")
- } /* end if */
- else {
- /* Just point at the memory dataspace & selection */
- /* (Casting away const OK -QAK) */
- chunk_info->mspace=(H5S_t *)fm->mem_space;
+ /* Just point at the memory dataspace & selection */
+ /* (Casting away const OK -QAK) */
+ chunk_info->mspace=(H5S_t *)fm->mem_space;
- /* Indicate that the chunk's memory space is shared */
- chunk_info->mspace_shared=1;
- } /* end else */
+ /* Indicate that the chunk's memory space is shared */
+ chunk_info->mspace_shared=1;
} /* end if */
else {
/* Get bounding box for file selection */
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 34a32ee..7837d72 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -204,7 +204,6 @@ typedef struct fm_map {
H5D_chunk_info_t *last_chunk_info; /* Pointer to last chunk's info */
const H5S_t *file_space; /* Pointer to the file dataspace */
const H5S_t *mem_space; /* Pointer to the memory dataspace */
- unsigned mem_space_copy; /* Flag to indicate that the memory dataspace must be copied */
hsize_t f_dims[H5O_LAYOUT_NDIMS]; /* File dataspace dimensions */
H5S_t *mchunk_tmpl; /* Dataspace template for new memory chunks */
unsigned f_ndims; /* Number of dimensions for file dataspace */
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index e3b90bb..616efc0 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -1261,137 +1261,145 @@ H5S_get_select_type(const H5S_t *space)
htri_t
H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
{
- H5S_sel_iter_t iter1; /* Selection #1 iteration info */
- H5S_sel_iter_t iter2; /* Selection #2 iteration info */
- hbool_t iter1_init=0; /* Selection #1 iteration info has been initialized */
- hbool_t iter2_init=0; /* Selection #2 iteration info has been initialized */
- unsigned u; /* Index variable */
- htri_t ret_value=TRUE; /* return value */
+ H5S_sel_iter_t iter1; /* Selection #1 iteration info */
+ H5S_sel_iter_t iter2; /* Selection #2 iteration info */
+ hbool_t iter1_init = 0; /* Selection #1 iteration info has been initialized */
+ hbool_t iter2_init = 0; /* Selection #2 iteration info has been initialized */
+ unsigned u; /* Index variable */
+ htri_t ret_value = TRUE; /* Return value */
- FUNC_ENTER_NOAPI(H5S_select_shape_same, FAIL);
+ FUNC_ENTER_NOAPI(H5S_select_shape_same, FAIL)
/* Check args */
- assert(space1);
- assert(space2);
-
- /* Check for different dimensionality */
- if (space1->extent.rank!=space2->extent.rank)
- HGOTO_DONE(FALSE);
-
- /* Check for different number of elements selected */
- if(H5S_GET_SELECT_NPOINTS(space1)!=H5S_GET_SELECT_NPOINTS(space2))
- HGOTO_DONE(FALSE);
-
- /* Check for "easy" cases before getting into generalized block iteration code */
- if(H5S_GET_SELECT_TYPE(space1)==H5S_SEL_ALL && H5S_GET_SELECT_TYPE(space2)==H5S_SEL_ALL) {
- hsize_t dims1[H5O_LAYOUT_NDIMS]; /* End point of selection block in dataspace #1 */
- hsize_t dims2[H5O_LAYOUT_NDIMS]; /* End point of selection block in dataspace #2 */
-
- if(H5S_get_simple_extent_dims(space1, dims1, NULL)<0)
- HGOTO_ERROR (H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get dimensionality");
- if(H5S_get_simple_extent_dims(space2, dims2, NULL)<0)
- HGOTO_ERROR (H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get dimensionality");
-
- /* Check that the sizes are the same */
- for (u=0; u<space1->extent.rank; u++)
- if(dims1[u]!=dims2[u])
- HGOTO_DONE(FALSE);
+ HDassert(space1);
+ HDassert(space2);
+
+ /* Special case for one or both dataspaces being scalar */
+ if(space1->extent.rank == 0 || space2->extent.rank == 0) {
+ /* Check for different number of elements selected */
+ if(H5S_GET_SELECT_NPOINTS(space1) != H5S_GET_SELECT_NPOINTS(space2))
+ HGOTO_DONE(FALSE)
} /* end if */
- else if(H5S_GET_SELECT_TYPE(space1)==H5S_SEL_NONE || H5S_GET_SELECT_TYPE(space2)==H5S_SEL_NONE) {
- HGOTO_DONE(TRUE);
- } /* end if */
- else if((H5S_GET_SELECT_TYPE(space1)==H5S_SEL_HYPERSLABS && space1->select.sel_info.hslab->diminfo_valid)
- && (H5S_GET_SELECT_TYPE(space2)==H5S_SEL_HYPERSLABS && space2->select.sel_info.hslab->diminfo_valid)) {
-
- /* Check that the shapes are the same */
- for (u=0; u<space1->extent.rank; u++) {
- if(space1->select.sel_info.hslab->opt_diminfo[u].stride!=space2->select.sel_info.hslab->opt_diminfo[u].stride)
- HGOTO_DONE(FALSE);
- if(space1->select.sel_info.hslab->opt_diminfo[u].count!=space2->select.sel_info.hslab->opt_diminfo[u].count)
- HGOTO_DONE(FALSE);
- if(space1->select.sel_info.hslab->opt_diminfo[u].block!=space2->select.sel_info.hslab->opt_diminfo[u].block)
- HGOTO_DONE(FALSE);
- } /* end for */
- } /* end if */
- /* Iterate through all the blocks in the selection */
else {
- hsize_t start1[H5O_LAYOUT_NDIMS]; /* Start point of selection block in dataspace #1 */
- hsize_t start2[H5O_LAYOUT_NDIMS]; /* Start point of selection block in dataspace #2 */
- hsize_t end1[H5O_LAYOUT_NDIMS]; /* End point of selection block in dataspace #1 */
- hsize_t end2[H5O_LAYOUT_NDIMS]; /* End point of selection block in dataspace #2 */
- hsize_t off1[H5O_LAYOUT_NDIMS]; /* Offset of selection #1 blocks */
- hsize_t off2[H5O_LAYOUT_NDIMS]; /* Offset of selection #2 blocks */
- htri_t status1,status2; /* Status from next block checks */
- unsigned first_block=1; /* Flag to indicate the first block */
-
- /* Initialize iterator for each dataspace selection
- * Use '0' for element size instead of actual element size to indicate
- * that the selection iterator shouldn't be "flattened", since we
- * aren't actually going to be doing I/O with the iterators.
- */
- if(H5S_select_iter_init(&iter1, space1, (size_t)0) < 0)
- HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator");
- iter1_init = 1;
- if(H5S_select_iter_init(&iter2, space2, (size_t)0) < 0)
- HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator");
- iter2_init = 1;
-
- /* Iterate over all the blocks in each selection */
- while(1) {
- /* Get the current block for each selection iterator */
- if(H5S_SELECT_ITER_BLOCK(&iter1,start1,end1)<0)
- HGOTO_ERROR (H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get iterator block");
- if(H5S_SELECT_ITER_BLOCK(&iter2,start2,end2)<0)
- HGOTO_ERROR (H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get iterator block");
-
- /* The first block only compares the sizes and sets the relative offsets for later blocks */
- if(first_block) {
- /* If the block sizes from each selection doesn't match, get out */
- for (u=0; u<space1->extent.rank; u++) {
- if((end1[u]-start1[u])!=(end2[u]-start2[u]))
- HGOTO_DONE(FALSE);
-
- /* Set the relative locations of the selections */
- off1[u]=start1[u];
- off2[u]=start2[u];
- } /* end for */
-
- /* Reset "first block" flag */
- first_block=0;
- } /* end if */
- else {
- /* Check over the blocks for each selection */
- for (u=0; u<space1->extent.rank; u++) {
- /* Check if the blocks are in the same relative location */
- if((start1[u]-off1[u])!=(start2[u]-off2[u]))
- HGOTO_DONE(FALSE);
-
+ /* Check for different dimensionality */
+ if(space1->extent.rank != space2->extent.rank)
+ HGOTO_DONE(FALSE)
+
+ /* Check for different number of elements selected */
+ if(H5S_GET_SELECT_NPOINTS(space1) != H5S_GET_SELECT_NPOINTS(space2))
+ HGOTO_DONE(FALSE)
+
+ /* Check for "easy" cases before getting into generalized block iteration code */
+ if(H5S_GET_SELECT_TYPE(space1)==H5S_SEL_ALL && H5S_GET_SELECT_TYPE(space2)==H5S_SEL_ALL) {
+ hsize_t dims1[H5O_LAYOUT_NDIMS]; /* End point of selection block in dataspace #1 */
+ hsize_t dims2[H5O_LAYOUT_NDIMS]; /* End point of selection block in dataspace #2 */
+
+ if(H5S_get_simple_extent_dims(space1, dims1, NULL)<0)
+ HGOTO_ERROR (H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get dimensionality");
+ if(H5S_get_simple_extent_dims(space2, dims2, NULL)<0)
+ HGOTO_ERROR (H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get dimensionality");
+
+ /* Check that the sizes are the same */
+ for (u=0; u<space1->extent.rank; u++)
+ if(dims1[u]!=dims2[u])
+ HGOTO_DONE(FALSE);
+ } /* end if */
+ else if(H5S_GET_SELECT_TYPE(space1)==H5S_SEL_NONE || H5S_GET_SELECT_TYPE(space2)==H5S_SEL_NONE) {
+ HGOTO_DONE(TRUE);
+ } /* end if */
+ else if((H5S_GET_SELECT_TYPE(space1)==H5S_SEL_HYPERSLABS && space1->select.sel_info.hslab->diminfo_valid)
+ && (H5S_GET_SELECT_TYPE(space2)==H5S_SEL_HYPERSLABS && space2->select.sel_info.hslab->diminfo_valid)) {
+
+ /* Check that the shapes are the same */
+ for (u=0; u<space1->extent.rank; u++) {
+ if(space1->select.sel_info.hslab->opt_diminfo[u].stride!=space2->select.sel_info.hslab->opt_diminfo[u].stride)
+ HGOTO_DONE(FALSE);
+ if(space1->select.sel_info.hslab->opt_diminfo[u].count!=space2->select.sel_info.hslab->opt_diminfo[u].count)
+ HGOTO_DONE(FALSE);
+ if(space1->select.sel_info.hslab->opt_diminfo[u].block!=space2->select.sel_info.hslab->opt_diminfo[u].block)
+ HGOTO_DONE(FALSE);
+ } /* end for */
+ } /* end if */
+ /* Iterate through all the blocks in the selection */
+ else {
+ hsize_t start1[H5O_LAYOUT_NDIMS]; /* Start point of selection block in dataspace #1 */
+ hsize_t start2[H5O_LAYOUT_NDIMS]; /* Start point of selection block in dataspace #2 */
+ hsize_t end1[H5O_LAYOUT_NDIMS]; /* End point of selection block in dataspace #1 */
+ hsize_t end2[H5O_LAYOUT_NDIMS]; /* End point of selection block in dataspace #2 */
+ hsize_t off1[H5O_LAYOUT_NDIMS]; /* Offset of selection #1 blocks */
+ hsize_t off2[H5O_LAYOUT_NDIMS]; /* Offset of selection #2 blocks */
+ htri_t status1,status2; /* Status from next block checks */
+ unsigned first_block=1; /* Flag to indicate the first block */
+
+ /* Initialize iterator for each dataspace selection
+ * Use '0' for element size instead of actual element size to indicate
+ * that the selection iterator shouldn't be "flattened", since we
+ * aren't actually going to be doing I/O with the iterators.
+ */
+ if(H5S_select_iter_init(&iter1, space1, (size_t)0) < 0)
+ HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator");
+ iter1_init = 1;
+ if(H5S_select_iter_init(&iter2, space2, (size_t)0) < 0)
+ HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator");
+ iter2_init = 1;
+
+ /* Iterate over all the blocks in each selection */
+ while(1) {
+ /* Get the current block for each selection iterator */
+ if(H5S_SELECT_ITER_BLOCK(&iter1,start1,end1)<0)
+ HGOTO_ERROR (H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get iterator block");
+ if(H5S_SELECT_ITER_BLOCK(&iter2,start2,end2)<0)
+ HGOTO_ERROR (H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get iterator block");
+
+ /* The first block only compares the sizes and sets the relative offsets for later blocks */
+ if(first_block) {
/* If the block sizes from each selection doesn't match, get out */
- if((end1[u]-start1[u])!=(end2[u]-start2[u]))
- HGOTO_DONE(FALSE);
- } /* end for */
- } /* end else */
-
- /* Check if we are able to advance to the next selection block */
- if((status1=H5S_SELECT_ITER_HAS_NEXT_BLOCK(&iter1))<0)
- HGOTO_ERROR (H5E_DATASPACE, H5E_CANTNEXT, FAIL, "unable to check iterator block");
- if((status2=H5S_SELECT_ITER_HAS_NEXT_BLOCK(&iter2))<0)
- HGOTO_ERROR (H5E_DATASPACE, H5E_CANTNEXT, FAIL, "unable to check iterator block");
-
- /* Did we run out of blocks at the same time? */
- if(status1==FALSE && status2==FALSE)
- break;
- else if(status1!=status2) {
- HGOTO_DONE(FALSE);
- } /* end if */
- else {
- /* Advance to next block in selection iterators */
- if(H5S_SELECT_ITER_NEXT_BLOCK(&iter1)<0)
- HGOTO_ERROR (H5E_DATASPACE, H5E_CANTNEXT, FAIL, "unable to advance to next iterator block");
- if(H5S_SELECT_ITER_NEXT_BLOCK(&iter2)<0)
- HGOTO_ERROR (H5E_DATASPACE, H5E_CANTNEXT, FAIL, "unable to advance to next iterator block");
- } /* end else */
- } /* end while */
+ for (u=0; u<space1->extent.rank; u++) {
+ if((end1[u]-start1[u])!=(end2[u]-start2[u]))
+ HGOTO_DONE(FALSE);
+
+ /* Set the relative locations of the selections */
+ off1[u]=start1[u];
+ off2[u]=start2[u];
+ } /* end for */
+
+ /* Reset "first block" flag */
+ first_block=0;
+ } /* end if */
+ else {
+ /* Check over the blocks for each selection */
+ for (u=0; u<space1->extent.rank; u++) {
+ /* Check if the blocks are in the same relative location */
+ if((start1[u]-off1[u])!=(start2[u]-off2[u]))
+ HGOTO_DONE(FALSE);
+
+ /* If the block sizes from each selection doesn't match, get out */
+ if((end1[u]-start1[u])!=(end2[u]-start2[u]))
+ HGOTO_DONE(FALSE);
+ } /* end for */
+ } /* end else */
+
+ /* Check if we are able to advance to the next selection block */
+ if((status1=H5S_SELECT_ITER_HAS_NEXT_BLOCK(&iter1))<0)
+ HGOTO_ERROR (H5E_DATASPACE, H5E_CANTNEXT, FAIL, "unable to check iterator block");
+ if((status2=H5S_SELECT_ITER_HAS_NEXT_BLOCK(&iter2))<0)
+ HGOTO_ERROR (H5E_DATASPACE, H5E_CANTNEXT, FAIL, "unable to check iterator block");
+
+ /* Did we run out of blocks at the same time? */
+ if(status1==FALSE && status2==FALSE)
+ break;
+ else if(status1!=status2) {
+ HGOTO_DONE(FALSE);
+ } /* end if */
+ else {
+ /* Advance to next block in selection iterators */
+ if(H5S_SELECT_ITER_NEXT_BLOCK(&iter1)<0)
+ HGOTO_ERROR (H5E_DATASPACE, H5E_CANTNEXT, FAIL, "unable to advance to next iterator block");
+ if(H5S_SELECT_ITER_NEXT_BLOCK(&iter2)<0)
+ HGOTO_ERROR (H5E_DATASPACE, H5E_CANTNEXT, FAIL, "unable to advance to next iterator block");
+ } /* end else */
+ } /* end while */
+ } /* end else */
} /* end else */
done:
@@ -1404,7 +1412,7 @@ done:
HDONE_ERROR (H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator");
} /* end if */
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_select_shape_same() */