Add H5Sselect_shape_same and H5Sselect_intersect_block API routines, along

with tests and minor cleanups and refactorings.
This commit is contained in:
Quincey Koziol 2019-07-30 15:34:53 -05:00
parent d3fdcd8a68
commit 605889fde8
18 changed files with 1238 additions and 1033 deletions

View File

@ -1245,7 +1245,7 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
} /* end else */
/* Build the memory selection for each chunk */
if(sel_hyper_flag && H5S_select_shape_same(file_space, mem_space) == TRUE) {
if(sel_hyper_flag && H5S_SELECT_SHAPE_SAME(file_space, mem_space) == TRUE) {
/* Reset chunk template information */
fm->mchunk_tmpl = NULL;
@ -1811,7 +1811,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t
while(sel_points) {
/* Check for intersection of current chunk and file selection */
/* (Casting away const OK - QAK) */
if(TRUE == H5S_hyper_intersect_block((H5S_t *)fm->file_space, coords, end)) {
if(TRUE == H5S_SELECT_INTERSECT_BLOCK(fm->file_space, coords, end)) {
H5D_chunk_info_t *new_chunk_info; /* chunk information to insert into skip list */
hssize_t schunk_points; /* Number of elements in chunk selection */
@ -2030,12 +2030,8 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm)
/* Sanity check */
HDassert(H5S_SEL_HYPERSLABS == chunk_sel_type);
/* Release the current selection */
if(H5S_SELECT_RELEASE(chunk_info->mspace) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection")
/* Copy the file chunk's selection */
if(H5S_select_copy(chunk_info->mspace, chunk_info->fspace, FALSE) < 0)
if(H5S_SELECT_COPY(chunk_info->mspace, chunk_info->fspace, FALSE) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy selection")
/* Compute the adjustment for this chunk */

View File

@ -490,7 +490,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
* Note that in general, this requires us to touch up the memory buffer as
* well.
*/
if(TRUE == H5S_select_shape_same(mem_space, file_space) &&
if(TRUE == H5S_SELECT_SHAPE_SAME(mem_space, file_space) &&
H5S_GET_EXTENT_NDIMS(mem_space) != H5S_GET_EXTENT_NDIMS(file_space)) {
void *adj_buf = NULL; /* Pointer to the location in buf corresponding */
/* to the beginning of the projected mem space. */
@ -725,7 +725,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
* Note that in general, this requires us to touch up the memory buffer
* as well.
*/
if(TRUE == H5S_select_shape_same(mem_space, file_space) &&
if(TRUE == H5S_SELECT_SHAPE_SAME(mem_space, file_space) &&
H5S_GET_EXTENT_NDIMS(mem_space) != H5S_GET_EXTENT_NDIMS(file_space)) {
void *adj_buf = NULL; /* Pointer to the location in buf corresponding */
/* to the beginning of the projected mem space. */

View File

@ -868,7 +868,7 @@ H5F__is_hdf5(const char *name, hid_t fapl_id)
/* The file is an hdf5 file if the hdf5 file signature can be found */
if(H5FD_locate_signature(file, &sig_addr) < 0)
HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature")
HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "error while trying to locate file signature")
ret_value = (HADDR_UNDEF != sig_addr);
done:

View File

@ -827,7 +827,7 @@ H5P__dcrt_layout_cmp(const void *_layout1, const void *_layout2,
if((equal = H5S_extent_equal(layout1->storage.u.virt.list[u].source_dset.virtual_select, layout2->storage.u.virt.list[u].source_dset.virtual_select)) < 0) HGOTO_DONE(-1)
if(!equal)
HGOTO_DONE(1)
if((equal = H5S_select_shape_same(layout1->storage.u.virt.list[u].source_dset.virtual_select, layout2->storage.u.virt.list[u].source_dset.virtual_select)) < 0) HGOTO_DONE(-1)
if((equal = H5S_SELECT_SHAPE_SAME(layout1->storage.u.virt.list[u].source_dset.virtual_select, layout2->storage.u.virt.list[u].source_dset.virtual_select)) < 0) HGOTO_DONE(-1)
if(!equal)
HGOTO_DONE(1)
@ -847,7 +847,7 @@ H5P__dcrt_layout_cmp(const void *_layout1, const void *_layout2,
if((equal = H5S_extent_equal(layout1->storage.u.virt.list[u].source_select, layout2->storage.u.virt.list[u].source_select)) < 0) HGOTO_DONE(-1)
if(!equal)
HGOTO_DONE(1)
if((equal = H5S_select_shape_same(layout1->storage.u.virt.list[u].source_select, layout2->storage.u.virt.list[u].source_select)) < 0) HGOTO_DONE(-1)
if((equal = H5S_SELECT_SHAPE_SAME(layout1->storage.u.virt.list[u].source_select, layout2->storage.u.virt.list[u].source_select)) < 0) HGOTO_DONE(-1)
if(!equal)
HGOTO_DONE(1)
} /* end for */

View File

@ -28,11 +28,11 @@
/***********/
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Iprivate.h" /* ID Functions */
#include "H5Spkg.h" /* Dataspace functions */
#include "H5VMprivate.h" /* Vector functions */
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Iprivate.h" /* ID Functions */
#include "H5Spkg.h" /* Dataspace functions */
#include "H5VMprivate.h" /* Vector functions */
/****************/
@ -63,6 +63,8 @@ static htri_t H5S__all_is_contiguous(const H5S_t *space);
static htri_t H5S__all_is_single(const H5S_t *space);
static htri_t H5S__all_is_regular(const H5S_t *space);
static htri_t H5S__all_shape_same(const H5S_t *space1, const H5S_t *space2);
static htri_t H5S__all_intersect_block(const H5S_t *space, const hsize_t *start,
const hsize_t *end);
static herr_t H5S__all_adjust_u(H5S_t *space, const hsize_t *offset);
static herr_t H5S__all_project_scalar(const H5S_t *space, hsize_t *offset);
static herr_t H5S__all_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
@ -108,6 +110,7 @@ const H5S_select_class_t H5S_sel_all[1] = {{
H5S__all_is_single,
H5S__all_is_regular,
H5S__all_shape_same,
H5S__all_intersect_block,
H5S__all_adjust_u,
H5S__all_project_scalar,
H5S__all_project_simple,
@ -973,6 +976,41 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S__all_shape_same() */
/*--------------------------------------------------------------------------
NAME
H5S__all_intersect_block
PURPOSE
Detect intersections of selection with block
USAGE
htri_t H5S__all_intersect_block(space, start, end)
const H5S_t *space; IN: Dataspace with selection to use
const hsize_t *start; IN: Starting coordinate for block
const hsize_t *end; IN: Ending coordinate for block
RETURNS
Non-negative TRUE / FALSE on success, negative on failure
DESCRIPTION
Quickly detect intersections with a block
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
htri_t
H5S__all_intersect_block(const H5S_t H5_ATTR_UNUSED *space,
const hsize_t H5_ATTR_UNUSED *start, const hsize_t H5_ATTR_UNUSED *end)
{
FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(space);
HDassert(H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space));
HDassert(start);
HDassert(end);
FUNC_LEAVE_NOAPI(TRUE)
} /* end H5S__all_intersect_block() */
/*--------------------------------------------------------------------------
NAME

View File

@ -28,30 +28,20 @@
/***********/
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5CXprivate.h" /* API Contexts */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* ID Functions */
#include "H5MMprivate.h" /* Memory management */
#include "H5Spkg.h" /* Dataspace functions */
#include "H5VMprivate.h" /* Vector functions */
#include "H5private.h" /* Generic Functions */
#include "H5CXprivate.h" /* API Contexts */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* ID Functions */
#include "H5MMprivate.h" /* Memory management */
#include "H5Spkg.h" /* Dataspace functions */
#include "H5VMprivate.h" /* Vector functions */
/****************/
/* Local Macros */
/****************/
/* Macro for checking if two ranges overlap one another */
/*
* Check for the inverse of whether the ranges are disjoint. If they are
* disjoint, then the low bound of one of the ranges must be greater than the
* high bound of the other.
*/
/* (Assumes that low & high bounds are _inclusive_) */
#define H5S_RANGE_OVERLAP(L1, H1, L2, H2) \
(!((L1) > (H2) || (L2) > (H1)))
/* Flags for which hyperslab fragments to compute */
#define H5S_HYPER_COMPUTE_B_NOT_A 0x01
#define H5S_HYPER_COMPUTE_A_AND_B 0x02
@ -197,6 +187,8 @@ static htri_t H5S__hyper_is_contiguous(const H5S_t *space);
static htri_t H5S__hyper_is_single(const H5S_t *space);
static htri_t H5S__hyper_is_regular(const H5S_t *space);
static htri_t H5S__hyper_shape_same(const H5S_t *space1, const H5S_t *space2);
static htri_t H5S__hyper_intersect_block(const H5S_t *space, const hsize_t *start,
const hsize_t *end);
static herr_t H5S__hyper_adjust_u(H5S_t *space, const hsize_t *offset);
static herr_t H5S__hyper_project_scalar(const H5S_t *space, hsize_t *offset);
static herr_t H5S__hyper_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
@ -242,6 +234,7 @@ const H5S_select_class_t H5S_sel_hyper[1] = {{
H5S__hyper_is_single,
H5S__hyper_is_regular,
H5S__hyper_shape_same,
H5S__hyper_intersect_block,
H5S__hyper_adjust_u,
H5S__hyper_project_scalar,
H5S__hyper_project_simple,
@ -4829,7 +4822,6 @@ static herr_t
H5S__hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
{
const hsize_t *low_bounds, *high_bounds; /* Pointers to the correct pair of low & high bounds */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@ -4849,22 +4841,32 @@ H5S__hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
high_bounds = space->select.sel_info.hslab->span_lst->high_bounds;
} /* end else */
/* Loop over dimensions */
for(u = 0; u < space->extent.rank; u++) {
/* Sanity check */
HDassert(low_bounds[u] <= high_bounds[u]);
/* Check for offset set */
if(space->select.offset_changed) {
unsigned u; /* Local index variable */
/* Check for offset moving selection negative */
if(((hssize_t)low_bounds[u] + space->select.offset[u]) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "offset moves selection out of bounds")
/* Loop over dimensions */
for(u = 0; u < space->extent.rank; u++) {
/* Sanity check */
HDassert(low_bounds[u] <= high_bounds[u]);
/* Set the low & high bounds in this dimension */
start[u] = (hsize_t)((hssize_t)low_bounds[u] + space->select.offset[u]);
if((int)u == space->select.sel_info.hslab->unlim_dim)
end[u] = H5S_UNLIMITED;
else
end[u] = (hsize_t)((hssize_t)high_bounds[u] + space->select.offset[u]);
} /* end for */
/* Check for offset moving selection negative */
if(((hssize_t)low_bounds[u] + space->select.offset[u]) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "offset moves selection out of bounds")
/* Set the low & high bounds in this dimension */
start[u] = (hsize_t)((hssize_t)low_bounds[u] + space->select.offset[u]);
if((int)u == space->select.sel_info.hslab->unlim_dim)
end[u] = H5S_UNLIMITED;
else
end[u] = (hsize_t)((hssize_t)high_bounds[u] + space->select.offset[u]);
} /* end for */
} /* end if */
else {
/* Offset vector is still zeros, just copy low & high bounds */
H5MM_memcpy(start, low_bounds, sizeof(hsize_t) * space->extent.rank);
H5MM_memcpy(end, high_bounds, sizeof(hsize_t) * space->extent.rank);
} /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
@ -6240,32 +6242,31 @@ done:
/*--------------------------------------------------------------------------
NAME
H5S_hyper_intersect_block
H5S__hyper_intersect_block
PURPOSE
Detect intersections in span trees
Detect intersections of selection with block
USAGE
htri_t H5S_hyper_intersect_block(space, start, end)
H5S_t *space; IN: First dataspace to operate on span tree
hssize_t *start; IN: Starting coordinate for block
hssize_t *end; IN: Ending coordinate for block
htri_t H5S__hyper_intersect_block(space, start, end)
const H5S_t *space; IN: Dataspace with selection to use
const hsize_t *start; IN: Starting coordinate for block
const hsize_t *end; IN: Ending coordinate for block
RETURNS
Non-negative on success, negative on failure
Non-negative TRUE / FALSE on success, negative on failure
DESCRIPTION
Quickly detect intersections between span tree and block
Quickly detect intersections between both regular hyperslabs and span trees
with a block
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
Does not use selection offset.
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
htri_t
H5S_hyper_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *end)
static htri_t
H5S__hyper_intersect_block(const H5S_t *space, const hsize_t *start, const hsize_t *end)
{
const hsize_t *low_bounds, *high_bounds; /* Pointers to the correct pair of low & high bounds */
unsigned u; /* Local index variable */
htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
FUNC_ENTER_STATIC
/* Sanity check */
HDassert(space);
@ -6277,27 +6278,12 @@ H5S_hyper_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *end
* to be impossible.
*/
if(space->select.sel_info.hslab->diminfo_valid == H5S_DIMINFO_VALID_NO)
H5S__hyper_rebuild(space);
/* Check which set of low & high bounds we should be using */
if(space->select.sel_info.hslab->diminfo_valid == H5S_DIMINFO_VALID_YES) {
low_bounds = space->select.sel_info.hslab->diminfo.low_bounds;
high_bounds = space->select.sel_info.hslab->diminfo.high_bounds;
} /* end if */
else {
low_bounds = space->select.sel_info.hslab->span_lst->low_bounds;
high_bounds = space->select.sel_info.hslab->span_lst->high_bounds;
} /* end else */
/* Loop over selection bounds and block, checking for overlap */
for(u = 0; u < space->extent.rank; u++)
/* If selection bounds & block don't overlap, can leave now */
if(!H5S_RANGE_OVERLAP(low_bounds[u], high_bounds[u], start[u], end[u]))
HGOTO_DONE(FALSE)
H5S__hyper_rebuild((H5S_t *)space); /* Casting away const OK -QAK */
/* Check for regular hyperslab intersection */
if(space->select.sel_info.hslab->diminfo_valid == H5S_DIMINFO_VALID_YES) {
hbool_t single_block; /* Whether the regular selection is a single block */
unsigned u; /* Local index variable */
/* Check for a single block */
/* For a regular hyperslab to be single, it must have only one block
@ -6381,7 +6367,7 @@ H5S_hyper_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *end
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_hyper_intersect_block() */
} /* end H5S__hyper_intersect_block() */
/*--------------------------------------------------------------------------

View File

@ -28,11 +28,11 @@
/***********/
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Iprivate.h" /* ID Functions */
#include "H5Spkg.h" /* Dataspace functions */
#include "H5VMprivate.h" /* Vector functions */
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Iprivate.h" /* ID Functions */
#include "H5Spkg.h" /* Dataspace functions */
#include "H5VMprivate.h" /* Vector functions */
/****************/
@ -63,9 +63,12 @@ static htri_t H5S__none_is_contiguous(const H5S_t *space);
static htri_t H5S__none_is_single(const H5S_t *space);
static htri_t H5S__none_is_regular(const H5S_t *space);
static htri_t H5S__none_shape_same(const H5S_t *space1, const H5S_t *space2);
static htri_t H5S__none_intersect_block(const H5S_t *space, const hsize_t *start,
const hsize_t *end);
static herr_t H5S__none_adjust_u(H5S_t *space, const hsize_t *offset);
static herr_t H5S__none_project_scalar(const H5S_t *space, hsize_t *offset);
static herr_t H5S__none_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
static herr_t H5S__none_project_simple(const H5S_t *space, H5S_t *new_space,
hsize_t *offset);
static herr_t H5S__none_iter_init(const H5S_t *space, H5S_sel_iter_t *iter);
/* Selection iteration callbacks */
@ -108,6 +111,7 @@ const H5S_select_class_t H5S_sel_none[1] = {{
H5S__none_is_single,
H5S__none_is_regular,
H5S__none_shape_same,
H5S__none_intersect_block,
H5S__none_adjust_u,
H5S__none_project_scalar,
H5S__none_project_simple,
@ -883,6 +887,41 @@ H5S__none_shape_same(const H5S_t H5_ATTR_UNUSED *space1,
FUNC_LEAVE_NOAPI(TRUE)
} /* end H5S__none_shape_same() */
/*--------------------------------------------------------------------------
NAME
H5S__none_intersect_block
PURPOSE
Detect intersections of selection with block
USAGE
htri_t H5S__none_intersect_block(space, start, end)
const H5S_t *space; IN: Dataspace with selection to use
const hsize_t *start; IN: Starting coordinate for block
const hsize_t *end; IN: Ending coordinate for block
RETURNS
Non-negative TRUE / FALSE on success, negative on failure
DESCRIPTION
Quickly detect intersections with a block
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
htri_t
H5S__none_intersect_block(const H5S_t H5_ATTR_UNUSED *space,
const hsize_t H5_ATTR_UNUSED *start, const hsize_t H5_ATTR_UNUSED *end)
{
FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(space);
HDassert(H5S_SEL_NONE == H5S_GET_SELECT_TYPE(space));
HDassert(start);
HDassert(end);
FUNC_LEAVE_NOAPI(FALSE)
} /* end H5S__none_intersect_block() */
/*--------------------------------------------------------------------------
NAME

View File

@ -91,6 +91,15 @@
* H5S_UNLIMITED) */
#define H5S_MAX_SIZE ((hsize_t)(hssize_t)(-2))
/* Macro for checking if two ranges overlap one another */
/*
* Check for the inverse of whether the ranges are disjoint. If they are
* disjoint, then the low bound of one of the ranges must be greater than the
* high bound of the other.
*/
/* (Assumes that low & high bounds are _inclusive_) */
#define H5S_RANGE_OVERLAP(L1, H1, L2, H2) (!((L1) > (H2) || (L2) > (H1)))
/*
* Dataspace extent information
@ -240,6 +249,8 @@ typedef htri_t (*H5S_sel_is_single_func_t)(const H5S_t *space);
typedef htri_t (*H5S_sel_is_regular_func_t)(const H5S_t *space);
/* Method to determine if two dataspaces' selections are the same shape */
typedef htri_t (*H5S_sel_shape_same_func_t)(const H5S_t *space1, const H5S_t *space2);
/* Method to determine if selection intersects a block */
typedef htri_t (*H5S_sel_intersect_block_func_t)(const H5S_t *space, const hsize_t *start, const hsize_t *end);
/* Method to adjust a selection by an offset */
typedef herr_t (*H5S_sel_adjust_u_func_t)(H5S_t *space, const hsize_t *offset);
/* Method to construct single element projection onto scalar dataspace */
@ -268,6 +279,7 @@ typedef struct {
H5S_sel_is_single_func_t is_single; /* Method to determine if current selection is a single block */
H5S_sel_is_regular_func_t is_regular; /* Method to determine if current selection is "regular" */
H5S_sel_shape_same_func_t shape_same; /* Method to determine if two dataspaces' selections are the same shape */
H5S_sel_intersect_block_func_t intersect_block; /* Method to determine if a dataspaces' selection intersects a block */
H5S_sel_adjust_u_func_t adjust_u; /* Method to adjust a selection by an offset */
H5S_sel_project_scalar project_scalar; /* Method to construct scalar dataspace projection */
H5S_sel_project_simple project_simple; /* Method to construct simple dataspace projection */
@ -369,7 +381,6 @@ H5_DLL herr_t H5S__hyper_project_intersection(const H5S_t *src_space,
/* Testing functions */
#ifdef H5S_TESTING
H5_DLL htri_t H5S__select_shape_same_test(hid_t sid1, hid_t sid2);
H5_DLL herr_t H5S__get_rebuild_status_test(hid_t space_id,
H5S_diminfo_valid_t *status1, H5S_diminfo_valid_t *status2);
H5_DLL herr_t H5S__get_diminfo_status_test(hid_t space_id,

View File

@ -28,14 +28,14 @@
/***********/
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5CXprivate.h" /* API Contexts */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* ID Functions */
#include "H5MMprivate.h" /* Memory management */
#include "H5Spkg.h" /* Dataspace functions */
#include "H5VMprivate.h" /* Vector functions */
#include "H5private.h" /* Generic Functions */
#include "H5CXprivate.h" /* API Contexts */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* ID Functions */
#include "H5MMprivate.h" /* Memory management */
#include "H5Spkg.h" /* Dataspace functions */
#include "H5VMprivate.h" /* Vector functions */
/****************/
@ -75,6 +75,8 @@ static htri_t H5S__point_is_contiguous(const H5S_t *space);
static htri_t H5S__point_is_single(const H5S_t *space);
static htri_t H5S__point_is_regular(const H5S_t *space);
static htri_t H5S__point_shape_same(const H5S_t *space1, const H5S_t *space2);
static htri_t H5S__point_intersect_block(const H5S_t *space, const hsize_t *start,
const hsize_t *end);
static herr_t H5S__point_adjust_u(H5S_t *space, const hsize_t *offset);
static herr_t H5S__point_project_scalar(const H5S_t *space, hsize_t *offset);
static herr_t H5S__point_project_simple(const H5S_t *space, H5S_t *new_space,
@ -124,6 +126,7 @@ const H5S_select_class_t H5S_sel_point[1] = {{
H5S__point_is_single,
H5S__point_is_regular,
H5S__point_shape_same,
H5S__point_intersect_block,
H5S__point_adjust_u,
H5S__point_project_scalar,
H5S__point_project_simple,
@ -1995,6 +1998,63 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S__point_shape_same() */
/*--------------------------------------------------------------------------
NAME
H5S__point_intersect_block
PURPOSE
Detect intersections of selection with block
USAGE
htri_t H5S__point_intersect_block(space, start, end)
const H5S_t *space; IN: Dataspace with selection to use
const hsize_t *start; IN: Starting coordinate for block
const hsize_t *end; IN: Ending coordinate for block
RETURNS
Non-negative TRUE / FALSE on success, negative on failure
DESCRIPTION
Quickly detect intersections with a block
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
htri_t
H5S__point_intersect_block(const H5S_t *space, const hsize_t *start,
const hsize_t *end)
{
H5S_pnt_node_t *pnt; /* Point information node */
htri_t ret_value = FALSE; /* Return value */
FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(space);
HDassert(H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(space));
HDassert(start);
HDassert(end);
/* Loop over points */
pnt = space->select.sel_info.pnt_lst->head;
while(pnt) {
unsigned u; /* Local index variable */
/* Verify that the point is within the block */
for(u = 0; u < space->extent.rank; u++)
if(pnt->pnt[u] < start[u] || pnt->pnt[u] > end[u])
break;
/* Check if point was within block for all dimensions */
if(u == space->extent.rank)
HGOTO_DONE(TRUE)
/* Advance to next point */
pnt = pnt->next;
} /* end while */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S__point_intersect_block() */
/*--------------------------------------------------------------------------
NAME

View File

@ -30,15 +30,6 @@
#include "H5Pprivate.h" /* Property lists */
#include "H5Tprivate.h" /* Datatypes */
/* Flags for H5S_find */
#define H5S_CONV_PAR_IO_POSSIBLE 0x0001
/* The storage options are mutually exclusive */
/* (2-bits reserved for storage type currently) */
#define H5S_CONV_STORAGE_COMPACT 0x0000 /* i.e. '0' */
#define H5S_CONV_STORAGE_CONTIGUOUS 0x0002 /* i.e. '1' */
#define H5S_CONV_STORAGE_CHUNKED 0x0004 /* i.e. '2' */
#define H5S_CONV_STORAGE_MASK 0x0006
/* Forward references of package typedefs */
typedef struct H5S_extent_t H5S_extent_t;
typedef struct H5S_pnt_node_t H5S_pnt_node_t;
@ -192,6 +183,8 @@ typedef struct H5S_sel_iter_op_t {
#endif /* H5S_MODULE */
/* Handle these callbacks in a special way, since they have prologs that need to be executed */
#define H5S_SELECT_COPY(DST,SRC,SHARE) (H5S_select_copy(DST,SRC,SHARE))
#define H5S_SELECT_SHAPE_SAME(S1,S2) (H5S_select_shape_same(S1,S2))
#define H5S_SELECT_INTERSECT_BLOCK(S,START,END) (H5S_select_intersect_block(S,START,END))
#define H5S_SELECT_RELEASE(S) (H5S_select_release(S))
#define H5S_SELECT_DESERIALIZE(S,BUF) (H5S_select_deserialize(S,BUF))
@ -252,6 +245,8 @@ H5_DLL herr_t H5S_get_select_num_elem_non_unlim(const H5S_t *space,
H5_DLL herr_t H5S_select_offset(H5S_t *space, const hssize_t *offset);
H5_DLL herr_t H5S_select_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection);
H5_DLL htri_t H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2);
H5_DLL htri_t H5S_select_intersect_block(const H5S_t *space, const hsize_t *start,
const hsize_t *end);
H5_DLL herr_t H5S_select_construct_projection(const H5S_t *base_space,
H5S_t **new_space_ptr, unsigned new_space_rank, const void *buf,
void const **adj_buf_ptr, hsize_t element_size);
@ -287,7 +282,6 @@ H5_DLL herr_t H5S_combine_hyperslab(H5S_t *old_space, H5S_seloper_t op,
const hsize_t *block, H5S_t **new_space);
H5_DLL herr_t H5S_hyper_add_span_element(H5S_t *space, unsigned rank,
const hsize_t *coords);
H5_DLL htri_t H5S_hyper_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *end);
H5_DLL herr_t H5S_hyper_adjust_s(H5S_t *space, const hssize_t *offset);
H5_DLL htri_t H5S_hyper_normalize_offset(H5S_t *space, hssize_t *old_offset);
H5_DLL herr_t H5S_hyper_denormalize_offset(H5S_t *space, const hssize_t *old_offset);

View File

@ -145,6 +145,9 @@ H5_DLL herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id);
H5_DLL htri_t H5Sselect_valid(hid_t spaceid);
H5_DLL herr_t H5Sget_select_bounds(hid_t spaceid, hsize_t start[],
hsize_t end[]);
H5_DLL htri_t H5Sselect_shape_same(hid_t space1_id, hid_t space2_id);
H5_DLL htri_t H5Sselect_intersect_block(hid_t space_id, const hsize_t *start,
const hsize_t *end);
H5_DLL herr_t H5Soffset_simple(hid_t space_id, const hssize_t *offset);
H5_DLL herr_t H5Sselect_all(hid_t spaceid);
H5_DLL herr_t H5Sselect_none(hid_t spaceid);

View File

@ -250,11 +250,15 @@ H5S_select_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection)
HDassert(dst);
HDassert(src);
/* Release the current selection */
if(H5S_SELECT_RELEASE(dst) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection")
/* Copy regular fields */
dst->select = src->select;
/* Perform correct type of copy based on the type of selection */
if((ret_value = (*src->select.type->copy)(dst,src,share_selection)) < 0)
if((ret_value = (*src->select.type->copy)(dst, src, share_selection)) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy selection specific information")
done:
@ -281,7 +285,7 @@ done:
herr_t
H5S_select_release(H5S_t *ds)
{
herr_t ret_value = FAIL; /* Return value */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@ -1689,9 +1693,12 @@ H5S_get_select_type(const H5S_t *space)
DESCRIPTION
Checks to see if the current selection in the dataspaces are the same
dimensionality and shape.
This is primarily used for reading the entire selection in one swoop.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
This routine participates in the "Inlining C function pointers" pattern,
don't call it directly, use the appropriate macro defined in H5Sprivate.h.
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
@ -1942,6 +1949,163 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_select_shape_same() */
/*--------------------------------------------------------------------------
NAME
H5Sselect_shape_same
PURPOSE
Check if two selections are the same shape
USAGE
htri_t H5Sselect_shape_same(space1_id, space2_id)
hid_t space1_id; IN: ID of 1st Dataspace pointer to compare
hid_t space2_id; IN: ID of 2nd Dataspace pointer to compare
RETURNS
TRUE/FALSE/FAIL
DESCRIPTION
Checks to see if the current selection in the dataspaces are the same
dimensionality and shape.
This is primarily used for reading the entire selection in one swoop.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
htri_t
H5Sselect_shape_same(hid_t space1_id, hid_t space2_id)
{
H5S_t *space1, *space2; /* Dataspaces to compare */
htri_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("t", "ii", space1_id, space2_id);
if(NULL == (space1 = (H5S_t *)H5I_object_verify(space1_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "not a dataspace")
if(NULL == (space2 = (H5S_t *)H5I_object_verify(space2_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "not a dataspace")
if((ret_value = H5S_select_shape_same(space1, space2)) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOMPARE, FAIL, "can't compare selections")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Sselect_shape_same() */
/*--------------------------------------------------------------------------
NAME
H5S_select_intersect_block
PURPOSE
Check if current selection intersects with a block
USAGE
htri_t H5S_select_intersect_block(space, start, end)
const H5S_t *space; IN: Dataspace to compare
const hsize_t *start; IN: Starting coordinate of block
const hsize_t *end; IN: Opposite ("ending") coordinate of block
RETURNS
TRUE / FALSE / FAIL
DESCRIPTION
Checks to see if the current selection in the dataspace intersects with
the block given.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
Assumes that start & end block bounds are _inclusive_, so start == end
value OK.
This routine participates in the "Inlining C function pointers" pattern,
don't call it directly, use the appropriate macro defined in H5Sprivate.h.
--------------------------------------------------------------------------*/
htri_t
H5S_select_intersect_block(const H5S_t *space, const hsize_t *start,
const hsize_t *end)
{
htri_t ret_value = TRUE; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
HDassert(space);
HDassert(start);
HDassert(end);
/* If selections aren't "none", compare their bounds */
if(H5S_SEL_NONE != H5S_GET_SELECT_TYPE(space)) {
hsize_t low[H5S_MAX_RANK]; /* Low bound of selection in dataspace */
hsize_t high[H5S_MAX_RANK]; /* High bound of selection in dataspace */
unsigned u; /* Local index variable */
/* Get low & high bounds for dataspace selection */
if(H5S_SELECT_BOUNDS(space, low, high) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds for dataspace")
/* Loop over selection bounds and block, checking for overlap */
for(u = 0; u < space->extent.rank; u++)
/* If selection bounds & block don't overlap, can leave now */
if(!H5S_RANGE_OVERLAP(low[u], high[u], start[u], end[u]))
HGOTO_DONE(FALSE)
} /* end if */
/* Call selection type's intersect routine */
if((ret_value = (*space->select.type->intersect_block)(space, start, end)) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOMPARE, FAIL, "can't intersect block with selection")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_select_intersect_block() */
/*--------------------------------------------------------------------------
NAME
H5Sselect_intersect_block
PURPOSE
Check if current selection intersects with a block
USAGE
htri_t H5Sselect_intersect_block(space_id, start, end)
hid_t space1_id; IN: ID of dataspace pointer to compare
const hsize_t *start; IN: Starting coordinate of block
const hsize_t *end; IN: Opposite ("ending") coordinate of block
RETURNS
TRUE / FALSE / FAIL
DESCRIPTION
Checks to see if the current selection in the dataspace intersects with
the block given.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
Assumes that start & end block bounds are _inclusive_, so start == end
value OK.
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
htri_t
H5Sselect_intersect_block(hid_t space_id, const hsize_t *start, const hsize_t *end)
{
H5S_t *space; /* Dataspace to query */
unsigned u; /* Local index value */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
/* Check arguments */
if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "not a dataspace")
if(NULL == start)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "block start array pointer is NULL")
if(NULL == end)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "block end array pointer is NULL")
/* Range check start & end values */
for(u = 0; u < space->extent.rank; u++)
if(start[u] > end[u])
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "block start[%u] (%llu) > end[%u] (%llu)", u, (unsigned long long)start[u], u, (unsigned long long)end[u])
/* Call internal routine to do comparison */
if((ret_value = H5S_select_intersect_block(space, start, end)) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOMPARE, FAIL, "can't compare selection and block")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Sselect_intersect_block() */
/*--------------------------------------------------------------------------
NAME

View File

@ -63,50 +63,6 @@
/*******************/
/*--------------------------------------------------------------------------
NAME
H5S__select_shape_same_test
PURPOSE
Determine if two dataspace selections are the same shape
USAGE
htri_t H5S__select_shape_same_test(sid1, sid2)
hid_t sid1; IN: 1st dataspace to compare
hid_t sid2; IN: 2nd dataspace to compare
RETURNS
Non-negative TRUE/FALSE on success, negative on failure
DESCRIPTION
Checks to see if the current selection in the dataspaces are the same
dimensionality and shape.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
htri_t
H5S__select_shape_same_test(hid_t sid1, hid_t sid2)
{
H5S_t *space1; /* Pointer to 1st dataspace */
H5S_t *space2; /* Pointer to 2nd dataspace */
htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_PACKAGE
/* Get dataspace structures */
if(NULL == (space1 = (H5S_t *)H5I_object_verify(sid1, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
if(NULL == (space2 = (H5S_t *)H5I_object_verify(sid2, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Check if the dataspace selections are the same shape */
if((ret_value = H5S_select_shape_same(space1, space2)) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOMPARE, FAIL, "unable to compare dataspace selections")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5S__select_shape_same_test() */
/*--------------------------------------------------------------------------
NAME

View File

@ -284,8 +284,6 @@ addr_reset(void)
* Programmer: Peter Cao
* Friday, August 4, 2006
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static herr_t
@ -345,8 +343,6 @@ error:
* Programmer: Peter Cao
* Monday, March 5, 2006
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static herr_t
@ -422,8 +418,6 @@ error:
* Programmer: Peter Cao
* Friday, August 4, 2006
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static herr_t
@ -517,8 +511,6 @@ error:
* Programmer: Peter Cao
* Saturday, December 17, 2005
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static int
@ -579,8 +571,6 @@ done:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static int
@ -856,10 +846,6 @@ error:
* Note: This isn't very general, the attributes are assumed to be
* those written in test_copy_attach_attributes().
*
* Modifier: Peter Cao
* Wednesday, March 21, 2007
* Change to compare any attributes of two objects
*
*-------------------------------------------------------------------------
*/
static int
@ -1167,7 +1153,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
if((obj2_sid = H5Rget_region(parent2, H5R_DATASET_REGION, ref_buf2)) < 0) TEST_ERROR
/* Check if dataspaces are the same shape */
if(H5S__select_shape_same_test(obj1_sid, obj2_sid) < 0) TEST_ERROR
if(H5Sselect_shape_same(obj1_sid, obj2_sid) < 0) TEST_ERROR
/* Close dataspaces */
if(H5Sclose(obj1_sid) < 0) TEST_ERROR
@ -1213,8 +1199,8 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf)
hssize_t nelmts; /* # of elements in dataspace */
void *rbuf = NULL; /* Buffer for reading raw data */
void *rbuf2 = NULL; /* Buffer for reading raw data */
H5D_space_status_t space_status; /* Dataset's raw data space status */
H5D_space_status_t space_status2; /* Dataset's raw data space status */
H5D_space_status_t space_status; /* Dataset's raw dataspace status */
H5D_space_status_t space_status2; /* Dataset's raw dataspace status */
/* Check the datatypes are equal */
@ -1569,8 +1555,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static int
@ -1858,8 +1842,6 @@ error:
* Programmer: Neil
* Friday, March 11, 2011
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static int
@ -1999,8 +1981,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static int
@ -2294,8 +2274,6 @@ error:
* Programmer: Neil Fortner
* Thursday, January 15, 2009
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static int
@ -2519,8 +2497,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static int
@ -2651,8 +2627,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static int
@ -4396,8 +4370,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static int
@ -6281,8 +6253,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static int
@ -6376,8 +6346,6 @@ error:
* Programmer: Peter Cao
* August 8, 2006
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static int
@ -6509,8 +6477,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static int
@ -7024,12 +6990,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
* Modifications:
* Neil Fortner
* Tuesday, February 16, 2010
* Modified test to test flags for expanding soft and external
* links.
*
*-------------------------------------------------------------------------
*/
static int
@ -8017,7 +7977,7 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* make a copy of the datatype for later use */
if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR
/* named data type */
/* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create and set compact plist */
@ -8171,7 +8131,7 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* make a copy of the datatype for later use */
if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR
/* named data type */
/* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@ -8326,7 +8286,7 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* make a copy of the datatype for later use */
if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR
/* named data type */
/* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create and set chunk plist */
@ -8487,7 +8447,7 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_
/* make a copy of the datatype for later use */
if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR
/* named data type */
/* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create and set chunk plist */
@ -10289,7 +10249,7 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* committed data type */
/* committed datatype */
if((H5Tcommit2(fid_src1, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@ -10313,7 +10273,7 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* committed data type */
/* committed datatype */
if((H5Tcommit2(fid_src2, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@ -10524,7 +10484,7 @@ test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, hbool_t reo
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* committed data type */
/* committed datatype */
if((H5Tcommit2(fid, NAME_GROUP_TOP "/" NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset */
@ -10551,7 +10511,7 @@ test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, hbool_t reo
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* committed data type */
/* committed datatype */
if((H5Tcommit2(fid, NAME_GROUP_TOP2 "/" NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset */
@ -10796,7 +10756,7 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* committed data type */
/* committed datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@ -10823,7 +10783,7 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* committed data type "a" */
/* committed datatype "a" */
if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@ -10832,7 +10792,7 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* committed data type "b" */
/* committed datatype "b" */
if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@ -11027,7 +10987,7 @@ test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* committed data type */
/* committed datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@ -11057,7 +11017,7 @@ test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* create anonymous committed data type */
/* create anonymous committed datatype */
if((H5Tcommit_anon(fid_dst, tid, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create attribute at SRC file */
@ -12817,7 +12777,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* named data type */
/* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@ -12847,7 +12807,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* committed data type "a" */
/* committed datatype "a" */
if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@ -12856,7 +12816,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* committed data type "b" */
/* committed datatype "b" */
if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@ -13176,7 +13136,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* committed data type */
/* committed datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@ -13206,7 +13166,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* committed data type "a" */
/* committed datatype "a" */
if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@ -13215,7 +13175,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
/* committed data type "b" */
/* committed datatype "b" */
if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@ -13499,8 +13459,6 @@ error:
* Programmer: Peter Cao
* March 11, 2006
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static int
@ -13817,8 +13775,6 @@ error:
* Programmer: Vailin Choi
* Feb 7, 2012
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static int
@ -14138,8 +14094,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
int

View File

@ -187,7 +187,7 @@ test_h5s_basic(void)
CHECK(ret, FAIL, "H5Sclose");
/*
* Check to be sure we can't create a simple data space that has too many
* Check to be sure we can't create a simple dataspace that has too many
* dimensions.
*/
H5E_BEGIN_TRY {
@ -318,7 +318,7 @@ test_h5s_basic(void)
/****************************************************************
**
** test_h5s_null(): Test NULL data space
** test_h5s_null(): Test NULL dataspace
**
****************************************************************/
static void
@ -460,7 +460,7 @@ test_h5s_null(void)
CHECK(ret, FAIL, "H5Fclose");
/*============================================
* Reopen the file to check the data space
* Reopen the file to check the dataspace
*============================================
*/
fid = H5Fopen(NULLFILE, H5F_ACC_RDONLY, H5P_DEFAULT);
@ -1078,7 +1078,7 @@ test_h5s_zero_dim(void)
CHECK(ret, FAIL, "H5Fclose");
/*============================================
* Reopen the file to check the data space
* Reopen the file to check the dataspace
*============================================
*/
fid1 = H5Fopen(ZEROFILE, H5F_ACC_RDONLY, H5P_DEFAULT);
@ -1227,7 +1227,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high)
ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Encode simple data space in a buffer with the fapl setting */
/* Encode simple dataspace in a buffer with the fapl setting */
ret = H5Sencode2(sid1, NULL, &sbuf_size, fapl);
CHECK(ret, FAIL, "H5Sencode2");
@ -1242,7 +1242,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high)
} H5E_END_TRY;
VERIFY(ret_id, FAIL, "H5Sdecode");
/* Encode the simple data space in a buffer with the fapl setting */
/* Encode the simple dataspace in a buffer with the fapl setting */
ret = H5Sencode2(sid1, sbuf, &sbuf_size, fapl);
CHECK(ret, FAIL, "H5Sencode");
@ -1289,7 +1289,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high)
sid2 = H5Screate(H5S_NULL);
CHECK(sid2, FAIL, "H5Screate");
/* Encode null data space in a buffer */
/* Encode null dataspace in a buffer */
ret = H5Sencode2(sid2, NULL, &null_size, fapl);
CHECK(ret, FAIL, "H5Sencode");
@ -1298,7 +1298,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high)
CHECK(null_sbuf, NULL, "HDcalloc");
}
/* Encode the null data space in the buffer */
/* Encode the null dataspace in the buffer */
ret = H5Sencode2(sid2, null_sbuf, &null_size, fapl);
CHECK(ret, FAIL, "H5Sencode2");
@ -1325,7 +1325,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high)
sid3 = H5Screate(H5S_SCALAR);
CHECK(sid3, FAIL, "H5Screate_simple");
/* Encode scalar data space in a buffer */
/* Encode scalar dataspace in a buffer */
ret = H5Sencode2(sid3, NULL, &scalar_size, fapl);
CHECK(ret, FAIL, "H5Sencode");
@ -1334,7 +1334,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high)
CHECK(scalar_buf, NULL, "HDcalloc");
}
/* Encode the scalar data space in the buffer */
/* Encode the scalar dataspace in the buffer */
ret = H5Sencode2(sid3, scalar_buf, &scalar_size, fapl);
CHECK(ret, FAIL, "H5Sencode2");
@ -1419,7 +1419,7 @@ test_h5s_encode1(void)
ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Encode simple data space in a buffer with the fapl setting */
/* Encode simple dataspace in a buffer with the fapl setting */
ret = H5Sencode1(sid1, NULL, &sbuf_size);
CHECK(ret, FAIL, "H5Sencode2");
@ -1434,7 +1434,7 @@ test_h5s_encode1(void)
} H5E_END_TRY;
VERIFY(ret_id, FAIL, "H5Sdecode");
/* Encode the simple data space in a buffer */
/* Encode the simple dataspace in a buffer */
ret = H5Sencode1(sid1, sbuf, &sbuf_size);
CHECK(ret, FAIL, "H5Sencode");
@ -1481,7 +1481,7 @@ test_h5s_encode1(void)
sid2 = H5Screate(H5S_NULL);
CHECK(sid2, FAIL, "H5Screate");
/* Encode null data space in a buffer */
/* Encode null dataspace in a buffer */
ret = H5Sencode1(sid2, NULL, &null_size);
CHECK(ret, FAIL, "H5Sencode");
@ -1490,7 +1490,7 @@ test_h5s_encode1(void)
CHECK(null_sbuf, NULL, "HDcalloc");
}
/* Encode the null data space in the buffer */
/* Encode the null dataspace in the buffer */
ret = H5Sencode1(sid2, null_sbuf, &null_size);
CHECK(ret, FAIL, "H5Sencode2");
@ -1515,9 +1515,9 @@ test_h5s_encode1(void)
*/
/* Create scalar dataspace */
sid3 = H5Screate(H5S_SCALAR);
CHECK(sid3, FAIL, "H5Screate_simple");
CHECK(sid3, FAIL, "H5Screate");
/* Encode scalar data space in a buffer */
/* Encode scalar dataspace in a buffer */
ret = H5Sencode1(sid3, NULL, &scalar_size);
CHECK(ret, FAIL, "H5Sencode");
@ -1526,7 +1526,7 @@ test_h5s_encode1(void)
CHECK(scalar_buf, NULL, "HDcalloc");
}
/* Encode the scalar data space in the buffer */
/* Encode the scalar dataspace in the buffer */
ret = H5Sencode1(sid3, scalar_buf, &scalar_size);
CHECK(ret, FAIL, "H5Sencode2");
@ -1622,8 +1622,8 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid,
VERIFY(H5Sget_select_npoints(in_sid), H5Sget_select_npoints(d_sid), "Compare npoints");
/* Verify if the two dataspace selections (in_sid, d_sid) are the same shape */
check = H5S__select_shape_same_test(in_sid, d_sid);
VERIFY(check, TRUE, "H5S__select_shape_same_test");
check = H5Sselect_shape_same(in_sid, d_sid);
VERIFY(check, TRUE, "H5Sselect_shape_same");
/* Compare the starting/ending coordinates of the bounding box for in_sid and d_sid */
ret = H5Sget_select_bounds(in_sid, in_low_bounds, in_high_bounds);
@ -2127,7 +2127,7 @@ test_h5s_encode_length(void)
ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, &start, &stride, &count, &block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Encode simple data space in a buffer */
/* Encode simple dataspace in a buffer */
ret = H5Sencode2(sid, NULL, &sbuf_size, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Sencode");
@ -2493,7 +2493,7 @@ test_h5s_chunk(void)
status = H5Pset_chunk(plist_id, 2, csize);
CHECK(status, FAIL, "H5Pset_chunk");
/* Create the data space */
/* Create the dataspace */
dims[0] = 50000;
dims[1] = 3;
space_id = H5Screate_simple(2, dims, NULL);

File diff suppressed because it is too large Load Diff

View File

@ -110,10 +110,6 @@ struct hs_dr_pio_test_vars_t
*
* Programmer: JRM -- 8/9/11
*
* Modifications:
*
* None.
*
*-------------------------------------------------------------------------
*/
@ -573,7 +569,7 @@ hs_dr_pio_test__setup(const int test_num,
tv_ptr->block);
VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_sid_0, set) suceeded");
/* In passing, setup the process slice data spaces as well */
/* In passing, setup the process slice dataspaces as well */
ret = H5Sselect_hyperslab(tv_ptr->mem_large_ds_process_slice_sid,
H5S_SELECT_SET,
@ -685,10 +681,6 @@ hs_dr_pio_test__setup(const int test_num,
*
* Programmer: JRM -- 9/18/09
*
* Modifications:
*
* None.
*
*-------------------------------------------------------------------------
*/
@ -791,22 +783,18 @@ hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr)
* selections of different rank in the parallel.
*
* Verify that we can read from disk correctly using
* selections of different rank that H5S_select_shape_same()
* selections of different rank that H5Sselect_shape_same()
* views as being of the same shape.
*
* In this function, we test this by reading small_rank - 1
* slices from the on disk large cube, and verifying that the
* data read is correct. Verify that H5S_select_shape_same()
* data read is correct. Verify that H5Sselect_shape_same()
* returns true on the memory and file selections.
*
* Return: void
*
* Programmer: JRM -- 9/10/11
*
* Modifications:
*
* None.
*
*-------------------------------------------------------------------------
*/
@ -831,7 +819,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
mpi_rank = tv_ptr->mpi_rank;
/* We have already done a H5Sselect_all() on the data space
/* We have already done a H5Sselect_all() on the dataspace
* small_ds_slice_sid in the initialization phase, so no need to
* call H5Sselect_all() again.
*/
@ -945,12 +933,11 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
"H5Sselect_hyperslab(file_large_cube_sid) succeeded");
/* verify that H5S_select_shape_same() reports the two
/* verify that H5Sselect_shape_same() reports the two
* selections as having the same shape.
*/
check = H5S__select_shape_same_test(tv_ptr->small_ds_slice_sid,
tv_ptr->file_large_ds_sid_0);
VRFY((check == TRUE), "H5S__select_shape_same_test passed");
check = H5Sselect_shape_same(tv_ptr->small_ds_slice_sid, tv_ptr->file_large_ds_sid_0);
VRFY((check == TRUE), "H5Sselect_shape_same passed");
/* Read selection from disk */
@ -1032,7 +1019,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
* selections of different rank in the parallel.
*
* Verify that we can read from disk correctly using
* selections of different rank that H5S_select_shape_same()
* selections of different rank that H5Sselect_shape_same()
* views as being of the same shape.
*
* In this function, we test this by reading slices of the
@ -1044,10 +1031,6 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
*
* Programmer: JRM -- 8/10/11
*
* Modifications:
*
* None.
*
*-------------------------------------------------------------------------
*/
@ -1213,12 +1196,11 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
"H5Sselect_hyperslab(mem_large_ds_sid) succeeded");
/* verify that H5S_select_shape_same() reports the two
/* verify that H5Sselect_shape_same() reports the two
* selections as having the same shape.
*/
check = H5S__select_shape_same_test(tv_ptr->file_small_ds_sid_0,
tv_ptr->mem_large_ds_sid);
VRFY((check == TRUE), "H5S__select_shape_same_test passed");
check = H5Sselect_shape_same(tv_ptr->file_small_ds_sid_0, tv_ptr->mem_large_ds_sid);
VRFY((check == TRUE), "H5Sselect_shape_same passed");
/* Read selection from disk */
@ -1315,24 +1297,20 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
* selections of different rank in the parallel.
*
* Verify that we can write from memory to file using
* selections of different rank that H5S_select_shape_same()
* selections of different rank that H5Sselect_shape_same()
* views as being of the same shape.
*
* Do this by writing small_rank - 1 dimensional slices from
* the in memory large data set to the on disk small cube
* dataset. After each write, read the slice of the small
* dataset back from disk, and verify that it contains
* the expected data. Verify that H5S_select_shape_same()
* the expected data. Verify that H5Sselect_shape_same()
* returns true on the memory and file selections.
*
* Return: void
*
* Programmer: JRM -- 8/10/11
*
* Modifications:
*
* None.
*
*-------------------------------------------------------------------------
*/
@ -1361,12 +1339,12 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/* now we go in the opposite direction, verifying that we can write
* from memory to file using selections of different rank that
* H5S_select_shape_same() views as being of the same shape.
* H5Sselect_shape_same() views as being of the same shape.
*
* Start by writing small_rank - 1 dimensional slices from the in memory large
* data set to the on disk small cube dataset. After each write, read the
* slice of the small dataset back from disk, and verify that it contains
* the expected data. Verify that H5S_select_shape_same() returns true on
* the expected data. Verify that H5Sselect_shape_same() returns true on
* the memory and file selections.
*/
@ -1527,13 +1505,12 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
"H5Sselect_hyperslab() mem_large_ds_sid succeeded.");
/* verify that H5S_select_shape_same() reports the in
/* verify that H5Sselect_shape_same() reports the in
* memory slice through the cube selection and the
* on disk full square selections as having the same shape.
*/
check = H5S__select_shape_same_test(tv_ptr->file_small_ds_sid_0,
tv_ptr->mem_large_ds_sid);
VRFY((check == TRUE), "H5S__select_shape_same_test passed.");
check = H5Sselect_shape_same(tv_ptr->file_small_ds_sid_0, tv_ptr->mem_large_ds_sid);
VRFY((check == TRUE), "H5Sselect_shape_same passed.");
/* write the slice from the in memory large data set to the
@ -1643,7 +1620,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
* selections of different rank in the parallel.
*
* Verify that we can write from memory to file using
* selections of different rank that H5S_select_shape_same()
* selections of different rank that H5Sselect_shape_same()
* views as being of the same shape.
*
* Do this by writing the contents of the process's slice of
@ -1652,17 +1629,13 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
* slice of the large data set back into memory, and verify
* that it contains the expected data.
*
* Verify that H5S_select_shape_same() returns true on the
* Verify that H5Sselect_shape_same() returns true on the
* memory and file selections.
*
* Return: void
*
* Programmer: JRM -- 8/10/11
*
* Modifications:
*
* None
*
*-------------------------------------------------------------------------
*/
@ -1692,7 +1665,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
* small data set to slices of the on disk large data set. After
* each write, read the process's slice of the large data set back
* into memory, and verify that it contains the expected data.
* Verify that H5S_select_shape_same() returns true on the memory
* Verify that H5Sselect_shape_same() returns true on the memory
* and file selections.
*/
@ -1859,14 +1832,13 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
"H5Sselect_hyperslab() target large ds slice succeeded");
/* verify that H5S_select_shape_same() reports the in
/* verify that H5Sselect_shape_same() reports the in
* memory small data set slice selection and the
* on disk slice through the large data set selection
* as having the same shape.
*/
check = H5S__select_shape_same_test(tv_ptr->mem_small_ds_sid,
tv_ptr->file_large_ds_sid_0);
VRFY((check == TRUE), "H5S__select_shape_same_test passed");
check = H5Sselect_shape_same(tv_ptr->mem_small_ds_sid, tv_ptr->file_large_ds_sid_0);
VRFY((check == TRUE), "H5Sselect_shape_same passed");
/* write the small data set slice from memory to the
@ -1986,21 +1958,6 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
*
* Programmer: JRM -- 9/18/09
*
* Modifications:
*
* JRM -- 9/16/10
* Added express_test parameter. Use it to control whether
* we set up the chunks so that no chunk is shared between
* processes, and also whether we set an alignment when we
* create the test file.
*
* JRM -- 8/11/11
* Refactored function heavily & broke it into six functions.
* Added the skips_ptr, max_skips, total_tests_ptr,
* tests_run_ptr, and tests_skiped_ptr parameters to support
* skipping portions of the test according to the express
* test value.
*
*-------------------------------------------------------------------------
*/
@ -2108,12 +2065,12 @@ contig_hs_dr_pio_test__run_test(const int test_num,
#endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */
/* first, verify that we can read from disk correctly using selections
* of different rank that H5S_select_shape_same() views as being of the
* of different rank that H5Sselect_shape_same() views as being of the
* same shape.
*
* Start by reading small_rank - 1 dimensional slice from the on disk
* large cube, and verifying that the data read is correct. Verify that
* H5S_select_shape_same() returns true on the memory and file selections.
* H5Sselect_shape_same() returns true on the memory and file selections.
*/
#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
@ -2139,12 +2096,12 @@ contig_hs_dr_pio_test__run_test(const int test_num,
/* now we go in the opposite direction, verifying that we can write
* from memory to file using selections of different rank that
* H5S_select_shape_same() views as being of the same shape.
* H5Sselect_shape_same() views as being of the same shape.
*
* Start by writing small_rank - 1 D slices from the in memory large data
* set to the on disk small cube dataset. After each write, read the
* slice of the small dataset back from disk, and verify that it contains
* the expected data. Verify that H5S_select_shape_same() returns true on
* the expected data. Verify that H5Sselect_shape_same() returns true on
* the memory and file selections.
*/
@ -2160,7 +2117,7 @@ contig_hs_dr_pio_test__run_test(const int test_num,
* small data set to slices of the on disk large data set. After
* each write, read the process's slice of the large data set back
* into memory, and verify that it contains the expected data.
* Verify that H5S_select_shape_same() returns true on the memory
* Verify that H5Sselect_shape_same() returns true on the memory
* and file selections.
*/
@ -2208,20 +2165,6 @@ contig_hs_dr_pio_test__run_test(const int test_num,
*
* Programmer: JRM -- 9/18/09
*
* Modifications:
*
* Modified function to take a sample of the run times
* of the different tests, and skip some of them if
* run times are too long.
*
* We need to do this because Lustre runns very slowly
* if two or more processes are banging on the same
* block of memory.
* JRM -- 9/10/10
* Break this one big test into 4 smaller tests according
* to {independent,collective}x{contigous,chunked} datasets.
* AKC -- 2010/01/14
*
*-------------------------------------------------------------------------
*/
@ -2395,18 +2338,18 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
/****************************************************************
**
** ckrbrd_hs_dr_pio_test__slct_ckrbrd():
** Given a data space of tgt_rank, and dimensions:
** Given a dataspace of tgt_rank, and dimensions:
**
** (mpi_size + 1), edge_size, ... , edge_size
**
** edge_size, and a checker_edge_size, select a checker
** board selection of a sel_rank (sel_rank < tgt_rank)
** dimensional slice through the data space parallel to the
** dimensional slice through the dataspace parallel to the
** sel_rank fastest changing indicies, with origin (in the
** higher indicies) as indicated by the start array.
**
** Note that this function, like all its relatives, is
** hard coded to presume a maximum data space rank of 5.
** hard coded to presume a maximum dataspace rank of 5.
** While this maximum is declared as a constant, increasing
** it will require extensive coding in addition to changing
** the value of the constant.
@ -2707,7 +2650,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid));
#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */
/* Clip the selection back to the data space proper. */
/* Clip the selection back to the dataspace proper. */
for ( i = 0; i < test_max_rank; i++ ) {
@ -2956,22 +2899,18 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
*
* Verify that we can read from disk correctly using checker
* board selections of different rank that
* H5S_select_shape_same() views as being of the same shape.
* H5Sselect_shape_same() views as being of the same shape.
*
* In this function, we test this by reading small_rank - 1
* In this function, we test this by reading small_rank - 1
* checker board slices from the on disk large cube, and
* verifying that the data read is correct. Verify that
* H5S_select_shape_same() returns true on the memory and
* H5Sselect_shape_same() returns true on the memory and
* file selections.
*
* Return: void
*
* Programmer: JRM -- 9/15/11
*
* Modifications:
*
* None.
*
*-------------------------------------------------------------------------
*/
@ -2997,12 +2936,12 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/* first, verify that we can read from disk correctly using selections
* of different rank that H5S_select_shape_same() views as being of the
* of different rank that H5Sselect_shape_same() views as being of the
* same shape.
*
* Start by reading a (small_rank - 1)-D checker board slice from this
* processes slice of the on disk large data set, and verifying that the
* data read is correct. Verify that H5S_select_shape_same() returns
* data read is correct. Verify that H5Sselect_shape_same() returns
* true on the memory and file selections.
*
* The first step is to set up the needed checker board selection in the
@ -3146,12 +3085,11 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->start
);
/* verify that H5S_select_shape_same() reports the two
/* verify that H5Sselect_shape_same() reports the two
* selections as having the same shape.
*/
check = H5S__select_shape_same_test(tv_ptr->small_ds_slice_sid,
tv_ptr->file_large_ds_sid_0);
VRFY((check == TRUE), "H5S__select_shape_same_test passed");
check = H5Sselect_shape_same(tv_ptr->small_ds_slice_sid, tv_ptr->file_large_ds_sid_0);
VRFY((check == TRUE), "H5Sselect_shape_same passed");
/* Read selection from disk */
@ -3231,7 +3169,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
* selections of different rank in the parallel.
*
* Verify that we can read from disk correctly using
* selections of different rank that H5S_select_shape_same()
* selections of different rank that H5Sselect_shape_same()
* views as being of the same shape.
*
* In this function, we test this by reading checker board
@ -3243,10 +3181,6 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
*
* Programmer: JRM -- 8/15/11
*
* Modifications:
*
* None.
*
*-------------------------------------------------------------------------
*/
@ -3412,12 +3346,11 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
);
/* verify that H5S_select_shape_same() reports the two
/* verify that H5Sselect_shape_same() reports the two
* selections as having the same shape.
*/
check = H5S__select_shape_same_test(tv_ptr->file_small_ds_sid_0,
tv_ptr->mem_large_ds_sid);
VRFY((check == TRUE), "H5S__select_shape_same_test passed");
check = H5Sselect_shape_same(tv_ptr->file_small_ds_sid_0, tv_ptr->mem_large_ds_sid);
VRFY((check == TRUE), "H5Sselect_shape_same passed");
/* Read selection from disk */
@ -3561,24 +3494,20 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
*
* Verify that we can write from memory to file using checker
* board selections of different rank that
* H5S_select_shape_same() views as being of the same shape.
* H5Sselect_shape_same() views as being of the same shape.
*
* Do this by writing small_rank - 1 dimensional checker
* board slices from the in memory large data set to the on
* disk small cube dataset. After each write, read the
* slice of the small dataset back from disk, and verify
* that it contains the expected data. Verify that
* H5S_select_shape_same() returns true on the memory and
* H5Sselect_shape_same() returns true on the memory and
* file selections.
*
* Return: void
*
* Programmer: JRM -- 8/15/11
*
* Modifications:
*
* None.
*
*-------------------------------------------------------------------------
*/
@ -3609,12 +3538,12 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/* now we go in the opposite direction, verifying that we can write
* from memory to file using selections of different rank that
* H5S_select_shape_same() views as being of the same shape.
* H5Sselect_shape_same() views as being of the same shape.
*
* Start by writing small_rank - 1 D slices from the in memory large data
* set to the on disk small dataset. After each write, read the slice of
* the small dataset back from disk, and verify that it contains the
* expected data. Verify that H5S_select_shape_same() returns true on
* expected data. Verify that H5Sselect_shape_same() returns true on
* the memory and file selections.
*/
@ -3795,14 +3724,13 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
);
/* verify that H5S_select_shape_same() reports the in
/* verify that H5Sselect_shape_same() reports the in
* memory checkerboard selection of the slice through the
* large dataset and the checkerboard selection of the process
* slice of the small data set as having the same shape.
*/
check = H5S__select_shape_same_test(tv_ptr->file_small_ds_sid_1,
tv_ptr->mem_large_ds_sid);
VRFY((check == TRUE), "H5S__select_shape_same_test passed.");
check = H5Sselect_shape_same(tv_ptr->file_small_ds_sid_1, tv_ptr->mem_large_ds_sid);
VRFY((check == TRUE), "H5Sselect_shape_same passed.");
/* write the checker board selection of the slice from the in
@ -3922,7 +3850,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
* board hyperslab selections of different rank in the parallel.
*
* Verify that we can write from memory to file using
* selections of different rank that H5S_select_shape_same()
* selections of different rank that H5Sselect_shape_same()
* views as being of the same shape.
*
* Do this by writing checker board selections of the contents
@ -3931,17 +3859,13 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
* read the process's slice of the large data set back into
* memory, and verify that it contains the expected data.
*
* Verify that H5S_select_shape_same() returns true on the
* Verify that H5Sselect_shape_same() returns true on the
* memory and file selections.
*
* Return: void
*
* Programmer: JRM -- 8/15/11
*
* Modifications:
*
* None
*
*-------------------------------------------------------------------------
*/
@ -3974,7 +3898,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
* small data set to slices of the on disk large data set. After
* each write, read the process's slice of the large data set back
* into memory, and verify that it contains the expected data.
* Verify that H5S_select_shape_same() returns true on the memory
* Verify that H5Sselect_shape_same() returns true on the memory
* and file selections.
*/
@ -4150,14 +4074,13 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
);
/* verify that H5S_select_shape_same() reports the in
/* verify that H5Sselect_shape_same() reports the in
* memory small data set slice selection and the
* on disk slice through the large data set selection
* as having the same shape.
*/
check = H5S__select_shape_same_test(tv_ptr->mem_small_ds_sid,
tv_ptr->file_large_ds_sid_1);
VRFY((check == TRUE), "H5S__select_shape_same_test passed");
check = H5Sselect_shape_same(tv_ptr->mem_small_ds_sid, tv_ptr->file_large_ds_sid_1);
VRFY((check == TRUE), "H5Sselect_shape_same passed");
/* write the small data set slice from memory to the
@ -4287,14 +4210,6 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
*
* Programmer: JRM -- 10/10/09
*
* Modifications:
*
* JRM -- 9/16/10
* Added the express_test parameter. Use it to control
* whether we set an alignment, and whether we allocate
* chunks such that no two processes will normally touch
* the same chunk.
*
*-------------------------------------------------------------------------
*/
@ -4409,12 +4324,12 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
/* first, verify that we can read from disk correctly using selections
* of different rank that H5S_select_shape_same() views as being of the
* of different rank that H5Sselect_shape_same() views as being of the
* same shape.
*
* Start by reading a (small_rank - 1)-D slice from this processes slice
* of the on disk large data set, and verifying that the data read is
* correct. Verify that H5S_select_shape_same() returns true on the
* correct. Verify that H5Sselect_shape_same() returns true on the
* memory and file selections.
*
* The first step is to set up the needed checker board selection in the
@ -4434,12 +4349,12 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
/* now we go in the opposite direction, verifying that we can write
* from memory to file using selections of different rank that
* H5S_select_shape_same() views as being of the same shape.
* H5Sselect_shape_same() views as being of the same shape.
*
* Start by writing small_rank - 1 D slices from the in memory large data
* set to the on disk small dataset. After each write, read the slice of
* the small dataset back from disk, and verify that it contains the
* expected data. Verify that H5S_select_shape_same() returns true on
* expected data. Verify that H5Sselect_shape_same() returns true on
* the memory and file selections.
*/
@ -4450,7 +4365,7 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
* small data set to slices of the on disk large data set. After
* each write, read the process's slice of the large data set back
* into memory, and verify that it contains the expected data.
* Verify that H5S_select_shape_same() returns true on the memory
* Verify that H5Sselect_shape_same() returns true on the memory
* and file selections.
*/
@ -4494,20 +4409,6 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
*
* Programmer: JRM -- 9/18/09
*
* Modifications:
*
* Modified function to take a sample of the run times
* of the different tests, and skip some of them if
* run times are too long.
*
* We need to do this because Lustre runns very slowly
* if two or more processes are banging on the same
* block of memory.
* JRM -- 9/10/10
* Break this one big test into 4 smaller tests according
* to {independent,collective}x{contigous,chunked} datasets.
* AKC -- 2010/01/17
*
*-------------------------------------------------------------------------
*/

View File

@ -60,8 +60,6 @@ static void coll_read_test(int chunk_factor);
* Programmer: Unknown
* Dec 2nd, 2004
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
void
@ -87,8 +85,6 @@ coll_irregular_cont_write(void)
* Programmer: Unknown
* Dec 2nd, 2004
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
void
@ -113,8 +109,6 @@ coll_irregular_cont_read(void)
* Programmer: Unknown
* Dec 2nd, 2004
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
void
@ -140,8 +134,6 @@ coll_irregular_simple_chunk_write(void)
* Programmer: Unknown
* Dec 2nd, 2004
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
void
@ -165,8 +157,6 @@ coll_irregular_simple_chunk_read(void)
* Programmer: Unknown
* Dec 2nd, 2004
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
void
@ -192,8 +182,6 @@ coll_irregular_complex_chunk_write(void)
* Programmer: Unknown
* Dec 2nd, 2004
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
void
@ -219,8 +207,6 @@ coll_irregular_complex_chunk_read(void)
* Programmer: Unknown
* Dec 2nd, 2004
*
* Modifications: Oct 18th, 2005
*
*-------------------------------------------------------------------------
*/
void coll_write_test(int chunk_factor)
@ -694,9 +680,6 @@ void coll_write_test(int chunk_factor)
* Programmer: Unknown
* Dec 2nd, 2004
*
* Modifications: Oct 18th, 2005
* Note: This test must be used with the correpsonding
coll_write_test.
*-------------------------------------------------------------------------
*/
static void
@ -948,18 +931,18 @@ coll_read_test(int chunk_factor)
**
** lower_dim_size_comp_test__select_checker_board():
**
** Given a data space of tgt_rank, and dimensions:
** Given a dataspace of tgt_rank, and dimensions:
**
** (mpi_size + 1), edge_size, ... , edge_size
**
** edge_size, and a checker_edge_size, select a checker
** board selection of a sel_rank (sel_rank < tgt_rank)
** dimensional slice through the data space parallel to the
** dimensional slice through the dataspace parallel to the
** sel_rank fastest changing indicies, with origin (in the
** higher indicies) as indicated by the start array.
**
** Note that this function, is hard coded to presume a
** maximum data space rank of 5.
** maximum dataspace rank of 5.
**
** While this maximum is declared as a constant, increasing
** it will require extensive coding in addition to changing
@ -1304,7 +1287,7 @@ lower_dim_size_comp_test__select_checker_board(
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
/* Clip the selection back to the data space proper. */
/* Clip the selection back to the dataspace proper. */
for ( i = 0; i < test_max_rank; i++ ) {
@ -1564,15 +1547,13 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
* Function: lower_dim_size_comp_test__run_test()
*
* Purpose: Verify that a bug in the computation of the size of the
* lower dimensions of a data space in H5S_obtain_datatype()
* lower dimensions of a dataspace in H5S_obtain_datatype()
* has been corrected.
*
* Return: void
*
* Programmer: JRM -- 11/11/09
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
@ -1763,7 +1744,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
}
#endif
/* create data spaces */
/* create dataspaces */
full_mem_small_ds_sid = H5Screate_simple(5, small_dims, NULL);
VRFY((full_mem_small_ds_sid != 0),
@ -2177,7 +2158,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
}
/* try clipping the selection back to the large data space proper */
/* try clipping the selection back to the large dataspace proper */
start[0] = start[1] = start[2] = start[3] = start[4] = (hsize_t)0;
stride[0] = (hsize_t)(2 * (mpi_size + 1));
@ -2331,12 +2312,11 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
large_sel_start);
/* verify that H5S_select_shape_same() reports the two
/* verify that H5Sselect_shape_same() reports the two
* selections as having the same shape.
*/
check = H5S__select_shape_same_test(mem_large_ds_sid,
file_small_ds_sid);
VRFY((check == TRUE), "H5S__select_shape_same_test passed (1)");
check = H5Sselect_shape_same(mem_large_ds_sid, file_small_ds_sid);
VRFY((check == TRUE), "H5Sselect_shape_same passed (1)");
ret = H5Dread(small_dataset,
@ -2452,12 +2432,11 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
large_sel_start);
/* verify that H5S_select_shape_same() reports the two
/* verify that H5Sselect_shape_same() reports the two
* selections as having the same shape.
*/
check = H5S__select_shape_same_test(mem_small_ds_sid,
file_large_ds_sid);
VRFY((check == TRUE), "H5S__select_shape_same_test passed (2)");
check = H5Sselect_shape_same(mem_small_ds_sid, file_large_ds_sid);
VRFY((check == TRUE), "H5Sselect_shape_same passed (2)");
ret = H5Dread(large_dataset,
@ -2613,8 +2592,6 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
*
* Programmer: JRM -- 11/11/09
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
@ -2672,8 +2649,6 @@ lower_dim_size_comp_test(void)
*
* Programmer: JRM -- 12/16/09
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
@ -2737,7 +2712,7 @@ link_chunk_collective_io_test(void)
/* setup dims */
dims[0] = ((hsize_t)mpi_size) * ((hsize_t)(LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE));
/* setup mem and file data spaces */
/* setup mem and file dataspaces */
write_mem_ds_sid = H5Screate_simple(1, chunk_dims, NULL);
VRFY((write_mem_ds_sid != 0),
"H5Screate_simple() write_mem_ds_sid succeeded");