00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _H5Sprivate_H
00020 #define _H5Sprivate_H
00021
00022
00023 #include "H5Spublic.h"
00024
00025
00026 #include "H5Dpublic.h"
00027
00028
00029 #include "H5private.h"
00030 #include "H5Fprivate.h"
00031 #include "H5Gprivate.h"
00032 #include "H5Oprivate.h"
00033 #include "H5Pprivate.h"
00034
00035
00036 #define H5S_CONV_PAR_IO_POSSIBLE 0x0001
00037
00038
00039 #define H5S_CONV_STORAGE_COMPACT 0x0000
00040 #define H5S_CONV_STORAGE_CONTIGUOUS 0x0002
00041 #define H5S_CONV_STORAGE_CHUNKED 0x0004
00042 #define H5S_CONV_STORAGE_MASK 0x0006
00043
00044
00045 #define H5S_GET_SEQ_LIST_SORTED 0x0001
00046
00047
00048 typedef struct H5S_t H5S_t;
00049 typedef struct H5S_extent_t H5S_extent_t;
00050 typedef struct H5S_pnt_node_t H5S_pnt_node_t;
00051 typedef struct H5S_hyper_span_t H5S_hyper_span_t;
00052 typedef struct H5S_hyper_span_info_t H5S_hyper_span_info_t;
00053
00054
00055 typedef struct H5S_hyper_dim_t {
00056 hsize_t start;
00057 hsize_t stride;
00058 hsize_t count;
00059 hsize_t block;
00060 } H5S_hyper_dim_t;
00061
00062
00063 typedef struct {
00064 H5S_pnt_node_t *curr;
00065 } H5S_point_iter_t;
00066
00067
00068 typedef struct {
00069
00070 hsize_t off[H5S_MAX_RANK];
00071 unsigned iter_rank;
00072
00073
00074
00075
00076
00077 hbool_t diminfo_valid;
00078
00079
00080 H5S_hyper_dim_t diminfo[H5S_MAX_RANK];
00081 hsize_t size[H5S_MAX_RANK];
00082 hssize_t sel_off[H5S_MAX_RANK];
00083 hbool_t flattened[H5S_MAX_RANK];
00084
00085
00086 H5S_hyper_span_info_t *spans;
00087 H5S_hyper_span_t *span[H5S_MAX_RANK];
00088 } H5S_hyper_iter_t;
00089
00090
00091 typedef struct {
00092 hsize_t elmt_offset;
00093 hsize_t byte_offset;
00094 } H5S_all_iter_t;
00095
00096
00097 struct H5S_sel_iter_class_t;
00098
00099
00100 typedef struct H5S_sel_iter_t {
00101
00102 const struct H5S_sel_iter_class_t *type;
00103
00104
00105 unsigned rank;
00106 hsize_t *dims;
00107 hsize_t elmt_left;
00108 size_t elmt_size;
00109
00110
00111 union {
00112 H5S_point_iter_t pnt;
00113 H5S_hyper_iter_t hyp;
00114 H5S_all_iter_t all;
00115 } u;
00116 } H5S_sel_iter_t;
00117
00118
00119 #ifdef H5S_PACKAGE
00120 #define H5S_GET_EXTENT_TYPE(S) ((S)->extent.type)
00121 #define H5S_GET_EXTENT_NDIMS(S) ((S)->extent.rank)
00122 #define H5S_GET_EXTENT_NPOINTS(S) ((S)->extent.nelem)
00123 #define H5S_GET_SELECT_NPOINTS(S) ((S)->select.num_elem)
00124 #define H5S_GET_SELECT_TYPE(S) ((S)->select.type->type)
00125 #define H5S_SELECT_GET_SEQ_LIST(S,FLAGS,ITER,MAXSEQ,MAXBYTES,NSEQ,NBYTES,OFF,LEN) ((*(S)->select.type->get_seq_list)(S,FLAGS,ITER,MAXSEQ,MAXBYTES,NSEQ,NBYTES,OFF,LEN))
00126 #define H5S_SELECT_VALID(S) ((*(S)->select.type->is_valid)(S))
00127 #define H5S_SELECT_RELEASE(S) ((*(S)->select.type->release)(S))
00128 #define H5S_SELECT_SERIAL_SIZE(S) ((*(S)->select.type->serial_size)(S))
00129 #define H5S_SELECT_SERIALIZE(S,BUF) ((*(S)->select.type->serialize)(S,BUF))
00130 #define H5S_SELECT_BOUNDS(S,START,END) ((*(S)->select.type->bounds)(S,START,END))
00131 #define H5S_SELECT_OFFSET(S, OFFSET) ((*(S)->select.type->offset)(S, OFFSET))
00132 #define H5S_SELECT_IS_CONTIGUOUS(S) ((*(S)->select.type->is_contiguous)(S))
00133 #define H5S_SELECT_IS_SINGLE(S) ((*(S)->select.type->is_single)(S))
00134 #define H5S_SELECT_IS_REGULAR(S) ((*(S)->select.type->is_regular)(S))
00135 #define H5S_SELECT_ADJUST_U(S,O) ((*(S)->select.type->adjust_u)(S, O))
00136 #define H5S_SELECT_ITER_COORDS(ITER,COORDS) ((*(ITER)->type->iter_coords)(ITER,COORDS))
00137 #define H5S_SELECT_ITER_BLOCK(ITER,START,END) ((*(ITER)->type->iter_block)(ITER,START,END))
00138 #define H5S_SELECT_ITER_NELMTS(ITER) ((*(ITER)->type->iter_nelmts)(ITER))
00139 #define H5S_SELECT_ITER_HAS_NEXT_BLOCK(ITER) ((*(ITER)->type->iter_has_next_block)(ITER))
00140 #define H5S_SELECT_ITER_NEXT(ITER,NELEM)((*(ITER)->type->iter_next)(ITER,NELEM))
00141 #define H5S_SELECT_ITER_NEXT_BLOCK(ITER) ((*(ITER)->type->iter_next_block)(ITER))
00142 #define H5S_SELECT_ITER_RELEASE(ITER) ((*(ITER)->type->iter_release)(ITER))
00143 #else
00144 #define H5S_GET_EXTENT_TYPE(S) (H5S_get_simple_extent_type(S))
00145 #define H5S_GET_EXTENT_NDIMS(S) (H5S_get_simple_extent_ndims(S))
00146 #define H5S_GET_EXTENT_NPOINTS(S) (H5S_get_simple_extent_npoints(S))
00147 #define H5S_GET_SELECT_NPOINTS(S) (H5S_get_select_npoints(S))
00148 #define H5S_GET_SELECT_TYPE(S) (H5S_get_select_type(S))
00149 #define H5S_SELECT_GET_SEQ_LIST(S,FLAGS,ITER,MAXSEQ,MAXBYTES,NSEQ,NBYTES,OFF,LEN) (H5S_select_get_seq_list(S,FLAGS,ITER,MAXSEQ,MAXBYTES,NSEQ,NBYTES,OFF,LEN))
00150 #define H5S_SELECT_VALID(S) (H5S_select_valid(S))
00151 #define H5S_SELECT_RELEASE(S) (H5S_select_release(S))
00152 #define H5S_SELECT_SERIAL_SIZE(S) (H5S_select_serial_size(S))
00153 #define H5S_SELECT_SERIALIZE(S,BUF) (H5S_select_serialize(S,BUF))
00154 #define H5S_SELECT_BOUNDS(S,START,END) (H5S_get_select_bounds(S,START,END))
00155 #define H5S_SELECT_OFFSET(S, OFFSET) (H5S_get_select_offset(S, OFFSET))
00156 #define H5S_SELECT_IS_CONTIGUOUS(S) (H5S_select_is_contiguous(S))
00157 #define H5S_SELECT_IS_SINGLE(S) (H5S_select_is_single(S))
00158 #define H5S_SELECT_IS_REGULAR(S) (H5S_select_is_regular(S))
00159 #define H5S_SELECT_ADJUST_U(S,O) (H5S_select_adjust_u(S, O))
00160 #define H5S_SELECT_ITER_COORDS(ITER,COORDS) (H5S_select_iter_coords(ITER,COORDS))
00161 #define H5S_SELECT_ITER_BLOCK(ITER,START,END) (H5S_select_iter_block(ITER,START,END))
00162 #define H5S_SELECT_ITER_NELMTS(ITER) (H5S_select_iter_nelmts(ITER))
00163 #define H5S_SELECT_ITER_HAS_NEXT_BLOCK(ITER) (H5S_select_iter_has_next_block(ITER))
00164 #define H5S_SELECT_ITER_NEXT(ITER,NELEM)(H5S_select_iter_next(ITER,NELEM))
00165 #define H5S_SELECT_ITER_NEXT_BLOCK(ITER) (H5S_select_iter_next_block(ITER))
00166 #define H5S_SELECT_ITER_RELEASE(ITER) (H5S_select_iter_release(ITER))
00167 #endif
00168
00169 #define H5S_SELECT_COPY(DST,SRC,SHARE) (H5S_select_copy(DST,SRC,SHARE))
00170 #define H5S_SELECT_DESERIALIZE(S,BUF) (H5S_select_deserialize(S,BUF))
00171
00172
00173
00174 H5_DLL H5S_t *H5S_copy(const H5S_t *src, hbool_t share_selection, hbool_t copy_max);
00175 H5_DLL herr_t H5S_close(H5S_t *ds);
00176 H5_DLL H5S_class_t H5S_get_simple_extent_type(const H5S_t *ds);
00177 H5_DLL hssize_t H5S_get_simple_extent_npoints(const H5S_t *ds);
00178 H5_DLL hsize_t H5S_get_npoints_max(const H5S_t *ds);
00179 H5_DLL hbool_t H5S_has_extent(const H5S_t *ds);
00180 H5_DLL int H5S_get_simple_extent_ndims(const H5S_t *ds);
00181 H5_DLL int H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[],
00182 hsize_t max_dims[]);
00183 H5_DLL herr_t H5S_write(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned update_flags,
00184 H5S_t *ds);
00185 H5_DLL herr_t H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, H5S_t *ds);
00186 H5_DLL H5S_t *H5S_read(const struct H5O_loc_t *loc, hid_t dxpl_id);
00187 H5_DLL htri_t H5S_set_extent(H5S_t *space, const hsize_t *size);
00188 H5_DLL herr_t H5S_set_extent_real(H5S_t *space, const hsize_t *size);
00189 H5_DLL H5S_t *H5S_create(H5S_class_t type);
00190 H5_DLL H5S_t *H5S_create_simple(unsigned rank, const hsize_t dims[],
00191 const hsize_t maxdims[]);
00192 H5_DLL herr_t H5S_set_latest_version(H5S_t *ds);
00193 H5_DLL herr_t H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream,
00194 int indent, int fwidth);
00195 #ifndef H5_NO_DEPRECATED_SYMBOLS
00196 H5_DLL int H5S_extend(H5S_t *space, const hsize_t *size);
00197 #endif
00198
00199
00200 H5_DLL hsize_t H5S_extent_nelem(const H5S_extent_t *ext);
00201 H5_DLL int H5S_extent_get_dims(const H5S_extent_t *ext, hsize_t dims[], hsize_t max_dims[]);
00202 H5_DLL htri_t H5S_extent_equal(const H5S_t *ds1, const H5S_t *ds2);
00203
00204
00205 H5_DLL herr_t H5S_select_deserialize(H5S_t *space, const uint8_t *buf);
00206 H5_DLL H5S_sel_type H5S_get_select_type(const H5S_t *space);
00207 H5_DLL herr_t H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space,
00208 H5D_operator_t op, void *operator_data);
00209 H5_DLL herr_t H5S_select_fill(const void *fill, size_t fill_size,
00210 const H5S_t *space, void *buf);
00211 H5_DLL htri_t H5S_select_valid(const H5S_t *space);
00212 H5_DLL hssize_t H5S_get_select_npoints(const H5S_t *space);
00213 H5_DLL herr_t H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
00214 H5_DLL herr_t H5S_get_select_offset(const H5S_t *space, hsize_t *offset);
00215 H5_DLL herr_t H5S_select_offset(H5S_t *space, const hssize_t *offset);
00216 H5_DLL herr_t H5S_select_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection);
00217 H5_DLL htri_t H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2);
00218 H5_DLL herr_t H5S_select_release(H5S_t *ds);
00219 H5_DLL herr_t H5S_select_get_seq_list(const H5S_t *space, unsigned flags,
00220 H5S_sel_iter_t *iter, size_t maxseq, size_t maxbytes,
00221 size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len);
00222 H5_DLL hssize_t H5S_select_serial_size(const H5S_t *space);
00223 H5_DLL herr_t H5S_select_serialize(const H5S_t *space, uint8_t *buf);
00224 H5_DLL htri_t H5S_select_is_contiguous(const H5S_t *space);
00225 H5_DLL htri_t H5S_select_is_single(const H5S_t *space);
00226 H5_DLL htri_t H5S_select_is_regular(const H5S_t *space);
00227 H5_DLL herr_t H5S_select_adjust_u(H5S_t *space, const hsize_t *offset);
00228
00229
00230 H5_DLL herr_t H5S_select_all(H5S_t *space, hbool_t rel_prev);
00231
00232
00233 H5_DLL herr_t H5S_select_none(H5S_t *space);
00234
00235
00236 H5_DLL herr_t H5S_select_elements(H5S_t *space, H5S_seloper_t op,
00237 size_t num_elem, const hsize_t *coord);
00238
00239
00240 H5_DLL herr_t H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, const hsize_t start[],
00241 const hsize_t *stride, const hsize_t count[], const hsize_t *block);
00242 H5_DLL herr_t H5S_hyper_add_span_element(H5S_t *space, unsigned rank,
00243 hsize_t *coords);
00244 H5_DLL herr_t H5S_hyper_reset_scratch(H5S_t *space);
00245 H5_DLL herr_t H5S_hyper_convert(H5S_t *space);
00246 #ifdef LATER
00247 H5_DLL htri_t H5S_hyper_intersect (H5S_t *space1, H5S_t *space2);
00248 #endif
00249 H5_DLL htri_t H5S_hyper_intersect_block (H5S_t *space, hsize_t *start, hsize_t *end);
00250 H5_DLL herr_t H5S_hyper_adjust_s(H5S_t *space, const hssize_t *offset);
00251 H5_DLL herr_t H5S_hyper_move(H5S_t *space, const hssize_t *offset);
00252 H5_DLL htri_t H5S_hyper_normalize_offset(H5S_t *space, hssize_t *old_offset);
00253 H5_DLL herr_t H5S_hyper_denormalize_offset(H5S_t *space, const hssize_t *old_offset);
00254
00255
00256 H5_DLL herr_t H5S_select_iter_init(H5S_sel_iter_t *iter, const H5S_t *space, size_t elmt_size);
00257 H5_DLL herr_t H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords);
00258 H5_DLL hsize_t H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter);
00259 H5_DLL herr_t H5S_select_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem);
00260 H5_DLL herr_t H5S_select_iter_release(H5S_sel_iter_t *sel_iter);
00261
00262 #ifdef H5_HAVE_PARALLEL
00263
00264
00265 H5_DLLVAR hbool_t H5S_mpi_opt_types_g;
00266
00267 H5_DLL herr_t
00268 H5S_mpio_space_type( const H5S_t *space, size_t elmt_size,
00269
00270 MPI_Datatype *new_type,
00271 size_t *count,
00272 hsize_t *extra_offset,
00273 hbool_t *is_derived_type );
00274
00275 H5_DLL herr_t
00276 H5S_mpio_space_span_type( const H5S_t *space, size_t elmt_size,
00277
00278 MPI_Datatype *new_type,
00279 size_t *count,
00280 hsize_t *extra_offset,
00281 hbool_t *is_derived_type );
00282
00283 #endif
00284
00285 #endif
00286