diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 16:47:45 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 16:47:45 (GMT) |
commit | 1ba1f2f3222cbe8df0bf601929a4bffd478d7e02 (patch) | |
tree | ae51dfc33cf40432dad25a5088767115a98f195e /src/H5ACprivate.h | |
parent | 8eef7d295cc3dd134aef0a826f1de4287629996d (diff) | |
download | hdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.zip hdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.tar.gz hdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.tar.bz2 |
Source formatted
Diffstat (limited to 'src/H5ACprivate.h')
-rw-r--r-- | src/H5ACprivate.h | 184 |
1 files changed, 81 insertions, 103 deletions
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 1889930..aac4209 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -26,42 +26,42 @@ #ifndef _H5ACprivate_H #define _H5ACprivate_H -#include "H5ACpublic.h" /*public prototypes */ +#include "H5ACpublic.h" /*public prototypes */ /* Pivate headers needed by this header */ -#include "H5private.h" /* Generic Functions */ -#include "H5Cprivate.h" /* Cache */ -#include "H5Fprivate.h" /* File access */ -#include "H5Pprivate.h" /* Property lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Cprivate.h" /* Cache */ +#include "H5Fprivate.h" /* File access */ +#include "H5Pprivate.h" /* Property lists */ #ifdef H5_METADATA_TRACE_FILE -#define H5AC__TRACE_FILE_ENABLED 1 +#define H5AC__TRACE_FILE_ENABLED 1 #else /* H5_METADATA_TRACE_FILE */ -#define H5AC__TRACE_FILE_ENABLED 0 +#define H5AC__TRACE_FILE_ENABLED 0 #endif /* H5_METADATA_TRACE_FILE */ /* Types of metadata objects cached */ typedef enum { - H5AC_BT_ID = 0, /*B-tree nodes */ - H5AC_SNODE_ID, /*symbol table nodes */ - H5AC_LHEAP_PRFX_ID, /*local heap prefix */ - H5AC_LHEAP_DBLK_ID, /*local heap data block */ - H5AC_GHEAP_ID, /*global heap */ - H5AC_OHDR_ID, /*object header */ - H5AC_OHDR_CHK_ID, /*object header chunk */ - H5AC_BT2_HDR_ID, /*v2 B-tree header */ - H5AC_BT2_INT_ID, /*v2 B-tree internal node */ - H5AC_BT2_LEAF_ID, /*v2 B-tree leaf node */ + H5AC_BT_ID = 0, /*B-tree nodes */ + H5AC_SNODE_ID, /*symbol table nodes */ + H5AC_LHEAP_PRFX_ID, /*local heap prefix */ + H5AC_LHEAP_DBLK_ID, /*local heap data block */ + H5AC_GHEAP_ID, /*global heap */ + H5AC_OHDR_ID, /*object header */ + H5AC_OHDR_CHK_ID, /*object header chunk */ + H5AC_BT2_HDR_ID, /*v2 B-tree header */ + H5AC_BT2_INT_ID, /*v2 B-tree internal node */ + H5AC_BT2_LEAF_ID, /*v2 B-tree leaf node */ H5AC_FHEAP_HDR_ID, /*fractal heap header */ H5AC_FHEAP_DBLOCK_ID, /*fractal heap direct block */ H5AC_FHEAP_IBLOCK_ID, /*fractal heap indirect block */ - H5AC_FSPACE_HDR_ID, /*free space header */ - H5AC_FSPACE_SINFO_ID,/*free space sections */ - H5AC_SOHM_TABLE_ID, /*shared object header message master table */ - H5AC_SOHM_LIST_ID, /*shared message index stored as a list */ - H5AC_SUPERBLOCK_ID, /* file superblock */ - H5AC_TEST_ID, /*test entry -- not used for actual files */ - H5AC_NTYPES /* Number of types, must be last */ + H5AC_FSPACE_HDR_ID, /*free space header */ + H5AC_FSPACE_SINFO_ID, /*free space sections */ + H5AC_SOHM_TABLE_ID, /*shared object header message master table */ + H5AC_SOHM_LIST_ID, /*shared message index stored as a list */ + H5AC_SUPERBLOCK_ID, /* file superblock */ + H5AC_TEST_ID, /*test entry -- not used for actual files */ + H5AC_NTYPES /* Number of types, must be last */ } H5AC_type_t; /* H5AC_DUMP_STATS_ON_CLOSE should always be FALSE when @@ -75,11 +75,11 @@ typedef enum { */ #if H5C_COLLECT_CACHE_STATS -#define H5AC_DUMP_STATS_ON_CLOSE 0 +#define H5AC_DUMP_STATS_ON_CLOSE 0 #else /* H5C_COLLECT_CACHE_STATS */ -#define H5AC_DUMP_STATS_ON_CLOSE 0 +#define H5AC_DUMP_STATS_ON_CLOSE 0 #endif /* H5C_COLLECT_CACHE_STATS */ @@ -87,9 +87,8 @@ typedef enum { * At present, these are the same as those given in H5Cprivate.h. */ -#define H5AC__DEFAULT_MAX_CACHE_SIZE H5C__DEFAULT_MAX_CACHE_SIZE -#define H5AC__DEFAULT_MIN_CLEAN_SIZE H5C__DEFAULT_MIN_CLEAN_SIZE - +#define H5AC__DEFAULT_MAX_CACHE_SIZE H5C__DEFAULT_MAX_CACHE_SIZE +#define H5AC__DEFAULT_MIN_CLEAN_SIZE H5C__DEFAULT_MIN_CLEAN_SIZE /* * Class methods pertaining to caching. Each type of cached object will @@ -115,18 +114,17 @@ typedef enum { * Note that the space allocated on disk may not be contiguous. */ -#define H5AC_CALLBACK__NO_FLAGS_SET H5C_CALLBACK__NO_FLAGS_SET -#define H5AC_CALLBACK__SIZE_CHANGED_FLAG H5C_CALLBACK__SIZE_CHANGED_FLAG -#define H5AC_CALLBACK__MOVED_FLAG H5C_CALLBACK__MOVED_FLAG - -typedef H5C_load_func_t H5AC_load_func_t; -typedef H5C_flush_func_t H5AC_flush_func_t; -typedef H5C_dest_func_t H5AC_dest_func_t; -typedef H5C_clear_func_t H5AC_clear_func_t; -typedef H5C_size_func_t H5AC_size_func_t; +#define H5AC_CALLBACK__NO_FLAGS_SET H5C_CALLBACK__NO_FLAGS_SET +#define H5AC_CALLBACK__SIZE_CHANGED_FLAG H5C_CALLBACK__SIZE_CHANGED_FLAG +#define H5AC_CALLBACK__MOVED_FLAG H5C_CALLBACK__MOVED_FLAG -typedef H5C_class_t H5AC_class_t; +typedef H5C_load_func_t H5AC_load_func_t; +typedef H5C_flush_func_t H5AC_flush_func_t; +typedef H5C_dest_func_t H5AC_dest_func_t; +typedef H5C_clear_func_t H5AC_clear_func_t; +typedef H5C_size_func_t H5AC_size_func_t; +typedef H5C_class_t H5AC_class_t; /* The H5AC_NSLOTS #define is now obsolete, as the metadata cache no longer * uses slots. However I am leaving it in for now to avoid modifying the @@ -141,11 +139,9 @@ typedef H5C_class_t H5AC_class_t; * cache entry by hashing the object's file address. Each file has its * own cache, an array of slots. */ -#define H5AC_NSLOTS 10330 /* The library "likes" this number... */ - - -typedef H5C_cache_entry_t H5AC_info_t; +#define H5AC_NSLOTS 10330 /* The library "likes" this number... */ +typedef H5C_cache_entry_t H5AC_info_t; /*===----------------------------------------------------------------------=== * Protect Types @@ -157,21 +153,20 @@ typedef H5C_cache_entry_t H5AC_info_t; */ typedef enum H5AC_protect_t { - H5AC_WRITE, /* Protect object for writing */ - H5AC_READ /* Protect object for reading */ + H5AC_WRITE, /* Protect object for writing */ + H5AC_READ /* Protect object for reading */ } H5AC_protect_t; - /* Typedef for metadata cache (defined in H5Cpkg.h) */ -typedef H5C_t H5AC_t; +typedef H5C_t H5AC_t; /* Metadata specific properties for FAPL */ /* (Only used for parallel I/O) */ #ifdef H5_HAVE_PARALLEL /* Definitions for "collective metadata write" property */ -#define H5AC_COLLECTIVE_META_WRITE_NAME "H5AC_collective_metadata_write" -#define H5AC_COLLECTIVE_META_WRITE_SIZE sizeof(unsigned) -#define H5AC_COLLECTIVE_META_WRITE_DEF 0 +#define H5AC_COLLECTIVE_META_WRITE_NAME "H5AC_collective_metadata_write" +#define H5AC_COLLECTIVE_META_WRITE_SIZE sizeof(unsigned) +#define H5AC_COLLECTIVE_META_WRITE_DEF 0 #endif /* H5_HAVE_PARALLEL */ /* Dataset transfer property list for flush calls */ @@ -183,13 +178,11 @@ extern hid_t H5AC_dxpl_id; /* (just "library internal" set - i.e. independent transfer mode) */ /* (Global variable declaration, definition is in H5AC.c) */ extern H5P_genplist_t *H5AC_ind_dxpl_g; -extern hid_t H5AC_ind_dxpl_id; - +extern hid_t H5AC_ind_dxpl_id; /* Default cache configuration. */ -#define H5AC__DEFAULT_METADATA_WRITE_STRATEGY \ - H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED +#define H5AC__DEFAULT_METADATA_WRITE_STRATEGY H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED /* clang-format off */ #ifdef H5_HAVE_PARALLEL @@ -267,7 +260,6 @@ extern hid_t H5AC_ind_dxpl_id; #endif /* H5_HAVE_PARALLEL */ /* clang-format on */ - /* * Library prototypes. */ @@ -277,93 +269,79 @@ extern hid_t H5AC_ind_dxpl_id; * the equivalent flags from H5Cprivate.h. */ -#define H5AC__NO_FLAGS_SET H5C__NO_FLAGS_SET -#define H5AC__SET_FLUSH_MARKER_FLAG H5C__SET_FLUSH_MARKER_FLAG -#define H5AC__DELETED_FLAG H5C__DELETED_FLAG -#define H5AC__DIRTIED_FLAG H5C__DIRTIED_FLAG -#define H5AC__PIN_ENTRY_FLAG H5C__PIN_ENTRY_FLAG -#define H5AC__UNPIN_ENTRY_FLAG H5C__UNPIN_ENTRY_FLAG -#define H5AC__FLUSH_INVALIDATE_FLAG H5C__FLUSH_INVALIDATE_FLAG -#define H5AC__FLUSH_CLEAR_ONLY_FLAG H5C__FLUSH_CLEAR_ONLY_FLAG +#define H5AC__NO_FLAGS_SET H5C__NO_FLAGS_SET +#define H5AC__SET_FLUSH_MARKER_FLAG H5C__SET_FLUSH_MARKER_FLAG +#define H5AC__DELETED_FLAG H5C__DELETED_FLAG +#define H5AC__DIRTIED_FLAG H5C__DIRTIED_FLAG +#define H5AC__PIN_ENTRY_FLAG H5C__PIN_ENTRY_FLAG +#define H5AC__UNPIN_ENTRY_FLAG H5C__UNPIN_ENTRY_FLAG +#define H5AC__FLUSH_INVALIDATE_FLAG H5C__FLUSH_INVALIDATE_FLAG +#define H5AC__FLUSH_CLEAR_ONLY_FLAG H5C__FLUSH_CLEAR_ONLY_FLAG #define H5AC__FLUSH_MARKED_ENTRIES_FLAG H5C__FLUSH_MARKED_ENTRIES_FLAG #define H5AC__FLUSH_IGNORE_PROTECTED_FLAG H5C__FLUSH_IGNORE_PROTECTED_FLAG -#define H5AC__FREE_FILE_SPACE_FLAG H5C__FREE_FILE_SPACE_FLAG +#define H5AC__FREE_FILE_SPACE_FLAG H5C__FREE_FILE_SPACE_FLAG #define H5AC__TAKE_OWNERSHIP_FLAG H5C__TAKE_OWNERSHIP_FLAG - /* #defines of flags used to report entry status in the * H5AC_get_entry_status() call. */ -#define H5AC_ES__IN_CACHE 0x0001 -#define H5AC_ES__IS_DIRTY 0x0002 -#define H5AC_ES__IS_PROTECTED 0x0004 +#define H5AC_ES__IN_CACHE 0x0001 +#define H5AC_ES__IS_DIRTY 0x0002 +#define H5AC_ES__IS_PROTECTED 0x0004 #define H5AC_ES__IS_PINNED 0x0008 - /* external function declarations: */ H5_DLL herr_t H5AC_init(void); H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr); -H5_DLL herr_t H5AC_get_entry_status(const H5F_t *f, haddr_t addr, - unsigned * status_ptr); -H5_DLL herr_t H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, - haddr_t addr, void *thing, unsigned int flags); +H5_DLL herr_t H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status_ptr); +H5_DLL herr_t H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, + unsigned int flags); H5_DLL herr_t H5AC_pin_protected_entry(void *thing); -H5_DLL void * H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, - haddr_t addr, void *udata, H5AC_protect_t rw); +H5_DLL void * H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *udata, + H5AC_protect_t rw); H5_DLL herr_t H5AC_resize_entry(void *thing, size_t new_size); H5_DLL herr_t H5AC_unpin_entry(void *thing); -H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, - const H5AC_class_t *type, haddr_t addr, - void *thing, unsigned flags); +H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, + unsigned flags); H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5AC_mark_entry_dirty(void *thing); -H5_DLL herr_t H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, - haddr_t old_addr, haddr_t new_addr); +H5_DLL herr_t H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_addr); H5_DLL herr_t H5AC_dest(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, - const H5AC_class_t *type, haddr_t addr, +H5_DLL herr_t H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, unsigned flags); H5_DLL herr_t H5AC_set_sync_point_done_callback(H5C_t *cache_ptr, - void (*sync_point_done)(int num_writes, haddr_t *written_entries_tbl)); + void (*sync_point_done)(int num_writes, + haddr_t *written_entries_tbl)); -H5_DLL herr_t H5AC_set_write_done_callback(H5C_t * cache_ptr, - void (* write_done)(void)); +H5_DLL herr_t H5AC_set_write_done_callback(H5C_t *cache_ptr, void (*write_done)(void)); H5_DLL herr_t H5AC_stats(const H5F_t *f); H5_DLL herr_t H5AC_dump_cache(const H5F_t *f); -H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr, - H5AC_cache_config_t *config_ptr); +H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr); -H5_DLL herr_t H5AC_get_cache_size(H5AC_t * cache_ptr, - size_t * max_size_ptr, - size_t * min_clean_size_ptr, - size_t * cur_size_ptr, - int32_t * cur_num_entries_ptr); +H5_DLL herr_t H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr, + size_t *cur_size_ptr, int32_t *cur_num_entries_ptr); -H5_DLL herr_t H5AC_get_cache_hit_rate(H5AC_t * cache_ptr, - double * hit_rate_ptr); +H5_DLL herr_t H5AC_get_cache_hit_rate(H5AC_t *cache_ptr, double *hit_rate_ptr); -H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t * cache_ptr); +H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t *cache_ptr); -H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, - H5AC_cache_config_t *config_ptr); +H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr); -H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t * config_ptr); +H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t *config_ptr); -H5_DLL herr_t H5AC_close_trace_file( H5AC_t * cache_ptr); +H5_DLL herr_t H5AC_close_trace_file(H5AC_t *cache_ptr); -H5_DLL herr_t H5AC_open_trace_file(H5AC_t * cache_ptr, - const char * trace_file_name); +H5_DLL herr_t H5AC_open_trace_file(H5AC_t *cache_ptr, const char *trace_file_name); #ifdef H5_HAVE_PARALLEL -H5_DLL herr_t H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr); +H5_DLL herr_t H5AC_add_candidate(H5AC_t *cache_ptr, haddr_t addr); #endif /* H5_HAVE_PARALLEL */ #endif /* !_H5ACprivate_H */ - |