summaryrefslogtreecommitdiffstats
path: root/src/H5Cdbg.c
diff options
context:
space:
mode:
authormainzer <mainzer#hdfgroup.org>2020-08-05 20:39:49 (GMT)
committermainzer <mainzer#hdfgroup.org>2020-08-05 20:39:49 (GMT)
commit33f35183cbfdde70ee8f803acb5b735ad4dfe086 (patch)
treee18d05c2c6b34f4baba1d4b28250dc4cf9d51171 /src/H5Cdbg.c
parent50f404c887118577034c6412aeaaa1f6db2fe475 (diff)
downloadhdf5-33f35183cbfdde70ee8f803acb5b735ad4dfe086.zip
hdf5-33f35183cbfdde70ee8f803acb5b735ad4dfe086.tar.gz
hdf5-33f35183cbfdde70ee8f803acb5b735ad4dfe086.tar.bz2
When flushing, the metadata cache attempts to flush entries in increasing
address order. To facilitate this, the metadata cache needs a list of of dirty entries in increasing address order. This is implemented via a skip list of all dirty entries in the cache. To date this skip list has been maintained at all times. However, profiling indicates that we can avoid significant overhead by constructing the skip list of dirty entries just before a flush, taking it down afterwareds, and not maintaining it during normal operation. This commit implements this optimization for both serial and parallel. Tested serial and parallel, debug and production on charis and jelly.
Diffstat (limited to 'src/H5Cdbg.c')
-rw-r--r--src/H5Cdbg.c41
1 files changed, 34 insertions, 7 deletions
diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c
index d5599f2..085ac77 100644
--- a/src/H5Cdbg.c
+++ b/src/H5Cdbg.c
@@ -260,6 +260,7 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name)
/*-------------------------------------------------------------------------
+ *
* Function: H5C_dump_cache_skip_list
*
* Purpose: Debugging routine that prints a summary of the contents of
@@ -271,6 +272,12 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name)
* Programmer: John Mainzer
* 11/15/14
*
+ * Changes: Updated function for the slist_enabled field in H6C_t.
+ * Recall that to minimize slist overhead, the slist is
+ * empty and not maintained if cache_ptr->slist_enabled is
+ * false.
+ * JRM -- 5/6/20
+ *
*-------------------------------------------------------------------------
*/
#ifndef NDEBUG
@@ -288,11 +295,16 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn)
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(calling_fcn != NULL);
- HDfprintf(stdout, "\n\nDumping metadata cache skip list from %s.\n", calling_fcn);
+ HDfprintf(stdout, "\n\nDumping metadata cache skip list from %s.\n",
+ calling_fcn);
+ HDfprintf(stdout, " slist enabled = %d.\n",
+ (int)(cache_ptr->slist_enabled));
HDfprintf(stdout, " slist len = %u.\n", cache_ptr->slist_len);
- HDfprintf(stdout, " slist size = %lld.\n", (long long)(cache_ptr->slist_size));
+ HDfprintf(stdout, " slist size = %lld.\n",
+ (long long)(cache_ptr->slist_size));
if(cache_ptr->slist_len > 0) {
+
/* If we get this far, all entries in the cache are listed in the
* skip list -- scan the skip list generating the desired output.
*/
@@ -300,13 +312,20 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn)
"Num: Addr: Len: Prot/Pind: Dirty: Type:\n");
i = 0;
+
node_ptr = H5SL_first(cache_ptr->slist_ptr);
- if(node_ptr != NULL)
+
+ if ( node_ptr != NULL ) {
+
entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
- else
+
+ } else {
+
entry_ptr = NULL;
+ }
+
+ while ( entry_ptr != NULL ) {
- while(entry_ptr != NULL) {
HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC );
HDfprintf(stdout,
@@ -323,19 +342,27 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn)
node_ptr, H5SL_item(node_ptr));
/* increment node_ptr before we delete its target */
+
node_ptr = H5SL_next(node_ptr);
- if(node_ptr != NULL)
+
+ if ( node_ptr != NULL ) {
+
entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
- else
+
+ } else {
+
entry_ptr = NULL;
+ }
i++;
+
} /* end while */
} /* end if */
HDfprintf(stdout, "\n\n");
FUNC_LEAVE_NOAPI(ret_value)
+
} /* H5C_dump_cache_skip_list() */
#endif /* NDEBUG */