Please, help us to better know about our user community by answering the following short survey: https://www.hdfgroup.org/website-survey/
HDF5  1.8.23
C-API Reference
Metadata Cache

Detailed Description

Functions

herr_t H5Fget_mdc_config (hid_t file_id, H5AC_cache_config_t *config_ptr)
 Obtains current metadata cache configuration for target file. More...
 
herr_t H5Fset_mdc_config (hid_t file_id, H5AC_cache_config_t *config_ptr)
 Attempts to configure metadata cache of target file. More...
 
herr_t H5Fget_mdc_hit_rate (hid_t file_id, double *hit_rate_ptr)
 Obtains target file's metadata cache hit rate. More...
 
herr_t H5Fget_mdc_size (hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, int *cur_num_entries_ptr)
 Obtains current metadata cache size data for specified file. More...
 
herr_t H5Freset_mdc_hit_rate_stats (hid_t file_id)
 Resets hit rate statistics counters for the target file. More...
 

Function Documentation

◆ H5Fget_mdc_config()

herr_t H5Fget_mdc_config ( hid_t  file_id,
H5AC_cache_config_t config_ptr 
)

Obtains current metadata cache configuration for target file.

Parameters
[in]file_idFile identifier
[in,out]config_ptrPointer to the H5AC_cache_config_t instance in which the current metadata cache configuration is to be reported. The fields of this structure are discussed here.
Returns
Returns a non-negative value if successful; otherwise returns a negative value.
Note
The in direction applies only to the H5AC_cache_config_t::version field. All other fields are out parameters.

H5Fget_mdc_config() loads the current metadata cache configuration into the instance of H5AC_cache_config_t pointed to by the config_ptr parameter.
The fields of the H5AC_cache_config_t structure are shown below:

