mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-12 17:31:09 +08:00
[svn-r19096] Description:
Bring "round robin" metadata write strategy code from 'round_robin' branch to the trunk. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.6.3 (amazon) in debug mode Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
This commit is contained in:
parent
f82774c0d5
commit
5a1cb3c7a6
2709
src/H5AC.c
2709
src/H5AC.c
File diff suppressed because it is too large
Load Diff
@ -46,6 +46,17 @@
|
||||
|
||||
#define H5AC_DEBUG_DIRTY_BYTES_CREATION 0
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
|
||||
/* the following #defined are used to specify the operation required
|
||||
* at a sync point.
|
||||
*/
|
||||
|
||||
#define H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN 0
|
||||
#define H5AC_SYNC_POINT_OP__FLUSH_CACHE 1
|
||||
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* It is a bit difficult to set ranges of allowable values on the
|
||||
* dirty_bytes_threshold field of H5AC_aux_t. The following are
|
||||
@ -59,6 +70,9 @@
|
||||
#define H5AC__MAX_DIRTY_BYTES_THRESHOLD (int32_t) \
|
||||
(H5C__MAX_MAX_CACHE_SIZE / 4)
|
||||
|
||||
#define H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
|
||||
H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* structure H5AC_aux_t
|
||||
@ -162,6 +176,12 @@
|
||||
* broadcast. This field is reset to zero after each such
|
||||
* broadcast.
|
||||
*
|
||||
* metadata_write_strategy: Integer code indicating how we will be
|
||||
* writing the metadata. In the first incarnation of
|
||||
* this code, all writes were done from process 0. This
|
||||
* field exists to facilitate experiments with other
|
||||
* strategies.
|
||||
*
|
||||
* dirty_bytes_propagations: This field only exists when the
|
||||
* H5AC_DEBUG_DIRTY_BYTES_CREATION #define is TRUE.
|
||||
*
|
||||
@ -211,6 +231,19 @@
|
||||
* been created via move operations since the last time
|
||||
* the cleaned list was propagated.
|
||||
*
|
||||
* Things have changed a bit since the following four fields were defined.
|
||||
* If metadata_write_strategy is H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY,
|
||||
* all comments hold as before -- with the caviate that pending further
|
||||
* coding, the process 0 metadata cache is forbidden to flush entries outside
|
||||
* of a sync point.
|
||||
*
|
||||
* However, for different metadata write strategies, these fields are used
|
||||
* only to maintain the correct dirty byte count on process zero -- and in
|
||||
* most if not all cases, this is redundant, as process zero will be barred
|
||||
* from flushing entries outside of a sync point.
|
||||
*
|
||||
* JRM -- 3/16/10
|
||||
*
|
||||
* d_slist_ptr: Pointer to an instance of H5SL_t used to maintain a list
|
||||
* of entries that have been dirtied since the last time they
|
||||
* were listed in a clean entries broadcast. This list is
|
||||
@ -259,6 +292,17 @@
|
||||
* contain the value 0 on all processes other than process 0.
|
||||
* It exists primarily for sanity checking.
|
||||
*
|
||||
* The following two fields are used only when metadata_write_strategy
|
||||
* is H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED.
|
||||
*
|
||||
* candidate_slist_ptr: Pointer to an instance of H5SL_t used by process 0
|
||||
* to construct a list of entries to be flushed at this sync
|
||||
* point. This list is then broadcast to the other processes,
|
||||
* which then either flush or mark clean all entries on it.
|
||||
*
|
||||
* candidate_slist_len: Integer field containing the number of entries on the
|
||||
* candidate list. It exists primarily for sanity checking.
|
||||
*
|
||||
* write_done: In the parallel test bed, it is necessary to ensure that
|
||||
* all writes to the server process from cache 0 complete
|
||||
* before it enters the barrier call with the other caches.
|
||||
@ -271,6 +315,19 @@
|
||||
* This field must be set to NULL when the callback is not
|
||||
* needed.
|
||||
*
|
||||
* Note: This field has been extended for use by all processes
|
||||
* with the addition of support for the distributed
|
||||
* metadata write strategy.
|
||||
* JRM -- 5/9/10
|
||||
*
|
||||
* sync_point_done: In the parallel test bed, it is necessary to verify
|
||||
* that the expected writes, and only the expected writes,
|
||||
* have taken place at the end of each sync point.
|
||||
*
|
||||
* The sync_point_done callback allows t_cache to perform
|
||||
* this verification. The field is set to NULL when the
|
||||
* callback is not needed.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
@ -293,6 +350,8 @@ typedef struct H5AC_aux_t
|
||||
|
||||
int32_t dirty_bytes;
|
||||
|
||||
int32_t metadata_write_strategy;
|
||||
|
||||
#if H5AC_DEBUG_DIRTY_BYTES_CREATION
|
||||
|
||||
int32_t dirty_bytes_propagations;
|
||||
@ -316,8 +375,15 @@ typedef struct H5AC_aux_t
|
||||
|
||||
int32_t c_slist_len;
|
||||
|
||||
H5SL_t * candidate_slist_ptr;
|
||||
|
||||
int32_t candidate_slist_len;
|
||||
|
||||
void (* write_done)(void);
|
||||
|
||||
void (* sync_point_done)(int num_writes,
|
||||
haddr_t * written_entries_tbl);
|
||||
|
||||
} H5AC_aux_t; /* struct H5AC_aux_t */
|
||||
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
@ -222,6 +222,9 @@ H5_DLLVAR hid_t H5AC_ind_dxpl_id;
|
||||
|
||||
/* Default cache configuration. */
|
||||
|
||||
#define H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
|
||||
H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
#define H5AC__DEFAULT_CACHE_CONFIG \
|
||||
{ \
|
||||
@ -254,7 +257,9 @@ H5_DLLVAR hid_t H5AC_ind_dxpl_id;
|
||||
/* int epochs_before_eviction = */ 3, \
|
||||
/* hbool_t apply_empty_reserve = */ TRUE, \
|
||||
/* double empty_reserve = */ 0.1, \
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024) \
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024), \
|
||||
/* int metadata_write_strategy = */ \
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
|
||||
}
|
||||
#else /* H5_HAVE_PARALLEL */
|
||||
#define H5AC__DEFAULT_CACHE_CONFIG \
|
||||
@ -288,7 +293,9 @@ H5_DLLVAR hid_t H5AC_ind_dxpl_id;
|
||||
/* int epochs_before_eviction = */ 3, \
|
||||
/* hbool_t apply_empty_reserve = */ TRUE, \
|
||||
/* double empty_reserve = */ 0.1, \
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024) \
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024), \
|
||||
/* int metadata_write_strategy = */ \
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
|
||||
}
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
@ -358,6 +365,9 @@ H5_DLL herr_t H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id,
|
||||
const H5AC_class_t *type, haddr_t addr,
|
||||
unsigned flags);
|
||||
|
||||
H5_DLL herr_t H5AC_set_sync_point_done_callback(H5C_t *cache_ptr,
|
||||
void (*sync_point_done)(int num_writes, haddr_t *written_entries_tbl));
|
||||
|
||||
H5_DLL herr_t H5AC_set_write_done_callback(H5C_t * cache_ptr,
|
||||
void (* write_done)(void));
|
||||
H5_DLL herr_t H5AC_stats(const H5F_t *f);
|
||||
@ -392,5 +402,9 @@ H5_DLL herr_t H5AC_retag_copied_metadata(H5F_t * f, haddr_t metadata_tag);
|
||||
|
||||
H5_DLL herr_t H5AC_ignore_tags(H5F_t * f);
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
H5_DLL herr_t H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr);
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
#endif /* !_H5ACprivate_H */
|
||||
|
||||
|
@ -354,21 +354,22 @@ extern "C" {
|
||||
* Parallel Configuration Fields:
|
||||
*
|
||||
* In PHDF5, all operations that modify metadata must be executed collectively.
|
||||
*
|
||||
* We used to think that this was enough to ensure consistency across the
|
||||
* metadata caches, but since we allow processes to read metadata individually,
|
||||
* the order of dirty entries in the LRU list can vary across processes,
|
||||
* which can result in inconsistencies between the caches.
|
||||
*
|
||||
* To prevent this, only the metadata cache on process 0 is allowed to write
|
||||
* to file, and then only after synchronizing with the other caches. After
|
||||
* it writes entries to file, it sends the base addresses of the now clean
|
||||
* entries to the other caches, so they can mark these entries clean as well.
|
||||
* PHDF5 uses several strategies to prevent such inconsistencies in metadata,
|
||||
* all of which use the fact that the same stream of dirty metadata is seen
|
||||
* by all processes for purposes of synchronization. This is done by
|
||||
* having each process count the number of bytes of dirty metadata generated,
|
||||
* and then running a "sync point" whenever this count exceeds a user
|
||||
* specified threshold (see dirty_bytes_threshold below).
|
||||
*
|
||||
* The different caches know when to synchronize caches by counting the
|
||||
* number of bytes of dirty metadata created by the collective operations
|
||||
* modifying metadata. Whenever this count exceeds a user specified
|
||||
* threshold (see below), process 0 flushes down to its minimum clean size,
|
||||
* and then sends the list of newly cleaned entries to the other caches.
|
||||
* The current metadata write strategy is indicated by the
|
||||
* metadata_write_strategy field. The possible values of this field, along
|
||||
* with the associated metadata write strategies are discussed below.
|
||||
*
|
||||
* dirty_bytes_threshold: Threshold of dirty byte creation used to
|
||||
* synchronize updates between caches. (See above for outline and
|
||||
@ -378,11 +379,67 @@ extern "C" {
|
||||
* file. This field is ignored unless HDF5 has been compiled for
|
||||
* parallel.
|
||||
*
|
||||
* metadata_write_strategy: Integer field containing a code indicating the
|
||||
* desired metadata write strategy. The valid values of this field
|
||||
* are enumerated and discussed below:
|
||||
*
|
||||
*
|
||||
* H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
|
||||
*
|
||||
* When metadata_write_strategy is set to this value, only process
|
||||
* zero is allowed to write dirty metadata to disk. All other
|
||||
* processes must retain dirty metadata until they are informed at
|
||||
* a sync point that the dirty metadata in question has been written
|
||||
* to disk.
|
||||
*
|
||||
* When the sync point is reached (or when there is a user generated
|
||||
* flush), process zero flushes sufficient entries to bring it into
|
||||
* complience with its min clean size (or flushes all dirty entries in
|
||||
* the case of a user generated flush), broad casts the list of
|
||||
* entries just cleaned to all the other processes, and then exits
|
||||
* the sync point.
|
||||
*
|
||||
* Upon receipt of the broadcast, the other processes mark the indicated
|
||||
* entries as clean, and leave the sync point as well.
|
||||
*
|
||||
*
|
||||
* H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
|
||||
*
|
||||
* In the distributed metadata write strategy, process zero still makes
|
||||
* the decisions as to what entries should be flushed, but the actual
|
||||
* flushes are distributed across the processes in the computation to
|
||||
* the extent possible.
|
||||
*
|
||||
* In this strategy, when a sync point is triggered (either by dirty
|
||||
* metadata creation or manual flush), all processes enter a barrier.
|
||||
*
|
||||
* On the other side of the barrier, process 0 constructs an ordered
|
||||
* list of the entries to be flushed, and then broadcasts this list
|
||||
* to the caches in all the processes.
|
||||
*
|
||||
* All processes then scan the list of entries to be flushed, flushing
|
||||
* some, and marking the rest as clean. The algorithm for this purpose
|
||||
* ensures that each entry in the list is flushed exactly once, and
|
||||
* all are marked clean in each cache.
|
||||
*
|
||||
* Note that in the case of a flush of the cache, no message passing
|
||||
* is necessary, as all processes have the same list of dirty entries,
|
||||
* and all of these entries must be flushed. Thus in this case it is
|
||||
* sufficient for each process to sort its list of dirty entries after
|
||||
* leaving the initial barrier, and use this list as if it had been
|
||||
* received from process zero.
|
||||
*
|
||||
* To avoid possible messages from the past/future, all caches must
|
||||
* wait until all caches are done before leaving the sync point.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#define H5AC__CURR_CACHE_CONFIG_VERSION 1
|
||||
#define H5AC__MAX_TRACE_FILE_NAME_LEN 1024
|
||||
|
||||
#define H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY 0
|
||||
#define H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED 1
|
||||
|
||||
typedef struct H5AC_cache_config_t
|
||||
{
|
||||
/* general configuration fields: */
|
||||
@ -440,6 +497,7 @@ typedef struct H5AC_cache_config_t
|
||||
|
||||
/* parallel configuration fields: */
|
||||
int dirty_bytes_threshold;
|
||||
int metadata_write_strategy;
|
||||
|
||||
} H5AC_cache_config_t;
|
||||
|
||||
|
863
src/H5C.c
863
src/H5C.c
@ -333,6 +333,624 @@ done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5C_apply_candidate_list
|
||||
*
|
||||
* Purpose: Apply the supplied candidate list.
|
||||
*
|
||||
* We used to do this by simply having each process write
|
||||
* every mpi_size-th entry in the candidate list, starting
|
||||
* at index mpi_rank, and mark all the others clean.
|
||||
*
|
||||
* However, this can cause unnecessary contention in a file
|
||||
* system by increasing the number of processes writing to
|
||||
* adjacent locations in the HDF5 file.
|
||||
*
|
||||
* To attempt to minimize this, we now arange matters such
|
||||
* that each process writes n adjacent entries in the
|
||||
* candidate list, and marks all others clean. We must do
|
||||
* this in such a fashion as to guarantee that each entry
|
||||
* on the candidate list is written by exactly one process,
|
||||
* and marked clean by all others.
|
||||
*
|
||||
* To do this, first construct a table mapping mpi_rank
|
||||
* to the index of the first entry in the candidate list to
|
||||
* be written by the process of that mpi_rank, and then use
|
||||
* the table to control which entries are written and which
|
||||
* are marked as clean as a function of the mpi_rank.
|
||||
*
|
||||
* Note that the table must be identical on all processes, as
|
||||
* all see the same candidate list, mpi_size, and mpi_rank --
|
||||
* the inputs used to construct the table.
|
||||
*
|
||||
* We construct the table as follows. Let:
|
||||
*
|
||||
* n = num_candidates / mpi_size;
|
||||
*
|
||||
* m = num_candidates % mpi_size;
|
||||
*
|
||||
* Now allocate an array of integers of length mpi_size + 1,
|
||||
* and call this array candidate_assignment_table.
|
||||
*
|
||||
* Conceptually, if the number of candidates is a multiple
|
||||
* of the mpi_size, we simply pass through the candidate list
|
||||
* and assign n entries to each process to flush, with the
|
||||
* index of the first entry to flush in the location in
|
||||
* the candidate_assignment_table indicated by the mpi_rank
|
||||
* of the process.
|
||||
*
|
||||
* In the more common case in which the candidate list isn't
|
||||
* isn't a multiple of the mpi_size, we pretend it is, and
|
||||
* give num_candidates % mpi_size processes one extra entry
|
||||
* each to make things work out.
|
||||
*
|
||||
* Once the table is constructed, we determine the first and
|
||||
* last entry this process is to flush as follows:
|
||||
*
|
||||
* first_entry_to_flush = candidate_assignment_table[mpi_rank]
|
||||
*
|
||||
* last_entry_to_flush =
|
||||
* candidate_assignment_table[mpi_rank + 1] - 1;
|
||||
*
|
||||
* With these values determined, we simply scan through the
|
||||
* candidate list, marking all entries in the range
|
||||
* [first_entry_to_flush, last_entry_to_flush] for flush,
|
||||
* and all others to be cleaned.
|
||||
*
|
||||
* Finally, we scan the LRU from tail to head, flushing
|
||||
* or marking clean the candidate entries as indicated.
|
||||
* If necessary, we scan the pinned list as well.
|
||||
*
|
||||
* Note that this function will fail if any protected or
|
||||
* clean entries appear on the candidate list.
|
||||
*
|
||||
* This function is used in managing sync points, and
|
||||
* shouldn't be used elsewhere.
|
||||
*
|
||||
* Return: Success: SUCCEED
|
||||
*
|
||||
* Failure: FAIL
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 3/17/10
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
* Heavily reworked to have each process flush a group of
|
||||
* adjacent entries.
|
||||
* JRM -- 4/15/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
#define H5C_APPLY_CANDIDATE_LIST__DEBUG 0
|
||||
herr_t
|
||||
H5C_apply_candidate_list(H5F_t * f,
|
||||
hid_t primary_dxpl_id,
|
||||
hid_t secondary_dxpl_id,
|
||||
H5C_t * cache_ptr,
|
||||
int num_candidates,
|
||||
haddr_t * candidates_list_ptr,
|
||||
int mpi_rank,
|
||||
int mpi_size)
|
||||
{
|
||||
hbool_t first_flush = FALSE;
|
||||
int i;
|
||||
int m;
|
||||
int n;
|
||||
int first_entry_to_flush;
|
||||
int last_entry_to_flush;
|
||||
int entries_to_clear = 0;
|
||||
int entries_to_flush = 0;
|
||||
int entries_cleared = 0;
|
||||
int entries_flushed = 0;
|
||||
int entries_examined = 0;
|
||||
int initial_list_len;
|
||||
int * candidate_assignment_table = NULL;
|
||||
haddr_t addr;
|
||||
H5C_cache_entry_t * clear_ptr = NULL;
|
||||
H5C_cache_entry_t * entry_ptr = NULL;
|
||||
H5C_cache_entry_t * flush_ptr = NULL;
|
||||
#if H5C_DO_SANITY_CHECKS
|
||||
haddr_t last_addr;
|
||||
#endif /* H5C_DO_SANITY_CHECKS */
|
||||
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
|
||||
char tbl_buf[1024];
|
||||
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(H5C_apply_candidate_list, FAIL)
|
||||
|
||||
HDassert( cache_ptr != NULL );
|
||||
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
|
||||
HDassert( num_candidates > 0 );
|
||||
HDassert( num_candidates <= cache_ptr->slist_len );
|
||||
HDassert( candidates_list_ptr != NULL );
|
||||
HDassert( 0 <= mpi_rank );
|
||||
HDassert( mpi_rank < mpi_size );
|
||||
|
||||
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
|
||||
HDfprintf(stdout, "%s:%d: setting up candidate assignment table.\n",
|
||||
FUNC, mpi_rank);
|
||||
for ( i = 0; i < 1024; i++ ) tbl_buf[i] = '\0';
|
||||
sprintf(&(tbl_buf[0]), "candidate list = ");
|
||||
for ( i = 0; i < num_candidates; i++ )
|
||||
{
|
||||
sprintf(&(tbl_buf[strlen(tbl_buf)]), " 0x%llx",
|
||||
(long long)(*(candidates_list_ptr + i)));
|
||||
}
|
||||
sprintf(&(tbl_buf[strlen(tbl_buf)]), "\n");
|
||||
HDfprintf(stdout, "%s", tbl_buf);
|
||||
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
|
||||
|
||||
n = num_candidates / mpi_size;
|
||||
m = num_candidates % mpi_size;
|
||||
HDassert(n >= 0);
|
||||
|
||||
if(NULL == (candidate_assignment_table = (int *)H5MM_malloc(sizeof(int) * (size_t)(mpi_size + 1))))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for candidate assignment table")
|
||||
|
||||
candidate_assignment_table[0] = 0;
|
||||
candidate_assignment_table[mpi_size] = num_candidates;
|
||||
|
||||
if(m == 0) { /* mpi_size is an even divisor of num_candidates */
|
||||
HDassert(n > 0);
|
||||
for(i = 1; i < mpi_size; i++)
|
||||
candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n;
|
||||
} /* end if */
|
||||
else {
|
||||
for(i = 1; i <= m; i++)
|
||||
candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n + 1;
|
||||
|
||||
if(num_candidates < mpi_size) {
|
||||
for(i = m + 1; i < mpi_size; i++)
|
||||
candidate_assignment_table[i] = num_candidates;
|
||||
} /* end if */
|
||||
else {
|
||||
for(i = m + 1; i < mpi_size; i++)
|
||||
candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n;
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
HDassert((candidate_assignment_table[mpi_size - 1] + n) == num_candidates);
|
||||
|
||||
#if H5C_DO_SANITY_CHECKS
|
||||
/* verify that the candidate assignment table has the expected form */
|
||||
for ( i = 1; i < mpi_size - 1; i++ )
|
||||
{
|
||||
int a, b;
|
||||
|
||||
a = candidate_assignment_table[i] - candidate_assignment_table[i - 1];
|
||||
b = candidate_assignment_table[i + 1] - candidate_assignment_table[i];
|
||||
|
||||
HDassert( n + 1 >= a );
|
||||
HDassert( a >= b );
|
||||
HDassert( b >= n );
|
||||
}
|
||||
#endif /* H5C_DO_SANITY_CHECKS */
|
||||
|
||||
first_entry_to_flush = candidate_assignment_table[mpi_rank];
|
||||
last_entry_to_flush = candidate_assignment_table[mpi_rank + 1] - 1;
|
||||
|
||||
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
|
||||
for ( i = 0; i < 1024; i++ )
|
||||
tbl_buf[i] = '\0';
|
||||
sprintf(&(tbl_buf[0]), "candidate assignment table = ");
|
||||
for(i = 0; i <= mpi_size; i++)
|
||||
sprintf(&(tbl_buf[strlen(tbl_buf)]), " %d", candidate_assignment_table[i]);
|
||||
sprintf(&(tbl_buf[strlen(tbl_buf)]), "\n");
|
||||
HDfprintf(stdout, "%s", tbl_buf);
|
||||
|
||||
HDfprintf(stdout, "%s:%d: flush entries [%d, %d].\n",
|
||||
FUNC, mpi_rank, first_entry_to_flush, last_entry_to_flush);
|
||||
|
||||
HDfprintf(stdout, "%s:%d: marking entries.\n", FUNC, mpi_rank);
|
||||
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
|
||||
|
||||
for(i = 0; i < num_candidates; i++) {
|
||||
addr = candidates_list_ptr[i];
|
||||
HDassert( H5F_addr_defined(addr) );
|
||||
|
||||
#if H5C_DO_SANITY_CHECKS
|
||||
if ( i > 0 ) {
|
||||
if ( last_addr == addr ) {
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Duplicate entry in cleaned list.\n")
|
||||
} else if ( last_addr > addr ) {
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "candidate list not sorted.\n")
|
||||
}
|
||||
}
|
||||
|
||||
last_addr = addr;
|
||||
#endif /* H5C_DO_SANITY_CHECKS */
|
||||
|
||||
H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL)
|
||||
if(entry_ptr == NULL) {
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed candidate entry not in cache?!?!?.")
|
||||
} else if(!entry_ptr->is_dirty) {
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not dirty?!?!?.")
|
||||
} else if ( entry_ptr->is_protected ) {
|
||||
/* For now at least, we can't deal with protected entries.
|
||||
* If we encounter one, scream and die. If it becomes an
|
||||
* issue, we should be able to work around this.
|
||||
*/
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry is protected?!?!?.")
|
||||
} else {
|
||||
/* determine whether the entry is to be cleared or flushed,
|
||||
* and mark it accordingly. We will scan the protected and
|
||||
* pinned list shortly, and clear or flush according to these
|
||||
* markings.
|
||||
*/
|
||||
if((i >= first_entry_to_flush) && (i <= last_entry_to_flush)) {
|
||||
entries_to_flush++;
|
||||
entry_ptr->flush_immediately = TRUE;
|
||||
} /* end if */
|
||||
else {
|
||||
entries_to_clear++;
|
||||
entry_ptr->clear_on_unprotect = TRUE;
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
} /* end for */
|
||||
|
||||
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
|
||||
HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %d/%d/%d.\n",
|
||||
FUNC, mpi_rank, (int)num_candidates, (int)entries_to_clear,
|
||||
(int)entries_to_flush);
|
||||
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
|
||||
|
||||
|
||||
/* We have now marked all the entries on the candidate list for
|
||||
* either flush or clear -- now scan the LRU and the pinned list
|
||||
* for these entries and do the deed.
|
||||
*
|
||||
* Note that we are doing things in this round about manner so as
|
||||
* to preserve the order of the LRU list to the best of our ability.
|
||||
* If we don't do this, my experiments indicate that we will have a
|
||||
* noticably poorer hit ratio as a result.
|
||||
*/
|
||||
|
||||
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
|
||||
HDfprintf(stdout, "%s:%d: scanning LRU list. len = %d.\n", FUNC, mpi_rank,
|
||||
(int)(cache_ptr->LRU_list_len));
|
||||
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
|
||||
|
||||
entries_examined = 0;
|
||||
initial_list_len = cache_ptr->LRU_list_len;
|
||||
entry_ptr = cache_ptr->LRU_tail_ptr;
|
||||
|
||||
while((entry_ptr != NULL) && (entries_examined <= initial_list_len) &&
|
||||
((entries_cleared + entries_flushed) < num_candidates)) {
|
||||
if(entry_ptr->clear_on_unprotect) {
|
||||
entry_ptr->clear_on_unprotect = FALSE;
|
||||
clear_ptr = entry_ptr;
|
||||
entry_ptr = entry_ptr->prev;
|
||||
entries_cleared++;
|
||||
|
||||
#if ( H5C_APPLY_CANDIDATE_LIST__DEBUG > 1 )
|
||||
HDfprintf(stdout, "%s:%d: clearing 0x%llx.\n", FUNC, mpi_rank,
|
||||
(long long)clear_ptr->addr);
|
||||
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
|
||||
|
||||
if(H5C_flush_single_entry(f,
|
||||
primary_dxpl_id,
|
||||
secondary_dxpl_id,
|
||||
clear_ptr->type,
|
||||
clear_ptr->addr,
|
||||
H5C__FLUSH_CLEAR_ONLY_FLAG,
|
||||
&first_flush,
|
||||
TRUE) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't clear entry.")
|
||||
} else if(entry_ptr->flush_immediately) {
|
||||
entry_ptr->flush_immediately = FALSE;
|
||||
flush_ptr = entry_ptr;
|
||||
entry_ptr = entry_ptr->prev;
|
||||
entries_flushed++;
|
||||
|
||||
#if ( H5C_APPLY_CANDIDATE_LIST__DEBUG > 1 )
|
||||
HDfprintf(stdout, "%s:%d: flushing 0x%llx.\n", FUNC, mpi_rank,
|
||||
(long long)flush_ptr->addr);
|
||||
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
|
||||
|
||||
if(H5C_flush_single_entry(f,
|
||||
primary_dxpl_id,
|
||||
secondary_dxpl_id,
|
||||
flush_ptr->type,
|
||||
flush_ptr->addr,
|
||||
H5C__NO_FLAGS_SET,
|
||||
&first_flush,
|
||||
TRUE) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't clear entry.")
|
||||
} else {
|
||||
entry_ptr = entry_ptr->prev;
|
||||
}
|
||||
|
||||
entries_examined++;
|
||||
} /* end while */
|
||||
|
||||
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
|
||||
HDfprintf(stdout, "%s:%d: entries examined/cleared/flushed = %d/%d/%d.\n",
|
||||
FUNC, mpi_rank, entries_examined,
|
||||
entries_cleared, entries_flushed);
|
||||
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
|
||||
|
||||
/* It is also possible that some of the cleared entries are on the
|
||||
* pinned list. Must scan that also.
|
||||
*/
|
||||
|
||||
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
|
||||
HDfprintf(stdout, "%s:%d: scanning pinned entry list. len = %d\n",
|
||||
FUNC, mpi_rank, (int)(cache_ptr->pel_len));
|
||||
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
|
||||
|
||||
entry_ptr = cache_ptr->pel_head_ptr;
|
||||
while((entry_ptr != NULL) &&
|
||||
((entries_cleared + entries_flushed) < num_candidates)) {
|
||||
if(entry_ptr->clear_on_unprotect) {
|
||||
entry_ptr->clear_on_unprotect = FALSE;
|
||||
clear_ptr = entry_ptr;
|
||||
entry_ptr = entry_ptr->next;
|
||||
entries_cleared++;
|
||||
|
||||
#if ( H5C_APPLY_CANDIDATE_LIST__DEBUG > 1 )
|
||||
HDfprintf(stdout, "%s:%d: clearing 0x%llx.\n", FUNC, mpi_rank,
|
||||
(long long)clear_ptr->addr);
|
||||
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
|
||||
|
||||
if(H5C_flush_single_entry(f,
|
||||
primary_dxpl_id,
|
||||
secondary_dxpl_id,
|
||||
clear_ptr->type,
|
||||
clear_ptr->addr,
|
||||
H5C__FLUSH_CLEAR_ONLY_FLAG,
|
||||
&first_flush,
|
||||
TRUE) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't clear entry.")
|
||||
} else if(entry_ptr->flush_immediately) {
|
||||
entry_ptr->flush_immediately = FALSE;
|
||||
flush_ptr = entry_ptr;
|
||||
entry_ptr = entry_ptr->next;
|
||||
entries_flushed++;
|
||||
|
||||
#if ( H5C_APPLY_CANDIDATE_LIST__DEBUG > 1 )
|
||||
HDfprintf(stdout, "%s:%d: flushing 0x%llx.\n", FUNC, mpi_rank,
|
||||
(long long)flush_ptr->addr);
|
||||
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
|
||||
|
||||
if(H5C_flush_single_entry(f,
|
||||
primary_dxpl_id,
|
||||
secondary_dxpl_id,
|
||||
flush_ptr->type,
|
||||
flush_ptr->addr,
|
||||
H5C__NO_FLAGS_SET,
|
||||
&first_flush,
|
||||
TRUE) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't clear entry.")
|
||||
} else {
|
||||
entry_ptr = entry_ptr->next;
|
||||
}
|
||||
} /* end while */
|
||||
|
||||
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
|
||||
HDfprintf(stdout,
|
||||
"%s:%d: pel entries examined/cleared/flushed = %d/%d/%d.\n",
|
||||
FUNC, mpi_rank, entries_examined,
|
||||
entries_cleared, entries_flushed);
|
||||
HDfprintf(stdout, "%s:%d: done.\n", FUNC, mpi_rank);
|
||||
|
||||
fsync(stdout);
|
||||
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
|
||||
|
||||
if((entries_flushed != entries_to_flush) || (entries_cleared != entries_to_clear))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry count mismatch.")
|
||||
|
||||
done:
|
||||
if(candidate_assignment_table != NULL)
|
||||
candidate_assignment_table = (int *)H5MM_xfree((void *)candidate_assignment_table);
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* H5C_apply_candidate_list() */
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5C_construct_candidate_list__clean_cache
|
||||
*
|
||||
* Purpose: Construct the list of entries that should be flushed to
|
||||
* clean all entries in the cache.
|
||||
*
|
||||
* This function is used in managing sync points, and
|
||||
* shouldn't be used elsewhere.
|
||||
*
|
||||
* Return: Success: SUCCEED
|
||||
*
|
||||
* Failure: FAIL
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 3/17/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
herr_t
|
||||
H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr)
|
||||
{
|
||||
size_t space_needed;
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(H5C_construct_candidate_list__clean_cache, FAIL)
|
||||
|
||||
HDassert( cache_ptr != NULL );
|
||||
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
|
||||
|
||||
/* As a sanity check, set space needed to the size of the skip list.
|
||||
* This should be the sum total of the sizes of all the dirty entries
|
||||
* in the metadata cache.
|
||||
*/
|
||||
space_needed = cache_ptr->slist_size;
|
||||
|
||||
/* Recall that while we shouldn't have any protected entries at this
|
||||
* point, it is possible that some dirty entries may reside on the
|
||||
* pinned list at this point.
|
||||
*/
|
||||
HDassert( cache_ptr->slist_size <=
|
||||
(cache_ptr->dLRU_list_size + cache_ptr->pel_size) );
|
||||
HDassert( cache_ptr->slist_len <=
|
||||
(cache_ptr->dLRU_list_len + cache_ptr->pel_len) );
|
||||
|
||||
if(space_needed > 0) { /* we have work to do */
|
||||
H5C_cache_entry_t *entry_ptr;
|
||||
int nominated_entries_count = 0;
|
||||
size_t nominated_entries_size = 0;
|
||||
haddr_t nominated_addr;
|
||||
|
||||
HDassert( cache_ptr->slist_len > 0 );
|
||||
|
||||
/* Scan the dirty LRU list from tail forward and nominate sufficient
|
||||
* entries to free up the necessary space.
|
||||
*/
|
||||
entry_ptr = cache_ptr->dLRU_tail_ptr;
|
||||
while((nominated_entries_size < space_needed) &&
|
||||
(nominated_entries_count < cache_ptr->slist_len) &&
|
||||
(entry_ptr != NULL)) {
|
||||
HDassert( ! (entry_ptr->is_protected) );
|
||||
HDassert( ! (entry_ptr->is_read_only) );
|
||||
HDassert( entry_ptr->ro_ref_count == 0 );
|
||||
HDassert( entry_ptr->is_dirty );
|
||||
HDassert( entry_ptr->in_slist );
|
||||
|
||||
nominated_addr = entry_ptr->addr;
|
||||
if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed(1).")
|
||||
|
||||
nominated_entries_size += entry_ptr->size;
|
||||
nominated_entries_count++;
|
||||
entry_ptr = entry_ptr->aux_prev;
|
||||
} /* end while */
|
||||
HDassert( entry_ptr == NULL );
|
||||
|
||||
/* it is possible that there are some dirty entries on the
|
||||
* protected entry list as well -- scan it too if necessary
|
||||
*/
|
||||
entry_ptr = cache_ptr->pel_head_ptr;
|
||||
while((nominated_entries_size < space_needed) &&
|
||||
(nominated_entries_count < cache_ptr->slist_len) &&
|
||||
(entry_ptr != NULL)) {
|
||||
if(entry_ptr->is_dirty) {
|
||||
HDassert( ! (entry_ptr->is_protected) );
|
||||
HDassert( ! (entry_ptr->is_read_only) );
|
||||
HDassert( entry_ptr->ro_ref_count == 0 );
|
||||
HDassert( entry_ptr->is_dirty );
|
||||
HDassert( entry_ptr->in_slist );
|
||||
|
||||
nominated_addr = entry_ptr->addr;
|
||||
if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed(2).")
|
||||
|
||||
nominated_entries_size += entry_ptr->size;
|
||||
nominated_entries_count++;
|
||||
} /* end if */
|
||||
|
||||
entry_ptr = entry_ptr->next;
|
||||
} /* end while */
|
||||
|
||||
HDassert( nominated_entries_count == cache_ptr->slist_len );
|
||||
HDassert( nominated_entries_size == space_needed );
|
||||
} /* end if */
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* H5C_construct_candidate_list__clean_cache() */
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5C_construct_candidate_list__min_clean
|
||||
*
|
||||
* Purpose: Construct the list of entries that should be flushed to
|
||||
* get the cache back within its min clean constraints.
|
||||
*
|
||||
* This function is used in managing sync points, and
|
||||
* shouldn't be used elsewhere.
|
||||
*
|
||||
* Return: Success: SUCCEED
|
||||
*
|
||||
* Failure: FAIL
|
||||
*
|
||||
* Programmer: John Mainzer
|
||||
* 3/17/10
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
herr_t
|
||||
H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr)
|
||||
{
|
||||
size_t space_needed = 0;
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(H5C_construct_candidate_list__min_clean, FAIL)
|
||||
|
||||
HDassert( cache_ptr != NULL );
|
||||
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
|
||||
|
||||
/* compute the number of bytes (if any) that must be flushed to get the
|
||||
* cache back within its min clean constraints.
|
||||
*/
|
||||
if(cache_ptr->max_cache_size > cache_ptr->index_size) {
|
||||
if(((cache_ptr->max_cache_size - cache_ptr->index_size) +
|
||||
cache_ptr->cLRU_list_size) >= cache_ptr->min_clean_size)
|
||||
space_needed = 0;
|
||||
else
|
||||
space_needed = cache_ptr->min_clean_size -
|
||||
((cache_ptr->max_cache_size - cache_ptr->index_size) +
|
||||
cache_ptr->cLRU_list_size);
|
||||
} /* end if */
|
||||
else {
|
||||
if(cache_ptr->min_clean_size <= cache_ptr->cLRU_list_size)
|
||||
space_needed = 0;
|
||||
else
|
||||
space_needed = cache_ptr->min_clean_size -
|
||||
cache_ptr->cLRU_list_size;
|
||||
} /* end else */
|
||||
|
||||
if(space_needed > 0) { /* we have work to do */
|
||||
H5C_cache_entry_t *entry_ptr;
|
||||
int nominated_entries_count = 0;
|
||||
size_t nominated_entries_size = 0;
|
||||
|
||||
HDassert( cache_ptr->slist_len > 0 );
|
||||
|
||||
/* Scan the dirty LRU list from tail forward and nominate sufficient
|
||||
* entries to free up the necessary space.
|
||||
*/
|
||||
entry_ptr = cache_ptr->dLRU_tail_ptr;
|
||||
while((nominated_entries_size < space_needed) &&
|
||||
(nominated_entries_count < cache_ptr->slist_len) &&
|
||||
(entry_ptr != NULL)) {
|
||||
haddr_t nominated_addr;
|
||||
|
||||
HDassert( ! (entry_ptr->is_protected) );
|
||||
HDassert( ! (entry_ptr->is_read_only) );
|
||||
HDassert( entry_ptr->ro_ref_count == 0 );
|
||||
HDassert( entry_ptr->is_dirty );
|
||||
HDassert( entry_ptr->in_slist );
|
||||
|
||||
nominated_addr = entry_ptr->addr;
|
||||
if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed.")
|
||||
|
||||
nominated_entries_size += entry_ptr->size;
|
||||
nominated_entries_count++;
|
||||
entry_ptr = entry_ptr->aux_prev;
|
||||
} /* end while */
|
||||
HDassert( nominated_entries_count <= cache_ptr->slist_len );
|
||||
HDassert( nominated_entries_size >= space_needed );
|
||||
} /* end if */
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* H5C_construct_candidate_list__min_clean() */
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5C_create
|
||||
@ -356,10 +974,6 @@ done:
|
||||
* Programmer: John Mainzer
|
||||
* 6/2/04
|
||||
*
|
||||
* JRM -- 11/5/08
|
||||
* Added initialization for the new clean_index_size and
|
||||
* dirty_index_size fields of H5C_t.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
H5C_t *
|
||||
@ -1502,9 +2116,7 @@ H5C_flush_to_min_clean(H5F_t * f,
|
||||
#endif /* end modified code -- commented out for now */
|
||||
|
||||
done:
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
||||
} /* H5C_flush_to_min_clean() */
|
||||
|
||||
|
||||
@ -1903,33 +2515,6 @@ H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr,
|
||||
* Programmer: John Mainzer
|
||||
* 6/2/04
|
||||
*
|
||||
* QAK -- 1/31/08
|
||||
* Added initialization for the new free_file_space_on_destroy
|
||||
* field.
|
||||
*
|
||||
* JRM -- 11/13/08
|
||||
* Moved test to see if we already have an entry with the
|
||||
* specified address in the cache. This was necessary as
|
||||
* we used to modify some fields in the entry to be inserted
|
||||
* priort to this test, which got the cache confused if the
|
||||
* insertion failed because the entry was already present.
|
||||
*
|
||||
* Also revised the function to call H5C_make_space_in_cache()
|
||||
* if the min_clean_size is not met at present, not just if
|
||||
* there is insufficient space in the cache for the new
|
||||
* entry.
|
||||
*
|
||||
* The purpose of this modification is to avoid "metadata
|
||||
* blizzards" in the write only case. In such instances,
|
||||
* the cache was allowed to fill with dirty metadata. When
|
||||
* we finally needed to evict an entry to make space, we had
|
||||
* to flush out a whole cache full of metadata -- which has
|
||||
* interesting performance effects. We hope to avoid (or
|
||||
* perhaps more accurately hide) this effect by maintaining
|
||||
* the min_clean_size, which should force us to start flushing
|
||||
* entries long before we actually have to evict something
|
||||
* to make space.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -2042,6 +2627,7 @@ H5C_insert_entry(H5F_t * f,
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
entry_ptr->clear_on_unprotect = FALSE;
|
||||
entry_ptr->flush_immediately = FALSE;
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
entry_ptr->flush_in_progress = FALSE;
|
||||
@ -3813,29 +4399,17 @@ done:
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5C_set_prefix(H5C_t * cache_ptr,
|
||||
char * prefix)
|
||||
H5C_set_prefix(H5C_t * cache_ptr, char * prefix)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5C_set_prefix)
|
||||
|
||||
FUNC_ENTER_NOAPI(H5C_set_prefix, FAIL)
|
||||
|
||||
/* This would normally be an assert, but we need to use an HGOTO_ERROR
|
||||
* call to shut up the compiler.
|
||||
*/
|
||||
if ( ( ! cache_ptr ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) {
|
||||
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr")
|
||||
}
|
||||
|
||||
HDassert( prefix );
|
||||
HDassert( HDstrlen(prefix) < H5C__PREFIX_LEN ) ;
|
||||
HDassert((cache_ptr) && (cache_ptr->magic == H5C__H5C_T_MAGIC));
|
||||
HDassert(prefix);
|
||||
HDassert(HDstrlen(prefix) < H5C__PREFIX_LEN);
|
||||
|
||||
HDstrcpy(&(cache_ptr->prefix[0]), prefix);
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
||||
FUNC_LEAVE_NOAPI(SUCCEED)
|
||||
} /* H5C_set_prefix() */
|
||||
|
||||
|
||||
@ -7441,17 +8015,6 @@ H5C_flush_single_entry(H5F_t * f,
|
||||
}
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
/* this should be useful for debugging from time to time.
|
||||
* lets leave it in for now. -- JRM 12/15/04
|
||||
*/
|
||||
else {
|
||||
HDfprintf(stdout,
|
||||
"H5C_flush_single_entry(): non-existant entry. addr = %a\n",
|
||||
addr);
|
||||
HDfflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#endif /* H5C_DO_SANITY_CHECKS */
|
||||
|
||||
if ( ( entry_ptr != NULL ) && ( entry_ptr->is_protected ) )
|
||||
@ -7572,133 +8135,6 @@ H5C_flush_single_entry(H5F_t * f,
|
||||
*/
|
||||
if ( destroy ) { /* AKA eviction */
|
||||
|
||||
#if 0 /* JRM */
|
||||
/* This test code may come in handy -- lets keep it for a while.
|
||||
*
|
||||
* Note that it will cause spurious errors in the serial case
|
||||
* unless we are maintaining the clean and dirty LRU lists.
|
||||
*/
|
||||
{
|
||||
if ( entry_ptr->is_dirty )
|
||||
{
|
||||
if ( cache_ptr->dLRU_head_ptr == NULL )
|
||||
HDfprintf(stdout,
|
||||
"%s: cache_ptr->dLRU_head_ptr == NULL.\n",
|
||||
FUNC);
|
||||
|
||||
if ( cache_ptr->dLRU_tail_ptr == NULL )
|
||||
HDfprintf(stdout,
|
||||
"%s: cache_ptr->dLRU_tail_ptr == NULL.\n",
|
||||
FUNC);
|
||||
|
||||
if ( cache_ptr->dLRU_list_len <= 0 )
|
||||
HDfprintf(stdout,
|
||||
"%s: cache_ptr->dLRU_list_len <= 0.\n",
|
||||
FUNC);
|
||||
|
||||
if ( cache_ptr->dLRU_list_size <= 0 )
|
||||
HDfprintf(stdout,
|
||||
"%s: cache_ptr->dLRU_list_size <= 0.\n",
|
||||
FUNC);
|
||||
|
||||
if ( cache_ptr->dLRU_list_size < entry_ptr->size )
|
||||
HDfprintf(stdout,
|
||||
"%s: cache_ptr->dLRU_list_size < entry_ptr->size.\n",
|
||||
FUNC);
|
||||
|
||||
if ( ( (cache_ptr->dLRU_list_size) == entry_ptr->size ) &&
|
||||
( ! ( (cache_ptr->dLRU_list_len) == 1 ) ) )
|
||||
HDfprintf(stdout,
|
||||
"%s: dLRU_list_size == size && dLRU_list_len != 1\n",
|
||||
FUNC);
|
||||
|
||||
if ( ( entry_ptr->aux_prev == NULL ) &&
|
||||
( cache_ptr->dLRU_head_ptr != entry_ptr ) )
|
||||
HDfprintf(stdout,
|
||||
"%s: entry_ptr->aux_prev == NULL && dLRU_head_ptr != entry_ptr\n",
|
||||
FUNC);
|
||||
|
||||
if ( ( entry_ptr->aux_next == NULL ) &&
|
||||
( cache_ptr->dLRU_tail_ptr != entry_ptr ) )
|
||||
HDfprintf(stdout,
|
||||
"%s: entry_ptr->aux_next == NULL && dLRU_tail_ptr != entry_ptr\n",
|
||||
FUNC);
|
||||
|
||||
if ( ( cache_ptr->dLRU_list_len == 1 ) &&
|
||||
( ! ( ( cache_ptr->dLRU_head_ptr == entry_ptr ) &&
|
||||
( cache_ptr->dLRU_tail_ptr == entry_ptr ) &&
|
||||
( entry_ptr->aux_next == NULL ) &&
|
||||
( entry_ptr->aux_prev == NULL ) &&
|
||||
( cache_ptr->dLRU_list_size == entry_ptr->size )
|
||||
)
|
||||
)
|
||||
)
|
||||
{
|
||||
HDfprintf(stdout,
|
||||
"%s: single entry dlru sanity check fails\n",
|
||||
FUNC);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( cache_ptr->cLRU_head_ptr == NULL )
|
||||
HDfprintf(stdout,
|
||||
"%s: cache_ptr->cLRU_head_ptr == NULL.\n",
|
||||
FUNC);
|
||||
|
||||
if ( cache_ptr->cLRU_tail_ptr == NULL )
|
||||
HDfprintf(stdout,
|
||||
"%s: cache_ptr->cLRU_tail_ptr == NULL.\n",
|
||||
FUNC);
|
||||
|
||||
if ( cache_ptr->cLRU_list_len <= 0 )
|
||||
HDfprintf(stdout,
|
||||
"%s: cache_ptr->cLRU_list_len <= 0.\n",
|
||||
FUNC);
|
||||
|
||||
if ( cache_ptr->cLRU_list_size <= 0 )
|
||||
HDfprintf(stdout,
|
||||
"%s: cache_ptr->cLRU_list_size <= 0.\n",
|
||||
FUNC);
|
||||
|
||||
if ( cache_ptr->cLRU_list_size < entry_ptr->size )
|
||||
HDfprintf(stdout,
|
||||
"%s: cache_ptr->cLRU_list_size < entry_ptr->size.\n",
|
||||
FUNC);
|
||||
|
||||
if ( ( (cache_ptr->cLRU_list_size) == entry_ptr->size ) &&
|
||||
( ! ( (cache_ptr->cLRU_list_len) == 1 ) ) )
|
||||
HDfprintf(stdout,
|
||||
"%s: cLRU_list_size == size && cLRU_list_len != 1\n",
|
||||
FUNC);
|
||||
|
||||
if ( ( entry_ptr->aux_prev == NULL ) &&
|
||||
( cache_ptr->cLRU_head_ptr != entry_ptr ) )
|
||||
HDfprintf(stdout, "%s: entry_ptr->aux_prev == NULL && cLRU_head_ptr != entry_ptr\n", FUNC);
|
||||
|
||||
if ( ( entry_ptr->aux_next == NULL ) &&
|
||||
( cache_ptr->cLRU_tail_ptr != entry_ptr ) )
|
||||
HDfprintf(stdout, "%s: entry_ptr->aux_next == NULL && cLRU_tail_ptr != entry_ptr\n", FUNC);
|
||||
|
||||
if ( ( cache_ptr->cLRU_list_len == 1 ) &&
|
||||
( ! ( ( cache_ptr->cLRU_head_ptr == entry_ptr ) &&
|
||||
( cache_ptr->cLRU_tail_ptr == entry_ptr ) &&
|
||||
( entry_ptr->aux_next == NULL ) &&
|
||||
( entry_ptr->aux_prev == NULL ) &&
|
||||
( cache_ptr->cLRU_list_size == entry_ptr->size )
|
||||
)
|
||||
)
|
||||
)
|
||||
{
|
||||
HDfprintf(stdout,
|
||||
"%s: single entry clru sanity check fails\n",
|
||||
FUNC);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* JRM */
|
||||
|
||||
H5C__UPDATE_RP_FOR_EVICTION(cache_ptr, entry_ptr, FAIL)
|
||||
|
||||
} else {
|
||||
@ -7864,10 +8300,10 @@ H5C_flush_single_entry(H5F_t * f,
|
||||
* H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN()).
|
||||
*/
|
||||
H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), \
|
||||
(entry_ptr->size),\
|
||||
(entry_ptr->size), \
|
||||
(new_size), \
|
||||
(entry_ptr), \
|
||||
(TRUE));
|
||||
(TRUE))
|
||||
|
||||
/* The entry can't be protected since we just flushed it.
|
||||
* Thus we must update the replacement policy data
|
||||
@ -7923,9 +8359,7 @@ H5C_flush_single_entry(H5F_t * f,
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
||||
} /* H5C_flush_single_entry() */
|
||||
|
||||
|
||||
@ -8023,6 +8457,7 @@ H5C_load_entry(H5F_t * f,
|
||||
entry->flush_marker = FALSE;
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
entry->clear_on_unprotect = FALSE;
|
||||
entry->flush_immediately = FALSE;
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
entry->flush_in_progress = FALSE;
|
||||
entry->destroy_in_progress = FALSE;
|
||||
@ -8862,20 +9297,17 @@ H5C_flush_marked_entries(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_
|
||||
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
|
||||
|
||||
/* Flush all marked entries */
|
||||
if (H5C_flush_cache(f,
|
||||
if(H5C_flush_cache(f,
|
||||
primary_dxpl_id,
|
||||
secondary_dxpl_id,
|
||||
H5C__FLUSH_MARKED_ENTRIES_FLAG |
|
||||
H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0) {
|
||||
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache")
|
||||
|
||||
} /* end if */
|
||||
|
||||
done:
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value);
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* H5C_flush_marked_entries */
|
||||
|
||||
#if H5C_DO_TAGGING_SANITY_CHECKS
|
||||
@ -8891,8 +9323,6 @@ done:
|
||||
* Programmer: Mike McGreevy
|
||||
* January 14, 2010
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
@ -8959,10 +9389,7 @@ H5C_verify_tag(int id, haddr_t tag)
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
/* Function Leave Macro */
|
||||
FUNC_LEAVE_NOAPI(ret_value);
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* H5C_verify_tag */
|
||||
#endif
|
||||
|
||||
@ -8980,43 +9407,35 @@ done:
|
||||
* Programmer: Mike McGreevy
|
||||
* March 17, 2010
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
void
|
||||
H5C_retag_copied_metadata(H5C_t * cache_ptr, haddr_t metadata_tag)
|
||||
{
|
||||
/* Variable Declarations */
|
||||
herr_t ret_value = SUCCEED; /* Return Value */
|
||||
int i = 0; /* Iterator */
|
||||
H5C_cache_entry_t *next_entry_ptr = NULL; /* entry pointer */
|
||||
|
||||
/* Assertions */
|
||||
HDassert(cache_ptr);
|
||||
|
||||
/* Function Enter Macro */
|
||||
FUNC_ENTER_NOAPI(H5C_retag_copied_metadata, FAIL)
|
||||
FUNC_ENTER_NOAPI_NOFUNC(H5C_retag_copied_metadata)
|
||||
|
||||
/* Iterate through entries, retagging those with the H5AC__COPIED_TAG tag */
|
||||
for (i = 0; i < H5C__HASH_TABLE_LEN; i++) {
|
||||
for(i = 0; i < H5C__HASH_TABLE_LEN; i++) {
|
||||
H5C_cache_entry_t *next_entry_ptr; /* entry pointer */
|
||||
|
||||
next_entry_ptr = cache_ptr->index[i];
|
||||
|
||||
while ( next_entry_ptr != NULL ) {
|
||||
if (cache_ptr->index[i] != NULL) {
|
||||
if ((cache_ptr->index[i])->tag == H5AC__COPIED_TAG) {
|
||||
while(next_entry_ptr != NULL) {
|
||||
if(cache_ptr->index[i] != NULL) {
|
||||
if((cache_ptr->index[i])->tag == H5AC__COPIED_TAG)
|
||||
(cache_ptr->index[i])->tag = metadata_tag;
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
|
||||
next_entry_ptr = next_entry_ptr->ht_next;
|
||||
} /* end while */
|
||||
|
||||
} /* end for */
|
||||
|
||||
done:
|
||||
|
||||
/* Function Leave Macro */
|
||||
FUNC_LEAVE_NOAPI(ret_value);
|
||||
|
||||
FUNC_LEAVE_NOAPI_VOID
|
||||
} /* H5C_retag_copied_metadata */
|
||||
|
||||
|
41
src/H5Cpkg.h
41
src/H5Cpkg.h
@ -1875,7 +1875,7 @@ if ( ( (cache_ptr) == NULL ) || \
|
||||
( ( !( was_clean ) || \
|
||||
( (cache_ptr)->clean_index_size < (old_size) ) ) && \
|
||||
( ( (was_clean) ) || \
|
||||
( (cache_ptr)->dirty_index_size < (old_size) ) ) ) \
|
||||
( (cache_ptr)->dirty_index_size < (old_size) ) ) ) || \
|
||||
( (entry_ptr) == NULL ) ) { \
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
|
||||
"Pre HT entry size change SC failed") \
|
||||
@ -1893,7 +1893,7 @@ if ( ( (cache_ptr) == NULL ) || \
|
||||
( ( !((entry_ptr)->is_dirty ) || \
|
||||
( (cache_ptr)->dirty_index_size < (new_size) ) ) && \
|
||||
( ( ((entry_ptr)->is_dirty) ) || \
|
||||
( (cache_ptr)->clean_index_size < (new_size) ) ) ) \
|
||||
( (cache_ptr)->clean_index_size < (new_size) ) ) ) || \
|
||||
( ( (cache_ptr)->index_len == 1 ) && \
|
||||
( (cache_ptr)->index_size != (new_size) ) ) ) { \
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
|
||||
@ -2098,24 +2098,25 @@ if ( (cache_ptr)->index_size != \
|
||||
H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \
|
||||
}
|
||||
|
||||
#define H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size, \
|
||||
entry_ptr, was_clean) \
|
||||
{ \
|
||||
H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \
|
||||
entry_ptr, was_clean) \
|
||||
(cache_ptr)->index_size -= (old_size); \
|
||||
(cache_ptr)->index_size += (new_size); \
|
||||
if ( was_clean ) { \
|
||||
(cache_ptr)->clean_index_size -= (old_size); \
|
||||
} else { \
|
||||
(cache_ptr)->dirty_index_size -= (old_size); \
|
||||
} \
|
||||
if ( (entry_ptr)->is_dirty ) { \
|
||||
(cache_ptr)->dirty_index_size += (new_size); \
|
||||
} else { \
|
||||
(cache_ptr)->clean_index_size += (new_size); \
|
||||
} \
|
||||
H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, entry_ptr) \
|
||||
#define H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size, \
|
||||
entry_ptr, was_clean) \
|
||||
{ \
|
||||
H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \
|
||||
entry_ptr, was_clean) \
|
||||
(cache_ptr)->index_size -= (old_size); \
|
||||
(cache_ptr)->index_size += (new_size); \
|
||||
if ( was_clean ) { \
|
||||
(cache_ptr)->clean_index_size -= (old_size); \
|
||||
} else { \
|
||||
(cache_ptr)->dirty_index_size -= (old_size); \
|
||||
} \
|
||||
if ( (entry_ptr)->is_dirty ) { \
|
||||
(cache_ptr)->dirty_index_size += (new_size); \
|
||||
} else { \
|
||||
(cache_ptr)->clean_index_size += (new_size); \
|
||||
} \
|
||||
H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \
|
||||
entry_ptr) \
|
||||
}
|
||||
|
||||
|
||||
|
@ -383,6 +383,14 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
|
||||
* the unprotect, the entry's is_dirty flag is reset by flushing
|
||||
* it with the H5C__FLUSH_CLEAR_ONLY_FLAG.
|
||||
*
|
||||
* flush_immediately: Boolean flag used only in Phdf5 -- and then only
|
||||
* for H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED.
|
||||
*
|
||||
* When a destributed metadata write is triggered at a
|
||||
* sync point, this field is used to mark entries that
|
||||
* must be flushed before leaving the sync point. At all
|
||||
* other times, this field should be set to FALSE.
|
||||
*
|
||||
* flush_in_progress: Boolean flag that is set to true iff the entry
|
||||
* is in the process of being flushed. This allows the cache
|
||||
* to detect when a call is the result of a flush callback.
|
||||
@ -581,6 +589,7 @@ typedef struct H5C_cache_entry_t
|
||||
hbool_t flush_marker;
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
hbool_t clear_on_unprotect;
|
||||
hbool_t flush_immediately;
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
hbool_t flush_in_progress;
|
||||
hbool_t destroy_in_progress;
|
||||
@ -1034,6 +1043,21 @@ typedef struct H5C_auto_size_ctl_t
|
||||
#define H5C__FREE_FILE_SPACE_FLAG 0x0800
|
||||
#define H5C__TAKE_OWNERSHIP_FLAG 0x1000
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
H5_DLL herr_t H5C_apply_candidate_list(H5F_t * f,
|
||||
hid_t primary_dxpl_id,
|
||||
hid_t secondary_dxpl_id,
|
||||
H5C_t * cache_ptr,
|
||||
int num_candidates,
|
||||
haddr_t * candidates_list_ptr,
|
||||
int mpi_rank,
|
||||
int mpi_size);
|
||||
|
||||
H5_DLL herr_t H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr);
|
||||
|
||||
H5_DLL herr_t H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr);
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
H5_DLL H5C_t * H5C_create(size_t max_cache_size,
|
||||
size_t min_clean_size,
|
||||
int max_type_id,
|
||||
@ -1177,7 +1201,7 @@ H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr,
|
||||
|
||||
H5_DLL herr_t H5C_ignore_tags(H5C_t * cache_ptr);
|
||||
|
||||
H5_DLL herr_t H5C_retag_copied_metadata(H5C_t * cache_ptr, haddr_t metadata_tag);
|
||||
H5_DLL void H5C_retag_copied_metadata(H5C_t * cache_ptr, haddr_t metadata_tag);
|
||||
|
||||
#endif /* !_H5Cprivate_H */
|
||||
|
||||
|
@ -1771,6 +1771,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
else {
|
||||
#if 0 /* JRM -- 3/23/10 */ /* this is no longer always the case */
|
||||
/* Only one process can do the actual metadata write */
|
||||
if(file->mpi_rank != H5_PAR_META_WRITE)
|
||||
#ifdef LATER
|
||||
@ -1778,6 +1779,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
|
||||
#else /* LATER */
|
||||
HGOTO_DONE(SUCCEED) /* skip the actual write */
|
||||
#endif /* LATER */
|
||||
#endif /* JRM */
|
||||
} /* end if */
|
||||
|
||||
/* Write the data. */
|
||||
|
@ -1274,9 +1274,11 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
|
||||
HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code)
|
||||
#endif /* JRM */
|
||||
|
||||
#if 0 /* JRM -- 3/23/10 */ /* this is no longer always the case */
|
||||
/* Only one process will do the actual write if all procs in comm write same metadata */
|
||||
if (file->mpi_rank != H5_PAR_META_WRITE)
|
||||
HGOTO_DONE(SUCCEED) /* skip the actual write */
|
||||
#endif /* JRM */
|
||||
} /* end if */
|
||||
|
||||
#ifdef REPORT_IO
|
||||
|
235
test/cache_api.c
235
test/cache_api.c
@ -65,11 +65,8 @@ static void check_file_mdc_api_errs(void);
|
||||
* Programmer: John Mainzer
|
||||
* 4/12/04
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
check_fapl_mdc_api_calls(void)
|
||||
{
|
||||
@ -113,7 +110,9 @@ check_fapl_mdc_api_calls(void)
|
||||
/* int epochs_before_eviction = */ 4,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.05,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
};
|
||||
H5AC_cache_config_t scratch;
|
||||
H5C_auto_size_ctl_t default_auto_size_ctl;
|
||||
@ -560,7 +559,9 @@ check_file_mdc_api_calls(void)
|
||||
/* int epochs_before_eviction = */ 4,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.05,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
};
|
||||
H5AC_cache_config_t mod_config_2 =
|
||||
{
|
||||
@ -593,7 +594,9 @@ check_file_mdc_api_calls(void)
|
||||
/* int epochs_before_eviction = */ 4,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.05,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
};
|
||||
H5AC_cache_config_t mod_config_3 =
|
||||
{
|
||||
@ -626,7 +629,9 @@ check_file_mdc_api_calls(void)
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ FALSE,
|
||||
/* double empty_reserve = */ 0.05,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
};
|
||||
H5AC_cache_config_t mod_config_4 =
|
||||
{
|
||||
@ -660,7 +665,9 @@ check_file_mdc_api_calls(void)
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
};
|
||||
|
||||
TESTING("MDC/FILE related API calls");
|
||||
@ -915,7 +922,9 @@ mdc_api_call_smoke_check(int express_test)
|
||||
/* int epochs_before_eviction = */ 2,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.05,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
};
|
||||
H5AC_cache_config_t mod_config_2 =
|
||||
{
|
||||
@ -948,7 +957,9 @@ mdc_api_call_smoke_check(int express_test)
|
||||
/* int epochs_before_eviction = */ 2,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.05,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
};
|
||||
H5AC_cache_config_t mod_config_3 =
|
||||
{
|
||||
@ -981,7 +992,9 @@ mdc_api_call_smoke_check(int express_test)
|
||||
/* int epochs_before_eviction = */ 2,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.05,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
};
|
||||
|
||||
TESTING("MDC API smoke check");
|
||||
@ -1514,7 +1527,7 @@ mdc_api_call_smoke_check(int express_test)
|
||||
* used to test error rejection in the MDC related API calls.
|
||||
*/
|
||||
|
||||
#define NUM_INVALID_CONFIGS 41
|
||||
#define NUM_INVALID_CONFIGS 42
|
||||
|
||||
H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
{
|
||||
@ -1549,7 +1562,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 1 -- bad rpt_fcn_enabled */
|
||||
@ -1582,7 +1597,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 2 -- bad open_trace_file */
|
||||
@ -1615,7 +1632,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 3 -- bad close_trace_file */
|
||||
@ -1648,7 +1667,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 4 -- open_trace_file == TRUE and empty trace_file_name */
|
||||
@ -1681,7 +1702,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 5 -- bad set_initial_size */
|
||||
@ -1714,7 +1737,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 6 -- max_size too big */
|
||||
@ -1747,7 +1772,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 7 -- min_size too small */
|
||||
@ -1780,7 +1807,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 8 -- min_size > max_size */
|
||||
@ -1813,7 +1842,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 9 -- initial size out of range (too big) */
|
||||
@ -1846,7 +1877,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 10 -- initial_size out of range (too small) */
|
||||
@ -1879,7 +1912,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 11 -- min_clean_fraction too big */
|
||||
@ -1912,7 +1947,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 12 -- min_clean_fraction too small */
|
||||
@ -1945,7 +1982,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 13 -- epoch_length too small */
|
||||
@ -1978,7 +2017,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 14 -- epoch_length too big */
|
||||
@ -2011,7 +2052,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 15 -- invalid incr_mode */
|
||||
@ -2044,7 +2087,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 16 -- lower_hr_threshold too small */
|
||||
@ -2077,7 +2122,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 17 -- lower_hr_threshold too big */
|
||||
@ -2110,7 +2157,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 18 -- increment too small */
|
||||
@ -2143,7 +2192,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 19 -- bad apply_max_increment */
|
||||
@ -2176,7 +2227,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 20 -- invalid flash_incr_mode */
|
||||
@ -2209,7 +2262,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 21 -- flash_multiple too small */
|
||||
@ -2242,7 +2297,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 22 -- flash_multiple too big */
|
||||
@ -2275,7 +2332,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 23 -- flash_threshold too small */
|
||||
@ -2308,7 +2367,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 24 -- flash_threshold too big */
|
||||
@ -2341,7 +2402,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 25 -- bad decr_mode */
|
||||
@ -2374,7 +2437,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 26 -- upper_hr_threshold too big */
|
||||
@ -2407,7 +2472,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 27 -- decrement too small */
|
||||
@ -2440,7 +2507,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 28 -- decrement too big */
|
||||
@ -2473,7 +2542,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 29 -- epochs_before_eviction too small */
|
||||
@ -2506,7 +2577,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 0,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 30 -- epochs_before_eviction too big */
|
||||
@ -2539,7 +2612,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ H5C__MAX_EPOCH_MARKERS + 1,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 31 -- invalid apply_empty_reserve */
|
||||
@ -2572,7 +2647,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ 2,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 32 -- empty_reserve too small */
|
||||
@ -2605,7 +2682,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ -0.0000000001,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 33 -- empty_reserve too big */
|
||||
@ -2638,7 +2717,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 1.00000000001,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 34 -- upper_hr_threshold too small */
|
||||
@ -2671,7 +2752,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 35 -- upper_hr_threshold too big */
|
||||
@ -2704,7 +2787,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 36 -- upper_hr_threshold <= lower_hr_threshold */
|
||||
@ -2737,7 +2822,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 37 -- dirty_bytes_threshold too small */
|
||||
@ -2770,7 +2857,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (H5C__MIN_MAX_CACHE_SIZE / 2) - 1
|
||||
/* int dirty_bytes_threshold = */ (H5C__MIN_MAX_CACHE_SIZE / 2) - 1,
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 38 -- dirty_bytes_threshold too big */
|
||||
@ -2803,7 +2892,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (H5C__MAX_MAX_CACHE_SIZE / 4) + 1
|
||||
/* int dirty_bytes_threshold = */ (H5C__MAX_MAX_CACHE_SIZE / 4) + 1,
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 39 -- attempt to disable evictions when auto incr enabled */
|
||||
@ -2836,7 +2927,9 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 40 -- attempt to disable evictions when auto decr enabled */
|
||||
@ -2869,7 +2962,43 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024)
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */
|
||||
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
|
||||
},
|
||||
{
|
||||
/* 41 -- unknown metadata write strategy */
|
||||
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
|
||||
/* hbool_t rpt_fcn_enabled = */ FALSE,
|
||||
/* hbool_t open_trace_file = */ FALSE,
|
||||
/* hbool_t close_trace_file = */ FALSE,
|
||||
/* char trace_file_name[] = */ "",
|
||||
/* hbool_t evictions_enabled = */ TRUE,
|
||||
/* hbool_t set_initial_size = */ TRUE,
|
||||
/* size_t initial_size = */ (1 * 1024 * 1024),
|
||||
/* double min_clean_fraction = */ 0.25,
|
||||
/* size_t max_size = */ (16 * 1024 * 1024),
|
||||
/* size_t min_size = */ ( 1 * 1024 * 1024),
|
||||
/* long int epoch_length = */ 50000,
|
||||
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
|
||||
/* double lower_hr_threshold = */ 0.9,
|
||||
/* double increment = */ 2.0,
|
||||
/* hbool_t apply_max_increment = */ TRUE,
|
||||
/* size_t max_increment = */ (4 * 1024 * 1024),
|
||||
/* enum H5C_cache_flash_incr_mode */
|
||||
/* flash_incr_mode = */ H5C_flash_incr__off,
|
||||
/* double flash_multiple = */ 2.0,
|
||||
/* double flash_threshold = */ 0.5,
|
||||
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
|
||||
/* double upper_hr_threshold = */ 0.999,
|
||||
/* double decrement = */ 0.9,
|
||||
/* hbool_t apply_max_decrement = */ TRUE,
|
||||
/* size_t max_decrement = */ (1 * 1024 * 1024),
|
||||
/* int epochs_before_eviction = */ 3,
|
||||
/* hbool_t apply_empty_reserve = */ TRUE,
|
||||
/* double empty_reserve = */ 0.1,
|
||||
/* int dirty_bytes_threshold = */ (256 * 1024),
|
||||
/* int metadata_write_strategy = */ -1
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -412,38 +412,40 @@ if ( ( (cache_ptr) == NULL ) || \
|
||||
|
||||
/* Macros used in H5AC level tests */
|
||||
|
||||
#define CACHE_CONFIGS_EQUAL(a, b, cmp_set_init, cmp_init_size) \
|
||||
( ( (a).version == (b).version ) && \
|
||||
( (a).rpt_fcn_enabled == (b).rpt_fcn_enabled ) && \
|
||||
( (a).open_trace_file == (b).open_trace_file ) && \
|
||||
( (a).close_trace_file == (b).close_trace_file ) && \
|
||||
( ( (a).open_trace_file == FALSE ) || \
|
||||
( strcmp((a).trace_file_name, (b).trace_file_name) == 0 ) ) && \
|
||||
( (a).evictions_enabled == (b).evictions_enabled ) && \
|
||||
( ( ! cmp_set_init ) || \
|
||||
( (a).set_initial_size == (b).set_initial_size ) ) && \
|
||||
( ( ! cmp_init_size ) || \
|
||||
( (a).initial_size == (b).initial_size ) ) && \
|
||||
( (a).min_clean_fraction == (b).min_clean_fraction ) && \
|
||||
( (a).max_size == (b).max_size ) && \
|
||||
( (a).min_size == (b).min_size ) && \
|
||||
( (a).epoch_length == (b).epoch_length ) && \
|
||||
( (a).incr_mode == (b).incr_mode ) && \
|
||||
( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \
|
||||
( (a).increment == (b).increment ) && \
|
||||
( (a).apply_max_increment == (b).apply_max_increment ) && \
|
||||
( (a).max_increment == (b).max_increment ) && \
|
||||
( (a).flash_incr_mode == (b).flash_incr_mode ) && \
|
||||
( (a).flash_multiple == (b).flash_multiple ) && \
|
||||
( (a).flash_threshold == (b).flash_threshold ) && \
|
||||
( (a).decr_mode == (b).decr_mode ) && \
|
||||
( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \
|
||||
( (a).decrement == (b).decrement ) && \
|
||||
( (a).apply_max_decrement == (b).apply_max_decrement ) && \
|
||||
( (a).max_decrement == (b).max_decrement ) && \
|
||||
( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \
|
||||
( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \
|
||||
( (a).empty_reserve == (b).empty_reserve ) )
|
||||
#define CACHE_CONFIGS_EQUAL(a, b, cmp_set_init, cmp_init_size) \
|
||||
( ( (a).version == (b).version ) && \
|
||||
( (a).rpt_fcn_enabled == (b).rpt_fcn_enabled ) && \
|
||||
( (a).open_trace_file == (b).open_trace_file ) && \
|
||||
( (a).close_trace_file == (b).close_trace_file ) && \
|
||||
( ( (a).open_trace_file == FALSE ) || \
|
||||
( strcmp((a).trace_file_name, (b).trace_file_name) == 0 ) ) && \
|
||||
( (a).evictions_enabled == (b).evictions_enabled ) && \
|
||||
( ( ! cmp_set_init ) || \
|
||||
( (a).set_initial_size == (b).set_initial_size ) ) && \
|
||||
( ( ! cmp_init_size ) || \
|
||||
( (a).initial_size == (b).initial_size ) ) && \
|
||||
( (a).min_clean_fraction == (b).min_clean_fraction ) && \
|
||||
( (a).max_size == (b).max_size ) && \
|
||||
( (a).min_size == (b).min_size ) && \
|
||||
( (a).epoch_length == (b).epoch_length ) && \
|
||||
( (a).incr_mode == (b).incr_mode ) && \
|
||||
( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \
|
||||
( (a).increment == (b).increment ) && \
|
||||
( (a).apply_max_increment == (b).apply_max_increment ) && \
|
||||
( (a).max_increment == (b).max_increment ) && \
|
||||
( (a).flash_incr_mode == (b).flash_incr_mode ) && \
|
||||
( (a).flash_multiple == (b).flash_multiple ) && \
|
||||
( (a).flash_threshold == (b).flash_threshold ) && \
|
||||
( (a).decr_mode == (b).decr_mode ) && \
|
||||
( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \
|
||||
( (a).decrement == (b).decrement ) && \
|
||||
( (a).apply_max_decrement == (b).apply_max_decrement ) && \
|
||||
( (a).max_decrement == (b).max_decrement ) && \
|
||||
( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \
|
||||
( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \
|
||||
( (a).empty_reserve == (b).empty_reserve ) && \
|
||||
( (a).dirty_bytes_threshold == (b).dirty_bytes_threshold ) && \
|
||||
( (a).metadata_write_strategy == (b).metadata_write_strategy ) )
|
||||
|
||||
#define XLATE_EXT_TO_INT_MDC_CONFIG(i, e) \
|
||||
{ \
|
||||
|
2214
testpar/t_cache.c
2214
testpar/t_cache.c
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user