mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-12 17:31:09 +08:00
[svn-r25283] Description:
Correct error in new hyperslab selection test to use the right # of dimensions for start/stride/count/block arrays. Also, switch H5Sselect_select to H5Smodify_select. Tested on: MacOSX/64 10.9.3 (amazon) w/gcc 4.9.1, OpenMPI, C++, FORTRAN & threadsafe (Too minor to require h5committest)
This commit is contained in:
parent
e23830d29f
commit
ec408ef083
@ -1125,11 +1125,11 @@ nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
/****if* H5Sf/h5sselect_select_c
|
||||
/****if* H5Sf/h5smodify_select_c
|
||||
* NAME
|
||||
* h5sselect_select_c
|
||||
* h5smodify_select_c
|
||||
* PURPOSE
|
||||
* Call H5Sselect_ select
|
||||
* Call H5Smodify_select
|
||||
* INPUTS
|
||||
* space1_id - identifier of the first dataspace to modify
|
||||
* operator - defines how the new selection is combined
|
||||
@ -1145,7 +1145,7 @@ nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t
|
||||
*/
|
||||
|
||||
int_f
|
||||
nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id)
|
||||
nh5smodify_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id)
|
||||
/******/
|
||||
{
|
||||
int ret_value = -1;
|
||||
@ -1157,7 +1157,7 @@ nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id)
|
||||
|
||||
c_space1_id = (hid_t)*space1_id;
|
||||
c_space2_id = (hid_t)*space2_id;
|
||||
if( H5Sselect_select(c_space1_id, c_op, c_space2_id)< 0) return ret_value;
|
||||
if( H5Smodify_select(c_space1_id, c_op, c_space2_id)< 0) return ret_value;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
@ -1611,7 +1611,7 @@ CONTAINS
|
||||
! !$!****s* H5S/
|
||||
! !$!
|
||||
! !$! NAME
|
||||
! !$! h5sselect_select_f
|
||||
! !$! h5smodify_select_f
|
||||
! !$!
|
||||
! !$! PURPOSE
|
||||
! !$! Refine a hyperslab selection with an operation
|
||||
@ -1648,7 +1648,7 @@ CONTAINS
|
||||
! !$!
|
||||
|
||||
! ! SOURCE
|
||||
! SUBROUTINE h5sselect_select_f(space1_id, operator, space2_id, &
|
||||
! SUBROUTINE h5smodify_select_f(space1_id, operator, space2_id, &
|
||||
! hdferr)
|
||||
! IMPLICIT NONE
|
||||
! INTEGER(HID_T), INTENT(INOUT) :: space1_id ! Dataspace identifier to
|
||||
@ -1668,22 +1668,22 @@ CONTAINS
|
||||
! INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
! INTERFACE
|
||||
! INTEGER FUNCTION h5sselect_select_c(space1_id, operator, &
|
||||
! INTEGER FUNCTION h5smodify_select_c(space1_id, operator, &
|
||||
! space2_id)
|
||||
! USE H5GLOBAL
|
||||
! !DEC$IF DEFINED(HDF5F90_WINDOWS)
|
||||
! !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_SELECT_C'::h5sselect_select_c
|
||||
! !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SMODIFY_SELECT_C'::h5smodify_select_c
|
||||
! !DEC$ENDIF
|
||||
! INTEGER(HID_T), INTENT(INOUT) :: space1_id
|
||||
! INTEGER(HID_T), INTENT(IN) :: space2_id
|
||||
! INTEGER, INTENT(IN) :: operator
|
||||
! END FUNCTION h5sselect_select_c
|
||||
! END FUNCTION h5smodify_select_c
|
||||
! END INTERFACE
|
||||
|
||||
! hdferr = h5sselect_select_c(space1_id, operator, space2_id)
|
||||
! hdferr = h5smodify_select_c(space1_id, operator, space2_id)
|
||||
! return
|
||||
|
||||
! END SUBROUTINE h5sselect_select_f
|
||||
! END SUBROUTINE h5smodify_select_f
|
||||
|
||||
!
|
||||
!****s* H5S/h5sget_select_type_f
|
||||
|
@ -143,7 +143,7 @@ H5_FCDLL int_f nh5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size);
|
||||
#define nh5sselect_hyperslab_c H5_FC_FUNC_(h5sselect_hyperslab_c, H5SSELECT_HYPERSLAB_C)
|
||||
#define nh5scombine_hyperslab_c H5_FC_FUNC_(h5scombine_hyperslab_c, H5SCOMBINE_HYPERSLAB_C)
|
||||
#define nh5scombine_select_c H5_FC_FUNC_(h5scombine_select_c, H5SCOMBINE_SELECT_C)
|
||||
#define nh5sselect_select_c H5_FC_FUNC_(h5sselect_select_c, H5SSELECT_SELECT_C)
|
||||
#define nh5smodify_select_c H5_FC_FUNC_(h5smodify_select_c, H5SMODIFY_SELECT_C)
|
||||
#define nh5sget_select_type_c H5_FC_FUNC_(h5sget_select_type_c, H5SGET_SELECT_TYPE_C)
|
||||
#define nh5sselect_elements_c H5_FC_FUNC_(h5sselect_elements_c, H5SSELECT_ELEMENTS_C)
|
||||
#define nh5sdecode_c H5_FC_FUNC_(h5sdecode_c, H5SDECODE_C)
|
||||
@ -178,7 +178,7 @@ H5_FCDLL int_f nh5sget_select_type_c ( hid_t_f *space_id , int_f *op);
|
||||
H5_FCDLL int_f nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord);
|
||||
H5_FCDLL int_f nh5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id);
|
||||
H5_FCDLL int_f nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id);
|
||||
H5_FCDLL int_f nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id);
|
||||
H5_FCDLL int_f nh5smodify_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id);
|
||||
H5_FCDLL int_f nh5sdecode_c ( _fcd buf, hid_t_f *obj_id );
|
||||
H5_FCDLL int_f nh5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc );
|
||||
H5_FCDLL int_f nh5sextent_equal_c ( hid_t_f * space1_id, hid_t_f *space2_id, hid_t_f *c_equal);
|
||||
|
@ -86,7 +86,7 @@ static herr_t H5S_fill_in_hyperslab(H5S_t *old_space, H5S_seloper_t op,
|
||||
static herr_t H5S_fill_in_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2,
|
||||
H5S_t **result);
|
||||
static H5S_t *H5S_combine_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2);
|
||||
static herr_t H5S_select_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2);
|
||||
static herr_t H5S_modify_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2);
|
||||
static herr_t H5S_hyper_get_seq_list_gen(const H5S_t *space, H5S_sel_iter_t *iter,
|
||||
size_t maxseq, size_t maxelem, size_t *nseq, size_t *nelem, hsize_t *off,
|
||||
size_t *len);
|
||||
@ -7845,7 +7845,7 @@ H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id)
|
||||
/* Note: currently, the offset of each dataspace is ignored */
|
||||
#if 0
|
||||
/* Check that both dataspaces have the same offset */
|
||||
/* Same note as in H5Sselect_select */
|
||||
/* Same note as in H5Smodify_select */
|
||||
for(u=0; u<space1->extent.rank; u++) {
|
||||
if(space1->select.offset[u] != space2->select.offset[u])
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces not same offset")
|
||||
@ -7873,9 +7873,9 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5S_select_select
|
||||
* Function: H5S_modify_select
|
||||
*
|
||||
* Purpose: Internal version of H5Sselect_select().
|
||||
* Purpose: Internal version of H5Smodify_select().
|
||||
*
|
||||
* Return: New dataspace on success/NULL on failure
|
||||
*
|
||||
@ -7888,7 +7888,7 @@ done:
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5S_select_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2)
|
||||
H5S_modify_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
@ -7930,17 +7930,17 @@ H5S_select_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2)
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5S_select_select() */
|
||||
} /* end H5S_modify_select() */
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
NAME
|
||||
H5Sselect_select
|
||||
H5Smodify_select
|
||||
PURPOSE
|
||||
Refine a hyperslab selection with an operation using a second hyperslab
|
||||
to modify it
|
||||
USAGE
|
||||
herr_t H5Sselect_select(space1, op, space2)
|
||||
herr_t H5Smodify_select(space1, op, space2)
|
||||
hid_t space1; IN/OUT: First Dataspace ID
|
||||
H5S_seloper_t op; IN: Selection operation
|
||||
hid_t space2; IN: Second Dataspace ID
|
||||
@ -7956,7 +7956,7 @@ done:
|
||||
REVISION LOG
|
||||
--------------------------------------------------------------------------*/
|
||||
herr_t
|
||||
H5Sselect_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id)
|
||||
H5Smodify_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id)
|
||||
{
|
||||
H5S_t *space1; /* First Dataspace */
|
||||
H5S_t *space2; /* Second Dataspace */
|
||||
@ -8007,12 +8007,12 @@ H5Sselect_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces don't have hyperslab selections")
|
||||
|
||||
/* Go refine the first selection */
|
||||
if(H5S_select_select(space1, op, space2) < 0)
|
||||
if(H5S_modify_select(space1, op, space2) < 0)
|
||||
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to modify hyperslab selection")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5Sselect_select() */
|
||||
} /* end H5Smodify_select() */
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
|
@ -118,7 +118,7 @@ H5_DLL hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op,
|
||||
const hsize_t _stride[],
|
||||
const hsize_t count[],
|
||||
const hsize_t _block[]);
|
||||
H5_DLL herr_t H5Sselect_select(hid_t space1_id, H5S_seloper_t op,
|
||||
H5_DLL herr_t H5Smodify_select(hid_t space1_id, H5S_seloper_t op,
|
||||
hid_t space2_id);
|
||||
H5_DLL hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op,
|
||||
hid_t space2_id);
|
||||
|
@ -4935,7 +4935,7 @@ test_select_hyper_union(void)
|
||||
**
|
||||
** test_select_hyper_union_stagger(): Test basic H5S (dataspace) selection code.
|
||||
** Tests unions of staggered hyperslabs. (Uses H5Scombine_hyperslab
|
||||
** and H5Sselect_select instead of H5Sselect_hyperslab)
|
||||
** and H5Smodify_select instead of H5Sselect_hyperslab)
|
||||
**
|
||||
****************************************************************/
|
||||
static void
|
||||
@ -5039,8 +5039,8 @@ test_select_hyper_union_stagger(void)
|
||||
CHECK(error, FAIL, "H5Sselect_hyperslab");
|
||||
|
||||
/* Combine the copied dataspace with the temporary dataspace */
|
||||
error=H5Sselect_select(tmp_space,H5S_SELECT_OR,tmp2_space);
|
||||
CHECK(error, FAIL, "H5Sselect_select");
|
||||
error=H5Smodify_select(tmp_space,H5S_SELECT_OR,tmp2_space);
|
||||
CHECK(error, FAIL, "H5Smodify_select");
|
||||
|
||||
/* Create Memory Dataspace */
|
||||
memspace=H5Screate_simple(memrank,dimsm,NULL);
|
||||
@ -5292,7 +5292,7 @@ test_select_hyper_union_3d(void)
|
||||
**
|
||||
** test_select_hyper_valid_combination(): Tests invalid and valid
|
||||
** combinations of selections on dataspace for H5Scombine_select
|
||||
** and H5Sselect_select.
|
||||
** and H5Smodify_select.
|
||||
**
|
||||
****************************************************************/
|
||||
static void
|
||||
@ -5307,10 +5307,10 @@ test_select_hyper_valid_combination(void)
|
||||
hsize_t dims3D[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3};
|
||||
|
||||
hsize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */
|
||||
hsize_t start[SPACE9_RANK]; /* Hyperslab start */
|
||||
hsize_t stride[SPACE9_RANK]; /* Hyperslab stride */
|
||||
hsize_t count[SPACE9_RANK]; /* Hyperslab block count */
|
||||
hsize_t block[SPACE9_RANK]; /* Hyperslab block size */
|
||||
hsize_t start[SPACE4_RANK]; /* Hyperslab start */
|
||||
hsize_t stride[SPACE4_RANK]; /* Hyperslab stride */
|
||||
hsize_t count[SPACE4_RANK]; /* Hyperslab block count */
|
||||
hsize_t block[SPACE4_RANK]; /* Hyperslab block size */
|
||||
herr_t ret; /* Generic return value */
|
||||
|
||||
/* Output message about test being performed */
|
||||
@ -5357,29 +5357,29 @@ test_select_hyper_valid_combination(void)
|
||||
tmp_sid = H5Scombine_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid);
|
||||
VERIFY(tmp_sid, FAIL, "H5Scombine_select");
|
||||
|
||||
tmp_sid = H5Sselect_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid);
|
||||
VERIFY(tmp_sid, FAIL, "H5Sselect_select");
|
||||
tmp_sid = H5Smodify_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid);
|
||||
VERIFY(tmp_sid, FAIL, "H5Smodify_select");
|
||||
|
||||
/* Test the invalid combination between two hyperslab but of different dimension size */
|
||||
tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid);
|
||||
VERIFY(tmp_sid, FAIL, "H5Scombine_select");
|
||||
|
||||
tmp_sid = H5Sselect_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid);
|
||||
VERIFY(tmp_sid, FAIL, "H5Sselect_select");
|
||||
tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid);
|
||||
VERIFY(tmp_sid, FAIL, "H5Smodify_select");
|
||||
|
||||
/* Test invalid operation inputs to the two functions */
|
||||
tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid);
|
||||
VERIFY(tmp_sid, FAIL, "H5Scombine_select");
|
||||
|
||||
tmp_sid = H5Sselect_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid);
|
||||
VERIFY(tmp_sid, FAIL, "H5Sselect_select");
|
||||
tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid);
|
||||
VERIFY(tmp_sid, FAIL, "H5Smodify_select");
|
||||
|
||||
/* Test inputs in case of non-existent space ids */
|
||||
tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid);
|
||||
VERIFY(tmp_sid, FAIL, "H5Scombine_select");
|
||||
|
||||
tmp_sid = H5Sselect_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid);
|
||||
VERIFY(tmp_sid, FAIL, "H5Sselect_select");
|
||||
tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid);
|
||||
VERIFY(tmp_sid, FAIL, "H5Smodify_select");
|
||||
|
||||
/* Close dataspaces */
|
||||
ret = H5Sclose(single_pt_sid);
|
||||
|
Loading…
x
Reference in New Issue
Block a user