00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef _H5ACprivate_H
00033 #define _H5ACprivate_H
00034
00035 #include "H5ACpublic.h"
00036
00037
00038 #include "H5private.h"
00039 #include "H5Fprivate.h"
00040 #include "H5Cprivate.h"
00041
00042 #ifdef H5_METADATA_TRACE_FILE
00043 #define H5AC__TRACE_FILE_ENABLED 1
00044 #else
00045 #define H5AC__TRACE_FILE_ENABLED 0
00046 #endif
00047
00048
00049 typedef enum {
00050 H5AC_BT_ID = 0,
00051 H5AC_SNODE_ID,
00052 H5AC_LHEAP_PRFX_ID,
00053 H5AC_LHEAP_DBLK_ID,
00054 H5AC_GHEAP_ID,
00055 H5AC_OHDR_ID,
00056 H5AC_BT2_HDR_ID,
00057 H5AC_BT2_INT_ID,
00058 H5AC_BT2_LEAF_ID,
00059 H5AC_FHEAP_HDR_ID,
00060 H5AC_FHEAP_DBLOCK_ID,
00061 H5AC_FHEAP_IBLOCK_ID,
00062 H5AC_FSPACE_HDR_ID,
00063 H5AC_FSPACE_SINFO_ID,
00064 H5AC_SOHM_TABLE_ID,
00065 H5AC_SOHM_LIST_ID,
00066 H5AC_SUPERBLOCK_ID,
00067 H5AC_TEST_ID,
00068 H5AC_NTYPES
00069 } H5AC_type_t;
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 #if H5C_COLLECT_CACHE_STATS
00081
00082 #define H5AC_DUMP_STATS_ON_CLOSE 0
00083
00084 #else
00085
00086 #define H5AC_DUMP_STATS_ON_CLOSE 0
00087
00088 #endif
00089
00090
00091
00092
00093
00094 #define H5AC__DEFAULT_MAX_CACHE_SIZE H5C__DEFAULT_MAX_CACHE_SIZE
00095 #define H5AC__DEFAULT_MIN_CLEAN_SIZE H5C__DEFAULT_MIN_CLEAN_SIZE
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122 #define H5AC_CALLBACK__NO_FLAGS_SET H5C_CALLBACK__NO_FLAGS_SET
00123 #define H5AC_CALLBACK__SIZE_CHANGED_FLAG H5C_CALLBACK__SIZE_CHANGED_FLAG
00124 #define H5AC_CALLBACK__RENAMED_FLAG H5C_CALLBACK__RENAMED_FLAG
00125
00126 typedef H5C_load_func_t H5AC_load_func_t;
00127 typedef H5C_flush_func_t H5AC_flush_func_t;
00128 typedef H5C_dest_func_t H5AC_dest_func_t;
00129 typedef H5C_clear_func_t H5AC_clear_func_t;
00130 typedef H5C_size_func_t H5AC_size_func_t;
00131
00132 typedef H5C_class_t H5AC_class_t;
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148 #define H5AC_NSLOTS 10330
00149
00150
00151 typedef H5C_cache_entry_t H5AC_info_t;
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163 typedef enum H5AC_protect_t {
00164 H5AC_WRITE,
00165 H5AC_READ
00166 } H5AC_protect_t;
00167
00168
00169
00170 typedef H5C_t H5AC_t;
00171
00172
00173
00174 #ifdef H5_HAVE_PARALLEL
00175
00176 #define H5AC_BLOCK_BEFORE_META_WRITE_NAME "H5AC_block_before_meta_write"
00177 #define H5AC_BLOCK_BEFORE_META_WRITE_SIZE sizeof(unsigned)
00178 #define H5AC_BLOCK_BEFORE_META_WRITE_DEF 0
00179
00180
00181 #define H5AC_LIBRARY_INTERNAL_NAME "H5AC_library_internal"
00182 #define H5AC_LIBRARY_INTERNAL_SIZE sizeof(unsigned)
00183 #define H5AC_LIBRARY_INTERNAL_DEF 0
00184 #endif
00185
00186
00187
00188
00189 extern hid_t H5AC_dxpl_id;
00190
00191
00192
00193
00194 extern hid_t H5AC_ind_dxpl_id;
00195
00196
00197
00198
00199 #ifdef H5_HAVE_PARALLEL
00200 #define H5AC__DEFAULT_CACHE_CONFIG \
00201 { \
00202 H5C__CURR_AUTO_SIZE_CTL_VER, \
00203 FALSE, \
00204 FALSE, \
00205 FALSE, \
00206 "", \
00207 TRUE, \
00208 TRUE, \
00209 ( 2 * 1024 * 1024), \
00210 0.3, \
00211 (32 * 1024 * 1024), \
00212 ( 1 * 1024 * 1024), \
00213 50000, \
00214 H5C_incr__threshold, \
00215 0.9, \
00216 2.0, \
00217 TRUE, \
00218 (4 * 1024 * 1024), \
00219 \
00220 H5C_flash_incr__add_space, \
00221 1.0, \
00222 0.25, \
00223 H5C_decr__age_out_with_threshold,\
00224 0.999, \
00225 0.9, \
00226 TRUE, \
00227 (1 * 1024 * 1024), \
00228 3, \
00229 TRUE, \
00230 0.1, \
00231 (256 * 1024) \
00232 }
00233 #else
00234 #define H5AC__DEFAULT_CACHE_CONFIG \
00235 { \
00236 H5C__CURR_AUTO_SIZE_CTL_VER, \
00237 FALSE, \
00238 FALSE, \
00239 FALSE, \
00240 "", \
00241 TRUE, \
00242 TRUE, \
00243 ( 2 * 1024 * 1024), \
00244 0.01, \
00245 (32 * 1024 * 1024), \
00246 ( 1 * 1024 * 1024), \
00247 50000, \
00248 H5C_incr__threshold, \
00249 0.9, \
00250 2.0, \
00251 TRUE, \
00252 (4 * 1024 * 1024), \
00253 \
00254 H5C_flash_incr__add_space, \
00255 1.4, \
00256 0.25, \
00257 H5C_decr__age_out_with_threshold,\
00258 0.999, \
00259 0.9, \
00260 TRUE, \
00261 (1 * 1024 * 1024), \
00262 3, \
00263 TRUE, \
00264 0.1, \
00265 (256 * 1024) \
00266 }
00267 #endif
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279 #define H5AC__NO_FLAGS_SET H5C__NO_FLAGS_SET
00280 #define H5AC__SET_FLUSH_MARKER_FLAG H5C__SET_FLUSH_MARKER_FLAG
00281 #define H5AC__DELETED_FLAG H5C__DELETED_FLAG
00282 #define H5AC__DIRTIED_FLAG H5C__DIRTIED_FLAG
00283 #define H5AC__SIZE_CHANGED_FLAG H5C__SIZE_CHANGED_FLAG
00284 #define H5AC__PIN_ENTRY_FLAG H5C__PIN_ENTRY_FLAG
00285 #define H5AC__UNPIN_ENTRY_FLAG H5C__UNPIN_ENTRY_FLAG
00286 #define H5AC__FLUSH_INVALIDATE_FLAG H5C__FLUSH_INVALIDATE_FLAG
00287 #define H5AC__FLUSH_CLEAR_ONLY_FLAG H5C__FLUSH_CLEAR_ONLY_FLAG
00288 #define H5AC__FLUSH_MARKED_ENTRIES_FLAG H5C__FLUSH_MARKED_ENTRIES_FLAG
00289 #define H5AC__FLUSH_IGNORE_PROTECTED_FLAG H5C__FLUSH_IGNORE_PROTECTED_FLAG
00290 #define H5AC__FREE_FILE_SPACE_FLAG H5C__FREE_FILE_SPACE_FLAG
00291 #define H5AC__TAKE_OWNERSHIP_FLAG H5C__TAKE_OWNERSHIP_FLAG
00292
00293
00294
00295
00296
00297
00298 #define H5AC_ES__IN_CACHE 0x0001
00299 #define H5AC_ES__IS_DIRTY 0x0002
00300 #define H5AC_ES__IS_PROTECTED 0x0004
00301 #define H5AC_ES__IS_PINNED 0x0008
00302
00303
00304
00305
00306 H5_DLL herr_t H5AC_init(void);
00307 H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr);
00308 H5_DLL herr_t H5AC_get_entry_status(const H5F_t * f, haddr_t addr,
00309 unsigned * status_ptr);
00310 H5_DLL herr_t H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type,
00311 haddr_t addr, void *thing, unsigned int flags);
00312 H5_DLL herr_t H5AC_pin_protected_entry(void *thing);
00313 H5_DLL void * H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type,
00314 haddr_t addr, const void *udata1, void *udata2,
00315 H5AC_protect_t rw);
00316 H5_DLL herr_t H5AC_resize_pinned_entry(void *thing, size_t new_size);
00317 H5_DLL herr_t H5AC_unpin_entry(void *thing);
00318 H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id,
00319 const H5AC_class_t *type, haddr_t addr,
00320 void *thing, unsigned flags);
00321 H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id);
00322 H5_DLL herr_t H5AC_mark_pinned_entry_dirty(void *thing, hbool_t size_changed,
00323 size_t new_size);
00324 H5_DLL herr_t H5AC_mark_pinned_or_protected_entry_dirty(void *thing);
00325 H5_DLL herr_t H5AC_rename(H5F_t *f, const H5AC_class_t *type,
00326 haddr_t old_addr, haddr_t new_addr);
00327
00328 H5_DLL herr_t H5AC_dest(H5F_t *f, hid_t dxpl_id);
00329
00330 H5_DLL herr_t H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id,
00331 const H5AC_class_t *type, haddr_t addr,
00332 unsigned flags);
00333
00334 H5_DLL herr_t H5AC_set_write_done_callback(H5C_t * cache_ptr,
00335 void (* write_done)(void));
00336 H5_DLL herr_t H5AC_stats(const H5F_t *f);
00337
00338 H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr,
00339 H5AC_cache_config_t *config_ptr);
00340
00341 H5_DLL herr_t H5AC_get_cache_size(H5AC_t * cache_ptr,
00342 size_t * max_size_ptr,
00343 size_t * min_clean_size_ptr,
00344 size_t * cur_size_ptr,
00345 int32_t * cur_num_entries_ptr);
00346
00347 H5_DLL herr_t H5AC_get_cache_hit_rate(H5AC_t * cache_ptr,
00348 double * hit_rate_ptr);
00349
00350 H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t * cache_ptr);
00351
00352 H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr,
00353 H5AC_cache_config_t *config_ptr);
00354
00355 H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t * config_ptr);
00356
00357 H5_DLL herr_t H5AC_close_trace_file( H5AC_t * cache_ptr);
00358
00359 H5_DLL herr_t H5AC_open_trace_file(H5AC_t * cache_ptr,
00360 const char * trace_file_name);
00361
00362 #endif
00363