summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5AC.c')
-rw-r--r--src/H5AC.c94
1 files changed, 52 insertions, 42 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index 659c4e6..bd2b20b 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -760,6 +760,11 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id)
HDassert(f);
HDassert(f->shared->cache);
+#if H5AC_DUMP_STATS_ON_CLOSE
+ /* Dump debugging info */
+ H5AC_stats(f);
+#endif /* H5AC_DUMP_STATS_ON_CLOSE */
+
#if H5AC__TRACE_FILE_ENABLED
if(H5AC_close_trace_file(f->shared->cache) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_close_trace_file() failed.")
@@ -847,8 +852,8 @@ H5AC_expunge_entry(H5F_t *f,
H5AC_t * cache_ptr = f->shared->cache;
- /* For the expunge entry call, only the addr, and type id are really
- * necessary in the trace file. Write the return value to catch occult
+ /* For the expunge entry call, only the addr, and type id are really
+ * necessary in the trace file. Write the return value to catch occult
* errors.
*/
if ( ( cache_ptr != NULL ) &&
@@ -1207,19 +1212,21 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
#endif /* H5AC__TRACE_FILE_ENABLED */
#ifdef H5_HAVE_PARALLEL
- if ( ( aux_ptr != NULL ) &&
- ( aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold ) ) {
-
- result = H5AC_propagate_flushed_and_still_clean_entries_list(f,
- H5AC_noblock_dxpl_id,
- f->shared->cache,
- TRUE);
- if ( result < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \
- "Can't propagate clean entries list.")
- }
- }
+ /* Check if we should try to flush */
+ if(aux_ptr && (aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)) {
+ hbool_t evictions_enabled;
+
+ /* Query if evictions are allowed */
+ if(H5C_get_evictions_enabled((const H5C_t *)f->shared->cache, &evictions_enabled) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_get_evictions_enabled() failed.")
+
+ /* Flush if evictions are allowed */
+ if(evictions_enabled) {
+ if(H5AC_propagate_flushed_and_still_clean_entries_list(f,
+ H5AC_noblock_dxpl_id, f->shared->cache, TRUE) < 0 )
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.")
+ } /* end if */
+ } /* end if */
#endif /* H5_HAVE_PARALLEL */
done:
@@ -1489,19 +1496,21 @@ H5AC_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_ad
}
#ifdef H5_HAVE_PARALLEL
- if ( ( aux_ptr != NULL ) &&
- ( aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold ) ) {
-
- result = H5AC_propagate_flushed_and_still_clean_entries_list(f,
- H5AC_noblock_dxpl_id,
- f->shared->cache,
- TRUE);
- if ( result < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \
- "Can't propagate clean entries list.")
- }
- }
+ /* Check if we should try to flush */
+ if(aux_ptr && (aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)) {
+ hbool_t evictions_enabled;
+
+ /* Query if evictions are allowed */
+ if(H5C_get_evictions_enabled((const H5C_t *)f->shared->cache, &evictions_enabled) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_get_evictions_enabled() failed.")
+
+ /* Flush if evictions are allowed */
+ if(evictions_enabled) {
+ if(H5AC_propagate_flushed_and_still_clean_entries_list(f,
+ H5AC_noblock_dxpl_id, f->shared->cache, TRUE) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.")
+ } /* end if */
+ } /* end if */
#endif /* H5_HAVE_PARALLEL */
done:
@@ -2183,20 +2192,21 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
}
#ifdef H5_HAVE_PARALLEL
- if ( ( aux_ptr != NULL ) &&
- ( aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold ) ) {
-
- result = H5AC_propagate_flushed_and_still_clean_entries_list(f,
- H5AC_noblock_dxpl_id,
- f->shared->cache,
- TRUE);
-
- if ( result < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \
- "Can't propagate clean entries list.")
- }
- }
+ /* Check if we should try to flush */
+ if(aux_ptr && (aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)) {
+ hbool_t evictions_enabled;
+
+ /* Query if evictions are allowed */
+ if(H5C_get_evictions_enabled((const H5C_t *)f->shared->cache, &evictions_enabled) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_get_evictions_enabled() failed.")
+
+ /* Flush if evictions are allowed */
+ if(evictions_enabled) {
+ if(H5AC_propagate_flushed_and_still_clean_entries_list(f,
+ H5AC_noblock_dxpl_id, f->shared->cache, TRUE) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.")
+ } /* end if */
+ } /* end if */
#endif /* H5_HAVE_PARALLEL */
done: