diff options
Diffstat (limited to 'src/H5Cdbg.c')
-rw-r--r-- | src/H5Cdbg.c | 453 |
1 files changed, 225 insertions, 228 deletions
diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index ed95bcd..3ad67a1 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -85,9 +85,9 @@ H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(cache_ptr != NULL); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(cache_name != NULL); + assert(cache_ptr != NULL); + assert(cache_ptr->magic == H5C__H5C_T_MAGIC); + assert(cache_name != NULL); /* First, create a skip list */ if (NULL == (slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) @@ -101,7 +101,7 @@ H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name) entry_ptr = cache_ptr->index[i]; while (entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + assert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); if (H5SL_insert(slist_ptr, entry_ptr, &(entry_ptr->addr)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "can't insert entry in skip list") @@ -113,40 +113,40 @@ H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name) * skip list -- scan the skip list generating the desired output. */ - HDfprintf(stdout, "\n\nDump of metadata cache \"%s\"\n", cache_name); + fprintf(stdout, "\n\nDump of metadata cache \"%s\"\n", cache_name); /* Print header */ - HDfprintf(stdout, "Entry "); - HDfprintf(stdout, "| Address "); - HDfprintf(stdout, "| Tag "); - HDfprintf(stdout, "| Size "); - HDfprintf(stdout, "| Ring "); - HDfprintf(stdout, "| Type "); - HDfprintf(stdout, "| Prot/Pin/Dirty"); - HDfprintf(stdout, "\n"); - - HDfprintf(stdout, "--------------------------------------------------------------------------------------" - "--------------------------\n"); + fprintf(stdout, "Entry "); + fprintf(stdout, "| Address "); + fprintf(stdout, "| Tag "); + fprintf(stdout, "| Size "); + fprintf(stdout, "| Ring "); + fprintf(stdout, "| Type "); + fprintf(stdout, "| Prot/Pin/Dirty"); + fprintf(stdout, "\n"); + + fprintf(stdout, "--------------------------------------------------------------------------------------" + "--------------------------\n"); i = 0; entry_ptr = (H5C_cache_entry_t *)H5SL_remove_first(slist_ptr); while (entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + assert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); /* Print entry */ - HDfprintf(stdout, "%s%5d ", cache_ptr->prefix, i); - HDfprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->addr)); + fprintf(stdout, "%s%5d ", cache_ptr->prefix, i); + fprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->addr)); if (NULL == entry_ptr->tag_info) - HDfprintf(stdout, " %16s ", "N/A"); + fprintf(stdout, " %16s ", "N/A"); else - HDfprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->tag_info->tag)); - HDfprintf(stdout, " %5lld ", (long long)(entry_ptr->size)); - HDfprintf(stdout, " %d ", (int)(entry_ptr->ring)); - HDfprintf(stdout, " %2d %-32s ", (int)(entry_ptr->type->id), (entry_ptr->type->name)); - HDfprintf(stdout, " %d", (int)(entry_ptr->is_protected)); - HDfprintf(stdout, " %d", (int)(entry_ptr->is_pinned)); - HDfprintf(stdout, " %d", (int)(entry_ptr->is_dirty)); - HDfprintf(stdout, "\n"); + fprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->tag_info->tag)); + fprintf(stdout, " %5lld ", (long long)(entry_ptr->size)); + fprintf(stdout, " %d ", (int)(entry_ptr->ring)); + fprintf(stdout, " %2d %-32s ", (int)(entry_ptr->type->id), (entry_ptr->type->name)); + fprintf(stdout, " %d", (int)(entry_ptr->is_protected)); + fprintf(stdout, " %d", (int)(entry_ptr->is_pinned)); + fprintf(stdout, " %d", (int)(entry_ptr->is_dirty)); + fprintf(stdout, "\n"); /* remove the next (first) item in the skip list */ entry_ptr = (H5C_cache_entry_t *)H5SL_remove_first(slist_ptr); @@ -154,10 +154,10 @@ H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name) i++; } /* end while */ - HDfprintf(stdout, "\n\n"); + fprintf(stdout, "\n\n"); /* Verify that all the entries were removed from the skip list */ - HDassert(H5SL_count(slist_ptr) == 0); + assert(H5SL_count(slist_ptr) == 0); done: /* Discard the skip list */ @@ -192,55 +192,55 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name) FUNC_ENTER_NOAPI_NOERR /* Sanity check */ - HDassert(cache_ptr != NULL); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(cache_name != NULL); + assert(cache_ptr != NULL); + assert(cache_ptr->magic == H5C__H5C_T_MAGIC); + assert(cache_name != NULL); - HDfprintf(stdout, "\n\nDump of metadata cache LRU \"%s\"\n", cache_name); - HDfprintf(stdout, "LRU len = %d, LRU size = %d\n", cache_ptr->LRU_list_len, - (int)(cache_ptr->LRU_list_size)); - HDfprintf(stdout, "index_size = %d, max_cache_size = %d, delta = %d\n\n", (int)(cache_ptr->index_size), - (int)(cache_ptr->max_cache_size), - (int)(cache_ptr->max_cache_size) - (int)(cache_ptr->index_size)); + fprintf(stdout, "\n\nDump of metadata cache LRU \"%s\"\n", cache_name); + fprintf(stdout, "LRU len = %d, LRU size = %d\n", cache_ptr->LRU_list_len, + (int)(cache_ptr->LRU_list_size)); + fprintf(stdout, "index_size = %d, max_cache_size = %d, delta = %d\n\n", (int)(cache_ptr->index_size), + (int)(cache_ptr->max_cache_size), + (int)(cache_ptr->max_cache_size) - (int)(cache_ptr->index_size)); /* Print header */ - HDfprintf(stdout, "Entry "); - HDfprintf(stdout, "| Address "); - HDfprintf(stdout, "| Tag "); - HDfprintf(stdout, "| Size "); - HDfprintf(stdout, "| Ring "); - HDfprintf(stdout, "| Type "); - HDfprintf(stdout, "| Dirty"); - HDfprintf(stdout, "\n"); - - HDfprintf(stdout, "--------------------------------------------------------------------------------------" - "--------------------------\n"); + fprintf(stdout, "Entry "); + fprintf(stdout, "| Address "); + fprintf(stdout, "| Tag "); + fprintf(stdout, "| Size "); + fprintf(stdout, "| Ring "); + fprintf(stdout, "| Type "); + fprintf(stdout, "| Dirty"); + fprintf(stdout, "\n"); + + fprintf(stdout, "--------------------------------------------------------------------------------------" + "--------------------------\n"); entry_ptr = cache_ptr->LRU_head_ptr; while (entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + assert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); /* Print entry */ - HDfprintf(stdout, "%s%5d ", cache_ptr->prefix, i); - HDfprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->addr)); + fprintf(stdout, "%s%5d ", cache_ptr->prefix, i); + fprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->addr)); if (NULL == entry_ptr->tag_info) - HDfprintf(stdout, " %16s ", "N/A"); + fprintf(stdout, " %16s ", "N/A"); else - HDfprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->tag_info->tag)); + fprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->tag_info->tag)); - HDfprintf(stdout, " %5lld ", (long long)(entry_ptr->size)); - HDfprintf(stdout, " %d ", (int)(entry_ptr->ring)); - HDfprintf(stdout, " %2d %-32s ", (int)(entry_ptr->type->id), (entry_ptr->type->name)); - HDfprintf(stdout, " %d", (int)(entry_ptr->is_dirty)); - HDfprintf(stdout, "\n"); + fprintf(stdout, " %5lld ", (long long)(entry_ptr->size)); + fprintf(stdout, " %d ", (int)(entry_ptr->ring)); + fprintf(stdout, " %2d %-32s ", (int)(entry_ptr->type->id), (entry_ptr->type->name)); + fprintf(stdout, " %d", (int)(entry_ptr->is_dirty)); + fprintf(stdout, "\n"); i++; entry_ptr = entry_ptr->next; } /* end while */ - HDfprintf(stdout, "--------------------------------------------------------------------------------------" - "--------------------------\n"); + fprintf(stdout, "--------------------------------------------------------------------------------------" + "--------------------------\n"); FUNC_LEAVE_NOAPI(SUCCEED) } /* H5C_dump_cache_LRU() */ @@ -272,21 +272,21 @@ H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn) FUNC_ENTER_NOAPI_NOERR - HDassert(cache_ptr != NULL); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(calling_fcn != NULL); + assert(cache_ptr != NULL); + assert(cache_ptr->magic == H5C__H5C_T_MAGIC); + assert(calling_fcn != NULL); - HDfprintf(stdout, "\n\nDumping metadata cache skip list from %s.\n", calling_fcn); - HDfprintf(stdout, " slist %s.\n", cache_ptr->slist_enabled ? "enabled" : "disabled"); - HDfprintf(stdout, " slist len = %" PRIu32 ".\n", cache_ptr->slist_len); - HDfprintf(stdout, " slist size = %zu.\n", cache_ptr->slist_size); + fprintf(stdout, "\n\nDumping metadata cache skip list from %s.\n", calling_fcn); + fprintf(stdout, " slist %s.\n", cache_ptr->slist_enabled ? "enabled" : "disabled"); + fprintf(stdout, " slist len = %" PRIu32 ".\n", cache_ptr->slist_len); + fprintf(stdout, " slist size = %zu.\n", 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. */ - HDfprintf(stdout, "Num: Addr: Len: Prot/Pind: Dirty: Type:\n"); + fprintf(stdout, "Num: Addr: Len: Prot/Pind: Dirty: Type:\n"); i = 0; @@ -297,12 +297,12 @@ H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn) entry_ptr = NULL; while (entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDfprintf(stdout, "%s%d 0x%016llx %4lld %d/%d %d %s\n", cache_ptr->prefix, i, - (long long)(entry_ptr->addr), (long long)(entry_ptr->size), - (int)(entry_ptr->is_protected), (int)(entry_ptr->is_pinned), (int)(entry_ptr->is_dirty), - entry_ptr->type->name); - HDfprintf(stdout, " node_ptr = %p, item = %p\n", (void *)node_ptr, H5SL_item(node_ptr)); + assert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + fprintf(stdout, "%s%d 0x%016llx %4lld %d/%d %d %s\n", cache_ptr->prefix, i, + (long long)(entry_ptr->addr), (long long)(entry_ptr->size), + (int)(entry_ptr->is_protected), (int)(entry_ptr->is_pinned), (int)(entry_ptr->is_dirty), + entry_ptr->type->name); + fprintf(stdout, " node_ptr = %p, item = %p\n", (void *)node_ptr, H5SL_item(node_ptr)); /* increment node_ptr before we delete its target */ node_ptr = H5SL_next(node_ptr); @@ -315,7 +315,7 @@ H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn) } /* end while */ } /* end if */ - HDfprintf(stdout, "\n\n"); + fprintf(stdout, "\n\n"); FUNC_LEAVE_NOAPI(ret_value) } /* H5C_dump_cache_skip_list() */ @@ -416,7 +416,7 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name, FUNC_ENTER_NOAPI(FAIL) - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + assert(cache_ptr->magic == H5C__H5C_T_MAGIC); /* This would normally be an assert, but we need to use an HGOTO_ERROR * call to shut up the compiler. @@ -481,157 +481,154 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name, average_failed_search_depth = ((double)(cache_ptr->total_failed_ht_search_depth)) / ((double)(cache_ptr->failed_ht_searches)); - HDfprintf(stdout, "\n%sH5C: cache statistics for %s\n", cache_ptr->prefix, cache_name); + fprintf(stdout, "\n%sH5C: cache statistics for %s\n", cache_ptr->prefix, cache_name); - HDfprintf(stdout, "\n"); + fprintf(stdout, "\n"); - HDfprintf(stdout, "%s hash table insertion / deletions = %ld / %ld\n", cache_ptr->prefix, - (long)(cache_ptr->total_ht_insertions), (long)(cache_ptr->total_ht_deletions)); + fprintf(stdout, "%s hash table insertion / deletions = %ld / %ld\n", cache_ptr->prefix, + (long)(cache_ptr->total_ht_insertions), (long)(cache_ptr->total_ht_deletions)); - HDfprintf(stdout, "%s HT successful / failed searches = %ld / %ld\n", cache_ptr->prefix, - (long)(cache_ptr->successful_ht_searches), (long)(cache_ptr->failed_ht_searches)); + fprintf(stdout, "%s HT successful / failed searches = %ld / %ld\n", cache_ptr->prefix, + (long)(cache_ptr->successful_ht_searches), (long)(cache_ptr->failed_ht_searches)); - HDfprintf(stdout, "%s Av. HT suc / failed search depth = %f / %f\n", cache_ptr->prefix, - average_successful_search_depth, average_failed_search_depth); + fprintf(stdout, "%s Av. HT suc / failed search depth = %f / %f\n", cache_ptr->prefix, + average_successful_search_depth, average_failed_search_depth); - HDfprintf(stdout, "%s current (max) index size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix, - (long)(cache_ptr->index_size), (long)(cache_ptr->max_index_size), - (unsigned long)(cache_ptr->index_len), (unsigned long)(cache_ptr->max_index_len)); + fprintf(stdout, "%s current (max) index size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix, + (long)(cache_ptr->index_size), (long)(cache_ptr->max_index_size), + (unsigned long)(cache_ptr->index_len), (unsigned long)(cache_ptr->max_index_len)); - HDfprintf(stdout, "%s current (max) clean/dirty idx size = %ld (%ld) / %ld (%ld)\n", cache_ptr->prefix, - (long)(cache_ptr->clean_index_size), (long)(cache_ptr->max_clean_index_size), - (long)(cache_ptr->dirty_index_size), (long)(cache_ptr->max_dirty_index_size)); + fprintf(stdout, "%s current (max) clean/dirty idx size = %ld (%ld) / %ld (%ld)\n", cache_ptr->prefix, + (long)(cache_ptr->clean_index_size), (long)(cache_ptr->max_clean_index_size), + (long)(cache_ptr->dirty_index_size), (long)(cache_ptr->max_dirty_index_size)); - HDfprintf(stdout, "%s current (max) slist size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix, - (long)(cache_ptr->slist_size), (long)(cache_ptr->max_slist_size), - (unsigned long)(cache_ptr->slist_len), (unsigned long)(cache_ptr->max_slist_len)); + fprintf(stdout, "%s current (max) slist size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix, + (long)(cache_ptr->slist_size), (long)(cache_ptr->max_slist_size), + (unsigned long)(cache_ptr->slist_len), (unsigned long)(cache_ptr->max_slist_len)); - HDfprintf(stdout, "%s current (max) PL size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix, - (long)(cache_ptr->pl_size), (long)(cache_ptr->max_pl_size), (unsigned long)(cache_ptr->pl_len), - (unsigned long)(cache_ptr->max_pl_len)); + fprintf(stdout, "%s current (max) PL size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix, + (long)(cache_ptr->pl_size), (long)(cache_ptr->max_pl_size), (unsigned long)(cache_ptr->pl_len), + (unsigned long)(cache_ptr->max_pl_len)); - HDfprintf(stdout, "%s current (max) PEL size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix, - (long)(cache_ptr->pel_size), (long)(cache_ptr->max_pel_size), - (unsigned long)(cache_ptr->pel_len), (unsigned long)(cache_ptr->max_pel_len)); + fprintf(stdout, "%s current (max) PEL size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix, + (long)(cache_ptr->pel_size), (long)(cache_ptr->max_pel_size), (unsigned long)(cache_ptr->pel_len), + (unsigned long)(cache_ptr->max_pel_len)); - HDfprintf(stdout, "%s current LRU list size / length = %ld / %lu\n", cache_ptr->prefix, - (long)(cache_ptr->LRU_list_size), (unsigned long)(cache_ptr->LRU_list_len)); + fprintf(stdout, "%s current LRU list size / length = %ld / %lu\n", cache_ptr->prefix, + (long)(cache_ptr->LRU_list_size), (unsigned long)(cache_ptr->LRU_list_len)); #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - HDfprintf(stdout, "%s current clean LRU size / length = %ld / %lu\n", cache_ptr->prefix, - (long)(cache_ptr->cLRU_list_size), (unsigned long)(cache_ptr->cLRU_list_len)); + fprintf(stdout, "%s current clean LRU size / length = %ld / %lu\n", cache_ptr->prefix, + (long)(cache_ptr->cLRU_list_size), (unsigned long)(cache_ptr->cLRU_list_len)); - HDfprintf(stdout, "%s current dirty LRU size / length = %ld / %lu\n", cache_ptr->prefix, - (long)(cache_ptr->dLRU_list_size), (unsigned long)(cache_ptr->dLRU_list_len)); + fprintf(stdout, "%s current dirty LRU size / length = %ld / %lu\n", cache_ptr->prefix, + (long)(cache_ptr->dLRU_list_size), (unsigned long)(cache_ptr->dLRU_list_len)); #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - HDfprintf(stdout, "%s Total hits / misses / hit_rate = %ld / %ld / %f\n", cache_ptr->prefix, - (long)total_hits, (long)total_misses, hit_rate); + fprintf(stdout, "%s Total hits / misses / hit_rate = %ld / %ld / %f\n", cache_ptr->prefix, + (long)total_hits, (long)total_misses, hit_rate); - HDfprintf(stdout, "%s Total write / read (max) protects = %ld / %ld (%ld)\n", cache_ptr->prefix, - (long)total_write_protects, (long)total_read_protects, (long)max_read_protects); + fprintf(stdout, "%s Total write / read (max) protects = %ld / %ld (%ld)\n", cache_ptr->prefix, + (long)total_write_protects, (long)total_read_protects, (long)max_read_protects); - HDfprintf(stdout, "%s Total clears / flushes = %ld / %ld\n", cache_ptr->prefix, - (long)total_clears, (long)total_flushes); + fprintf(stdout, "%s Total clears / flushes = %ld / %ld\n", cache_ptr->prefix, + (long)total_clears, (long)total_flushes); - HDfprintf(stdout, "%s Total evictions / take ownerships = %ld / %ld\n", cache_ptr->prefix, - (long)total_evictions, (long)total_take_ownerships); + fprintf(stdout, "%s Total evictions / take ownerships = %ld / %ld\n", cache_ptr->prefix, + (long)total_evictions, (long)total_take_ownerships); - HDfprintf(stdout, "%s Total insertions(pinned) / moves = %ld(%ld) / %ld\n", cache_ptr->prefix, - (long)total_insertions, (long)total_pinned_insertions, (long)total_moves); + fprintf(stdout, "%s Total insertions(pinned) / moves = %ld(%ld) / %ld\n", cache_ptr->prefix, + (long)total_insertions, (long)total_pinned_insertions, (long)total_moves); - HDfprintf(stdout, "%s Total entry / cache flush moves = %ld / %ld\n", cache_ptr->prefix, - (long)total_entry_flush_moves, (long)total_cache_flush_moves); + fprintf(stdout, "%s Total entry / cache flush moves = %ld / %ld\n", cache_ptr->prefix, + (long)total_entry_flush_moves, (long)total_cache_flush_moves); - HDfprintf(stdout, "%s Total entry size incrs / decrs = %ld / %ld\n", cache_ptr->prefix, - (long)total_size_increases, (long)total_size_decreases); + fprintf(stdout, "%s Total entry size incrs / decrs = %ld / %ld\n", cache_ptr->prefix, + (long)total_size_increases, (long)total_size_decreases); - HDfprintf(stdout, "%s Ttl entry/cache flush size changes = %ld / %ld\n", cache_ptr->prefix, - (long)total_entry_flush_size_changes, (long)total_cache_flush_size_changes); + fprintf(stdout, "%s Ttl entry/cache flush size changes = %ld / %ld\n", cache_ptr->prefix, + (long)total_entry_flush_size_changes, (long)total_cache_flush_size_changes); - HDfprintf(stdout, "%s Total entry pins (dirty) / unpins = %ld (%ld) / %ld\n", cache_ptr->prefix, - (long)total_pins, (long)total_dirty_pins, (long)total_unpins); + fprintf(stdout, "%s Total entry pins (dirty) / unpins = %ld (%ld) / %ld\n", cache_ptr->prefix, + (long)total_pins, (long)total_dirty_pins, (long)total_unpins); - HDfprintf(stdout, "%s Total pinned flushes / clears = %ld / %ld\n", cache_ptr->prefix, - (long)total_pinned_flushes, (long)total_pinned_clears); + fprintf(stdout, "%s Total pinned flushes / clears = %ld / %ld\n", cache_ptr->prefix, + (long)total_pinned_flushes, (long)total_pinned_clears); - HDfprintf(stdout, "%s MSIC: (make space in cache) calls = %lld\n", cache_ptr->prefix, - (long long)(cache_ptr->calls_to_msic)); + fprintf(stdout, "%s MSIC: (make space in cache) calls = %lld\n", cache_ptr->prefix, + (long long)(cache_ptr->calls_to_msic)); if (cache_ptr->calls_to_msic > 0) average_entries_skipped_per_calls_to_msic = (((double)(cache_ptr->total_entries_skipped_in_msic)) / ((double)(cache_ptr->calls_to_msic))); - HDfprintf(stdout, "%s MSIC: Average/max entries skipped = %lf / %ld\n", cache_ptr->prefix, - (double)average_entries_skipped_per_calls_to_msic, - (long)(cache_ptr->max_entries_skipped_in_msic)); + fprintf(stdout, "%s MSIC: Average/max entries skipped = %lf / %ld\n", cache_ptr->prefix, + (double)average_entries_skipped_per_calls_to_msic, + (long)(cache_ptr->max_entries_skipped_in_msic)); if (cache_ptr->calls_to_msic > 0) average_dirty_pf_entries_skipped_per_call_to_msic = (((double)(cache_ptr->total_dirty_pf_entries_skipped_in_msic)) / ((double)(cache_ptr->calls_to_msic))); - HDfprintf(stdout, "%s MSIC: Average/max dirty pf entries skipped = %lf / %ld\n", cache_ptr->prefix, - average_dirty_pf_entries_skipped_per_call_to_msic, - (long)(cache_ptr->max_dirty_pf_entries_skipped_in_msic)); + fprintf(stdout, "%s MSIC: Average/max dirty pf entries skipped = %lf / %ld\n", cache_ptr->prefix, + average_dirty_pf_entries_skipped_per_call_to_msic, + (long)(cache_ptr->max_dirty_pf_entries_skipped_in_msic)); if (cache_ptr->calls_to_msic > 0) average_entries_scanned_per_calls_to_msic = (((double)(cache_ptr->total_entries_scanned_in_msic)) / ((double)(cache_ptr->calls_to_msic))); - HDfprintf(stdout, "%s MSIC: Average/max entries scanned = %lf / %ld\n", cache_ptr->prefix, - (double)average_entries_scanned_per_calls_to_msic, - (long)(cache_ptr->max_entries_scanned_in_msic)); + fprintf(stdout, "%s MSIC: Average/max entries scanned = %lf / %ld\n", cache_ptr->prefix, + (double)average_entries_scanned_per_calls_to_msic, + (long)(cache_ptr->max_entries_scanned_in_msic)); - HDfprintf(stdout, "%s MSIC: Scanned to make space(evict) = %lld\n", cache_ptr->prefix, - (long long)(cache_ptr->entries_scanned_to_make_space)); + fprintf(stdout, "%s MSIC: Scanned to make space(evict) = %lld\n", cache_ptr->prefix, + (long long)(cache_ptr->entries_scanned_to_make_space)); - HDfprintf( - stdout, "%s MSIC: Scanned to satisfy min_clean = %lld\n", cache_ptr->prefix, - (long long)(cache_ptr->total_entries_scanned_in_msic - cache_ptr->entries_scanned_to_make_space)); + fprintf(stdout, "%s MSIC: Scanned to satisfy min_clean = %lld\n", cache_ptr->prefix, + (long long)(cache_ptr->total_entries_scanned_in_msic - cache_ptr->entries_scanned_to_make_space)); - HDfprintf(stdout, "%s slist/LRU/index scan restarts = %lld / %lld / %lld.\n", cache_ptr->prefix, - (long long)(cache_ptr->slist_scan_restarts), (long long)(cache_ptr->LRU_scan_restarts), - (long long)(cache_ptr->index_scan_restarts)); + fprintf(stdout, "%s slist/LRU/index scan restarts = %lld / %lld / %lld.\n", cache_ptr->prefix, + (long long)(cache_ptr->slist_scan_restarts), (long long)(cache_ptr->LRU_scan_restarts), + (long long)(cache_ptr->index_scan_restarts)); - HDfprintf(stdout, "%s cache image creations/reads/loads/size = %d / %d /%d / %" PRIuHSIZE "\n", - cache_ptr->prefix, cache_ptr->images_created, cache_ptr->images_read, cache_ptr->images_loaded, - cache_ptr->last_image_size); + fprintf(stdout, "%s cache image creations/reads/loads/size = %d / %d /%d / %" PRIuHSIZE "\n", + cache_ptr->prefix, cache_ptr->images_created, cache_ptr->images_read, cache_ptr->images_loaded, + cache_ptr->last_image_size); - HDfprintf(stdout, "%s prefetches / dirty prefetches = %lld / %lld\n", cache_ptr->prefix, - (long long)(cache_ptr->prefetches), (long long)(cache_ptr->dirty_prefetches)); + fprintf(stdout, "%s prefetches / dirty prefetches = %lld / %lld\n", cache_ptr->prefix, + (long long)(cache_ptr->prefetches), (long long)(cache_ptr->dirty_prefetches)); - HDfprintf(stdout, "%s prefetch hits/flushes/evictions = %lld / %lld / %lld\n", cache_ptr->prefix, - (long long)(cache_ptr->prefetch_hits), - (long long)(cache_ptr->flushes[H5AC_PREFETCHED_ENTRY_ID]), - (long long)(cache_ptr->evictions[H5AC_PREFETCHED_ENTRY_ID])); + fprintf(stdout, "%s prefetch hits/flushes/evictions = %lld / %lld / %lld\n", cache_ptr->prefix, + (long long)(cache_ptr->prefetch_hits), (long long)(cache_ptr->flushes[H5AC_PREFETCHED_ENTRY_ID]), + (long long)(cache_ptr->evictions[H5AC_PREFETCHED_ENTRY_ID])); if (cache_ptr->prefetches > 0) prefetch_use_rate = 100.0 * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches)); else prefetch_use_rate = 0.0; - HDfprintf(stdout, "%s prefetched entry use rate = %lf\n", cache_ptr->prefix, prefetch_use_rate); + fprintf(stdout, "%s prefetched entry use rate = %lf\n", cache_ptr->prefix, prefetch_use_rate); #if H5C_COLLECT_CACHE_ENTRY_STATS - HDfprintf(stdout, "%s aggregate max / min accesses = %d / %d\n", cache_ptr->prefix, - (int)aggregate_max_accesses, (int)aggregate_min_accesses); + fprintf(stdout, "%s aggregate max / min accesses = %d / %d\n", cache_ptr->prefix, + (int)aggregate_max_accesses, (int)aggregate_min_accesses); - HDfprintf(stdout, "%s aggregate max_clears / max_flushes = %d / %d\n", cache_ptr->prefix, - (int)aggregate_max_clears, (int)aggregate_max_flushes); + fprintf(stdout, "%s aggregate max_clears / max_flushes = %d / %d\n", cache_ptr->prefix, + (int)aggregate_max_clears, (int)aggregate_max_flushes); - HDfprintf(stdout, "%s aggregate max_size / max_pins = %d / %d\n", cache_ptr->prefix, - (int)aggregate_max_size, (int)aggregate_max_pins); + fprintf(stdout, "%s aggregate max_size / max_pins = %d / %d\n", cache_ptr->prefix, + (int)aggregate_max_size, (int)aggregate_max_pins); #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ if (display_detailed_stats) { for (i = 0; i <= cache_ptr->max_type_id; i++) { - HDfprintf(stdout, "\n"); + fprintf(stdout, "\n"); - HDfprintf(stdout, "%s Stats on %s:\n", cache_ptr->prefix, - ((cache_ptr->class_table_ptr))[i]->name); + fprintf(stdout, "%s Stats on %s:\n", cache_ptr->prefix, ((cache_ptr->class_table_ptr))[i]->name); if ((cache_ptr->hits[i] > 0) || (cache_ptr->misses[i] > 0)) hit_rate = 100.0 * ((double)(cache_ptr->hits[i])) / @@ -639,56 +636,56 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name, else hit_rate = 0.0; - HDfprintf(stdout, "%s hits / misses / hit_rate = %ld / %ld / %f\n", cache_ptr->prefix, - (long)(cache_ptr->hits[i]), (long)(cache_ptr->misses[i]), hit_rate); + fprintf(stdout, "%s hits / misses / hit_rate = %ld / %ld / %f\n", cache_ptr->prefix, + (long)(cache_ptr->hits[i]), (long)(cache_ptr->misses[i]), hit_rate); - HDfprintf(stdout, "%s write / read (max) protects = %ld / %ld (%d)\n", cache_ptr->prefix, - (long)(cache_ptr->write_protects[i]), (long)(cache_ptr->read_protects[i]), - (int)(cache_ptr->max_read_protects[i])); + fprintf(stdout, "%s write / read (max) protects = %ld / %ld (%d)\n", cache_ptr->prefix, + (long)(cache_ptr->write_protects[i]), (long)(cache_ptr->read_protects[i]), + (int)(cache_ptr->max_read_protects[i])); - HDfprintf(stdout, "%s clears / flushes = %ld / %ld\n", cache_ptr->prefix, - (long)(cache_ptr->clears[i]), (long)(cache_ptr->flushes[i])); + fprintf(stdout, "%s clears / flushes = %ld / %ld\n", cache_ptr->prefix, + (long)(cache_ptr->clears[i]), (long)(cache_ptr->flushes[i])); - HDfprintf(stdout, "%s evictions / take ownerships = %ld / %ld\n", cache_ptr->prefix, - (long)(cache_ptr->evictions[i]), (long)(cache_ptr->take_ownerships[i])); + fprintf(stdout, "%s evictions / take ownerships = %ld / %ld\n", cache_ptr->prefix, + (long)(cache_ptr->evictions[i]), (long)(cache_ptr->take_ownerships[i])); - HDfprintf(stdout, "%s insertions(pinned) / moves = %ld(%ld) / %ld\n", cache_ptr->prefix, - (long)(cache_ptr->insertions[i]), (long)(cache_ptr->pinned_insertions[i]), - (long)(cache_ptr->moves[i])); + fprintf(stdout, "%s insertions(pinned) / moves = %ld(%ld) / %ld\n", cache_ptr->prefix, + (long)(cache_ptr->insertions[i]), (long)(cache_ptr->pinned_insertions[i]), + (long)(cache_ptr->moves[i])); - HDfprintf(stdout, "%s entry / cache flush moves = %ld / %ld\n", cache_ptr->prefix, - (long)(cache_ptr->entry_flush_moves[i]), (long)(cache_ptr->cache_flush_moves[i])); + fprintf(stdout, "%s entry / cache flush moves = %ld / %ld\n", cache_ptr->prefix, + (long)(cache_ptr->entry_flush_moves[i]), (long)(cache_ptr->cache_flush_moves[i])); - HDfprintf(stdout, "%s size increases / decreases = %ld / %ld\n", cache_ptr->prefix, - (long)(cache_ptr->size_increases[i]), (long)(cache_ptr->size_decreases[i])); + fprintf(stdout, "%s size increases / decreases = %ld / %ld\n", cache_ptr->prefix, + (long)(cache_ptr->size_increases[i]), (long)(cache_ptr->size_decreases[i])); - HDfprintf(stdout, "%s entry/cache flush size changes = %ld / %ld\n", cache_ptr->prefix, - (long)(cache_ptr->entry_flush_size_changes[i]), - (long)(cache_ptr->cache_flush_size_changes[i])); + fprintf(stdout, "%s entry/cache flush size changes = %ld / %ld\n", cache_ptr->prefix, + (long)(cache_ptr->entry_flush_size_changes[i]), + (long)(cache_ptr->cache_flush_size_changes[i])); - HDfprintf(stdout, "%s entry pins / unpins = %ld / %ld\n", cache_ptr->prefix, - (long)(cache_ptr->pins[i]), (long)(cache_ptr->unpins[i])); + fprintf(stdout, "%s entry pins / unpins = %ld / %ld\n", cache_ptr->prefix, + (long)(cache_ptr->pins[i]), (long)(cache_ptr->unpins[i])); - HDfprintf(stdout, "%s entry dirty pins/pin'd flushes = %ld / %ld\n", cache_ptr->prefix, - (long)(cache_ptr->dirty_pins[i]), (long)(cache_ptr->pinned_flushes[i])); + fprintf(stdout, "%s entry dirty pins/pin'd flushes = %ld / %ld\n", cache_ptr->prefix, + (long)(cache_ptr->dirty_pins[i]), (long)(cache_ptr->pinned_flushes[i])); #if H5C_COLLECT_CACHE_ENTRY_STATS - HDfprintf(stdout, "%s entry max / min accesses = %d / %d\n", cache_ptr->prefix, - cache_ptr->max_accesses[i], cache_ptr->min_accesses[i]); + fprintf(stdout, "%s entry max / min accesses = %d / %d\n", cache_ptr->prefix, + cache_ptr->max_accesses[i], cache_ptr->min_accesses[i]); - HDfprintf(stdout, "%s entry max_clears / max_flushes = %d / %d\n", cache_ptr->prefix, - cache_ptr->max_clears[i], cache_ptr->max_flushes[i]); + fprintf(stdout, "%s entry max_clears / max_flushes = %d / %d\n", cache_ptr->prefix, + cache_ptr->max_clears[i], cache_ptr->max_flushes[i]); - HDfprintf(stdout, "%s entry max_size / max_pins = %d / %d\n", cache_ptr->prefix, - (int)(cache_ptr->max_size[i]), (int)(cache_ptr->max_pins[i])); + fprintf(stdout, "%s entry max_size / max_pins = %d / %d\n", cache_ptr->prefix, + (int)(cache_ptr->max_size[i]), (int)(cache_ptr->max_pins[i])); #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ } /* end for */ } /* end if */ - HDfprintf(stdout, "\n"); + fprintf(stdout, "\n"); #endif /* H5C_COLLECT_CACHE_STATS */ @@ -723,8 +720,8 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED *cache_ptr) int i; #endif /* H5C_COLLECT_CACHE_STATS */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + assert(cache_ptr); + assert(cache_ptr->magic == H5C__H5C_T_MAGIC); #if H5C_COLLECT_CACHE_STATS for (i = 0; i <= cache_ptr->max_type_id; i++) { @@ -847,29 +844,29 @@ H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, haddr_t child FUNC_ENTER_NOAPI(NULL) /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(H5F_addr_defined(parent_addr)); - HDassert(H5F_addr_defined(child_addr)); - HDassert(fd_exists_ptr); + assert(cache_ptr); + assert(cache_ptr->magic == H5C__H5C_T_MAGIC); + assert(H5F_addr_defined(parent_addr)); + assert(H5F_addr_defined(child_addr)); + assert(fd_exists_ptr); H5C__SEARCH_INDEX(cache_ptr, parent_addr, parent_ptr, FAIL) H5C__SEARCH_INDEX(cache_ptr, child_addr, child_ptr, FAIL) if (parent_ptr && child_ptr) { - HDassert(parent_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(child_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + assert(parent_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + assert(child_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); if (child_ptr->flush_dep_nparents > 0) { unsigned u; /* Local index variable */ - HDassert(child_ptr->flush_dep_parent); - HDassert(child_ptr->flush_dep_parent_nalloc >= child_ptr->flush_dep_nparents); + assert(child_ptr->flush_dep_parent); + assert(child_ptr->flush_dep_parent_nalloc >= child_ptr->flush_dep_nparents); for (u = 0; u < child_ptr->flush_dep_nparents; u++) { if (child_ptr->flush_dep_parent[u] == parent_ptr) { fd_exists = TRUE; - HDassert(parent_ptr->flush_dep_nchildren > 0); + assert(parent_ptr->flush_dep_nchildren > 0); break; } /* end if */ } /* end for */ @@ -918,8 +915,8 @@ H5C_validate_index_list(H5C_t *cache_ptr) FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + assert(cache_ptr); + assert(cache_ptr->magic == H5C__H5C_T_MAGIC); for (i = 0; i < H5C_RING_NTYPES; i++) { index_ring_len[i] = 0; @@ -952,8 +949,8 @@ H5C_validate_index_list(H5C_t *cache_ptr) ((entry_ptr->il_next == NULL) || (entry_ptr->il_next->il_prev != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointers for entry are invalid") - HDassert(entry_ptr->ring > 0); - HDassert(entry_ptr->ring < H5C_RING_NTYPES); + assert(entry_ptr->ring > 0); + assert(entry_ptr->ring < H5C_RING_NTYPES); len++; index_ring_len[entry_ptr->ring] += 1; @@ -993,7 +990,7 @@ H5C_validate_index_list(H5C_t *cache_ptr) done: if (ret_value != SUCCEED) - HDassert(0); + assert(0); FUNC_LEAVE_NOAPI(ret_value) } /* H5C_validate_index_list() */ @@ -1045,10 +1042,10 @@ H5C_get_entry_ptr_from_addr(H5C_t *cache_ptr, haddr_t addr, void **entry_ptr_ptr FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(H5F_addr_defined(addr)); - HDassert(entry_ptr_ptr); + assert(cache_ptr); + assert(cache_ptr->magic == H5C__H5C_T_MAGIC); + assert(H5F_addr_defined(addr)); + assert(entry_ptr_ptr); H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) @@ -1089,8 +1086,8 @@ H5C_get_serialization_in_progress(const H5C_t *cache_ptr) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + assert(cache_ptr); + assert(cache_ptr->magic == H5C__H5C_T_MAGIC); FUNC_LEAVE_NOAPI(cache_ptr->serialization_in_progress) } /* H5C_get_serialization_in_progress() */ @@ -1123,10 +1120,10 @@ H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(inner_ring >= H5C_RING_USER); - HDassert(inner_ring <= H5C_RING_SB); + assert(cache_ptr); + assert(cache_ptr->magic == H5C__H5C_T_MAGIC); + assert(inner_ring >= H5C_RING_USER); + assert(inner_ring <= H5C_RING_SB); while (ring <= inner_ring) { if (cache_ptr->dirty_index_ring_size[ring] > 0) @@ -1176,12 +1173,12 @@ H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_class_t *expecte FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(H5F_addr_defined(addr)); - HDassert(expected_type); - HDassert(in_cache_ptr); - HDassert(type_ok_ptr); + assert(cache_ptr); + assert(cache_ptr->magic == H5C__H5C_T_MAGIC); + assert(H5F_addr_defined(addr)); + assert(expected_type); + assert(in_cache_ptr); + assert(type_ok_ptr); H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) |