diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2014-06-13 06:23:57 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2014-06-13 06:23:57 (GMT) |
commit | 4ccb865c70f977a4a97d75df3d6e792c8cbdfdd8 (patch) | |
tree | 860f585f1589250b03aec29371acb13ebbf2e022 /src/H5Spkg.h | |
parent | c2bc22d51cdf528c9b04ec115ac22c7e79fd7c6d (diff) | |
download | hdf5-4ccb865c70f977a4a97d75df3d6e792c8cbdfdd8.zip hdf5-4ccb865c70f977a4a97d75df3d6e792c8cbdfdd8.tar.gz hdf5-4ccb865c70f977a4a97d75df3d6e792c8cbdfdd8.tar.bz2 |
[svn-r25273] Description:
Bring in Chao/Neil/my changes to optimize hyperslab selection operations
further, along with 3 new public API routines: H5Scombine_hyperslab(),
H5Sselect_select() and H5Scombine_select(), along with many minor cleanups to
the code and fixing a few compiler warnings.
Tested on:
Mac OSX/64 10.9.3 w/gcc 4.9.x and parallel w/OpenMPI
(h5commttest forthcoming)
Diffstat (limited to 'src/H5Spkg.h')
-rw-r--r-- | src/H5Spkg.h | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/src/H5Spkg.h b/src/H5Spkg.h index 0a9df69..d76d7ca 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -77,6 +77,7 @@ struct H5S_pnt_node_t { /* Information about point selection list */ typedef struct { H5S_pnt_node_t *head; /* Pointer to head of point list */ + H5S_pnt_node_t *tail; /* Pointer to tail of point list */ } H5S_pnt_list_t; /* Information about new-style hyperslab spans */ @@ -90,7 +91,7 @@ struct H5S_hyper_span_t { struct H5S_hyper_span_t *next; /* Pointer to next span in list */ }; -/* Information about a list of hyperslab spans */ +/* Information about a list of hyperslab spans in one dimension */ struct H5S_hyper_span_info_t { unsigned count; /* Ref. count of number of spans which share this span */ struct H5S_hyper_span_info_t *scratch; /* Scratch pointer @@ -99,12 +100,20 @@ struct H5S_hyper_span_info_t { * to point to the last span in a * list during single element adds) */ - struct H5S_hyper_span_t *head; /* Pointer to list of spans in next dimension down */ + struct H5S_hyper_span_t *head; /* Pointer to the first span of list of spans in the current dimension */ + struct H5S_hyper_span_t *tail; /* Pointer to the last span of list of spans in the current dimension */ }; +/* Enum for diminfo_valid field in H5S_hyper_sel_t */ +typedef enum { + H5S_DIMINFO_VALID_IMPOSSIBLE, /* 0: diminfo is not valid and can never be valid with the current selection */ + H5S_DIMINFO_VALID_NO, /* 1: diminfo is not valid but may or may not be possible to constuct */ + H5S_DIMINFO_VALID_YES /* 2: diminfo is valid */ +} H5S_diminfo_valid_t; + /* Information about new-style hyperslab selection */ typedef struct { - hbool_t diminfo_valid; /* Whether the dataset has valid diminfo */ + H5S_diminfo_valid_t diminfo_valid; /* Whether the dataset has valid diminfo */ H5S_hyper_dim_t opt_diminfo[H5S_MAX_RANK]; /* per-dim selection info */ H5S_hyper_dim_t app_diminfo[H5S_MAX_RANK]; /* per-dim selection info */ /* 'opt_diminfo' points to a [potentially] optimized version of the user's @@ -113,7 +122,7 @@ typedef struct { * are only used for re-gurgitating the original values used to set the * hyperslab to the application when it queries the hyperslab selection * information. */ - H5S_hyper_span_info_t *span_lst; /* List of hyperslab span information */ + H5S_hyper_span_info_t *span_lst; /* List of hyperslab span information of all dimensions */ } H5S_hyper_sel_t; /* Selection information methods */ @@ -180,7 +189,12 @@ typedef struct { const H5S_select_class_t *type; /* Pointer to selection's class info */ hbool_t offset_changed; /* Indicate that the offset for the selection has been changed */ hssize_t offset[H5S_MAX_RANK]; /* Offset within the extent */ - hsize_t num_elem; /* Number of elements in selection */ + hsize_t num_elem; /* Number of elements in selection */ + + /* The following two fields defines the bounding box of the whole selection relative to the offset */ + hsize_t low_bounds[H5S_MAX_RANK]; /* The smallest offset in each dimension */ + hsize_t high_bounds[H5S_MAX_RANK]; /* The largest offset in each dimension */ + union { H5S_pnt_list_t *pnt_lst; /* List of selected points (order is important) */ H5S_hyper_sel_t *hslab; /* Info about hyperslab selections */ @@ -249,11 +263,16 @@ H5_DLL herr_t H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src, hbool_t copy_max); /* Operations on selections */ +H5_DLL htri_t H5S_hyper_rebuild(H5S_t *space); /* Testing functions */ #ifdef H5S_TESTING H5_DLL htri_t H5S_select_shape_same_test(hid_t sid1, hid_t sid2); -H5_DLL htri_t H5S_get_rebuild_status_test(hid_t space_id); +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, + H5S_diminfo_valid_t *status); +H5_DLL htri_t H5S_internal_consistency_test(hid_t space_id); #endif /* H5S_TESTING */ #endif /*_H5Spkg_H*/ |