HDF5  1.12.0
H5Cprivate.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group. *
3  * Copyright by the Board of Trustees of the University of Illinois. *
4  * All rights reserved. *
5  * *
6  * This file is part of HDF5. The full HDF5 copyright notice, including *
7  * terms governing use, modification, and redistribution, is contained in *
8  * the COPYING file, which can be found at the root of the source code *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
10  * If you do not have access to either file, you may request a copy from *
11  * help@hdfgroup.org. *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /*-------------------------------------------------------------------------
15  *
16  * Created: H5Cprivate.h
17  * 6/3/04
18  * John Mainzer
19  *
20  * Purpose: Constants and typedefs available to the rest of the
21  * library.
22  *
23  * Modifications:
24  *
25  *-------------------------------------------------------------------------
26  */
27 
28 #ifndef _H5Cprivate_H
29 #define _H5Cprivate_H
30 
31 #include "H5Cpublic.h" /* public prototypes */
32 
33 /* Private headers needed by this header */
34 #include "H5private.h" /* Generic Functions */
35 #include "H5Fprivate.h" /* File access */
36 
37 /**************************/
38 /* Library Private Macros */
39 /**************************/
40 
41 /* Cache configuration settings */
42 #define H5C__MAX_NUM_TYPE_IDS 30
43 #define H5C__PREFIX_LEN 32
44 
45 /* This sanity checking constant was picked out of the air. Increase
46  * or decrease it if appropriate. Its purposes is to detect corrupt
47  * object sizes, so it probably doesn't matter if it is a bit big.
48  *
49  * JRM - 5/17/04
50  */
51 #define H5C_MAX_ENTRY_SIZE ((size_t)(32 * 1024 * 1024))
52 
53 #ifdef H5_HAVE_PARALLEL
54 /* we must maintain the clean and dirty LRU lists when we are compiled
55  * with parallel support.
56  */
57 #define H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS 1
58 #else /* H5_HAVE_PARALLEL */
59 /* The clean and dirty LRU lists don't buy us anything here -- we may
60  * want them on for testing on occasion, but in general they should be
61  * off.
62  */
63 #define H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS 0
64 #endif /* H5_HAVE_PARALLEL */
65 
66 /* Flags for cache client class behavior */
67 #define H5C__CLASS_NO_FLAGS_SET ((unsigned)0x0)
68 #define H5C__CLASS_SPECULATIVE_LOAD_FLAG ((unsigned)0x1)
69 /* The following flags may only appear in test code */
70 #define H5C__CLASS_SKIP_READS ((unsigned)0x2)
71 #define H5C__CLASS_SKIP_WRITES ((unsigned)0x4)
72 
73 /* Flags for pre-serialize callback */
74 #define H5C__SERIALIZE_NO_FLAGS_SET ((unsigned)0)
75 #define H5C__SERIALIZE_RESIZED_FLAG ((unsigned)0x1)
76 #define H5C__SERIALIZE_MOVED_FLAG ((unsigned)0x2)
77 
78 /* Upper and lower limits on cache size. These limits are picked
79  * out of a hat -- you should be able to change them as necessary.
80  *
81  * However, if you need a very big cache, you should also increase the
82  * size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current
83  * upper bound on cache size is rather large for the current hash table
84  * size.
85  */
86 #define H5C__MAX_MAX_CACHE_SIZE ((size_t)(128 * 1024 * 1024))
87 #define H5C__MIN_MAX_CACHE_SIZE ((size_t)(1024))
88 
89 /* Default max cache size and min clean size are give here to make
90  * them generally accessible.
91  */
92 #define H5C__DEFAULT_MAX_CACHE_SIZE ((size_t)(4 * 1024 * 1024))
93 #define H5C__DEFAULT_MIN_CLEAN_SIZE ((size_t)(2 * 1024 * 1024))
94 
95 /* Values for cache entry magic field */
96 #define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A
97 #define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef
98 
99 /* Cache configuration validation definitions */
100 #define H5C_RESIZE_CFG__VALIDATE_GENERAL 0x1
101 #define H5C_RESIZE_CFG__VALIDATE_INCREMENT 0x2
102 #define H5C_RESIZE_CFG__VALIDATE_DECREMENT 0x4
103 #define H5C_RESIZE_CFG__VALIDATE_INTERACTIONS 0x8
104 #define H5C_RESIZE_CFG__VALIDATE_ALL \
105 ( \
106  H5C_RESIZE_CFG__VALIDATE_GENERAL | \
107  H5C_RESIZE_CFG__VALIDATE_INCREMENT | \
108  H5C_RESIZE_CFG__VALIDATE_DECREMENT | \
109  H5C_RESIZE_CFG__VALIDATE_INTERACTIONS \
110 )
111 
112 /* Cache configuration versions */
113 #define H5C__CURR_AUTO_SIZE_CTL_VER 1
114 #define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1
115 #define H5C__CURR_CACHE_IMAGE_CTL_VER 1
116 
117 /* Default configuration settings */
118 #define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f
119 #define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f
120 #define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024))
121 #define H5C__DEF_AR_INIT_SIZE ((size_t)( 1 * 1024 * 1024))
122 #define H5C__DEF_AR_MIN_SIZE ((size_t)( 1 * 1024 * 1024))
123 #define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f
124 #define H5C__DEF_AR_INCREMENT 2.0f
125 #define H5C__DEF_AR_MAX_INCREMENT ((size_t)( 2 * 1024 * 1024))
126 #define H5C__DEF_AR_FLASH_MULTIPLE 1.0f
127 #define H5C__DEV_AR_FLASH_THRESHOLD 0.25f
128 #define H5C__DEF_AR_DECREMENT 0.9f
129 #define H5C__DEF_AR_MAX_DECREMENT ((size_t)( 1 * 1024 * 1024))
130 #define H5C__DEF_AR_EPCHS_B4_EVICT 3
131 #define H5C__DEF_AR_EMPTY_RESERVE 0.05f
132 #define H5C__MIN_AR_EPOCH_LENGTH 100
133 #define H5C__DEF_AR_EPOCH_LENGTH 50000
134 #define H5C__MAX_AR_EPOCH_LENGTH 1000000
135 
136 /* #defines of flags used in the flags parameters in some of the
137  * following function calls. Note that not all flags are applicable
138  * to all function calls. Flags that don't apply to a particular
139  * function are ignored in that function.
140  *
141  * These flags apply to all function calls:
142  * H5C__NO_FLAGS_SET (generic "no flags set" for all fcn calls)
143  *
144  *
145  * These flags apply to H5C_insert_entry():
146  * H5C__SET_FLUSH_MARKER_FLAG
147  * H5C__PIN_ENTRY_FLAG
148  * H5C__FLUSH_LAST_FLAG ; super block only
149  * H5C__FLUSH_COLLECTIVELY_FLAG ; super block only
150  *
151  * These flags apply to H5C_protect()
152  * H5C__READ_ONLY_FLAG
153  * H5C__FLUSH_LAST_FLAG ; super block only
154  * H5C__FLUSH_COLLECTIVELY_FLAG ; super block only
155  *
156  * These flags apply to H5C_unprotect():
157  * H5C__SET_FLUSH_MARKER_FLAG
158  * H5C__DELETED_FLAG
159  * H5C__DIRTIED_FLAG
160  * H5C__PIN_ENTRY_FLAG
161  * H5C__UNPIN_ENTRY_FLAG
162  * H5C__FREE_FILE_SPACE_FLAG
163  * H5C__TAKE_OWNERSHIP_FLAG
164  *
165  * These flags apply to H5C_expunge_entry():
166  * H5C__FREE_FILE_SPACE_FLAG
167  *
168  * These flags apply to H5C_evict():
169  * H5C__EVICT_ALLOW_LAST_PINS_FLAG
170  *
171  * These flags apply to H5C_flush_cache():
172  * H5C__FLUSH_INVALIDATE_FLAG
173  * H5C__FLUSH_CLEAR_ONLY_FLAG
174  * H5C__FLUSH_MARKED_ENTRIES_FLAG
175  * H5C__FLUSH_IGNORE_PROTECTED_FLAG (can't use this flag in combination
176  * with H5C__FLUSH_INVALIDATE_FLAG)
177  * H5C__DURING_FLUSH_FLAG
178  *
179  * These flags apply to H5C_flush_single_entry():
180  * H5C__FLUSH_INVALIDATE_FLAG
181  * H5C__FLUSH_CLEAR_ONLY_FLAG
182  * H5C__FLUSH_MARKED_ENTRIES_FLAG
183  * H5C__TAKE_OWNERSHIP_FLAG
184  * H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG
185  * H5C__GENERATE_IMAGE_FLAG
186  * H5C__UPDATE_PAGE_BUFFER_FLAG
187  */
188 #define H5C__NO_FLAGS_SET 0x00000
189 #define H5C__SET_FLUSH_MARKER_FLAG 0x00001
190 #define H5C__DELETED_FLAG 0x00002
191 #define H5C__DIRTIED_FLAG 0x00004
192 #define H5C__PIN_ENTRY_FLAG 0x00008
193 #define H5C__UNPIN_ENTRY_FLAG 0x00010
194 #define H5C__FLUSH_INVALIDATE_FLAG 0x00020
195 #define H5C__FLUSH_CLEAR_ONLY_FLAG 0x00040
196 #define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x00080
197 #define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x00100
198 #define H5C__READ_ONLY_FLAG 0x00200
199 #define H5C__FREE_FILE_SPACE_FLAG 0x00400
200 #define H5C__TAKE_OWNERSHIP_FLAG 0x00800
201 #define H5C__FLUSH_LAST_FLAG 0x01000
202 #define H5C__FLUSH_COLLECTIVELY_FLAG 0x02000
203 #define H5C__EVICT_ALLOW_LAST_PINS_FLAG 0x04000
204 #define H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG 0x08000
205 #define H5C__DURING_FLUSH_FLAG 0x10000 /* Set when the entire cache is being flushed */
206 #define H5C__GENERATE_IMAGE_FLAG 0x20000 /* Set during parallel I/O */
207 #define H5C__UPDATE_PAGE_BUFFER_FLAG 0x40000 /* Set during parallel I/O */
208 
209 /* Debugging/sanity checking/statistics settings */
210 #ifndef NDEBUG
211 #define H5C_DO_SANITY_CHECKS 1
212 #define H5C_DO_SLIST_SANITY_CHECKS 0
213 #define H5C_DO_TAGGING_SANITY_CHECKS 1
214 #define H5C_DO_EXTREME_SANITY_CHECKS 0
215 #else /* NDEBUG */
216 /* With rare execptions, the following defines should be set
217  * to 0 if NDEBUG is defined
218  */
219 #define H5C_DO_SANITY_CHECKS 0
220 #define H5C_DO_SLIST_SANITY_CHECKS 0
221 #define H5C_DO_TAGGING_SANITY_CHECKS 0
222 #define H5C_DO_EXTREME_SANITY_CHECKS 0
223 #endif /* NDEBUG */
224 
225 /* Cork actions: cork/uncork/get cork status of an object */
226 #define H5C__SET_CORK 0x1
227 #define H5C__UNCORK 0x2
228 #define H5C__GET_CORKED 0x4
229 
230 /* Note: The memory sanity checks aren't going to work until I/O filters are
231  * changed to call a particular alloc/free routine for their buffers,
232  * because the H5AC__SERIALIZE_RESIZED_FLAG set by the fractal heap
233  * direct block serialize callback calls H5Z_pipeline(). When the I/O
234  * filters are changed, then we should implement "cache image alloc/free"
235  * routines that the fractal heap direct block (and global heap) serialize
236  * calls can use when resizing (and re-allocating) their image in the
237  * cache. -QAK */
238 #define H5C_DO_MEMORY_SANITY_CHECKS 0
239 
240 /* H5C_COLLECT_CACHE_STATS controls overall collection of statistics
241  * on cache activity. In general, this #define should be set to 1 in
242  * debug mode, and 0 in production mode..
243  */
244 
245 #ifndef NDEBUG
246 #define H5C_COLLECT_CACHE_STATS 1
247 #else /* NDEBUG */
248 #define H5C_COLLECT_CACHE_STATS 0
249 #endif /* NDEBUG */
250 
251 /* H5C_COLLECT_CACHE_ENTRY_STATS controls collection of statistics
252  * in individual cache entries.
253  *
254  * H5C_COLLECT_CACHE_ENTRY_STATS should only be defined to true if
255  * H5C_COLLECT_CACHE_STATS is also defined to true.
256  */
257 #if H5C_COLLECT_CACHE_STATS
258 #define H5C_COLLECT_CACHE_ENTRY_STATS 1
259 #else
260 #define H5C_COLLECT_CACHE_ENTRY_STATS 0
261 #endif /* H5C_COLLECT_CACHE_STATS */
262 
263 
264 /****************************/
265 /* Library Private Typedefs */
266 /****************************/
267 
268 /* Typedef for the main structure for the cache (defined in H5Cpkg.h) */
269 typedef struct H5C_t H5C_t;
270 
271 /*
272  *
273  * Struct H5C_class_t
274  *
275  * Instances of H5C_class_t are used to specify the callback functions
276  * used by the metadata cache for each class of metadata cache entry.
277  * The fields of the structure are discussed below:
278  *
279  * id: Integer field containing the unique ID of the class of metadata
280  * cache entries.
281  *
282  * name: Pointer to a string containing the name of the class of metadata
283  * cache entries.
284  *
285  * mem_type: Instance of H5FD_mem_t, that is used to supply the
286  * mem type passed into H5F_block_read().
287  *
288  * flags: Flags indicating class-specific behavior.
289  *
290  * Possible flags are:
291  *
292  * H5C__CLASS_NO_FLAGS_SET: No special processing.
293  *
294  * H5C__CLASS_SPECULATIVE_LOAD_FLAG: This flag is used only in
295  * H5C_load_entry(). When it is set, entries are
296  * permitted to change their sizes on the first attempt
297  * to load.
298  *
299  * If the new size is larger than the old, the read buffer
300  * is reallocated to the new size, loaded from file, and the
301  * deserialize routine is called a second time on the
302  * new buffer. The entry returned by the first call to
303  * the deserialize routine is discarded (via the free_icr
304  * call) after the new size is retrieved (via the image_len
305  * call). Note that the new size is used as the size of the
306  * entry in the cache.
307  *
308  * If the new size is smaller than the old, no new loads
309  * or deserializes are performed, but the new size becomes
310  * the size of the entry in the cache.
311  *
312  * When this flag is set, an attempt to read past the
313  * end of file could occur. In this case, if the size
314  * returned get_load_size callback would result in a
315  * read past the end of file, the size is truncated to
316  * avoid this, and processing proceeds as normal.
317  *
318  * The following flags may only appear in test code.
319  *
320  * H5C__CLASS_SKIP_READS: This flags is intended only for use in test
321  * code. When it is set, reads on load will be skipped,
322  * and an uninitialize buffer will be passed to the
323  * deserialize function.
324  *
325  * H5C__CLASS_SKIP_WRITES: This flags is intended only for use in test
326  * code. When it is set, writes of buffers prepared by the
327  * serialize callback will be skipped.
328  *
329  * GET_INITIAL_LOAD_SIZE: Pointer to the 'get initial load size' function.
330  *
331  * This function determines the size based on the information in the
332  * parameter "udata" or an initial speculative guess. The size is
333  * returned in the parameter "image_len_ptr".
334  *
335  * For an entry with H5C__CLASS_NO_FLAGS_SET:
336  * This function returns in "image_len_ptr" the on disk size of the
337  * entry.
338  *
339  * For an entry with H5C__CLASS_SPECULATIVE_LOAD_FLAG:
340  * This function returns in "image_len_ptr" an initial guess of the
341  * entry's on disk size. This many bytes will be loaded from
342  * the file and then passed to 'get_final_load_size' callback
343  * for the actual (final) image length to be determined.
344  *
345  * The typedef for the get_initial_load_size callback is as follows:
346  *
347  * typedef herr_t (*H5C_get_initial_load_size_func_t)(void *udata_ptr,
348  * size_t *image_len_ptr);
349  *
350  * The parameters of the get_initial_load_size callback are as follows:
351  *
352  * udata_ptr: Pointer to user data provided in the protect call, which
353  * will also be passed through to the 'get_final_load_size',
354  * 'verify_chksum', and 'deserialize' callbacks.
355  *
356  * image_len_ptr: Pointer to the length in bytes of the in-file image to
357  * be deserialized is to be returned.
358  *
359  * This value is used by the cache to determine the size of
360  * the disk image for the metadata, in order to read the disk
361  * image from the file.
362  *
363  * Processing in the get_load_size function should proceed as follows:
364  *
365  * If successful, the function will place the length in the *image_len_ptr
366  * associated with supplied user data and then return SUCCEED.
367  *
368  * On failure, the function must return FAIL and push error information
369  * onto the error stack with the error API routines, without modifying
370  * the value pointed to by image_len_ptr.
371  *
372  *
373  * GET_FINAL_LOAD_SIZE: Pointer to the 'get final load size' function.
374  *
375  * This function determines the final size of a speculatively loaded
376  * metadata cache entry based on the parameter "image" and the "udata"
377  * parameters. This callback _must_ be implemented for cache clients
378  * which set the H5C__CLASS_SPECULATIVE_LOAD_FLAG and must return the
379  * actual length of on-disk image after being called once.
380  *
381  * This function might deserialize the needed metadata information to
382  * determine the actual size. The size is returned in the parameter
383  * "actual_len_ptr".
384  *
385  * The typedef for the get_load_size callback is as follows:
386  *
387  * typedef herr_t (*H5C_get_final_load_size_func_t)(const void *image_ptr,
388  * size_t image_len,
389  * void *udata_ptr,
390  * size_t *actual_len_ptr);
391  *
392  * The parameters of the get_load_size callback are as follows:
393  *
394  * image_ptr: Pointer to a buffer containing the (possibly partial)
395  * metadata read in.
396  *
397  * image_len: The length in bytes of the (possibly partial) in-file image
398  * to be queried for an actual length.
399  *
400  * udata_ptr: Pointer to user data provided in the protect call, which
401  * will also be passed through to the 'verify_chksum' and
402  * 'deserialize' callbacks.
403  *
404  * actual_len_ptr: Pointer to the location containing the actual length
405  * of the metadata entry on disk.
406  *
407  * Processing in the get_final_load_size function should proceed as follows:
408  *
409  * If successful, the function will place the length in the *actual_len_ptr
410  * associated with supplied image and/or user data and then return SUCCEED.
411  *
412  * On failure, the function must return FAIL and push error information
413  * onto the error stack with the error API routines, without modifying
414  * the value pointed to by actual_len_ptr.
415  *
416  *
417  * VERIFY_CHKSUM: Pointer to the verify_chksum function.
418  *
419  * This function verifies the checksum computed for the metadata is
420  * the same as the checksum stored in the metadata.
421  *
422  * It computes the checksum based on the metadata stored in the
423  * parameter "image_ptr" and the actual length of the metadata in the
424  * parameter "len" which is obtained from the "get_load_size" callback.
425  *
426  * The typedef for the verify_chksum callback is as follows:
427  *
428  * typedef htri_t (*H5C_verify_chksum_func_t)(const void *image_ptr,
429  * size_t len,
430  * void *udata_ptr);
431  *
432  * The parameters of the verify_chksum callback are as follows:
433  *
434  * image_ptr: Pointer to a buffer containing the metadata read in.
435  *
436  * len: The actual length of the metadata.
437  *
438  * udata_ptr: Pointer to user data.
439  *
440  *
441  * DESERIALIZE: Pointer to the deserialize function.
442  *
443  * This function must be able to deserialize a buffer containing the
444  * on-disk image of a metadata cache entry, allocate and initialize the
445  * equivalent in core representation, and return a pointer to that
446  * representation.
447  *
448  * The typedef for the deserialize callback is as follows:
449  *
450  * typedef void *(*H5C_deserialize_func_t)(const void * image_ptr,
451  * size_t len,
452  * void * udata_ptr,
453  * boolean * dirty_ptr);
454  *
455  * The parameters of the deserialize callback are as follows:
456  *
457  * image_ptr: Pointer to a buffer of length len containing the
458  * contents of the file starting at addr and continuing
459  * for len bytes.
460  *
461  * len: Length in bytes of the in file image to be deserialized.
462  *
463  * This parameter is supplied mainly for sanity checking.
464  * Sanity checks should be performed when compiled in debug
465  * mode, but the parameter may be unused when compiled in
466  * production mode.
467  *
468  * udata_ptr: Pointer to user data provided in the protect call, which
469  * must be passed through to the deserialize callback.
470  *
471  * dirty_ptr: Pointer to boolean which the deserialize function
472  * must use to mark the entry dirty if it has to modify
473  * the entry to clean up file corruption left over from
474  * an old bug in the HDF5 library.
475  *
476  * Processing in the deserialize function should proceed as follows:
477  *
478  * If the image contains valid data, and is of the correct length,
479  * the deserialize function must allocate space for an in-core
480  * representation of that data, deserialize the contents of the image
481  * into the space allocated for the in-core representation, and return
482  * a pointer to the in core representation. Observe that an
483  * instance of H5C_cache_entry_t must be the first item in this
484  * representation. The cache will initialize it after the callback
485  * returns.
486  *
487  * Note that the structure of the in-core representation is otherwise
488  * up to the cache client. All that is required is that the pointer
489  * returned be sufficient for the client's purposes when it is returned
490  * on a protect call.
491  *
492  * If the deserialize function has to clean up file corruption
493  * left over from an old bug in the HDF5 library, it must set
494  * *dirty_ptr to TRUE. If it doesn't, no action is needed as
495  * *dirty_ptr will be set to FALSE before the deserialize call.
496  *
497  * If the operation fails for any reason (i.e. bad data in buffer, bad
498  * buffer length, malloc failure, etc.) the function must return NULL and
499  * push error information on the error stack with the error API routines.
500  *
501  *
502  * IMAGE_LEN: Pointer to the image length callback.
503  *
504  * The image_len callback is used to obtain the size of newly inserted
505  * entries and assert verification.
506  *
507  * The typedef for the image_len callback is as follows:
508  *
509  * typedef herr_t (*H5C_image_len_func_t)(void *thing,
510  * size_t *image_len_ptr);
511  *
512  * The parameters of the image_len callback are as follows:
513  *
514  * thing: Pointer to the in core representation of the entry.
515  *
516  * image_len_ptr: Pointer to size_t in which the callback will return
517  * the length (in bytes) of the cache entry.
518  *
519  * Processing in the image_len function should proceed as follows:
520  *
521  * If successful, the function will place the length of the on disk
522  * image associated with the in core representation provided in the
523  * thing parameter in *image_len_ptr, and then return SUCCEED.
524  *
525  * If the function fails, it must return FAIL and push error information
526  * onto the error stack with the error API routines, and return without
527  * modifying the values pointed to by the image_len_ptr parameter.
528  *
529  *
530  * PRE_SERIALIZE: Pointer to the pre-serialize callback.
531  *
532  * The pre-serialize callback is invoked by the metadata cache before
533  * it needs a current on-disk image of the metadata entry for purposes
534  * either constructing a journal or flushing the entry to disk.
535  *
536  * If the client needs to change the address or length of the entry prior
537  * to flush, the pre-serialize callback is responsible for these actions,
538  * so that the actual serialize callback (described below) is only
539  * responsible for serializing the data structure, not moving it on disk
540  * or resizing it.
541  *
542  * In addition, the client may use the pre-serialize callback to
543  * ensure that the entry is ready to be flushed -- in particular,
544  * if the entry contains references to other entries that are in
545  * temporary file space, the pre-serialize callback must move those
546  * entries into real file space so that the serialzed entry will
547  * contain no invalid data.
548  *
549  * One would think that the base address and length of
550  * the length of the entry's image on disk would be well known.
551  * However, that need not be the case as free space section info
552  * entries will change size (and possibly location) depending on the
553  * number of blocks of free space being manages, and fractal heap
554  * direct blocks can change compressed size (and possibly location)
555  * on serialization if compression is enabled. Similarly, it may
556  * be necessary to move entries from temporary to real file space.
557  *
558  * The pre-serialize callback must report any such changes to the
559  * cache, which must then update its internal structures as needed.
560  *
561  * The typedef for the pre-serialize callback is as follows:
562  *
563  * typedef herr_t (*H5C_pre_serialize_func_t)(H5F_t *f,
564  * void * thing,
565  * haddr_t addr,
566  * size_t len,
567  * haddr_t * new_addr_ptr,
568  * size_t * new_len_ptr,
569  * unsigned * flags_ptr);
570  *
571  * The parameters of the pre-serialize callback are as follows:
572  *
573  * f: File pointer -- needed if other metadata cache entries
574  * must be modified in the process of serializing the
575  * target entry.
576  *
577  * thing: Pointer to void containing the address of the in core
578  * representation of the target metadata cache entry.
579  * This is the same pointer returned by a protect of the
580  * addr and len given above.
581  *
582  * addr: Base address in file of the entry to be serialized.
583  *
584  * This parameter is supplied mainly for sanity checking.
585  * Sanity checks should be performed when compiled in debug
586  * mode, but the parameter may be unused when compiled in
587  * production mode.
588  *
589  * len: Length in bytes of the in file image of the entry to be
590  * serialized. Also the size the image passed to the
591  * serialize callback (discussed below) unless that
592  * value is altered by this function.
593  *
594  * This parameter is supplied mainly for sanity checking.
595  * Sanity checks should be performed when compiled in debug
596  * mode, but the parameter may be unused when compiled in
597  * production mode.
598  *
599  * new_addr_ptr: Pointer to haddr_t. If the entry is moved by
600  * the serialize function, the new on disk base address must
601  * be stored in *new_addr_ptr, and the appropriate flag set
602  * in *flags_ptr.
603  *
604  * If the entry is not moved by the serialize function,
605  * *new_addr_ptr is undefined on pre-serialize callback
606  * return.
607  *
608  * new_len_ptr: Pointer to size_t. If the entry is resized by the
609  * serialize function, the new length of the on disk image
610  * must be stored in *new_len_ptr, and the appropriate flag set
611  * in *flags_ptr.
612  *
613  * If the entry is not resized by the pre-serialize function,
614  * *new_len_ptr is undefined on pre-serialize callback
615  * return.
616  *
617  * flags_ptr: Pointer to an unsigned integer used to return flags
618  * indicating whether the preserialize function resized or moved
619  * the entry. If the entry was neither resized or moved, the
620  * serialize function must set *flags_ptr to zero. The
621  * H5C__SERIALIZE_RESIZED_FLAG or H5C__SERIALIZE_MOVED_FLAG must
622  * be set to indicate a resize or move respectively.
623  *
624  * If the H5C__SERIALIZE_RESIZED_FLAG is set, the new length
625  * must be stored in *new_len_ptr.
626  *
627  * If the H5C__SERIALIZE_MOVED_FLAG flag is set, the
628  * new image base address must be stored in *new_addr_ptr.
629  *
630  * Processing in the pre-serialize function should proceed as follows:
631  *
632  * The pre-serialize function must examine the in core representation
633  * indicated by the thing parameter, if the pre-serialize function does
634  * not need to change the size or location of the on-disk image, it must
635  * set *flags_ptr to zero.
636  *
637  * If the size of the on-disk image must be changed, the pre-serialize
638  * function must load the length of the new image into *new_len_ptr, and
639  * set the H5C__SERIALIZE_RESIZED_FLAG in *flags_ptr.
640  *
641  * If the base address of the on disk image must be changed, the
642  * pre-serialize function must set *new_addr_ptr to the new base address,
643  * and set the H5C__SERIALIZE_MOVED_FLAG in *flags_ptr.
644  *
645  * In addition, the pre-serialize callback may perform any other
646  * processing required before the entry is written to disk
647  *
648  * If it is successful, the function must return SUCCEED.
649  *
650  * If it fails for any reason, the function must return FAIL and
651  * push error information on the error stack with the error API
652  * routines.
653  *
654  *
655  * SERIALIZE: Pointer to the serialize callback.
656  *
657  * The serialize callback is invoked by the metadata cache whenever
658  * it needs a current on disk image of the metadata entry for purposes
659  * either constructing a journal entry or flushing the entry to disk.
660  *
661  * At this point, the base address and length of the entry's image on
662  * disk must be well known and not change during the serialization
663  * process.
664  *
665  * While any size and/or location changes must have been handled
666  * by a pre-serialize call, the client may elect to handle any other
667  * changes to the entry required to place it in correct form for
668  * writing to disk in this call.
669  *
670  * The typedef for the serialize callback is as follows:
671  *
672  * typedef herr_t (*H5C_serialize_func_t)(const H5F_t *f,
673  * void * image_ptr,
674  * size_t len,
675  * void * thing);
676  *
677  * The parameters of the serialize callback are as follows:
678  *
679  * f: File pointer -- needed if other metadata cache entries
680  * must be modified in the process of serializing the
681  * target entry.
682  *
683  * image_ptr: Pointer to a buffer of length len bytes into which a
684  * serialized image of the target metadata cache entry is
685  * to be written.
686  *
687  * Note that this buffer will not in general be initialized
688  * to any particular value. Thus the serialize function may
689  * not assume any initial value and must set each byte in
690  * the buffer.
691  *
692  * len: Length in bytes of the in file image of the entry to be
693  * serialized. Also the size of *image_ptr (below).
694  *
695  * This parameter is supplied mainly for sanity checking.
696  * Sanity checks should be performed when compiled in debug
697  * mode, but the parameter may be unused when compiled in
698  * production mode.
699  *
700  * thing: Pointer to void containing the address of the in core
701  * representation of the target metadata cache entry.
702  * This is the same pointer returned by a protect of the
703  * addr and len given above.
704  *
705  * Processing in the serialize function should proceed as follows:
706  *
707  * If there are any remaining changes to the entry required before
708  * write to disk, they must be dealt with first.
709  *
710  * The serialize function must then examine the in core
711  * representation indicated by the thing parameter, and write a
712  * serialized image of its contents into the provided buffer.
713  *
714  * If it is successful, the function must return SUCCEED.
715  *
716  * If it fails for any reason, the function must return FAIL and
717  * push error information on the error stack with the error API
718  * routines.
719  *
720  *
721  * NOTIFY: Pointer to the notify callback.
722  *
723  * The notify callback is invoked by the metadata cache when a cache
724  * action on an entry has taken/will take place and the client indicates
725  * it wishes to be notified about the action.
726  *
727  * The typedef for the notify callback is as follows:
728  *
729  * typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action,
730  * void *thing);
731  *
732  * The parameters of the notify callback are as follows:
733  *
734  * action: An enum indicating the metadata cache action that has taken/
735  * will take place.
736  *
737  * thing: Pointer to void containing the address of the in core
738  * representation of the target metadata cache entry. This
739  * is the same pointer that would be returned by a protect
740  * of the addr and len of the entry.
741  *
742  * Processing in the notify function should proceed as follows:
743  *
744  * The notify function may perform any action it would like, including
745  * metadata cache calls.
746  *
747  * If the function is successful, it must return SUCCEED.
748  *
749  * If it fails for any reason, the function must return FAIL and
750  * push error information on the error stack with the error API
751  * routines.
752  *
753  *
754  * FREE_ICR: Pointer to the free ICR callback.
755  *
756  * The free ICR callback is invoked by the metadata cache when it
757  * wishes to evict an entry, and needs the client to free the memory
758  * allocated for the in core representation.
759  *
760  * The typedef for the free ICR callback is as follows:
761  *
762  * typedef herr_t (*H5C_free_icr_func_t)(void * thing));
763  *
764  * The parameters of the free ICR callback are as follows:
765  *
766  * thing: Pointer to void containing the address of the in core
767  * representation of the target metadata cache entry. This
768  * is the same pointer that would be returned by a protect
769  * of the addr and len of the entry.
770  *
771  * Processing in the free ICR function should proceed as follows:
772  *
773  * The free ICR function must free all memory allocated to the
774  * in core representation.
775  *
776  * If the function is successful, it must return SUCCEED.
777  *
778  * If it fails for any reason, the function must return FAIL and
779  * push error information on the error stack with the error API
780  * routines.
781  *
782  * At least when compiled with debug, it would be useful if the
783  * free ICR call would fail if the in core representation has been
784  * modified since the last serialize callback.
785  *
786  * GET_FSF_SIZE: Pointer to the get file space free size callback.
787  *
788  * In principle, there is no need for the get file space free size
789  * callback. However, as an optimization, it is sometimes convenient
790  * to allocate and free file space for a number of cache entries
791  * simultaneously in a single contiguous block of file space.
792  *
793  * File space allocation is done by the client, so the metadata cache
794  * need not be involved. However, since the metadata cache typically
795  * handles file space release when an entry is destroyed, some
796  * adjustment on the part of the metadata cache is required for this
797  * operation.
798  *
799  * The get file space free size callback exists to support this
800  * operation.
801  *
802  * If a group of cache entries that were allocated as a group are to
803  * be discarded and their file space released, the type of the first
804  * (i.e. lowest address) entry in the group must implement the
805  * get free file space size callback.
806  *
807  * To free the file space of all entries in the group in a single
808  * operation, first expunge all entries other than the first without
809  * the free file space flag.
810  *
811  * Then, to complete the operation, unprotect or expunge the first
812  * entry in the block with the free file space flag set. Since
813  * the get free file space callback is implemented, the metadata
814  * cache will use this callback to get the size of the block to be
815  * freed, instead of using the size of the entry as is done otherwise.
816  *
817  * At present this callback is used only by the H5FA and H5EA dblock
818  * and dblock page client classes.
819  *
820  * The typedef for the get_fsf_size callback is as follows:
821  *
822  * typedef herr_t (*H5C_get_fsf_size_t)(const void * thing,
823  * hsize_t *fsf_size_ptr);
824  *
825  * The parameters of the get_fsf_size callback are as follows:
826  *
827  * thing: Pointer to void containing the address of the in core
828  * representation of the target metadata cache entry. This
829  * is the same pointer that would be returned by a protect()
830  * call of the associated addr and len.
831  *
832  * fs_size_ptr: Pointer to hsize_t in which the callback will return
833  * the size of the piece of file space to be freed. Note
834  * that the space to be freed is presumed to have the same
835  * base address as the cache entry.
836  *
837  * The function simply returns the size of the block of file space
838  * to be freed in *fsf_size_ptr.
839  *
840  * If the function is successful, it must return SUCCEED.
841  *
842  * If it fails for any reason, the function must return FAIL and
843  * push error information on the error stack with the error API
844  * routines.
845  *
846  ***************************************************************************/
847 
848 /* Actions that can be reported to 'notify' client callback */
849 typedef enum H5C_notify_action_t {
850  H5C_NOTIFY_ACTION_AFTER_INSERT, /* Entry has been added to the cache
851  * via the insert call
852  */
853  H5C_NOTIFY_ACTION_AFTER_LOAD, /* Entry has been loaded into the
854  * from file via the protect call
855  */
856  H5C_NOTIFY_ACTION_AFTER_FLUSH, /* Entry has just been flushed to
857  * file.
858  */
859  H5C_NOTIFY_ACTION_BEFORE_EVICT, /* Entry is about to be evicted
860  * from cache.
861  */
862  H5C_NOTIFY_ACTION_ENTRY_DIRTIED, /* Entry has been marked dirty. */
863  H5C_NOTIFY_ACTION_ENTRY_CLEANED, /* Entry has been marked clean. */
864  H5C_NOTIFY_ACTION_CHILD_DIRTIED, /* Dependent child has been marked dirty. */
865  H5C_NOTIFY_ACTION_CHILD_CLEANED, /* Dependent child has been marked clean. */
866  H5C_NOTIFY_ACTION_CHILD_UNSERIALIZED, /* Dependent child has been marked unserialized. */
867  H5C_NOTIFY_ACTION_CHILD_SERIALIZED /* Dependent child has been marked serialized. */
869 
870 /* Cache client callback function pointers */
871 typedef herr_t (*H5C_get_initial_load_size_func_t)(void *udata_ptr, size_t *image_len_ptr);
872 typedef herr_t (*H5C_get_final_load_size_func_t)(const void *image_ptr,
873  size_t image_len, void *udata_ptr, size_t *actual_len_ptr);
874 typedef htri_t (*H5C_verify_chksum_func_t)(const void *image_ptr, size_t len, void *udata_ptr);
875 typedef void *(*H5C_deserialize_func_t)(const void *image_ptr,
876  size_t len, void *udata_ptr, hbool_t *dirty_ptr);
877 typedef herr_t (*H5C_image_len_func_t)(const void *thing, size_t *image_len_ptr);
879  size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr);
880 typedef herr_t (*H5C_serialize_func_t)(const H5F_t *f, void *image_ptr,
881  size_t len, void *thing);
883 typedef herr_t (*H5C_free_icr_func_t)(void *thing);
884 typedef herr_t (*H5C_get_fsf_size_t)(const void * thing, hsize_t *fsf_size_ptr);
885 
886 /* Metadata cache client class definition */
887 typedef struct H5C_class_t {
888  int id;
889  const char * name;
891  unsigned flags;
903 
904 /* Type definitions of callback functions used by the cache as a whole */
906  hbool_t *write_permitted_ptr);
907 typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr,
908  hbool_t was_dirty, unsigned flags);
909 
910 /****************************************************************************
911  *
912  * H5C_ring_t & associated #defines
913  *
914  * The metadata cache uses the concept of rings to order the flushes of
915  * classes of entries. In this arrangement, each entry in the cache is
916  * assigned to a ring, and on flush, the members of the outermost ring
917  * are flushed first, followed by the next outermost, and so on with the
918  * members of the innermost ring being flushed last.
919  *
920  * Note that flush dependencies are used to order flushes within rings.
921  *
922  * Note also that at the conceptual level, rings are argueably superfluous,
923  * as a similar effect could be obtained via the flush dependency mechanism.
924  * However, this would require all entries in the cache to participate in a
925  * flush dependency -- with the implied setup and takedown overhead and
926  * added complexity. Further, the flush ordering between rings need only
927  * be enforced on flush operations, and thus the use of flush dependencies
928  * instead would apply unnecessary constraints on flushes under normal
929  * operating circumstances.
930  *
931  * As of this writing, all metadata entries pretaining to data sets and
932  * groups must be flushed first, and are thus assigned to the outermost
933  * ring.
934  *
935  * Free space managers managing file space must be flushed next,
936  * and are assigned to the second and third outermost rings. Two rings
937  * are used here as the raw data free space manager must be flushed before
938  * the metadata free space manager.
939  *
940  * The object header and associated chunks used to implement superblock
941  * extension messages must be flushed next, and are thus assigned to
942  * the fourth outermost ring.
943  *
944  * The superblock proper must be flushed last, and is thus assigned to
945  * the innermost ring.
946  *
947  * The H5C_ring_t and the associated #defines below are used to define
948  * the rings. Each entry must be assigned to the appropriate ring on
949  * insertion or protect.
950  *
951  * Note that H5C_ring_t was originally an enumerated type. It was
952  * converted to an integer and a set of #defines for convenience in
953  * debugging.
954  */
955 
956 #define H5C_RING_UNDEFINED 0 /* shouldn't appear in the cache */
957 #define H5C_RING_USER 1 /* outermost ring */
958 #define H5C_RING_RDFSM 2
959 #define H5C_RING_MDFSM 3
960 #define H5C_RING_SBE 4
961 #define H5C_RING_SB 5 /* innermost ring */
962 #define H5C_RING_NTYPES 6
963 
964 typedef int H5C_ring_t;
965 
966 
967 /****************************************************************************
968  *
969  * structure H5C_cache_entry_t
970  *
971  * Instances of the H5C_cache_entry_t structure are used to store cache
972  * entries in a hash table and sometimes in a skip list.
973  * See H5SL.c for the particulars of the skip list.
974  *
975  * In typical application, this structure is the first field in a
976  * structure to be cached. For historical reasons, the external module
977  * is responsible for managing the is_dirty field (this is no longer
978  * completely true. See the comment on the is_dirty field for details).
979  * All other fields are managed by the cache.
980  *
981  * The fields of this structure are discussed individually below:
982  *
983  * JRM - 4/26/04
984  *
985  * magic: Unsigned 32 bit integer that must always be set to
986  * H5C__H5C_CACHE_ENTRY_T_MAGIC when the entry is valid.
987  * The field must be set to H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC
988  * just before the entry is freed.
989  *
990  * This is necessary, as the LRU list can be changed out
991  * from under H5C__make_space_in_cache() by the serialize
992  * callback which may change the size of an existing entry,
993  * and/or load a new entry while serializing the target entry.
994  *
995  * This in turn can cause a recursive call to
996  * H5C__make_space_in_cache() which may either flush or evict
997  * the next entry that the first invocation of that function
998  * was about to examine.
999  *
1000  * The magic field allows H5C__make_space_in_cache() to
1001  * detect this case, and re-start its scan from the bottom
1002  * of the LRU when this situation occurs.
1003  *
1004  * cache_ptr: Pointer to the cache that this entry is contained within.
1005  *
1006  * addr: Base address of the cache entry on disk.
1007  *
1008  * size: Length of the cache entry on disk in bytes Note that unlike
1009  * normal caches, the entries in this cache are of arbitrary size.
1010  *
1011  * The file space allocations for cache entries implied by the
1012  * addr and size fields must be disjoint.
1013  *
1014  * image_ptr: Pointer to void. When not NULL, this field points to a
1015  * dynamically allocated block of size bytes in which the
1016  * on disk image of the metadata cache entry is stored.
1017  *
1018  * If the entry is dirty, the pre-serialize and serialize
1019  * callbacks must be used to update this image before it is
1020  * written to disk
1021  *
1022  * image_up_to_date: Boolean flag that is set to TRUE when *image_ptr
1023  * is up to date, and set to false when the entry is dirtied.
1024  *
1025  * type: Pointer to the instance of H5C_class_t containing pointers
1026  * to the methods for cache entries of the current type. This
1027  * field should be NULL when the instance of H5C_cache_entry_t
1028  * is not in use.
1029  *
1030  * The name is not particularly descriptive, but is retained
1031  * to avoid changes in existing code.
1032  *
1033  * is_dirty: Boolean flag indicating whether the contents of the cache
1034  * entry has been modified since the last time it was written
1035  * to disk.
1036  *
1037  * dirtied: Boolean flag used to indicate that the entry has been
1038  * dirtied while protected.
1039  *
1040  * This field is set to FALSE in the protect call, and may
1041  * be set to TRUE by the H5C_mark_entry_dirty() call at any
1042  * time prior to the unprotect call.
1043  *
1044  * The H5C_mark_entry_dirty() call exists as a convenience
1045  * function for the fractal heap code which may not know if
1046  * an entry is protected or pinned, but knows that is either
1047  * protected or pinned. The dirtied field was added as in
1048  * the parallel case, it is necessary to know whether a
1049  * protected entry is dirty prior to the protect call.
1050  *
1051  * is_protected: Boolean flag indicating whether this entry is protected
1052  * (or locked, to use more conventional terms). When it is
1053  * protected, the entry cannot be flushed or accessed until
1054  * it is unprotected (or unlocked -- again to use more
1055  * conventional terms).
1056  *
1057  * Note that protected entries are removed from the LRU lists
1058  * and inserted on the protected list.
1059  *
1060  * is_read_only: Boolean flag that is only meaningful if is_protected is
1061  * TRUE. In this circumstance, it indicates whether the
1062  * entry has been protected read-only, or read/write.
1063  *
1064  * If the entry has been protected read-only (i.e. is_protected
1065  * and is_read_only are both TRUE), we allow the entry to be
1066  * protected more than once.
1067  *
1068  * In this case, the number of readers is maintained in the
1069  * ro_ref_count field (see below), and unprotect calls simply
1070  * decrement that field until it drops to zero, at which point
1071  * the entry is actually unprotected.
1072  *
1073  * ro_ref_count: Integer field used to maintain a count of the number of
1074  * outstanding read-only protects on this entry. This field
1075  * must be zero whenever either is_protected or is_read_only
1076  * are TRUE.
1077  *
1078  * is_pinned: Boolean flag indicating whether the entry has been pinned
1079  * in the cache.
1080  *
1081  * For very hot entries, the protect / unprotect overhead
1082  * can become excessive. Thus the cache has been extended
1083  * to allow an entry to be "pinned" in the cache.
1084  *
1085  * Pinning an entry in the cache has several implications:
1086  *
1087  * 1) A pinned entry cannot be evicted. Thus unprotected
1088  * pinned entries must be stored in the pinned entry
1089  * list, instead of being managed by the replacement
1090  * policy code (LRU at present).
1091  *
1092  * 2) A pinned entry can be accessed or modified at any time.
1093  * This places an extra burden on the pre-serialize and
1094  * serialize callbacks, which must ensure that a pinned
1095  * entry is consistent and ready to write to disk before
1096  * generating an image.
1097  *
1098  * 3) A pinned entry can be marked as dirty (and possibly
1099  * change size) while it is unprotected.
1100  *
1101  * 4) The flush-destroy code must allow pinned entries to
1102  * be unpinned (and possibly unprotected) during the
1103  * flush.
1104  *
1105  * JRM -- 3/16/06
1106  *
1107  * in_slist: Boolean flag indicating whether the entry is in the skip list
1108  * As a general rule, entries are placed in the list when they
1109  * are marked dirty. However they may remain in the list after
1110  * being flushed.
1111  *
1112  * Update: Dirty entries are now removed from the skip list
1113  * when they are flushed.
1114  *
1115  * flush_marker: Boolean flag indicating that the entry is to be flushed
1116  * the next time H5C_flush_cache() is called with the
1117  * H5C__FLUSH_MARKED_ENTRIES_FLAG. The flag is reset when
1118  * the entry is flushed for whatever reason.
1119  *
1120  * flush_me_last: Boolean flag indicating that this entry should not be
1121  * flushed from the cache until all other entries without
1122  * the flush_me_last flag set have been flushed.
1123  *
1124  * Note:
1125  *
1126  * At this time, the flush_me_last
1127  * flag will only be applied to one entry, the superblock,
1128  * and the code utilizing these flags is protected with HDasserts
1129  * to enforce this. This restraint can certainly be relaxed in
1130  * the future if the the need for multiple entries getting flushed
1131  * last or collectively arises, though the code allowing for that
1132  * will need to be expanded and tested appropriately if that
1133  * functionality is desired.
1134  *
1135  * Update: There are now two possible last entries
1136  * (superblock and file driver info message). This
1137  * number will probably increase as we add superblock
1138  * messages. JRM -- 11/18/14
1139  *
1140  * clear_on_unprotect: Boolean flag used only in PHDF5. When H5C is used
1141  * to implement the metadata cache In the parallel case, only
1142  * the cache with mpi rank 0 is allowed to actually write to
1143  * file -- all other caches must retain dirty entries until they
1144  * are advised that the entry is clean.
1145  *
1146  * This flag is used in the case that such an advisory is
1147  * received when the entry is protected. If it is set when an
1148  * entry is unprotected, and the dirtied flag is not set in
1149  * the unprotect, the entry's is_dirty flag is reset by flushing
1150  * it with the H5C__FLUSH_CLEAR_ONLY_FLAG.
1151  *
1152  * flush_immediately: Boolean flag used only in Phdf5 -- and then only
1153  * for H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED.
1154  *
1155  * When a distributed metadata write is triggered at a
1156  * sync point, this field is used to mark entries that
1157  * must be flushed before leaving the sync point. At all
1158  * other times, this field should be set to FALSE.
1159  *
1160  * flush_in_progress: Boolean flag that is set to true iff the entry
1161  * is in the process of being flushed. This allows the cache
1162  * to detect when a call is the result of a flush callback.
1163  *
1164  * destroy_in_progress: Boolean flag that is set to true iff the entry
1165  * is in the process of being flushed and destroyed.
1166  *
1167  *
1168  * Fields supporting rings for flush ordering:
1169  *
1170  * All entries in the metadata cache are assigned to a ring. On cache
1171  * flush, all entries in the outermost ring are flushed first, followed
1172  * by all members of the next outermost ring, and so on until the
1173  * innermost ring is flushed. Note that this ordering is ONLY applied
1174  * in flush and serialize calls. Rings are ignored during normal operations
1175  * in which entries are flushed as directed by the replacement policy.
1176  *
1177  * See the header comment on H5C_ring_t above for further details.
1178  *
1179  * Note that flush dependencies (see below) are used to order flushes
1180  * within rings. Unlike rings, flush dependencies are applied to ALL
1181  * writes, not just those triggered by flush or serialize calls.
1182  *
1183  * ring: Instance of H5C_ring_t indicating the ring to which this
1184  * entry is assigned.
1185  *
1186  *
1187  * Fields supporting the 'flush dependency' feature:
1188  *
1189  * Entries in the cache may have 'flush dependencies' on other entries in the
1190  * cache. A flush dependency requires that all dirty child entries be flushed
1191  * to the file before a dirty parent entry (of those child entries) can be
1192  * flushed to the file. This can be used by cache clients to create data
1193  * structures that allow Single-Writer/Multiple-Reader (SWMR) access for the
1194  * data structure.
1195  *
1196  * flush_dep_parent: Pointer to the array of flush dependency parent entries
1197  * for this entry.
1198  *
1199  * flush_dep_nparents: Number of flush dependency parent entries for this
1200  * entry, i.e. the number of valid elements in flush_dep_parent.
1201  *
1202  * flush_dep_parent_nalloc: The number of allocated elements in
1203  * flush_dep_parent_nalloc.
1204  *
1205  * flush_dep_nchildren: Number of flush dependency children for this entry. If
1206  * this field is nonzero, then this entry must be pinned and
1207  * therefore cannot be evicted.
1208  *
1209  * flush_dep_ndirty_children: Number of flush dependency children that are
1210  * either dirty or have a nonzero flush_dep_ndirty_children. If
1211  * this field is nonzero, then this entry cannot be flushed.
1212  *
1213  * flush_dep_nunser_children: Number of flush dependency children
1214  * that are either unserialized, or have a non-zero number of
1215  * positive number of unserialized children.
1216  *
1217  * Note that since there is no requirement that a clean entry
1218  * be serialized, it is possible that flush_dep_nunser_children
1219  * to be greater than flush_dep_ndirty_children.
1220  *
1221  * This field exist to facilitate correct ordering of entry
1222  * serializations when it is necessary to serialize all the
1223  * entries in the metadata cache. Thus in the cache
1224  * serialization, no entry can be serialized unless this
1225  * field contains 0.
1226  *
1227  * Fields supporting the hash table:
1228  *
1229  * Entries in the cache are indexed by a more or less conventional hash table.
1230  * If there are multiple entries in any hash bin, they are stored in a doubly
1231  * linked list.
1232  *
1233  * Addendum: JRM -- 10/14/15
1234  *
1235  * We have come to scan all entries in the cache frequently enough that
1236  * the cost of doing so by scanning the hash table has become unacceptable.
1237  * To reduce this cost, the index now also maintains a doubly linked list
1238  * of all entries in the index. This list is known as the index list.
1239  * The il_next and il_prev fields discussed below were added to support
1240  * the index list.
1241  *
1242  * ht_next: Next pointer used by the hash table to store multiple
1243  * entries in a single hash bin. This field points to the
1244  * next entry in the doubly linked list of entries in the
1245  * hash bin, or NULL if there is no next entry.
1246  *
1247  * ht_prev: Prev pointer used by the hash table to store multiple
1248  * entries in a single hash bin. This field points to the
1249  * previous entry in the doubly linked list of entries in
1250  * the hash bin, or NULL if there is no previuos entry.
1251  *
1252  * il_next: Next pointer used by the index to maintain a doubly linked
1253  * list of all entries in the index (and thus in the cache).
1254  * This field contains a pointer to the next entry in the
1255  * index list, or NULL if there is no next entry.
1256  *
1257  * il_prev: Prev pointer used by the index to maintain a doubly linked
1258  * list of all entries in the index (and thus in the cache).
1259  * This field contains a pointer to the previous entry in the
1260  * index list, or NULL if there is no previous entry.
1261  *
1262  *
1263  * Fields supporting replacement policies:
1264  *
1265  * The cache must have a replacement policy, and it will usually be
1266  * necessary for this structure to contain fields supporting that policy.
1267  *
1268  * While there has been interest in several replacement policies for
1269  * this cache, the initial development schedule is tight. Thus I have
1270  * elected to support only a modified LRU policy for the first cut.
1271  *
1272  * When additional replacement policies are added, the fields in this
1273  * section will be used in different ways or not at all. Thus the
1274  * documentation of these fields is repeated for each replacement policy.
1275  *
1276  * Modified LRU:
1277  *
1278  * When operating in parallel mode, we must ensure that a read does not
1279  * cause a write. If it does, the process will hang, as the write will
1280  * be collective and the other processes will not know to participate.
1281  *
1282  * To deal with this issue, I have modified the usual LRU policy by adding
1283  * clean and dirty LRU lists to the usual LRU list. When reading in
1284  * parallel mode, we evict from the clean LRU list only. This implies
1285  * that we must try to ensure that the clean LRU list is reasonably well
1286  * stocked. See the comments on H5C_t in H5Cpkg.h for more details.
1287  *
1288  * Note that even if we start with a completely clean cache, a sequence
1289  * of protects without unprotects can empty the clean LRU list. In this
1290  * case, the cache must grow temporarily. At the next write, we will
1291  * attempt to evict enough entries to get the cache down to its nominal
1292  * maximum size.
1293  *
1294  * The use of the replacement policy fields under the Modified LRU policy
1295  * is discussed below:
1296  *
1297  * next: Next pointer in either the LRU, the protected list, or
1298  * the pinned list depending on the current values of
1299  * is_protected and is_pinned. If there is no next entry
1300  * on the list, this field should be set to NULL.
1301  *
1302  * prev: Prev pointer in either the LRU, the protected list,
1303  * or the pinned list depending on the current values of
1304  * is_protected and is_pinned. If there is no previous
1305  * entry on the list, this field should be set to NULL.
1306  *
1307  * aux_next: Next pointer on either the clean or dirty LRU lists.
1308  * This entry should be NULL when either is_protected or
1309  * is_pinned is true.
1310  *
1311  * When is_protected and is_pinned are false, and is_dirty is
1312  * true, it should point to the next item on the dirty LRU
1313  * list.
1314  *
1315  * When is_protected and is_pinned are false, and is_dirty is
1316  * false, it should point to the next item on the clean LRU
1317  * list. In either case, when there is no next item, it
1318  * should be NULL.
1319  *
1320  * aux_prev: Previous pointer on either the clean or dirty LRU lists.
1321  * This entry should be NULL when either is_protected or
1322  * is_pinned is true.
1323  *
1324  * When is_protected and is_pinned are false, and is_dirty is
1325  * true, it should point to the previous item on the dirty
1326  * LRU list.
1327  *
1328  * When is_protected and is_pinned are false, and is_dirty
1329  * is false, it should point to the previous item on the
1330  * clean LRU list.
1331  *
1332  * In either case, when there is no previous item, it should
1333  * be NULL.
1334  *
1335  * Fields supporting the cache image feature:
1336  *
1337  * The following fields are used to store data about the entry which must
1338  * be stored in the cache image block, but which will typically be either
1339  * lost or heavily altered in the process of serializing the cache and
1340  * preparing its contents to be copied into the cache image block.
1341  *
1342  * Some fields are also used in loading the contents of the metadata cache
1343  * image back into the cache, and in managing such entries until they are
1344  * either protected by the library (at which point they become regular
1345  * entries) or are evicted. See discussion of the prefetched field for
1346  * further details.
1347  *
1348  * include_in_image: Boolean flag indicating whether this entry should
1349  * be included in the metadata cache image. This field should
1350  * always be false prior to the H5C_prep_for_file_close() call.
1351  * During that call, it should be set to TRUE for all entries
1352  * that are to be included in the metadata cache image. At
1353  * present, only the superblock, the superblock extension
1354  * object header and its chunks (if any) are omitted from
1355  * the image.
1356  *
1357  * lru_rank: Rank of the entry in the LRU just prior to file close.
1358  *
1359  * Note that the first entry on the LRU has lru_rank 1,
1360  * and that entries not on the LRU at that time will have
1361  * either lru_rank -1 (if pinned) or 0 (if loaded during
1362  * the process of flushing the cache.
1363  *
1364  * image_dirty: Boolean flag indicating whether the entry should be marked
1365  * as dirty in the metadata cache image. The flag is set to
1366  * TRUE iff the entry is dirty when H5C_prep_for_file_close()
1367  * is called.
1368  *
1369  * fd_parent_count: If the entry is a child in one or more flush dependency
1370  * relationships, this field contains the number of flush
1371  * dependency parents.
1372  *
1373  * In all other cases, the field is set to zero.
1374  *
1375  * Note that while this count is initially taken from the
1376  * flush dependency fields above, if the entry is in the
1377  * cache image (i.e. include_in_image is TRUE), any parents
1378  * that are not in the image are removed from this count and
1379  * from the fd_parent_addrs array below.
1380  *
1381  * Finally observe that if the entry is dirty and in the
1382  * cache image, and its parent is dirty and not in the cache
1383  * image, then the entry must be removed from the cache image
1384  * to avoid violating the flush dependency flush ordering.
1385  *
1386  * fd_parent_addrs: If the entry is a child in one or more flush dependency
1387  * relationship when H5C_prep_for_file_close() is called, this
1388  * field must contain a pointer to an array of size
1389  * fd_parent_count containing the on disk addresses of the
1390  * parent.
1391  *
1392  * In all other cases, the field is set to NULL.
1393  *
1394  * Note that while this list of addresses is initially taken
1395  * from the flush dependency fields above, if the entry is in the
1396  * cache image (i.e. include_in_image is TRUE), any parents
1397  * that are not in the image are removed from this list, and
1398  * and from the fd_parent_count above.
1399  *
1400  * Finally observe that if the entry is dirty and in the
1401  * cache image, and its parent is dirty and not in the cache
1402  * image, then the entry must be removed from the cache image
1403  * to avoid violating the flush dependency flush ordering.
1404  *
1405  * fd_child_count: If the entry is a parent in a flush dependency
1406  * relationship, this field contains the number of flush
1407  * dependency children.
1408  *
1409  * In all other cases, the field is set to zero.
1410  *
1411  * Note that while this count is initially taken from the
1412  * flush dependency fields above, if the entry is in the
1413  * cache image (i.e. include_in_image is TRUE), any children
1414  * that are not in the image are removed from this count.
1415  *
1416  * fd_dirty_child_count: If the entry is a parent in a flush dependency
1417  * relationship, this field contains the number of dirty flush
1418  * dependency children.
1419  *
1420  * In all other cases, the field is set to zero.
1421  *
1422  * Note that while this count is initially taken from the
1423  * flush dependency fields above, if the entry is in the
1424  * cache image (i.e. include_in_image is TRUE), any dirty
1425  * children that are not in the image are removed from this
1426  * count.
1427  *
1428  * image_fd_height: Flush dependency height of the entry in the cache image.
1429  *
1430  * The flush dependency height of any entry involved in a
1431  * flush dependency relationship is defined to be the
1432  * longest flush dependency path from that entry to an entry
1433  * with no flush dependency children.
1434  *
1435  * Since the image_fd_height is used to order entries in the
1436  * cache image so that fd parents preceed fd children, for
1437  * purposes of this field, and entry is at flush dependency
1438  * level 0 if it either has no children, or if all of its
1439  * children are not in the cache image.
1440  *
1441  * Note that if a child in a flush dependency relationship is
1442  * dirty and in the cache image, and its parent is dirty and
1443  * not in the cache image, then the child must be excluded
1444  * from the cache image to maintain flush ordering.
1445  *
1446  * prefetched: Boolean flag indicating that the on disk image of the entry
1447  * has been loaded into the cache prior any request for the
1448  * entry by the rest of the library.
1449  *
1450  * As of this writing (8/10/15), this can only happen through
1451  * the load of a cache image block, although other scenarios
1452  * are contemplated for the use of this feature. Note that
1453  * unlike the usual prefetch situation, this means that a
1454  * prefetched entry can be dirty, and/or can be a party to
1455  * flush dependency relationship(s). This complicates matters
1456  * somewhat.
1457  *
1458  * The essential feature of a prefetched entry is that it
1459  * consists only of a buffer containing the on disk image of
1460  * the entry. Thus it must be deserialized before it can
1461  * be passed back to the library on a protect call. This
1462  * task is handled by H5C_deserialized_prefetched_entry().
1463  * In essence, this routine calls the deserialize callback
1464  * provided in the protect call with the on disk image,
1465  * deletes the prefetched entry from the cache, and replaces
1466  * it with the deserialized entry returned by the deserialize
1467  * callback.
1468  *
1469  * Further, if the prefetched entry is a flush dependency parent,
1470  * all its flush dependency children (which must also be
1471  * prefetched entries), must be transferred to the new cache
1472  * entry returned by the deserialization callback.
1473  *
1474  * Finally, if the prefetched entry is a flush dependency child,
1475  * this flush dependency must be destroyed prior to the
1476  * deserialize call.
1477  *
1478  * In addition to the above special processing on the first
1479  * protect call on a prefetched entry (after which is no longer
1480  * a prefetched entry), prefetched entries also require special
1481  * tretment on flush and evict.
1482  *
1483  * On flush, a dirty prefetched entry must simply be written
1484  * to disk and marked clean without any call to any client
1485  * callback.
1486  *
1487  * On eviction, if a prefetched entry is a flush dependency
1488  * child, that flush dependency relationship must be destroyed
1489  * just prior to the eviction. If the flush dependency code
1490  * is working properly, it should be impossible for any entry
1491  * that is a flush dependency parent to be evicted.
1492  *
1493  * prefetch_type_id: Integer field containing the type ID of the prefetched
1494  * entry. This ID must match the ID of the type provided in any
1495  * protect call on the prefetched entry.
1496  *
1497  * The value of this field is undefined in prefetched is FALSE.
1498  *
1499  * age: Number of times a prefetched entry has appeared in
1500  * subsequent cache images. The field exists to allow
1501  * imposition of a limit on how many times a prefetched
1502  * entry can appear in subsequent cache images without being
1503  * converted to a regular entry.
1504  *
1505  * This field must be zero if prefetched is FALSE.
1506  *
1507  * prefetched_dirty: Boolean field that must be set to FALSE unless the
1508  * following conditions hold:
1509  *
1510  * 1) The file has been opened R/O.
1511  *
1512  * 2) The entry is either a prefetched entry, or was
1513  * re-constructed from a prefetched entry.
1514  *
1515  * 3) The base prefetched entry was marked dirty.
1516  *
1517  * This field exists to solve the following problem with
1518  * files containing cache images that are opened R/O.
1519  *
1520  * If the cache image contains a dirty entry, that entry
1521  * must be marked clean when it is inserted into the cache
1522  * in the read-only case, as otherwise the metadata cache
1523  * will attempt to flush it on file close -- which is poor
1524  * form in the read-only case.
1525  *
1526  * However, since the entry is marked clean, it is possible
1527  * that the metadata cache will evict it if the size of the
1528  * metadata in the file exceeds the size of the metadata cache,
1529  * and the application visits much of this data.
1530  *
1531  * If this happens, and the metadata cache is then asked for
1532  * this entry, it will attempt to read it from file, and will
1533  * obtain either obsolete or invalid data depending on whether
1534  * the entry has ever been written to it assigned location in
1535  * the file.
1536  *
1537  * With this background, the purpose of this field should be
1538  * obvious -- when set, it allows the eviction candidate
1539  * selection code to skip over the entry, thus avoiding the
1540  * issue.
1541  *
1542  * Since the issue only arises in the R/O case, there is
1543  * no possible interaction with SWMR. There are also
1544  * potential interactions with Evict On Close -- at present,
1545  * we deal with this by disabling EOC in the R/O case.
1546  *
1547  * serialization_count: Integer field used to maintain a count of the
1548  * number of times each entry is serialized during cache
1549  * serialization. While no entry should be serialized more than
1550  * once in any serialization call, throw an assertion if any
1551  * flush depencency parent is serialized more than once during
1552  * a single cache serialization.
1553  *
1554  * This is a debugging field, and thus is maintained only if
1555  * NDEBUG is undefined.
1556  *
1557  * Fields supporting tagged entries:
1558  *
1559  * Entries in the cache that belong to a single object in the file are
1560  * joined into a doubly-linked list, and are "tagged" with the object header
1561  * address for that object's base header "chunk" (which is used as the
1562  * canonical address for the object). Global and shared entries are
1563  * not tagged. Tagged entries have a pointer to the tag info for the object,
1564  * which is shared state for all the entries for that object.
1565  *
1566  * tl_next: Pointer to the next entry in the tag list for an object.
1567  * NULL for the tail entry in the list, as well as untagged
1568  * entries.
1569  *
1570  * tl_prev: Pointer to the previous entry in the tag list for an object.
1571  * NULL for the head entry in the list, as well as untagged
1572  * entries.
1573  *
1574  * tag_info: Pointer to the common tag state for all entries belonging to
1575  * an object. NULL for untagged entries.
1576  *
1577  *
1578  * Cache entry stats collection fields:
1579  *
1580  * These fields should only be compiled in when both H5C_COLLECT_CACHE_STATS
1581  * and H5C_COLLECT_CACHE_ENTRY_STATS are true. When present, they allow
1582  * collection of statistics on individual cache entries.
1583  *
1584  * accesses: int32_t containing the number of times this cache entry has
1585  * been referenced in its lifetime.
1586  *
1587  * clears: int32_t containing the number of times this cache entry has
1588  * been cleared in its life time.
1589  *
1590  * flushes: int32_t containing the number of times this cache entry has
1591  * been flushed to file in its life time.
1592  *
1593  * pins: int32_t containing the number of times this cache entry has
1594  * been pinned in cache in its life time.
1595  *
1596  ****************************************************************************/
1597 typedef struct H5C_cache_entry_t {
1598  uint32_t magic;
1599  H5C_t *cache_ptr;
1600  haddr_t addr;
1601  size_t size;
1602  void *image_ptr;
1604  const H5C_class_t *type;
1605  hbool_t is_dirty;
1606  hbool_t dirtied;
1609  int ro_ref_count;
1611  hbool_t in_slist;
1614 #ifdef H5_HAVE_PARALLEL
1615  hbool_t clear_on_unprotect;
1616  hbool_t flush_immediately;
1617  hbool_t coll_access;
1618 #endif /* H5_HAVE_PARALLEL */
1621 
1622  /* fields supporting rings for purposes of flush ordering */
1623  H5C_ring_t ring;
1624 
1625  /* fields supporting the 'flush dependency' feature: */
1627  unsigned flush_dep_nparents;
1628  unsigned flush_dep_parent_nalloc;
1629  unsigned flush_dep_nchildren;
1630  unsigned flush_dep_ndirty_children;
1631  unsigned flush_dep_nunser_children;
1634 
1635  /* fields supporting the hash table: */
1636  struct H5C_cache_entry_t *ht_next;
1637  struct H5C_cache_entry_t *ht_prev;
1638  struct H5C_cache_entry_t *il_next;
1639  struct H5C_cache_entry_t *il_prev;
1640 
1641  /* fields supporting replacement policies: */
1642  struct H5C_cache_entry_t *next;
1643  struct H5C_cache_entry_t *prev;
1644 #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
1645  struct H5C_cache_entry_t *aux_next;
1646  struct H5C_cache_entry_t *aux_prev;
1647 #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
1648 #ifdef H5_HAVE_PARALLEL
1649  struct H5C_cache_entry_t *coll_next;
1650  struct H5C_cache_entry_t *coll_prev;
1651 #endif /* H5_HAVE_PARALLEL */
1652 
1653  /* fields supporting cache image */
1655  int32_t lru_rank;
1663  int prefetch_type_id;
1664  int32_t age;
1666 
1667 #ifndef NDEBUG /* debugging field */
1668  int serialization_count;
1669 #endif /* NDEBUG */
1670 
1671  /* fields supporting tag lists */
1672  struct H5C_cache_entry_t *tl_next;
1673  struct H5C_cache_entry_t *tl_prev;
1674  struct H5C_tag_info_t *tag_info;
1675 
1676 #if H5C_COLLECT_CACHE_ENTRY_STATS
1677  /* cache entry stats fields */
1678  int32_t accesses;
1679  int32_t clears;
1680  int32_t flushes;
1681  int32_t pins;
1682 #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
1684 
1685 
1686 /****************************************************************************
1687  *
1688  * structure H5C_image_entry_t
1689  *
1690  * Instances of the H5C_image_entry_t structure are used to store data on
1691  * metadata cache entries used in the construction of the metadata cache
1692  * image block. In essence this structure is a greatly simplified version
1693  * of H5C_cache_entry_t.
1694  *
1695  * The fields of this structure are discussed individually below:
1696  *
1697  * JRM - 8/5/15
1698  *
1699  * magic: Unsigned 32 bit integer that must always be set to
1700  * H5C_IMAGE_ENTRY_T_MAGIC when the entry is valid.
1701  * The field must be set to H5C_IMAGE_ENTRY_T_BAD_MAGIC
1702  * just before the entry is freed.
1703  *
1704  * addr: Base address of the cache entry on disk.
1705  *
1706  * size: Length of the cache entry on disk in bytes.
1707  *
1708  * ring: Instance of H5C_ring_t indicating the flush ordering ring
1709  * to which this entry is assigned.
1710  *
1711  * age: Number of times this prefetech entry has appeared in
1712  * the current sequence of cache images. This field is
1713  * initialized to 0 if the instance of H5C_image_entry_t
1714  * is constructed from a regular entry.
1715  *
1716  * If the instance is constructed from a prefetched entry
1717  * currently residing in the metadata cache, the field is
1718  * set to 1 + the age of the prefetched entry, or to
1719  * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX if that sum exceeds
1720  * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX.
1721  *
1722  * type_id: Integer field containing the type ID of the entry.
1723  *
1724  * lru_rank: Rank of the entry in the LRU just prior to file close.
1725  *
1726  * Note that the first entry on the LRU has lru_rank 1,
1727  * and that entries not on the LRU at that time will have
1728  * either lru_rank -1 (if pinned) or 0 (if loaded during
1729  * the process of flushing the cache.
1730  *
1731  * is_dirty: Boolean flag indicating whether the contents of the cache
1732  * entry has been modified since the last time it was written
1733  * to disk as a regular piece of metadata.
1734  *
1735  * image_fd_height: Flush dependency height of the entry in the cache image.
1736  *
1737  * The flush dependency height of any entry involved in a
1738  * flush dependency relationship is defined to be the
1739  * longest flush dependency path from that entry to an entry
1740  * with no flush dependency children.
1741  *
1742  * Since the image_fd_height is used to order entries in the
1743  * cache image so that fd parents preceed fd children, for
1744  * purposes of this field, an entry is at flush dependency
1745  * level 0 if it either has no children, or if all of its
1746  * children are not in the cache image.
1747  *
1748  * Note that if a child in a flush dependency relationship is
1749  * dirty and in the cache image, and its parent is dirty and
1750  * not in the cache image, then the child must be excluded
1751  * from the cache image to maintain flush ordering.
1752  *
1753  * fd_parent_count: If the entry is a child in one or more flush dependency
1754  * relationships, this field contains the number of flush
1755  * dependency parents.
1756  *
1757  * In all other cases, the field is set to zero.
1758  *
1759  * Note that while this count is initially taken from the
1760  * flush dependency fields in the associated instance of
1761  * H5C_cache_entry_t, if the entry is in the cache image
1762  * (i.e. include_in_image is TRUE), any parents that are
1763  * not in the image are removed from this count and
1764  * from the fd_parent_addrs array below.
1765  *
1766  * Finally observe that if the entry is dirty and in the
1767  * cache image, and its parent is dirty and not in the cache
1768  * image, then the entry must be removed from the cache image
1769  * to avoid violating the flush dependency flush ordering.
1770  * This should have happened before the construction of
1771  * the instance of H5C_image_entry_t.
1772  *
1773  * fd_parent_addrs: If the entry is a child in one or more flush dependency
1774  * relationship when H5C_prep_for_file_close() is called, this
1775  * field must contain a pointer to an array of size
1776  * fd_parent_count containing the on disk addresses of the
1777  * parents.
1778  *
1779  * In all other cases, the field is set to NULL.
1780  *
1781  * Note that while this list of addresses is initially taken
1782  * from the flush dependency fields in the associated instance of
1783  * H5C_cache_entry_t, if the entry is in the cache image
1784  * (i.e. include_in_image is TRUE), any parents that are not
1785  * in the image are removed from this list, and from the
1786  * fd_parent_count above.
1787  *
1788  * Finally observe that if the entry is dirty and in the
1789  * cache image, and its parent is dirty and not in the cache
1790  * image, then the entry must be removed from the cache image
1791  * to avoid violating the flush dependency flush ordering.
1792  * This should have happened before the construction of
1793  * the instance of H5C_image_entry_t.
1794  *
1795  * fd_child_count: If the entry is a parent in a flush dependency
1796  * relationship, this field contains the number of flush
1797  * dependency children.
1798  *
1799  * In all other cases, the field is set to zero.
1800  *
1801  * Note that while this count is initially taken from the
1802  * flush dependency fields in the associated instance of
1803  * H5C_cache_entry_t, if the entry is in the cache image
1804  * (i.e. include_in_image is TRUE), any children
1805  * that are not in the image are removed from this count.
1806  *
1807  * fd_dirty_child_count: If the entry is a parent in a flush dependency
1808  * relationship, this field contains the number of dirty flush
1809  * dependency children.
1810  *
1811  * In all other cases, the field is set to zero.
1812  *
1813  * Note that while this count is initially taken from the
1814  * flush dependency fields in the associated instance of
1815  * H5C_cache_entry_t, if the entry is in the cache image
1816  * (i.e. include_in_image is TRUE), any dirty children
1817  * that are not in the image are removed from this count.
1818  *
1819  * image_ptr: Pointer to void. When not NULL, this field points to a
1820  * dynamically allocated block of size bytes in which the
1821  * on disk image of the metadata cache entry is stored.
1822  *
1823  * If the entry is dirty, the pre-serialize and serialize
1824  * callbacks must be used to update this image before it is
1825  * written to disk
1826  *
1827  *
1828  ****************************************************************************/
1829 
1830 typedef struct H5C_image_entry_t {
1831  uint32_t magic;
1832  haddr_t addr;
1833  size_t size;
1834  H5C_ring_t ring;
1835  int32_t age;
1836  int32_t type_id;
1837  int32_t lru_rank;
1838  hbool_t is_dirty;
1839  unsigned image_fd_height;
1844  void *image_ptr;
1846 
1847 /****************************************************************************
1848  *
1849  * structure H5C_auto_size_ctl_t
1850  *
1851  * Instances of H5C_auto_size_ctl_t are used to get and set the control
1852  * fields for automatic cache re-sizing.
1853  *
1854  * The fields of the structure are discussed individually below:
1855  *
1856  * version: Integer field containing the version number of this version
1857  * of the H5C_auto_size_ctl_t structure. Any instance of
1858  * H5C_auto_size_ctl_t passed to the cache must have a known
1859  * version number, or an error will be flagged.
1860  *
1861  * report_fcn: Pointer to the function that is to be called to report
1862  * activities each time the auto cache resize code is executed. If the
1863  * field is NULL, no call is made.
1864  *
1865  * If the field is not NULL, it must contain the address of a function
1866  * of type H5C_auto_resize_report_fcn.
1867  *
1868  * set_initial_size: Boolean flag indicating whether the size of the
1869  * initial size of the cache is to be set to the value given in
1870  * the initial_size field. If set_initial_size is FALSE, the
1871  * initial_size field is ignored.
1872  *
1873  * initial_size: If enabled, this field contain the size the cache is
1874  * to be set to upon receipt of this structure. Needless to say,
1875  * initial_size must lie in the closed interval [min_size, max_size].
1876  *
1877  * min_clean_fraction: double in the range 0 to 1 indicating the fraction
1878  * of the cache that is to be kept clean. This field is only used
1879  * in parallel mode. Typical values are 0.1 to 0.5.
1880  *
1881  * max_size: Maximum size to which the cache can be adjusted. The
1882  * supplied value must fall in the closed interval
1883  * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, max_size must
1884  * be greater than or equal to min_size.
1885  *
1886  * min_size: Minimum size to which the cache can be adjusted. The
1887  * supplied value must fall in the closed interval
1888  * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, min_size must
1889  * be less than or equal to max_size.
1890  *
1891  * epoch_length: Number of accesses on the cache over which to collect
1892  * hit rate stats before running the automatic cache resize code,
1893  * if it is enabled.
1894  *
1895  * At the end of an epoch, we discard prior hit rate data and start
1896  * collecting afresh. The epoch_length must lie in the closed
1897  * interval [H5C__MIN_AR_EPOCH_LENGTH, H5C__MAX_AR_EPOCH_LENGTH].
1898  *
1899  *
1900  * Cache size increase control fields:
1901  *
1902  * incr_mode: Instance of the H5C_cache_incr_mode enumerated type whose
1903  * value indicates how we determine whether the cache size should be
1904  * increased. At present there are two possible values:
1905  *
1906  * H5C_incr__off: Don't attempt to increase the size of the cache
1907  * automatically.
1908  *
1909  * When this increment mode is selected, the remaining fields
1910  * in the cache size increase section ar ignored.
1911  *
1912  * H5C_incr__threshold: Attempt to increase the size of the cache
1913  * whenever the average hit rate over the last epoch drops
1914  * below the value supplied in the lower_hr_threshold
1915  * field.
1916  *
1917  * Note that this attempt will fail if the cache is already
1918  * at its maximum size, or if the cache is not already using
1919  * all available space.
1920  *
1921  * lower_hr_threshold: Lower hit rate threshold. If the increment mode
1922  * (incr_mode) is H5C_incr__threshold and the hit rate drops below the
1923  * value supplied in this field in an epoch, increment the cache size by
1924  * size_increment. Note that cache size may not be incremented above
1925  * max_size, and that the increment may be further restricted by the
1926  * max_increment field if it is enabled.
1927  *
1928  * When enabled, this field must contain a value in the range [0.0, 1.0].
1929  * Depending on the incr_mode selected, it may also have to be less than
1930  * upper_hr_threshold.
1931  *
1932  * increment: Double containing the multiplier used to derive the new
1933  * cache size from the old if a cache size increment is triggered.
1934  * The increment must be greater than 1.0, and should not exceed 2.0.
1935  *
1936  * The new cache size is obtained by multiplying the current max cache
1937  * size by the increment, and then clamping to max_size and to stay
1938  * within the max_increment as necessary.
1939  *
1940  * apply_max_increment: Boolean flag indicating whether the max_increment
1941  * field should be used to limit the maximum cache size increment.
1942  *
1943  * max_increment: If enabled by the apply_max_increment field described
1944  * above, this field contains the maximum number of bytes by which the
1945  * cache size can be increased in a single re-size.
1946  *
1947  * flash_incr_mode: Instance of the H5C_cache_flash_incr_mode enumerated
1948  * type whose value indicates whether and by what algorithm we should
1949  * make flash increases in the size of the cache to accommodate insertion
1950  * of large entries and large increases in the size of a single entry.
1951  *
1952  * The addition of the flash increment mode was occasioned by performance
1953  * problems that appear when a local heap is increased to a size in excess
1954  * of the current cache size. While the existing re-size code dealt with
1955  * this eventually, performance was very bad for the remainder of the
1956  * epoch.
1957  *
1958  * At present, there are two possible values for the flash_incr_mode:
1959  *
1960  * H5C_flash_incr__off: Don't perform flash increases in the size of
1961  * the cache.
1962  *
1963  * H5C_flash_incr__add_space: Let x be either the size of a newly
1964  * newly inserted entry, or the number of bytes by which the
1965  * size of an existing entry has been increased.
1966  *
1967  * If
1968  * x > flash_threshold * current max cache size,
1969  *
1970  * increase the current maximum cache size by x * flash_multiple
1971  * less any free space in the cache, and start a new epoch. For
1972  * now at least, pay no attention to the maximum increment.
1973  *
1974  *
1975  * With a little thought, it should be obvious that the above flash
1976  * cache size increase algorithm is not sufficient for all
1977  * circumstances -- for example, suppose the user round robins through
1978  * (1/flash_threshold) +1 groups, adding one data set to each on each
1979  * pass. Then all will increase in size at about the same time, requiring
1980  * the max cache size to at least double to maintain acceptable
1981  * performance, however the above flash increment algorithm will not be
1982  * triggered.
1983  *
1984  * Hopefully, the add space algorithm detailed above will be sufficient
1985  * for the performance problems encountered to date. However, we should
1986  * expect to revisit the issue.
1987  *
1988  * flash_multiple: Double containing the multiple described above in the
1989  * H5C_flash_incr__add_space section of the discussion of the
1990  * flash_incr_mode section. This field is ignored unless flash_incr_mode
1991  * is H5C_flash_incr__add_space.
1992  *
1993  * flash_threshold: Double containing the factor by which current max cache
1994  * size is multiplied to obtain the size threshold for the add_space
1995  * flash increment algorithm. The field is ignored unless
1996  * flash_incr_mode is H5C_flash_incr__add_space.
1997  *
1998  *
1999  * Cache size decrease control fields:
2000  *
2001  * decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose
2002  * value indicates how we determine whether the cache size should be
2003  * decreased. At present there are four possibilities.
2004  *
2005  * H5C_decr__off: Don't attempt to decrease the size of the cache
2006  * automatically.
2007  *
2008  * When this increment mode is selected, the remaining fields
2009  * in the cache size decrease section are ignored.
2010  *
2011  * H5C_decr__threshold: Attempt to decrease the size of the cache
2012  * whenever the average hit rate over the last epoch rises
2013  * above the value supplied in the upper_hr_threshold
2014  * field.
2015  *
2016  * H5C_decr__age_out: At the end of each epoch, search the cache for
2017  * entries that have not been accessed for at least the number
2018  * of epochs specified in the epochs_before_eviction field, and
2019  * evict these entries. Conceptually, the maximum cache size
2020  * is then decreased to match the new actual cache size. However,
2021  * this reduction may be modified by the min_size, the
2022  * max_decrement, and/or the empty_reserve.
2023  *
2024  * H5C_decr__age_out_with_threshold: Same as age_out, but we only
2025  * attempt to reduce the cache size when the hit rate observed
2026  * over the last epoch exceeds the value provided in the
2027  * upper_hr_threshold field.
2028  *
2029  * upper_hr_threshold: Upper hit rate threshold. The use of this field
2030  * varies according to the current decr_mode:
2031  *
2032  * H5C_decr__off or H5C_decr__age_out: The value of this field is
2033  * ignored.
2034  *
2035  * H5C_decr__threshold: If the hit rate exceeds this threshold in any
2036  * epoch, attempt to decrement the cache size by size_decrement.
2037  *
2038  * Note that cache size may not be decremented below min_size.
2039  *
2040  * Note also that if the upper_threshold is 1.0, the cache size
2041  * will never be reduced.
2042  *
2043  * H5C_decr__age_out_with_threshold: If the hit rate exceeds this
2044  * threshold in any epoch, attempt to reduce the cache size
2045  * by evicting entries that have not been accessed for more
2046  * than the specified number of epochs.
2047  *
2048  * decrement: This field is only used when the decr_mode is
2049  * H5C_decr__threshold.
2050  *
2051  * The field is a double containing the multiplier used to derive the
2052  * new cache size from the old if a cache size decrement is triggered.
2053  * The decrement must be in the range 0.0 (in which case the cache will
2054  * try to contract to its minimum size) to 1.0 (in which case the
2055  * cache will never shrink).
2056  *
2057  * apply_max_decrement: Boolean flag used to determine whether decrements
2058  * in cache size are to be limited by the max_decrement field.
2059  *
2060  * max_decrement: Maximum number of bytes by which the cache size can be
2061  * decreased in a single re-size. Note that decrements may also be
2062  * restricted by the min_size of the cache, and (in age out modes) by
2063  * the empty_reserve field.
2064  *
2065  * epochs_before_eviction: Integer field used in H5C_decr__age_out and
2066  * H5C_decr__age_out_with_threshold decrement modes.
2067  *
2068  * This field contains the number of epochs an entry must remain
2069  * unaccessed before it is evicted in an attempt to reduce the
2070  * cache size. If applicable, this field must lie in the range
2071  * [1, H5C__MAX_EPOCH_MARKERS].
2072  *
2073  * apply_empty_reserve: Boolean field controlling whether the empty_reserve
2074  * field is to be used in computing the new cache size when the
2075  * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold.
2076  *
2077  * empty_reserve: To avoid a constant racheting down of cache size by small
2078  * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold
2079  * modes, this field allows one to require that any cache size
2080  * reductions leave the specified fraction of unused space in the cache.
2081  *
2082  * The value of this field must be in the range [0.0, 1.0]. I would
2083  * expect typical values to be in the range of 0.01 to 0.1.
2084  *
2085  ****************************************************************************/
2086 
2088 {
2089  in_spec,
2090  increase,
2092  decrease,
2093  at_max_size,
2094  at_min_size,
2097  not_full
2098 }; /* enum H5C_resize_conditions */
2099 
2100 typedef void (*H5C_auto_resize_rpt_fcn)(H5C_t * cache_ptr, int32_t version,
2101  double hit_rate, enum H5C_resize_status status, size_t old_max_cache_size,
2102  size_t new_max_cache_size, size_t old_min_clean_size, size_t new_min_clean_size);
2103 
2104 typedef struct H5C_auto_size_ctl_t {
2105  /* general configuration fields: */
2106  int32_t version;
2111  size_t max_size;
2112  size_t min_size;
2114 
2115  /* size increase control fields: */
2118  double increment;
2124 
2125  /* size decrease control fields: */
2128  double decrement;
2135 
2136 /****************************************************************************
2137  *
2138  * structure H5C_cache_image_ctl_t
2139  *
2140  * Instances of H5C_image_ctl_t are used to get and set the control
2141  * fields for generation of a metadata cache image on file close.
2142  *
2143  * At present control of construction of a cache image is via a FAPL
2144  * property at file open / create.
2145  *
2146  * The fields of the structure are discussed individually below:
2147  *
2148  * version: Integer field containing the version number of this version
2149  * of the H5C_image_ctl_t structure. Any instance of
2150  * H5C_image_ctl_t passed to the cache must have a known
2151  * version number, or an error will be flagged.
2152  *
2153  * generate_image: Boolean flag indicating whether a cache image should
2154  * be created on file close.
2155  *
2156  * save_resize_status: Boolean flag indicating whether the cache image
2157  * should include the adaptive cache resize configuration and status.
2158  * Note that this field is ignored at present.
2159  *
2160  * entry_ageout: Integer field indicating the maximum number of
2161  * times a prefetched entry can appear in subsequent cache images.
2162  * This field exists to allow the user to avoid the buildup of
2163  * infrequently used entries in long sequences of cache images.
2164  *
2165  * The value of this field must lie in the range
2166  * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to
2167  * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100).
2168  *
2169  * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit
2170  * is imposed on number of times a prefeteched entry can appear
2171  * in subsequent cache images.
2172  *
2173  * A value of 0 prevents prefetched entries from being included
2174  * in cache images.
2175  *
2176  * Positive integers restrict prefetched entries to the specified
2177  * number of appearances.
2178  *
2179  * Note that the number of subsequent cache images that a prefetched
2180  * entry has appeared in is tracked in an 8 bit field. Thus, while
2181  * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its
2182  * current value, any value in excess of 255 will be the functional
2183  * equivalent of H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE.
2184  *
2185  * flags: Unsigned integer containing flags controlling which aspects of the
2186  * cache image functinality is actually executed. The primary impetus
2187  * behind this field is to allow development of tests for partial
2188  * implementations that will require little if any modification to run
2189  * with the full implementation. In normal operation, all flags should
2190  * be set.
2191  *
2192  ****************************************************************************/
2193 
2194 #define H5C_CI__GEN_MDCI_SBE_MESG ((unsigned)0x0001)
2195 #define H5C_CI__GEN_MDC_IMAGE_BLK ((unsigned)0x0002)
2196 #define H5C_CI__SUPRESS_ENTRY_WRITES ((unsigned)0x0004)
2197 #define H5C_CI__WRITE_CACHE_IMAGE ((unsigned)0x0008)
2199 /* This #define must set all defined H5C_CI flags. It is
2200  * used in the default value for instances of H5C_cache_image_ctl_t.
2201  * This value will only be modified in test code.
2202  */
2203 #define H5C_CI__ALL_FLAGS ((unsigned)0x000F)
2205 #define H5C__DEFAULT_CACHE_IMAGE_CTL \
2206 { \
2207  /* version = */ H5C__CURR_CACHE_IMAGE_CTL_VER, \
2208  /* generate_image = */ FALSE, \
2209  /* save_resize_status = */ FALSE, \
2210  /* entry_ageout = */ H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE, \
2211  /* flags = */ H5C_CI__ALL_FLAGS \
2212 }
2213 
2214 typedef struct H5C_cache_image_ctl_t {
2215  int32_t version;
2218  int32_t entry_ageout;
2219  unsigned flags;
2221 
2222 /* The cache logging output style */
2223 typedef enum H5C_log_style_t {
2228 /***************************************/
2229 /* Library-private Function Prototypes */
2230 /***************************************/
2232 H5_DLL H5C_t *H5C_create(size_t max_cache_size, size_t min_clean_size,
2233  int max_type_id, const H5C_class_t * const *class_table_ptr,
2234  H5C_write_permitted_func_t check_write_permitted, hbool_t write_permitted,
2235  H5C_log_flush_func_t log_flush, void *aux_ptr);
2236 H5_DLL void H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, int32_t version,
2237  double hit_rate, enum H5C_resize_status status,
2238  size_t old_max_cache_size, size_t new_max_cache_size,
2239  size_t old_min_clean_size, size_t new_min_clean_size);
2243  unsigned flags);
2244 H5_DLL herr_t H5C_flush_cache(H5F_t *f, unsigned flags);
2248 H5_DLL herr_t H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags);
2249 H5_DLL herr_t H5C_get_tag(const void *thing, /*OUT*/ haddr_t *tag);
2250 #if H5C_DO_TAGGING_SANITY_CHECKS
2251 herr_t H5C_verify_tag(int id, haddr_t tag);
2252 #endif
2255  H5C_auto_size_ctl_t *config_ptr);
2258 H5_DLL herr_t H5C_get_cache_size(H5C_t *cache_ptr, size_t *max_size_ptr,
2259  size_t *min_clean_size_ptr, size_t *cur_size_ptr,
2260  uint32_t *cur_num_entries_ptr);
2261 H5_DLL herr_t H5C_get_cache_flush_in_progress(H5C_t *cache_ptr, hbool_t *flush_in_progress_ptr);
2262 H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t *cache_ptr, double *hit_rate_ptr);
2264  size_t *size_ptr, hbool_t *in_cache_ptr, hbool_t *is_dirty_ptr,
2265  hbool_t *is_protected_ptr, hbool_t *is_pinned_ptr, hbool_t *is_corked_ptr,
2266  hbool_t *is_flush_dep_parent_ptr, hbool_t *is_flush_dep_child_ptr,
2267  hbool_t *image_up_to_date_ptr);
2268 H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t *cache_ptr, hbool_t *evictions_enabled_ptr);
2269 H5_DLL void * H5C_get_aux_ptr(const H5C_t *cache_ptr);
2270 H5_DLL herr_t H5C_image_stats(H5C_t * cache_ptr, hbool_t print_header);
2272  void *thing, unsigned int flags);
2274  hsize_t len, hbool_t rw);
2279 H5_DLL herr_t H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type,
2280  haddr_t old_addr, haddr_t new_addr);
2283 H5_DLL herr_t H5C_create_flush_dependency(void *parent_thing, void *child_thing);
2284 H5_DLL void * H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr,
2285  void *udata, unsigned flags);
2287 H5_DLL herr_t H5C_resize_entry(void *thing, size_t new_size);
2291 H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled);
2293 H5_DLL herr_t H5C_stats(H5C_t *cache_ptr, const char *cache_name,
2294  hbool_t display_detailed_stats);
2295 H5_DLL void H5C_stats__reset(H5C_t *cache_ptr);
2297 H5_DLL herr_t H5C_destroy_flush_dependency(void *parent_thing, void *child_thing);
2299  unsigned int flags);
2302  unsigned int tests);
2304 H5_DLL hbool_t H5C_get_ignore_tags(const H5C_t *cache_ptr);
2305 H5_DLL uint32_t H5C_get_num_objs_corked(const H5C_t *cache_ptr);
2306 H5_DLL herr_t H5C_retag_entries(H5C_t * cache_ptr, haddr_t src_tag, haddr_t dest_tag);
2307 H5_DLL herr_t H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked);
2313  hbool_t *write_ci_ptr);
2314 H5_DLL hbool_t H5C_cache_image_pending(const H5C_t *cache_ptr);
2316 
2317 /* Logging functions */
2320 H5_DLL herr_t H5C_get_logging_status(const H5C_t *cache, /*OUT*/ hbool_t *is_enabled, /*OUT*/ hbool_t *is_currently_logging);
2321 
2322 #ifdef H5_HAVE_PARALLEL
2323 H5_DLL herr_t H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr,
2324  unsigned num_candidates, haddr_t *candidates_list_ptr, int mpi_rank,
2325  int mpi_size);
2326 H5_DLL herr_t H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr);
2327 H5_DLL herr_t H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr);
2328 H5_DLL herr_t H5C_clear_coll_entries(H5C_t * cache_ptr, hbool_t partial);
2329 H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len,
2330  haddr_t *ce_array_ptr);
2331 #endif /* H5_HAVE_PARALLEL */
2333 #ifndef NDEBUG /* debugging functions */
2334 H5_DLL herr_t H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name);
2335 H5_DLL herr_t H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name);
2337 H5_DLL hbool_t H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring);
2338 H5_DLL herr_t H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn);
2339 #ifdef H5_HAVE_PARALLEL
2340 H5_DLL herr_t H5C_dump_coll_write_list(H5C_t * cache_ptr, char * calling_fcn);
2341 #endif /* H5_HAVE_PARALLEL */
2343  void **entry_ptr_ptr);
2344 H5_DLL herr_t H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr,
2345  haddr_t child_addr, hbool_t *fd_exists_ptr);
2347  const H5C_class_t *expected_type, hbool_t *in_cache_ptr,
2348  hbool_t *type_ok_ptr);
2350 #endif /* NDEBUG */
2351 
2352 #endif /* !_H5Cprivate_H */
2353 
thing
HDassert * thing
Definition: H5EA.c:616
H5C_cache_entry_t::flush_dep_nchildren
unsigned flush_dep_nchildren
Definition: H5Cprivate.h:2258
H5C_NOTIFY_ACTION_AFTER_INSERT
@ H5C_NOTIFY_ACTION_AFTER_INSERT
Definition: H5Cprivate.h:850
H5C_NOTIFY_ACTION_ENTRY_CLEANED
@ H5C_NOTIFY_ACTION_ENTRY_CLEANED
Definition: H5Cprivate.h:863
H5C_create
H5_DLL H5C_t * H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, const H5C_class_t *const *class_table_ptr, H5C_write_permitted_func_t check_write_permitted, hbool_t write_permitted, H5C_log_flush_func_t log_flush, void *aux_ptr)
Definition: H5C.c:243
H5C_auto_size_ctl_t::initial_size
size_t initial_size
Definition: H5Cprivate.h:2109
H5C_set_evictions_enabled
H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled)
Definition: H5C.c:2854
H5C_start_logging
H5_DLL herr_t H5C_start_logging(H5C_t *cache)
Definition: H5Clog.c:194
H5C_validate_resize_config
H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests)
Definition: H5C.c:3381
H5C_verify_chksum_func_t
htri_t(* H5C_verify_chksum_func_t)(const void *image_ptr, size_t len, void *udata_ptr)
Definition: H5Cprivate.h:874
H5C_get_cache_flush_in_progress
H5_DLL herr_t H5C_get_cache_flush_in_progress(H5C_t *cache_ptr, hbool_t *flush_in_progress_ptr)
Definition: H5Cquery.c:169
H5C_get_ignore_tags
H5_DLL hbool_t H5C_get_ignore_tags(const H5C_t *cache_ptr)
Definition: H5Ctag.c:163
H5C_get_serialization_in_progress
H5_DLL hbool_t H5C_get_serialization_in_progress(const H5C_t *cache_ptr)
Definition: H5Cdbg.c:1440
H5C_cache_entry_t::serialization_count
int serialization_count
Definition: H5Cprivate.h:2297
decrease_disabled
@ decrease_disabled
Definition: H5Cprivate.h:2334
H5C_stop_logging
H5_DLL herr_t H5C_stop_logging(H5C_t *cache)
Definition: H5Clog.c:238
not_full
@ not_full
Definition: H5Cprivate.h:2335
H5C_class_t
struct H5C_class_t H5C_class_t
H5C_cache_entry_t::prefetched
hbool_t prefetched
Definition: H5Cprivate.h:2291
H5C_NOTIFY_ACTION_BEFORE_EVICT
@ H5C_NOTIFY_ACTION_BEFORE_EVICT
Definition: H5Cprivate.h:859
f
hdr f
Definition: H5EA.c:755
H5C_ring_t
int H5C_ring_t
Definition: H5Cprivate.h:964
H5C_insert_entry
H5_DLL herr_t H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, unsigned int flags)
Definition: H5C.c:1241
H5C_evict
H5_DLL herr_t H5C_evict(H5F_t *f)
Definition: H5C.c:903
H5C_NOTIFY_ACTION_CHILD_DIRTIED
@ H5C_NOTIFY_ACTION_CHILD_DIRTIED
Definition: H5Cprivate.h:864
H5C_get_tag
H5_DLL herr_t H5C_get_tag(const void *thing, haddr_t *tag)
Definition: H5Ctag.c:908
H5C_class_t::image_len
H5C_image_len_func_t image_len
Definition: H5Cprivate.h:896
H5C_validate_cache_image_config
H5_DLL herr_t H5C_validate_cache_image_config(H5C_cache_image_ctl_t *ctl_ptr)
Definition: H5Cimage.c:1700
H5C_cache_entry_t::lru_rank
int32_t lru_rank
Definition: H5Cprivate.h:2284
H5C_auto_size_ctl_t::apply_max_increment
hbool_t apply_max_increment
Definition: H5Cprivate.h:2119
H5C_image_entry_t::age
int32_t age
Definition: H5Cprivate.h:1977
H5C_verify_tag
herr_t H5C_verify_tag(int id, haddr_t tag)
Definition: H5Ctag.c:672
H5C_t
Definition: H5Cpkg.h:4642
H5C_verify_entry_type
H5_DLL herr_t H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_class_t *expected_type, hbool_t *in_cache_ptr, hbool_t *type_ok_ptr)
Definition: H5Cdbg.c:1525
uint32_t
uint32_t
Definition: H5overflow.txt:38
H5C_get_final_load_size_func_t
herr_t(* H5C_get_final_load_size_func_t)(const void *image_ptr, size_t image_len, void *udata_ptr, size_t *actual_len_ptr)
Definition: H5Cprivate.h:872
at_max_size
@ at_max_size
Definition: H5Cprivate.h:2331
H5C_load_cache_image_on_next_protect
H5_DLL herr_t H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_t rw)
Definition: H5Cimage.c:1213
H5C_get_num_objs_corked
H5_DLL uint32_t H5C_get_num_objs_corked(const H5C_t *cache_ptr)
Definition: H5Ctag.c:189
H5C_flush_cache
H5_DLL herr_t H5C_flush_cache(H5F_t *f, unsigned flags)
Definition: H5C.c:1045
haddr_t
CATCH haddr_t
Definition: H5EAdblock.c:162
H5C_ignore_tags
H5_DLL herr_t H5C_ignore_tags(H5C_t *cache_ptr)
Definition: H5Ctag.c:134
H5C_unsettle_entry_ring
H5_DLL herr_t H5C_unsettle_entry_ring(void *thing)
Definition: H5C.c:3250
H5C_image_entry_t::type_id
int32_t type_id
Definition: H5Cprivate.h:1978
H5C_remove_entry
H5_DLL herr_t H5C_remove_entry(void *thing)
Definition: H5C.c:8675
H5C_get_logging_status
H5_DLL herr_t H5C_get_logging_status(const H5C_t *cache, hbool_t *is_enabled, hbool_t *is_currently_logging)
Definition: H5Clog.c:285
H5C_image_entry_t::fd_child_count
uint64_t fd_child_count
Definition: H5Cprivate.h:1984
H5C_class_t::serialize
H5C_serialize_func_t serialize
Definition: H5Cprivate.h:898
H5C_cache_entry_t::image_fd_height
uint32_t image_fd_height
Definition: H5Cprivate.h:2290
H5C_NOTIFY_ACTION_CHILD_SERIALIZED
@ H5C_NOTIFY_ACTION_CHILD_SERIALIZED
Definition: H5Cprivate.h:867
H5C_cache_entry_t::is_protected
hbool_t is_protected
Definition: H5Cprivate.h:2236
H5C_cache_entry_t::size
size_t size
Definition: H5Cprivate.h:2230
H5C_dump_cache_LRU
H5_DLL herr_t H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name)
Definition: H5Cdbg.c:199
H5C_cache_entry_t::is_pinned
hbool_t is_pinned
Definition: H5Cprivate.h:2239
H5C_class_t::notify
H5C_notify_func_t notify
Definition: H5Cprivate.h:899
H5C_class_t::deserialize
H5C_deserialize_func_t deserialize
Definition: H5Cprivate.h:895
H5C_cache_entry_t::flush_dep_ndirty_children
unsigned flush_dep_ndirty_children
Definition: H5Cprivate.h:2259
H5C_LOG_STYLE_JSON
@ H5C_LOG_STYLE_JSON
Definition: H5Cprivate.h:2224
H5C_image_entry_t::ring
H5C_ring_t ring
Definition: H5Cprivate.h:1976
H5C_unprotect
H5_DLL herr_t H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned int flags)
H5C_get_initial_load_size_func_t
herr_t(* H5C_get_initial_load_size_func_t)(void *udata_ptr, size_t *image_len_ptr)
Definition: H5Cprivate.h:871
H5C_image_entry_t::size
size_t size
Definition: H5Cprivate.h:1975
H5C_set_cache_image_config
H5_DLL herr_t H5C_set_cache_image_config(const H5F_t *f, H5C_t *cache_ptr, H5C_cache_image_ctl_t *config_ptr)
Definition: H5Cimage.c:1620
H5C_cache_entry_t::clears
int32_t clears
Definition: H5Cprivate.h:2308
H5C_cache_entry_t::flush_dep_parent
struct H5C_cache_entry_t ** flush_dep_parent
Definition: H5Cprivate.h:2255
H5C_class_t::get_initial_load_size
H5C_get_initial_load_size_func_t get_initial_load_size
Definition: H5Cprivate.h:892
H5C_get_evictions_enabled
H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t *cache_ptr, hbool_t *evictions_enabled_ptr)
Definition: H5Cquery.c:333
H5C_cache_entry_t::tl_prev
struct H5C_cache_entry_t * tl_prev
Definition: H5Cprivate.h:2302
flash_increase
@ flash_increase
Definition: H5Cprivate.h:2329
H5C_notify_func_t
herr_t(* H5C_notify_func_t)(H5C_notify_action_t action, void *thing)
Definition: H5Cprivate.h:882
H5C_image_len_func_t
herr_t(* H5C_image_len_func_t)(const void *thing, size_t *image_len_ptr)
Definition: H5Cprivate.h:877
H5C_dump_cache
H5_DLL herr_t H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name)
Definition: H5Cdbg.c:91
int64_t
int64_t
Definition: H5overflow.txt:35
H5C_cork
H5_DLL herr_t H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked)
Definition: H5C.c:7661
H5C_NOTIFY_ACTION_CHILD_UNSERIALIZED
@ H5C_NOTIFY_ACTION_CHILD_UNSERIALIZED
Definition: H5Cprivate.h:866
H5C_auto_size_ctl_t::apply_empty_reserve
hbool_t apply_empty_reserve
Definition: H5Cprivate.h:2132
H5C_validate_index_list
H5_DLL herr_t H5C_validate_index_list(H5C_t *cache_ptr)
Definition: H5Cdbg.c:1251
H5C_destroy_flush_dependency
H5_DLL herr_t H5C_destroy_flush_dependency(void *parent_thing, void *child_thing)
Definition: H5C.c:3682
H5C_cache_image_ctl_t
Definition: H5Cprivate.h:2214
H5C_cache_entry_t::il_prev
struct H5C_cache_entry_t * il_prev
Definition: H5Cprivate.h:2268
H5C_reset_cache_hit_rate_stats
H5_DLL herr_t H5C_reset_cache_hit_rate_stats(H5C_t *cache_ptr)
Definition: H5C.c:2618
H5C_mark_entry_dirty
H5_DLL herr_t H5C_mark_entry_dirty(void *thing)
Definition: H5C.c:1545
H5C_cache_image_pending
H5_DLL hbool_t H5C_cache_image_pending(const H5C_t *cache_ptr)
Definition: H5Cimage.c:163
H5C_cache_incr_mode
H5C_cache_incr_mode
Definition: H5Cpublic.h:37
htri_t
int htri_t
Definition: H5public.h:160
H5C_get_cache_size
H5_DLL herr_t H5C_get_cache_size(H5C_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, uint32_t *cur_num_entries_ptr)
Definition: H5Cquery.c:128
H5C_dump_cache_skip_list
H5_DLL herr_t H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn)
Definition: H5Cdbg.c:278
H5C_pre_serialize_func_t
herr_t(* H5C_pre_serialize_func_t)(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr)
Definition: H5Cprivate.h:878
H5C_cache_decr_mode
H5C_cache_decr_mode
Definition: H5Cpublic.h:49
H5C_prep_for_file_close
H5_DLL herr_t H5C_prep_for_file_close(H5F_t *f)
Definition: H5C.c:737
decrease
@ decrease
Definition: H5Cprivate.h:2330
H5C_class_t::verify_chksum
H5C_verify_chksum_func_t verify_chksum
Definition: H5Cprivate.h:894
H5C_cache_entry_t::is_read_only
hbool_t is_read_only
Definition: H5Cprivate.h:2237
H5C_log_flush_func_t
herr_t(* H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, hbool_t was_dirty, unsigned flags)
Definition: H5Cprivate.h:907
H5C_cache_entry_t::flush_in_progress
hbool_t flush_in_progress
Definition: H5Cprivate.h:2248
H5C_cache_entry_t::prefetched_dirty
hbool_t prefetched_dirty
Definition: H5Cprivate.h:2294
H5C_cache_entry_t::age
int32_t age
Definition: H5Cprivate.h:2293
H5C_cache_entry_t::accesses
int32_t accesses
Definition: H5Cprivate.h:2307
H5C_image_entry_t::magic
uint32_t magic
Definition: H5Cprivate.h:1973
H5C_cache_entry_t::next
struct H5C_cache_entry_t * next
Definition: H5Cprivate.h:2271
H5C_auto_size_ctl_t::flash_threshold
double flash_threshold
Definition: H5Cprivate.h:2123
H5C_cache_entry_t::is_dirty
hbool_t is_dirty
Definition: H5Cprivate.h:2234
H5C_resize_status
H5C_resize_status
Definition: H5Cprivate.h:2088
H5C_notify_action_t
H5C_notify_action_t
Definition: H5Cprivate.h:849
image_len
* image_len
Definition: H5EAcache.c:449
H5C_auto_size_ctl_t::min_size
size_t min_size
Definition: H5Cprivate.h:2112
H5C_cache_is_clean
H5_DLL hbool_t H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring)
Definition: H5Cdbg.c:1472
H5C_cache_entry_t::fd_parent_addrs
haddr_t * fd_parent_addrs
Definition: H5Cprivate.h:2287
at_min_size
@ at_min_size
Definition: H5Cprivate.h:2332
H5C_get_cache_image_config
H5_DLL herr_t H5C_get_cache_image_config(const H5C_t *cache_ptr, H5C_cache_image_ctl_t *config_ptr)
Definition: H5Cimage.c:929
H5C_NOTIFY_ACTION_AFTER_FLUSH
@ H5C_NOTIFY_ACTION_AFTER_FLUSH
Definition: H5Cprivate.h:856
H5C_cache_entry_t::flush_dep_nparents
unsigned flush_dep_nparents
Definition: H5Cprivate.h:2256
H5C_image_entry_t::lru_rank
int32_t lru_rank
Definition: H5Cprivate.h:1979
H5C_auto_size_ctl_t
struct H5C_auto_size_ctl_t H5C_auto_size_ctl_t
H5C_cache_entry_t::flushes
int32_t flushes
Definition: H5Cprivate.h:2309
H5C_cache_image_ctl_t::version
int32_t version
Definition: H5Cprivate.h:2215
H5C_get_aux_ptr
H5_DLL void * H5C_get_aux_ptr(const H5C_t *cache_ptr)
Definition: H5Cquery.c:369
H5C_image_entry_t::fd_parent_addrs
haddr_t * fd_parent_addrs
Definition: H5Cprivate.h:1983
H5C_cache_entry_t::destroy_in_progress
hbool_t destroy_in_progress
Definition: H5Cprivate.h:2249
H5C_mark_entry_serialized
H5_DLL herr_t H5C_mark_entry_serialized(void *thing)
Definition: H5C.c:1763
H5C_cache_entry_t::tag_info
struct H5C_tag_info_t * tag_info
Definition: H5Cprivate.h:2303
H5C_LOG_STYLE_TRACE
@ H5C_LOG_STYLE_TRACE
Definition: H5Cprivate.h:2225
H5C_auto_size_ctl_t::decr_mode
enum H5C_cache_decr_mode decr_mode
Definition: H5Cprivate.h:2126
H5Fprivate.h
H5C_deserialize_func_t
void *(* H5C_deserialize_func_t)(const void *image_ptr, size_t len, void *udata_ptr, hbool_t *dirty_ptr)
Definition: H5Cprivate.h:875
H5C_auto_size_ctl_t::lower_hr_threshold
double lower_hr_threshold
Definition: H5Cprivate.h:2117
H5C_cache_entry_t::il_next
struct H5C_cache_entry_t * il_next
Definition: H5Cprivate.h:2267
H5C_cache_entry_t::in_slist
hbool_t in_slist
Definition: H5Cprivate.h:2240
H5C_cache_entry_t::type
const H5C_class_t * type
Definition: H5Cprivate.h:2233
H5C_mark_entry_unserialized
H5_DLL herr_t H5C_mark_entry_unserialized(void *thing)
Definition: H5C.c:1718
H5C_auto_size_ctl_t::max_size
size_t max_size
Definition: H5Cprivate.h:2111
increase_disabled
@ increase_disabled
Definition: H5Cprivate.h:2333
H5C_expunge_tag_type_metadata
H5_DLL herr_t H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags)
Definition: H5Ctag.c:864
H5C_get_entry_ptr_from_addr
H5_DLL herr_t H5C_get_entry_ptr_from_addr(H5C_t *cache_ptr, haddr_t addr, void **entry_ptr_ptr)
Definition: H5Cdbg.c:1392
H5C_serialize_func_t
herr_t(* H5C_serialize_func_t)(const H5F_t *f, void *image_ptr, size_t len, void *thing)
Definition: H5Cprivate.h:880
H5C_pin_protected_entry
H5_DLL herr_t H5C_pin_protected_entry(void *thing)
Definition: H5C.c:2110
H5C_NOTIFY_ACTION_CHILD_CLEANED
@ H5C_NOTIFY_ACTION_CHILD_CLEANED
Definition: H5Cprivate.h:865
H5C_cache_entry_t::ro_ref_count
int ro_ref_count
Definition: H5Cprivate.h:2238
H5C_cache_entry_t::flush_dep_nunser_children
unsigned flush_dep_nunser_children
Definition: H5Cprivate.h:2260
uint64_t
uint64_t
Definition: H5overflow.txt:39
H5C_class_t::pre_serialize
H5C_pre_serialize_func_t pre_serialize
Definition: H5Cprivate.h:897
H5C_cache_entry_t::flush_me_last
hbool_t flush_me_last
Definition: H5Cprivate.h:2242
H5C_auto_size_ctl_t::version
int32_t version
Definition: H5Cprivate.h:2106
H5C_cache_image_ctl_t::flags
unsigned flags
Definition: H5Cprivate.h:2219
H5C_get_cache_hit_rate
H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t *cache_ptr, double *hit_rate_ptr)
Definition: H5Cquery.c:203
H5FD_mem_t
enum H5F_mem_t H5FD_mem_t
Definition: H5FDpublic.h:28
H5C_force_cache_image_load
H5_DLL herr_t H5C_force_cache_image_load(H5F_t *f)
Definition: H5Cimage.c:887
H5C_cache_entry_t::tl_next
struct H5C_cache_entry_t * tl_next
Definition: H5Cprivate.h:2301
H5C_cache_entry_t::ht_next
struct H5C_cache_entry_t * ht_next
Definition: H5Cprivate.h:2265
H5C_image_entry_t::addr
haddr_t addr
Definition: H5Cprivate.h:1974
H5C_cache_entry_t::prev
struct H5C_cache_entry_t * prev
Definition: H5Cprivate.h:2272
H5C_class_t
Definition: H5Cprivate.h:887
H5C_tag_info_t
Definition: H5Cpkg.h:3438
H5C_cache_image_ctl_t::save_resize_status
hbool_t save_resize_status
Definition: H5Cprivate.h:2217
H5C_unpin_entry
H5_DLL herr_t H5C_unpin_entry(void *thing)
Definition: H5C.c:2898
H5C_move_entry
H5_DLL herr_t H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type, haddr_t old_addr, haddr_t new_addr)
Definition: H5C.c:1812
H5C_cache_flash_incr_mode
H5C_cache_flash_incr_mode
Definition: H5Cpublic.h:43
H5C_auto_size_ctl_t
Definition: H5Cprivate.h:2104
H5C_cache_entry_t::flush_marker
hbool_t flush_marker
Definition: H5Cprivate.h:2241
H5C_class_t::flags
unsigned flags
Definition: H5Cprivate.h:891
H5C_flush_dependency_exists
H5_DLL herr_t H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, haddr_t child_addr, hbool_t *fd_exists_ptr)
Definition: H5Cdbg.c:1185
H5C_auto_size_ctl_t::incr_mode
enum H5C_cache_incr_mode incr_mode
Definition: H5Cprivate.h:2116
H5C_cache_image_ctl_t::generate_image
hbool_t generate_image
Definition: H5Cprivate.h:2216
H5C_auto_size_ctl_t::flash_incr_mode
enum H5C_cache_flash_incr_mode flash_incr_mode
Definition: H5Cprivate.h:2121
H5C_auto_size_ctl_t::upper_hr_threshold
double upper_hr_threshold
Definition: H5Cprivate.h:2127
H5C_auto_size_ctl_t::flash_multiple
double flash_multiple
Definition: H5Cprivate.h:2122
H5C_free_icr_func_t
herr_t(* H5C_free_icr_func_t)(void *thing)
Definition: H5Cprivate.h:883
H5C_cache_entry_t
struct H5C_cache_entry_t H5C_cache_entry_t
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5C_cache_entry_t::fd_dirty_child_count
uint64_t fd_dirty_child_count
Definition: H5Cprivate.h:2289
H5C_get_cache_auto_resize_config
H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr)
Definition: H5Cquery.c:89
H5C_cache_entry_t::addr
haddr_t addr
Definition: H5Cprivate.h:2229
H5C_auto_size_ctl_t::set_initial_size
hbool_t set_initial_size
Definition: H5Cprivate.h:2108
H5C_cache_entry_t::cache_ptr
H5C_t * cache_ptr
Definition: H5Cprivate.h:2228
increase
@ increase
Definition: H5Cprivate.h:2328
H5C_set_cache_auto_resize_config
H5_DLL herr_t H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr)
Definition: H5C.c:2655
H5C_write_permitted_func_t
herr_t(* H5C_write_permitted_func_t)(const H5F_t *f, hbool_t *write_permitted_ptr)
Definition: H5Cprivate.h:905
H5C_evict_tagged_entries
H5_DLL herr_t H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, hbool_t match_global)
Definition: H5Ctag.c:523
H5C_cache_entry_t::pinned_from_client
hbool_t pinned_from_client
Definition: H5Cprivate.h:2261
prefix
CATCH unable to release heap prefix
Definition: H5HL.c:380
H5C_auto_size_ctl_t::empty_reserve
double empty_reserve
Definition: H5Cprivate.h:2133
H5C_class_t::id
int id
Definition: H5Cprivate.h:888
H5C_cache_entry_t::fd_parent_count
uint64_t fd_parent_count
Definition: H5Cprivate.h:2286
H5C_class_t::mem_type
H5FD_mem_t mem_type
Definition: H5Cprivate.h:890
H5C_cache_entry_t::fd_child_count
uint64_t fd_child_count
Definition: H5Cprivate.h:2288
H5C_flush_to_min_clean
H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f)
Definition: H5C.c:1190
H5C_mark_entry_clean
H5_DLL herr_t H5C_mark_entry_clean(void *thing)
Definition: H5C.c:1642
H5C_auto_size_ctl_t::decrement
double decrement
Definition: H5Cprivate.h:2128
H5C_cache_entry_t::flush_dep_parent_nalloc
unsigned flush_dep_parent_nalloc
Definition: H5Cprivate.h:2257
H5C_expunge_entry
H5_DLL herr_t H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flags)
Definition: H5C.c:936
H5C_cache_entry_t::pins
int32_t pins
Definition: H5Cprivate.h:2310
H5C_cache_entry_t::image_ptr
void * image_ptr
Definition: H5Cprivate.h:2231
H5C_auto_size_ctl_t::increment
double increment
Definition: H5Cprivate.h:2118
H5C_get_fsf_size_t
herr_t(* H5C_get_fsf_size_t)(const void *thing, hsize_t *fsf_size_ptr)
Definition: H5Cprivate.h:884
H5C_cache_image_status
H5_DLL herr_t H5C_cache_image_status(H5F_t *f, hbool_t *load_ci_ptr, hbool_t *write_ci_ptr)
Definition: H5Cimage.c:202
H5F_t
Definition: H5Fpkg.h:374
H5C_log_style_t
H5C_log_style_t
Definition: H5Cprivate.h:2223
H5C_auto_size_ctl_t::min_clean_fraction
double min_clean_fraction
Definition: H5Cprivate.h:2110
H5C_NOTIFY_ACTION_ENTRY_DIRTIED
@ H5C_NOTIFY_ACTION_ENTRY_DIRTIED
Definition: H5Cprivate.h:862
H5C_def_auto_resize_rpt_fcn
H5_DLL void H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, int32_t version, double hit_rate, enum H5C_resize_status status, size_t old_max_cache_size, size_t new_max_cache_size, size_t old_min_clean_size, size_t new_min_clean_size)
Definition: H5C.c:523
H5C_image_entry_t::fd_parent_count
uint64_t fd_parent_count
Definition: H5Cprivate.h:1982
herr_t
int herr_t
Definition: H5public.h:128
H5C_auto_size_ctl_t::max_decrement
size_t max_decrement
Definition: H5Cprivate.h:2130
H5C_image_entry_t
Definition: H5Cprivate.h:1830
H5C_auto_size_ctl_t::epochs_before_eviction
int32_t epochs_before_eviction
Definition: H5Cprivate.h:2131
H5C_dest
H5_DLL herr_t H5C_dest(H5F_t *f)
Definition: H5C.c:834
H5C_retag_entries
H5_DLL herr_t H5C_retag_entries(H5C_t *cache_ptr, haddr_t src_tag, haddr_t dest_tag)
Definition: H5Ctag.c:786
hbool_t
bool hbool_t
Definition: H5public.h:159
H5C_get_entry_status
H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, haddr_t addr, size_t *size_ptr, hbool_t *in_cache_ptr, hbool_t *is_dirty_ptr, hbool_t *is_protected_ptr, hbool_t *is_pinned_ptr, hbool_t *is_corked_ptr, hbool_t *is_flush_dep_parent_ptr, hbool_t *is_flush_dep_child_ptr, hbool_t *image_up_to_date_ptr)
Definition: H5Cquery.c:251
H5C_image_stats
H5_DLL herr_t H5C_image_stats(H5C_t *cache_ptr, hbool_t print_header)
Definition: H5Cimage.c:962
H5C_cache_entry_t::ht_prev
struct H5C_cache_entry_t * ht_prev
Definition: H5Cprivate.h:2266
H5Cpublic.h
H5C_cache_entry_t::ring
H5C_ring_t ring
Definition: H5Cprivate.h:2252
H5C_get_entry_ring
H5_DLL herr_t H5C_get_entry_ring(const H5F_t *f, haddr_t addr, H5C_ring_t *ring)
Definition: H5Cquery.c:397
H5C_cache_image_ctl_t
struct H5C_cache_image_ctl_t H5C_cache_image_ctl_t
H5C_cache_entry_t
Definition: H5Cprivate.h:1597
H5C_protect
H5_DLL void * H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsigned flags)
Definition: H5C.c:2176
H5C_cache_entry_t::image_dirty
hbool_t image_dirty
Definition: H5Cprivate.h:2285
H5C_resize_entry
H5_DLL herr_t H5C_resize_entry(void *thing, size_t new_size)
Definition: H5C.c:1962
H5C_stats
H5_DLL herr_t H5C_stats(H5C_t *cache_ptr, const char *cache_name, hbool_t display_detailed_stats)
Definition: H5Cdbg.c:490
hsize_t
hsize_t
Definition: H5overflow.txt:44
H5C_set_prefix
H5_DLL herr_t H5C_set_prefix(H5C_t *cache_ptr, char *prefix)
Definition: H5Cdbg.c:458
H5C_cache_entry_t::dirtied
hbool_t dirtied
Definition: H5Cprivate.h:2235
H5C_stats__reset
H5_DLL void H5C_stats__reset(H5C_t *cache_ptr)
Definition: H5Cdbg.c:987
H5C_auto_size_ctl_t::epoch_length
int64_t epoch_length
Definition: H5Cprivate.h:2113
H5C_cache_entry_t::magic
uint32_t magic
Definition: H5Cprivate.h:2227
H5C_cache_entry_t::pinned_from_cache
hbool_t pinned_from_cache
Definition: H5Cprivate.h:2262
H5C_image_entry_t::image_ptr
void * image_ptr
Definition: H5Cprivate.h:1986
H5C_auto_size_ctl_t::rpt_fcn
H5C_auto_resize_rpt_fcn rpt_fcn
Definition: H5Cprivate.h:2107
H5C_create_flush_dependency
H5_DLL herr_t H5C_create_flush_dependency(void *parent_thing, void *child_thing)
Definition: H5C.c:3547
H5C_image_entry_t::fd_dirty_child_count
uint64_t fd_dirty_child_count
Definition: H5Cprivate.h:1985
H5C_NOTIFY_ACTION_AFTER_LOAD
@ H5C_NOTIFY_ACTION_AFTER_LOAD
Definition: H5Cprivate.h:853
H5C_class_t::fsf_size
H5C_get_fsf_size_t fsf_size
Definition: H5Cprivate.h:901
H5C_class_t::get_final_load_size
H5C_get_final_load_size_func_t get_final_load_size
Definition: H5Cprivate.h:893
H5C_get_mdc_image_info
H5_DLL herr_t H5C_get_mdc_image_info(H5C_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len)
Definition: H5Cquery.c:437
H5C_image_entry_t::is_dirty
hbool_t is_dirty
Definition: H5Cprivate.h:1980
H5C_auto_resize_rpt_fcn
void(* H5C_auto_resize_rpt_fcn)(H5C_t *cache_ptr, int32_t version, double hit_rate, enum H5C_resize_status status, size_t old_max_cache_size, size_t new_max_cache_size, size_t old_min_clean_size, size_t new_min_clean_size)
Definition: H5Cprivate.h:2100
H5C_class_t::name
const char * name
Definition: H5Cprivate.h:889
H5C_cache_entry_t::prefetch_type_id
int prefetch_type_id
Definition: H5Cprivate.h:2292
H5C_auto_size_ctl_t::max_increment
size_t max_increment
Definition: H5Cprivate.h:2120
H5C_cache_entry_t::image_up_to_date
hbool_t image_up_to_date
Definition: H5Cprivate.h:2232
H5C_image_entry_t::image_fd_height
unsigned image_fd_height
Definition: H5Cprivate.h:1981
H5C_cache_entry_t::include_in_image
hbool_t include_in_image
Definition: H5Cprivate.h:2283
H5private.h
in_spec
@ in_spec
Definition: H5Cprivate.h:2327
H5C_unsettle_ring
H5_DLL herr_t H5C_unsettle_ring(H5F_t *f, H5C_ring_t ring)
Definition: H5C.c:3322
H5C_auto_size_ctl_t::apply_max_decrement
hbool_t apply_max_decrement
Definition: H5Cprivate.h:2129
H5C_class_t::free_icr
H5C_free_icr_func_t free_icr
Definition: H5Cprivate.h:900
H5C_flush_tagged_entries
H5_DLL herr_t H5C_flush_tagged_entries(H5F_t *f, haddr_t tag)
Definition: H5Ctag.c:742
H5C_image_entry_t
struct H5C_image_entry_t H5C_image_entry_t
H5C_cache_image_ctl_t::entry_ageout
int32_t entry_ageout
Definition: H5Cprivate.h:2218