summaryrefslogtreecommitdiffstats
path: root/test/cache_common.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2020-11-17 13:47:52 (GMT)
committerGitHub <noreply@github.com>2020-11-17 13:47:52 (GMT)
commit5d0be1b196570ac2c08ffe0b61ac6a45b6ab7f3f (patch)
treedbe8a76bcb211babe9900647eb1f515d8623ad9b /test/cache_common.c
parentec48fb8dfdb4f2f59f22a5efb6b950aafcac449d (diff)
downloadhdf5-5d0be1b196570ac2c08ffe0b61ac6a45b6ab7f3f.zip
hdf5-5d0be1b196570ac2c08ffe0b61ac6a45b6ab7f3f.tar.gz
hdf5-5d0be1b196570ac2c08ffe0b61ac6a45b6ab7f3f.tar.bz2
Manual sync with develop (#95)
Brings all features from develop. Note that RELEASE.txt has not been updated (will be done in a future PR).
Diffstat (limited to 'test/cache_common.c')
-rw-r--r--test/cache_common.c133
1 files changed, 98 insertions, 35 deletions
diff --git a/test/cache_common.c b/test/cache_common.c
index d0c267f..8fc8303 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -2754,7 +2754,20 @@ expunge_entry(H5F_t *file_ptr, int32_t type, int32_t idx)
* Return: void
*
* Programmer: John Mainzer
- * 6/23/04
+ * 6/23/04
+ *
+ * Changes: Added code to setup and take down the skip list before
+ * and after calls to H5C_flush_cache(). Do this via calls
+ * to the H5C_FLUSH_CACHE macro.
+ *
+ * This is necessary, as H5C_flush() is called repeatedly
+ * during file flush. If we setup and took down the
+ * skip list on H5C_flush_cache(), we would find ourselves
+ * doing this repeatedly -- which is contrary to the
+ * objective of the exercise (avoiding as many skip list
+ * operations as possible).
+ *
+ * JRM -- 5/14/20
*
*-------------------------------------------------------------------------
*/
@@ -2774,22 +2787,23 @@ flush_cache(H5F_t *file_ptr, hbool_t destroy_entries, hbool_t dump_stats, hbool_
cache_ptr = file_ptr->shared->cache;
- if (destroy_entries)
- result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG);
+ if (destroy_entries) {
- else
- result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
+ H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_INVALIDATE_FLAG, "error in H5C_flush_cache().")
+ }
+ else {
- if (dump_stats)
- H5C_stats(cache_ptr, "test cache", dump_detailed_stats);
+ H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, "error in H5C_flush_cache().")
+ }
- if (result < 0) {
- pass = FALSE;
- failure_mssg = "error in H5C_flush_cache().";
+ if (dump_stats) {
+
+ H5C_stats(cache_ptr, "test cache", dump_detailed_stats);
}
- else if ((destroy_entries) &&
- ((cache_ptr->index_len != 0) || (cache_ptr->index_size != 0) ||
- (cache_ptr->clean_index_size != 0) || (cache_ptr->dirty_index_size != 0))) {
+
+ if ((pass) && (destroy_entries) &&
+ ((cache_ptr->index_len != 0) || (cache_ptr->index_size != 0) ||
+ (cache_ptr->clean_index_size != 0) || (cache_ptr->dirty_index_size != 0))) {
if (verbose) {
@@ -3544,6 +3558,11 @@ unprotect_entry(H5F_t *file_ptr, int32_t type, int32_t idx, unsigned int flags)
* Programmer: John Mainzer
* 6/12/04
*
+ * Changes: Updated slist size == dirty index size checks to
+ * bypass the test if cache_ptr->slist_enabled is FALSE.
+ *
+ * JRM -- 5/8/20
+ *
*-------------------------------------------------------------------------
*/
void
@@ -3587,7 +3606,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "1(i, %d, %d) ", type, tmp_idx);
insert_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
tmp_idx--;
@@ -3597,7 +3618,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "2(p, %d, %d) ", type, tmp_idx);
protect_entry(file_ptr, type, tmp_idx);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
tmp_idx--;
@@ -3607,7 +3630,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "3(u, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
/* (don't decrement tmp_idx) */
@@ -3617,7 +3642,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "4(r, %d, %d, %d) ", type, tmp_idx, (int)move_to_main_addr);
move_entry(cache_ptr, type, tmp_idx, move_to_main_addr);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
tmp_idx--;
@@ -3627,7 +3654,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "5(p, %d, %d) ", type, tmp_idx);
protect_entry(file_ptr, type, tmp_idx);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
tmp_idx -= 2;
@@ -3637,7 +3666,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "6(u, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
if (do_mult_ro_protects) {
@@ -3648,7 +3679,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "7(p-ro, %d, %d) ", type, tmp_idx);
protect_entry_ro(file_ptr, type, tmp_idx);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
tmp_idx--;
@@ -3658,7 +3691,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "8(p-ro, %d, %d) ", type, tmp_idx);
protect_entry_ro(file_ptr, type, tmp_idx);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
tmp_idx--;
@@ -3668,7 +3703,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "9(p-ro, %d, %d) ", type, tmp_idx);
protect_entry_ro(file_ptr, type, tmp_idx);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
/* (don't decrement tmp_idx) */
@@ -3678,7 +3715,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "10(u-ro, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
tmp_idx--;
@@ -3688,7 +3727,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "11(u-ro, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
tmp_idx--;
@@ -3698,7 +3739,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "12(u-ro, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
} /* if ( do_mult_ro_protects ) */
@@ -3707,7 +3750,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "13(p, %d, %d) ", type, idx);
protect_entry(file_ptr, type, idx);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
tmp_idx = idx - lag + 2;
@@ -3717,7 +3762,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "14(u, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
tmp_idx--;
@@ -3727,7 +3774,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "15(p, %d, %d) ", type, tmp_idx);
protect_entry(file_ptr, type, tmp_idx);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
if (do_destroys) {
@@ -3739,7 +3788,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "16(u, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
break;
case 1:
@@ -3748,7 +3799,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "17(u, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
else {
if (verbose)
@@ -3756,7 +3809,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
unprotect_entry(file_ptr, type, tmp_idx,
(dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET));
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end else */
break;
@@ -3765,7 +3820,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "19(u-del, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
break;
case 3:
@@ -3774,7 +3831,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDfprintf(stdout, "20(u-del, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
else {
if (verbose)
@@ -3783,7 +3842,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
unprotect_entry(file_ptr, type, tmp_idx,
(dirty_destroys ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) |
H5C__DELETED_FLAG);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end else */
break;
@@ -3801,7 +3862,9 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
unprotect_entry(file_ptr, type, tmp_idx,
(dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET));
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+
+ HDassert((!cache_ptr->slist_enabled) ||
+ (cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
} /* end elsef */