typedef struct H5AC_cache_config_t {
/* general configuration fields: */
int version;
size_t initial_size;
size_t max_size;
size_t min_size;
long int epoch_length;
/* size increase control fields: */
double increment;
size_t max_increment;
/* size decrease control fields: */
double decrement;
size_t max_decrement;
double empty_reserve;
/* parallel configuration fields: */
#define H5AC__MAX_TRACE_FILE_NAME_LEN
Definition: H5ACpublic.h:437
H5C_cache_incr_mode
Definition: H5Cpublic.h:34
H5C_cache_decr_mode
Definition: H5Cpublic.h:50
H5C_cache_flash_incr_mode
Definition: H5Cpublic.h:42
unsigned int hbool_t
Definition: H5public.h:250
Definition: H5ACpublic.h:467
enum H5C_cache_flash_incr_mode flash_incr_mode
Definition: H5ACpublic.h:620
double lower_hr_threshold
Definition: H5ACpublic.h:590
hbool_t apply_max_increment
Definition: H5ACpublic.h:612
hbool_t evictions_enabled
Definition: H5ACpublic.h:531
double decrement
Definition: H5ACpublic.h:662
enum H5C_cache_decr_mode decr_mode
Definition: H5ACpublic.h:643
size_t initial_size
Definition: H5ACpublic.h:555
hbool_t open_trace_file
Definition: H5ACpublic.h:483
hbool_t apply_empty_reserve
Definition: H5ACpublic.h:688
hbool_t set_initial_size
Definition: H5ACpublic.h:551
size_t max_decrement
Definition: H5ACpublic.h:678
double flash_multiple
Definition: H5ACpublic.h:625
int epochs_before_eviction
Definition: H5ACpublic.h:682
int metadata_write_strategy
Definition: H5ACpublic.h:712
double upper_hr_threshold
Definition: H5ACpublic.h:648
int dirty_bytes_threshold
Definition: H5ACpublic.h:701
char trace_file_name[1024+1]
Definition: H5ACpublic.h:516
double flash_threshold
Definition: H5ACpublic.h:634
double empty_reserve
Definition: H5ACpublic.h:692
hbool_t rpt_fcn_enabled
Definition: H5ACpublic.h:475
int version
Definition: H5ACpublic.h:470
double min_clean_fraction
Definition: H5ACpublic.h:561
hbool_t apply_max_decrement
Definition: H5ACpublic.h:674
double increment
Definition: H5ACpublic.h:600
long int epoch_length
Definition: H5ACpublic.h:578
hbool_t close_trace_file
Definition: H5ACpublic.h:504
size_t max_increment
Definition: H5ACpublic.h:616
enum H5C_cache_incr_mode incr_mode
Definition: H5ACpublic.h:585
size_t max_size
Definition: H5ACpublic.h:570
size_t min_size
Definition: H5ACpublic.h:574

(Click on a enumerator, field, or type for more information.)

Since
1.8.0

◆ H5Fget_mdc_hit_rate()

herr_t H5Fget_mdc_hit_rate ( hid_t  file_id,
double *  hit_rate_ptr 
)

Obtains target file's metadata cache hit rate.

Parameters
[in]file_idFile identifier
[out]hit_rate_ptrPointer to the double in which the hit rate is returned. Note that hit_rate_ptr is undefined if the API call fails
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Fget_mdc_hit_rate() queries the metadata cache of the target file to obtain its hit rate (cache hits / (cache hits + cache misses)) since the last time hit rate statistics were reset. If the cache has not been accessed since the last time the hit rate stats were reset, the hit rate is defined to be 0.0.

The hit rate stats can be reset either manually (via H5Freset_mdc_hit_rate_stats()), or automatically. If the cache's adaptive resize code is enabled, the hit rate stats will be reset once per epoch. If they are reset manually as well, the cache may behave oddly.

See the overview of the metadata cache in the special topics section of the user manual for details on the metadata cache and its adaptive resize algorithms.

◆ H5Fget_mdc_size()

herr_t H5Fget_mdc_size ( hid_t  file_id,
size_t *  max_size_ptr,
size_t *  min_clean_size_ptr,
size_t *  cur_size_ptr,
int *  cur_num_entries_ptr 
)

Obtains current metadata cache size data for specified file.

Parameters
[in]file_idFile identifier
[out]max_size_ptrPointer to the location in which the current cache maximum size is to be returned, or NULL if this datum is not desired
[out]min_clean_size_ptrPointer to the location in which the current cache minimum clean size is to be returned, or NULL if that datum is not desired
[out]cur_size_ptrPointer to the location in which the current cache size is to be returned, or NULL if that datum is not desired
[out]cur_num_entries_ptrPointer to the location in which the current number of entries in the cache is to be returned, or NULL if that datum is not desired
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Fget_mdc_size() queries the metadata cache of the target file for the desired size information, and returns this information in the locations indicated by the pointer parameters. If any pointer parameter is NULL, the associated data is not returned.

If the API call fails, the values returned via the pointer parameters are undefined.

If adaptive cache resizing is enabled, the cache maximum size and minimum clean size may change at the end of each epoch. Current size and current number of entries can change on each cache access.

Current size can exceed maximum size under certain conditions. See the overview of the metadata cache in the special topics section of the user manual for a discussion of this.

◆ H5Freset_mdc_hit_rate_stats()

herr_t H5Freset_mdc_hit_rate_stats ( hid_t  file_id)

Resets hit rate statistics counters for the target file.

Parameters
[in]file_idFile identifier
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Freset_mdc_hit_rate_stats() resets the hit rate statistics counters in the metadata cache associated with the specified file.

If the adaptive cache resizing code is enabled, the hit rate statistics are reset at the beginning of each epoch. This API call allows you to do the same thing from your program.

The adaptive cache resizing code may behave oddly if you use this call when adaptive cache resizing is enabled. However, the call should be useful if you choose to control metadata cache size from your program.

See Metadata Caching in HDF5 for details about the metadata cache and the adaptive cache resizing algorithms. If you have not read, understood, and thought about the material covered in that documentation, you should not be using this API call.

◆ H5Fset_mdc_config()

herr_t H5Fset_mdc_config ( hid_t  file_id,
H5AC_cache_config_t config_ptr 
)

Attempts to configure metadata cache of target file.

Parameters
[in]file_idFile identifier
[in,out]config_ptrPointer to the H5AC_cache_config_t instance containing the desired configuration. The fields of this structure are discussed here.
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Fset_mdc_config() attempts to configure the file's metadata cache according configuration supplied in config_ptr.

(Click on a enumerator, field, or type for more information.)

Since
1.8.0