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:             H5ACpublic.h
 
17
+
 *                      Jul 10 1997
 
18
+
 *                      Robb Matzke <matzke@llnl.gov>
 
19
+
 *
 
20
+
 * Purpose:             Public include file for cache functions.
 
21
+
 *
 
22
+
 * Modifications:
 
23
+
 *
 
24
+
 *-------------------------------------------------------------------------
 
25
+
 */
 
26
+
#ifndef _H5ACpublic_H
 
27
+
#define _H5ACpublic_H
 
28
+
 
29
+
/* Public headers needed by this file */
 
30
+
#include "H5public.h"
 
31
+
#include "H5Cpublic.h"
 
32
+
 
33
+
#ifdef __cplusplus
 
34
+
extern "C" {
 
35
+
#endif
 
36
+
 
37
+
/****************************************************************************
 
38
+
 *
 
39
+
 * structure H5AC_cache_config_t
 
40
+
 *
 
41
+
 * H5AC_cache_config_t is a public structure intended for use in public APIs.
 
42
+
 * At least in its initial incarnation, it is basicaly a copy of struct
 
43
+
 * H5C_auto_size_ctl_t, minus the report_fcn field, and plus the
 
44
+
 * dirty_bytes_threshold field.
 
45
+
 *
 
46
+
 * The report_fcn field is omitted, as including it would require us to
 
47
+
 * make H5C_t structure public.
 
48
+
 *
 
49
+
 * The dirty_bytes_threshold field does not appear in H5C_auto_size_ctl_t,
 
50
+
 * as synchronization between caches on different processes is handled at
 
51
+
 * the H5AC level, not at the level of H5C.  Note however that there is
 
52
+
 * considerable interaction between this value and the other fields in this
 
53
+
 * structure.
 
54
+
 *
 
55
+
 * Similarly, the open_trace_file, close_trace_file, and trace_file_name
 
56
+
 * fields do not appear in H5C_auto_size_ctl_t, as most trace file
 
57
+
 * issues are handled at the H5AC level.  The one exception is storage of
 
58
+
 * the pointer to the trace file, which is handled by H5C.
 
59
+
 *
 
60
+
 * The structure is in H5ACpublic.h as we may wish to allow different
 
61
+
 * configuration options for metadata and raw data caches.
 
62
+
 *
 
63
+
 * The fields of the structure are discussed individually below:
 
64
+
 *
 
65
+
 * version: Integer field containing the version number of this version
 
66
+
 *      of the H5AC_cache_config_t structure.  Any instance of
 
67
+
 *      H5AC_cache_config_t passed to the cache must have a known
 
68
+
 *      version number, or an error will be flagged.
 
69
+
 *
 
70
+
 * rpt_fcn_enabled: Boolean field used to enable and disable the default
 
71
+
 *    reporting function.  This function is invoked every time the
 
72
+
 *    automatic cache resize code is run, and reports on its activities.
 
73
+
 *
 
74
+
 *    This is a debugging function, and should normally be turned off.
 
75
+
 *
 
76
+
 * open_trace_file: Boolean field indicating whether the trace_file_name
 
77
+
 *     field should be used to open a trace file for the cache.
 
78
+
 *
 
79
+
 *      *** DEPRECATED *** Use H5Fstart/stop logging functions instead
 
80
+
 *
 
81
+
 *     The trace file is a debuging feature that allow the capture of
 
82
+
 *     top level metadata cache requests for purposes of debugging and/or
 
83
+
 *     optimization.  This field should normally be set to FALSE, as
 
84
+
 *     trace file collection imposes considerable overhead.
 
85
+
 *
 
86
+
 *     This field should only be set to TRUE when the trace_file_name
 
87
+
 *     contains the full path of the desired trace file, and either
 
88
+
 *     there is no open trace file on the cache, or the close_trace_file
 
89
+
 *     field is also TRUE.
 
90
+
 *
 
91
+
 * close_trace_file: Boolean field indicating whether the current trace
 
92
+
 *     file (if any) should be closed.
 
93
+
 *
 
94
+
 *      *** DEPRECATED *** Use H5Fstart/stop logging functions instead
 
95
+
 *
 
96
+
 *     See the above comments on the open_trace_file field.  This field
 
97
+
 *     should be set to FALSE unless there is an open trace file on the
 
98
+
 *     cache that you wish to close.
 
99
+
 *
 
100
+
 * trace_file_name: Full path of the trace file to be opened if the
 
101
+
 *     open_trace_file field is TRUE.
 
102
+
 *
 
103
+
 *      *** DEPRECATED *** Use H5Fstart/stop logging functions instead
 
104
+
 *
 
105
+
 *     In the parallel case, an ascii representation of the mpi rank of
 
106
+
 *     the process will be appended to the file name to yield a unique
 
107
+
 *     trace file name for each process.
 
108
+
 *
 
109
+
 *     The length of the path must not exceed H5AC__MAX_TRACE_FILE_NAME_LEN
 
110
+
 *     characters.
 
111
+
 *
 
112
+
 * evictions_enabled:  Boolean field used to either report the current
 
113
+
 *     evictions enabled status of the cache, or to set the cache's
 
114
+
 *    evictions enabled status.
 
115
+
 *
 
116
+
 *     In general, the metadata cache should always be allowed to
 
117
+
 *     evict entries.  However, in some cases it is advantageous to
 
118
+
 *     disable evictions briefly, and thereby postpone metadata
 
119
+
 *     writes.  However, this must be done with care, as the cache
 
120
+
 *     can grow quickly.  If you do this, re-enable evictions as
 
121
+
 *     soon as possible and monitor cache size.
 
122
+
 *
 
123
+
 *     At present, evictions can only be disabled if automatic
 
124
+
 *     cache resizing is also disabled (that is, ( incr_mode ==
 
125
+
 *    H5C_incr__off ) && ( decr_mode == H5C_decr__off )).  There
 
126
+
 *    is no logical reason why this should be so, but it simplifies
 
127
+
 *    implementation and testing, and I can't think of any reason
 
128
+
 *    why it would be desireable.  If you can think of one, I'll
 
129
+
 *    revisit the issue.
 
130
+
 *
 
131
+
 * set_initial_size: Boolean flag indicating whether the size of the
 
132
+
 *      initial size of the cache is to be set to the value given in
 
133
+
 *      the initial_size field.  If set_initial_size is FALSE, the
 
134
+
 *      initial_size field is ignored.
 
135
+
 *
 
136
+
 * initial_size: If enabled, this field contain the size the cache is
 
137
+
 *      to be set to upon receipt of this structure.  Needless to say,
 
138
+
 *      initial_size must lie in the closed interval [min_size, max_size].
 
139
+
 *
 
140
+
 * min_clean_fraction: double in the range 0 to 1 indicating the fraction
 
141
+
 *      of the cache that is to be kept clean.  This field is only used
 
142
+
 *      in parallel mode.  Typical values are 0.1 to 0.5.
 
143
+
 *
 
144
+
 * max_size: Maximum size to which the cache can be adjusted.  The
 
145
+
 *      supplied value must fall in the closed interval
 
146
+
 *      [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE].  Also, max_size must
 
147
+
 *      be greater than or equal to min_size.
 
148
+
 *
 
149
+
 * min_size: Minimum size to which the cache can be adjusted.  The
 
150
+
 *      supplied value must fall in the closed interval
 
151
+
 *      [H5C__MIN_MAX_CACHE_SIZE, H5C__MAX_MAX_CACHE_SIZE].  Also, min_size
 
152
+
 *      must be less than or equal to max_size.
 
153
+
 *
 
154
+
 * epoch_length: Number of accesses on the cache over which to collect
 
155
+
 *      hit rate stats before running the automatic cache resize code,
 
156
+
 *      if it is enabled.
 
157
+
 *
 
158
+
 *      At the end of an epoch, we discard prior hit rate data and start
 
159
+
 *      collecting afresh.  The epoch_length must lie in the closed
 
160
+
 *      interval [H5C__MIN_AR_EPOCH_LENGTH, H5C__MAX_AR_EPOCH_LENGTH].
 
161
+
 *
 
162
+
 *
 
163
+
 * Cache size increase control fields:
 
164
+
 *
 
165
+
 * incr_mode: Instance of the H5C_cache_incr_mode enumerated type whose
 
166
+
 *      value indicates how we determine whether the cache size should be
 
167
+
 *      increased.  At present there are two possible values:
 
168
+
 *
 
169
+
 *      H5C_incr__off:  Don't attempt to increase the size of the cache
 
170
+
 *              automatically.
 
171
+
 *
 
172
+
 *              When this increment mode is selected, the remaining fields
 
173
+
 *              in the cache size increase section ar ignored.
 
174
+
 *
 
175
+
 *      H5C_incr__threshold: Attempt to increase the size of the cache
 
176
+
 *              whenever the average hit rate over the last epoch drops
 
177
+
 *              below the value supplied in the lower_hr_threshold
 
178
+
 *              field.
 
179
+
 *
 
180
+
 *              Note that this attempt will fail if the cache is already
 
181
+
 *              at its maximum size, or if the cache is not already using
 
182
+
 *              all available space.
 
183
+
 *
 
184
+
 *      Note that you must set decr_mode to H5C_incr__off if you
 
185
+
 *      disable metadata cache entry evictions.
 
186
+
 *
 
187
+
 * lower_hr_threshold: Lower hit rate threshold.  If the increment mode
 
188
+
 *      (incr_mode) is H5C_incr__threshold and the hit rate drops below the
 
189
+
 *      value supplied in this field in an epoch, increment the cache size by
 
190
+
 *      size_increment.  Note that cache size may not be incremented above
 
191
+
 *      max_size, and that the increment may be further restricted by the
 
192
+
 *      max_increment field if it is enabled.
 
193
+
 *
 
194
+
 *      When enabled, this field must contain a value in the range [0.0, 1.0].
 
195
+
 *      Depending on the incr_mode selected, it may also have to be less than
 
196
+
 *      upper_hr_threshold.
 
197
+
 *
 
198
+
 * increment:  Double containing the multiplier used to derive the new
 
199
+
 *      cache size from the old if a cache size increment is triggered.
 
200
+
 *      The increment must be greater than 1.0, and should not exceed 2.0.
 
201
+
 *
 
202
+
 *      The new cache size is obtained my multiplying the current max cache
 
203
+
 *      size by the increment, and then clamping to max_size and to stay
 
204
+
 *      within the max_increment as necessary.
 
205
+
 *
 
206
+
 * apply_max_increment:  Boolean flag indicating whether the max_increment
 
207
+
 *      field should be used to limit the maximum cache size increment.
 
208
+
 *
 
209
+
 * max_increment: If enabled by the apply_max_increment field described
 
210
+
 *      above, this field contains the maximum number of bytes by which the
 
211
+
 *      cache size can be increased in a single re-size.
 
212
+
 *
 
213
+
 * flash_incr_mode:  Instance of the H5C_cache_flash_incr_mode enumerated
 
214
+
 *      type whose value indicates whether and by which algorithm we should
 
215
+
 *      make flash increases in the size of the cache to accomodate insertion
 
216
+
 *      of large entries and large increases in the size of a single entry.
 
217
+
 *
 
218
+
 *      The addition of the flash increment mode was occasioned by performance
 
219
+
 *      problems that appear when a local heap is increased to a size in excess
 
220
+
 *      of the current cache size.  While the existing re-size code dealt with
 
221
+
 *      this eventually, performance was very bad for the remainder of the
 
222
+
 *      epoch.
 
223
+
 *
 
224
+
 *      At present, there are two possible values for the flash_incr_mode:
 
225
+
 *
 
226
+
 *      H5C_flash_incr__off:  Don't perform flash increases in the size of
 
227
+
 *              the cache.
 
228
+
 *
 
229
+
 *      H5C_flash_incr__add_space:  Let x be either the size of a newly
 
230
+
 *              newly inserted entry, or the number of bytes by which the
 
231
+
 *              size of an existing entry has been increased.
 
232
+
 *
 
233
+
 *              If
 
234
+
 *                      x > flash_threshold * current max cache size,
 
235
+
 *
 
236
+
 *              increase the current maximum cache size by x * flash_multiple
 
237
+
 *              less any free space in the cache, and star a new epoch.  For
 
238
+
 *              now at least, pay no attention to the maximum increment.
 
239
+
 *
 
240
+
 *      In both of the above cases, the flash increment pays no attention to
 
241
+
 *      the maximum increment (at least in this first incarnation), but DOES
 
242
+
 *      stay within max_size.
 
243
+
 *
 
244
+
 *      With a little thought, it should be obvious that the above flash
 
245
+
 *      cache size increase algorithm is not sufficient for all circumstances
 
246
+
 *      -- for example, suppose the user round robins through
 
247
+
 *      (1/flash_threshold) +1 groups, adding one data set to each on each
 
248
+
 *      pass.  Then all will increase in size at about the same time, requiring
 
249
+
 *      the max cache size to at least double to maintain acceptable
 
250
+
 *      performance, however the above flash increment algorithm will not be
 
251
+
 *      triggered.
 
252
+
 *
 
253
+
 *      Hopefully, the add space algorithms detailed above will be sufficient
 
254
+
 *      for the performance problems encountered to date.  However, we should
 
255
+
 *      expect to revisit the issue.
 
256
+
 *
 
257
+
 * flash_multiple: Double containing the multiple described above in the
 
258
+
 *      H5C_flash_incr__add_space section of the discussion of the
 
259
+
 *      flash_incr_mode section.  This field is ignored unless flash_incr_mode
 
260
+
 *      is H5C_flash_incr__add_space.
 
261
+
 *
 
262
+
 * flash_threshold: Double containing the factor by which current max cache
 
263
+
 *      size is multiplied to obtain the size threshold for the add_space flash
 
264
+
 *      increment algorithm.  The field is ignored unless flash_incr_mode is
 
265
+
 *      H5C_flash_incr__add_space.
 
266
+
 *
 
267
+
 *
 
268
+
 * Cache size decrease control fields:
 
269
+
 *
 
270
+
 * decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose
 
271
+
 *      value indicates how we determine whether the cache size should be
 
272
+
 *      decreased.  At present there are four possibilities.
 
273
+
 *
 
274
+
 *      H5C_decr__off:  Don't attempt to decrease the size of the cache
 
275
+
 *              automatically.
 
276
+
 *
 
277
+
 *              When this increment mode is selected, the remaining fields
 
278
+
 *              in the cache size decrease section are ignored.
 
279
+
 *
 
280
+
 *      H5C_decr__threshold: Attempt to decrease the size of the cache
 
281
+
 *              whenever the average hit rate over the last epoch rises
 
282
+
 *              above the value supplied in the upper_hr_threshold
 
283
+
 *              field.
 
284
+
 *
 
285
+
 *      H5C_decr__age_out:  At the end of each epoch, search the cache for
 
286
+
 *              entries that have not been accessed for at least the number
 
287
+
 *              of epochs specified in the epochs_before_eviction field, and
 
288
+
 *              evict these entries.  Conceptually, the maximum cache size
 
289
+
 *              is then decreased to match the new actual cache size.  However,
 
290
+
 *              this reduction may be modified by the min_size, the
 
291
+
 *              max_decrement, and/or the empty_reserve.
 
292
+
 *
 
293
+
 *      H5C_decr__age_out_with_threshold:  Same as age_out, but we only
 
294
+
 *              attempt to reduce the cache size when the hit rate observed
 
295
+
 *              over the last epoch exceeds the value provided in the
 
296
+
 *              upper_hr_threshold field.
 
297
+
 *
 
298
+
 *      Note that you must set decr_mode to H5C_decr__off if you
 
299
+
 *      disable metadata cache entry evictions.
 
300
+
 *
 
301
+
 * upper_hr_threshold: Upper hit rate threshold.  The use of this field
 
302
+
 *      varies according to the current decr_mode:
 
303
+
 *
 
304
+
 *      H5C_decr__off or H5C_decr__age_out:  The value of this field is
 
305
+
 *              ignored.
 
306
+
 *
 
307
+
 *      H5C_decr__threshold:  If the hit rate exceeds this threshold in any
 
308
+
 *              epoch, attempt to decrement the cache size by size_decrement.
 
309
+
 *
 
310
+
 *              Note that cache size may not be decremented below min_size.
 
311
+
 *
 
312
+
 *              Note also that if the upper_threshold is 1.0, the cache size
 
313
+
 *              will never be reduced.
 
314
+
 *
 
315
+
 *      H5C_decr__age_out_with_threshold:  If the hit rate exceeds this
 
316
+
 *              threshold in any epoch, attempt to reduce the cache size
 
317
+
 *              by evicting entries that have not been accessed for more
 
318
+
 *              than the specified number of epochs.
 
319
+
 *
 
320
+
 * decrement: This field is only used when the decr_mode is
 
321
+
 *      H5C_decr__threshold.
 
322
+
 *
 
323
+
 *      The field is a double containing the multiplier used to derive the
 
324
+
 *      new cache size from the old if a cache size decrement is triggered.
 
325
+
 *      The decrement must be in the range 0.0 (in which case the cache will
 
326
+
 *      try to contract to its minimum size) to 1.0 (in which case the
 
327
+
 *      cache will never shrink).
 
328
+
 *
 
329
+
 * apply_max_decrement:  Boolean flag used to determine whether decrements
 
330
+
 *      in cache size are to be limited by the max_decrement field.
 
331
+
 *
 
332
+
 * max_decrement: Maximum number of bytes by which the cache size can be
 
333
+
 *      decreased in a single re-size.  Note that decrements may also be
 
334
+
 *      restricted by the min_size of the cache, and (in age out modes) by
 
335
+
 *      the empty_reserve field.
 
336
+
 *
 
337
+
 * epochs_before_eviction:  Integer field used in H5C_decr__age_out and
 
338
+
 *      H5C_decr__age_out_with_threshold decrement modes.
 
339
+
 *
 
340
+
 *      This field contains the number of epochs an entry must remain
 
341
+
 *      unaccessed before it is evicted in an attempt to reduce the
 
342
+
 *      cache size.  If applicable, this field must lie in the range
 
343
+
 *      [1, H5C__MAX_EPOCH_MARKERS].
 
344
+
 *
 
345
+
 * apply_empty_reserve:  Boolean field controlling whether the empty_reserve
 
346
+
 *      field is to be used in computing the new cache size when the
 
347
+
 *      decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold.
 
348
+
 *
 
349
+
 * empty_reserve:  To avoid a constant racheting down of cache size by small
 
350
+
 *      amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold
 
351
+
 *      modes, this field allows one to require that any cache size
 
352
+
 *      reductions leave the specified fraction of unused space in the cache.
 
353
+
 *
 
354
+
 *      The value of this field must be in the range [0.0, 1.0].  I would
 
355
+
 *      expect typical values to be in the range of 0.01 to 0.1.
 
356
+
 *
 
357
+
 *
 
358
+
 * Parallel Configuration Fields:
 
359
+
 *
 
360
+
 * In PHDF5, all operations that modify metadata must be executed collectively.
 
361
+
 *
 
362
+
 * We used to think that this was enough to ensure consistency across the
 
363
+
 * metadata caches, but since we allow processes to read metadata individually,
 
364
+
 * the order of dirty entries in the LRU list can vary across processes,
 
365
+
 * which can result in inconsistencies between the caches.
 
366
+
 *
 
367
+
 * PHDF5 uses several strategies to prevent such inconsistencies in metadata,
 
368
+
 * all of which use the fact that the same stream of dirty metadata is seen
 
369
+
 * by all processes for purposes of synchronization.  This is done by
 
370
+
 * having each process count the number of bytes of dirty metadata generated,
 
371
+
 * and then running a "sync point" whenever this count exceeds a user
 
372
+
 * specified threshold (see dirty_bytes_threshold below).
 
373
+
 *
 
374
+
 * The current metadata write strategy is indicated by the
 
375
+
 * metadata_write_strategy field.  The possible values of this field, along
 
376
+
 * with the associated metadata write strategies are discussed below.
 
377
+
 *
 
378
+
 * dirty_bytes_threshold:  Threshold of dirty byte creation used to
 
379
+
 *     synchronize updates between caches. (See above for outline and
 
380
+
 *    motivation.)
 
381
+
 *
 
382
+
 *    This value MUST be consistant across all processes accessing the
 
383
+
 *    file.  This field is ignored unless HDF5 has been compiled for
 
384
+
 *    parallel.
 
385
+
 *
 
386
+
 * metadata_write_strategy: Integer field containing a code indicating the
 
387
+
 *    desired metadata write strategy.  The valid values of this field
 
388
+
 *    are enumerated and discussed below:
 
389
+
 *
 
390
+
 *
 
391
+
 *    H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
 
392
+
 *
 
393
+
 *    When metadata_write_strategy is set to this value, only process
 
394
+
 *    zero is allowed to write dirty metadata to disk.  All other
 
395
+
 *    processes must retain dirty metadata until they are informed at
 
396
+
 *    a sync point that the dirty metadata in question has been written
 
397
+
 *    to disk.
 
398
+
 *
 
399
+
 *    When the sync point is reached (or when there is a user generated
 
400
+
 *    flush), process zero flushes sufficient entries to bring it into
 
401
+
 *    complience with its min clean size (or flushes all dirty entries in
 
402
+
 *    the case of a user generated flush), broad casts the list of
 
403
+
 *    entries just cleaned to all the other processes, and then exits
 
404
+
 *    the sync point.
 
405
+
 *
 
406
+
 *    Upon receipt of the broadcast, the other processes mark the indicated
 
407
+
 *    entries as clean, and leave the sync point as well.
 
408
+
 *
 
409
+
 *
 
410
+
 *    H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
 
411
+
 *
 
412
+
 *    In the distributed metadata write strategy, process zero still makes
 
413
+
 *    the decisions as to what entries should be flushed, but the actual
 
414
+
 *    flushes are distributed across the processes in the computation to
 
415
+
 *    the extent possible.
 
416
+
 *
 
417
+
 *    In this strategy, when a sync point is triggered (either by dirty
 
418
+
 *    metadata creation or manual flush), all processes enter a barrier.
 
419
+
 *
 
420
+
 *    On the other side of the barrier, process 0 constructs an ordered
 
421
+
 *    list of the entries to be flushed, and then broadcasts this list
 
422
+
 *    to the caches in all the processes.
 
423
+
 *
 
424
+
 *    All processes then scan the list of entries to be flushed, flushing
 
425
+
 *    some, and marking the rest as clean.  The algorithm for this purpose
 
426
+
 *    ensures that each entry in the list is flushed exactly once, and
 
427
+
 *    all are marked clean in each cache.
 
428
+
 *
 
429
+
 *    Note that in the case of a flush of the cache, no message passing
 
430
+
 *    is necessary, as all processes have the same list of dirty entries,
 
431
+
 *    and all of these entries must be flushed.  Thus in this case it is
 
432
+
 *    sufficient for each process to sort its list of dirty entries after
 
433
+
 *    leaving the initial barrier, and use this list as if it had been
 
434
+
 *    received from process zero.
 
435
+
 *
 
436
+
 *    To avoid possible messages from the past/future, all caches must
 
437
+
 *    wait until all caches are done before leaving the sync point.
 
438
+
 *
 
439
+
 ****************************************************************************/
 
440
+
 
441
+
#define H5AC__CURR_CACHE_CONFIG_VERSION     1
 
442
+
#define H5AC__MAX_TRACE_FILE_NAME_LEN        1024
 
443
+
 
444
+
#define H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY    0
 
445
+
#define H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED       1
 
446
+
 
447
+
typedef struct H5AC_cache_config_t
 
448
+
{
 
449
+
    /* general configuration fields: */
 
450
+
    int                      version;
 
451
+
 
452
+
    hbool_t             rpt_fcn_enabled;
 
453
+
 
454
+
    hbool_t             open_trace_file;
 
455
+
    hbool_t                  close_trace_file;
 
456
+
    char                     trace_file_name[H5AC__MAX_TRACE_FILE_NAME_LEN + 1];
 
457
+
 
458
+
    hbool_t                  evictions_enabled;
 
459
+
 
460
+
    hbool_t                  set_initial_size;
 
461
+
    size_t                   initial_size;
 
462
+
 
463
+
    double                   min_clean_fraction;
 
464
+
 
465
+
    size_t                   max_size;
 
466
+
    size_t                   min_size;
 
467
+
 
468
+
    long int                 epoch_length;
 
469
+
 
470
+
 
471
+
    /* size increase control fields: */
 
472
+
    enum H5C_cache_incr_mode incr_mode;
 
473
+
 
474
+
    double                   lower_hr_threshold;
 
475
+
 
476
+
    double                   increment;
 
477
+
 
478
+
    hbool_t                  apply_max_increment;
 
479
+
    size_t                   max_increment;
 
480
+
 
481
+
    enum H5C_cache_flash_incr_mode      flash_incr_mode;
 
482
+
    double                              flash_multiple;
 
483
+
    double                              flash_threshold;
 
484
+
 
485
+
 
486
+
    /* size decrease control fields: */
 
487
+
    enum H5C_cache_decr_mode decr_mode;
 
488
+
 
489
+
    double                   upper_hr_threshold;
 
490
+
 
491
+
    double                   decrement;
 
492
+
 
493
+
    hbool_t                  apply_max_decrement;
 
494
+
    size_t                   max_decrement;
 
495
+
 
496
+
    int                      epochs_before_eviction;
 
497
+
 
498
+
    hbool_t                  apply_empty_reserve;
 
499
+
    double                   empty_reserve;
 
500
+
 
501
+
 
502
+
    /* parallel configuration fields: */
 
503
+
    size_t                   dirty_bytes_threshold;
 
504
+
    int                      metadata_write_strategy;
 
505
+
 
506
+
} H5AC_cache_config_t;
 
507
+
 
508
+
 
509
+
/****************************************************************************
 
510
+
 *
 
511
+
 * structure H5AC_cache_image_config_t
 
512
+
 *
 
513
+
 * H5AC_cache_image_ctl_t is a public structure intended for use in public
 
514
+
 * APIs.  At least in its initial incarnation, it is a copy of struct
 
515
+
 * H5C_cache_image_ctl_t.
 
516
+
 *
 
517
+
 * The fields of the structure are discussed individually below:
 
518
+
 *
 
519
+
 * version: Integer field containing the version number of this version
 
520
+
 *      of the H5C_image_ctl_t structure.  Any instance of
 
521
+
 *      H5C_image_ctl_t passed to the cache must have a known
 
522
+
 *      version number, or an error will be flagged.
 
523
+
 *
 
524
+
 * generate_image:  Boolean flag indicating whether a cache image should
 
525
+
 *      be created on file close.
 
526
+
 *
 
527
+
 * save_resize_status:    Boolean flag indicating whether the cache image
 
528
+
 *    should include the adaptive cache resize configuration and status.
 
529
+
 *    Note that this field is ignored at present.
 
530
+
 *
 
531
+
 * entry_ageout:    Integer field indicating the maximum number of
 
532
+
 *    times a prefetched entry can appear in subsequent cache images.
 
533
+
 *    This field exists to allow the user to avoid the buildup of
 
534
+
 *    infrequently used entries in long sequences of cache images.
 
535
+
 *
 
536
+
 *    The value of this field must lie in the range
 
537
+
 *    H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to
 
538
+
 *    H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100).
 
539
+
 *
 
540
+
 *    H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit
 
541
+
 *    is imposed on number of times a prefeteched entry can appear
 
542
+
 *    in subsequent cache images.
 
543
+
 *
 
544
+
 *    A value of 0 prevents prefetched entries from being included
 
545
+
 *    in cache images.
 
546
+
 *
 
547
+
 *    Positive integers restrict prefetched entries to the specified
 
548
+
 *    number of appearances.
 
549
+
 *
 
550
+
 *    Note that the number of subsequent cache images that a prefetched
 
551
+
 *    entry has appeared in is tracked in an 8 bit field.  Thus, while
 
552
+
 *    H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its
 
553
+
 *    current value, any value in excess of 255 will be the functional
 
554
+
 *    equivalent of H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE.
 
555
+
 *
 
556
+
 ****************************************************************************/
 
557
+
 
558
+
#define H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION     1
 
559
+
 
560
+
#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE    -1
 
561
+
#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX    100
 
562
+
 
563
+
typedef struct H5AC_cache_image_config_t {
 
564
+
    int                                 version;
 
565
+
    hbool_t                             generate_image;
 
566
+
    hbool_t                             save_resize_status;
 
567
+
    int                                 entry_ageout;
 
568
+
} H5AC_cache_image_config_t;
 
569
+
 
570
+
#ifdef __cplusplus
 
571
+
}
 
572
+
#endif
 
573
+
#endif
 
574
+