summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-03-20 22:39:21 (GMT)
committerGitHub <noreply@github.com>2023-03-20 22:39:21 (GMT)
commitfd5d0944e23d0ba966e7244f9e3314b84cc45f30 (patch)
treeec7c054083dec36e454bcb203f8c11f08e18527e /src
parentb766e5f96f26805e8c92e718a05f42d073912711 (diff)
downloadhdf5-fd5d0944e23d0ba966e7244f9e3314b84cc45f30.zip
hdf5-fd5d0944e23d0ba966e7244f9e3314b84cc45f30.tar.gz
hdf5-fd5d0944e23d0ba966e7244f9e3314b84cc45f30.tar.bz2
[1.10 Merge] Add Developer build mode to CMake (#2617)
* Add Developer build mode to CMake (#1659) * Add Developer build mode to CMake * Set a few CMake variables for Developer build modes * Refactor enabling of debug and developer-level compile definitions * Convert cache debugging macros to normal ifdef style Normal ifdef-style instead of if-style allows build system to define macros without warning about redefining macros with different values (0 vs. 1) * Add HDF5 Developer compile definitions to testing files * Temporarily disable -fanalyzer flag for GCC 12+ Developer builds * Fix Java tests for Developer build modes (#2079) * Minor adjustment of Developer build mode changes for 1.10 branch
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt10
-rw-r--r--src/H5AC.c2
-rw-r--r--src/H5ACmpio.c14
-rw-r--r--src/H5ACpkg.h4
-rw-r--r--src/H5ACprivate.h2
-rw-r--r--src/H5C.c86
-rw-r--r--src/H5Cmpio.c44
-rw-r--r--src/H5Cpkg.h20
-rw-r--r--src/H5Cprivate.h32
-rw-r--r--src/H5Ctag.c4
-rw-r--r--src/H5EAprivate.h4
11 files changed, 110 insertions, 112 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f7e29d4..2e23cad 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1085,10 +1085,6 @@ if (BUILD_SHARED_LIBS)
)
endif ()
-## all_packages="AC,B,B2,D,F,FA,FL,FS,HL,I,O,S,ST,T,Z"
-#all_packages="AC,B2,CX,D,F,HL,I,O,S,ST,T,Z"
-option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF)
-
#-----------------------------------------------------------------------------
# Add H5Tinit source to build - generated by H5detect/CMake at configure time
#-----------------------------------------------------------------------------
@@ -1111,7 +1107,8 @@ if (BUILD_STATIC_LIBS)
${HDF_EXTRA_FLAGS}
PRIVATE
$<$<BOOL:${HDF5_ENABLE_TRACE}>:H5_DEBUG_API> # Enable tracing of the API
- $<$<BOOL:${HDF5_ENABLE_DEBUG_APIS}>:H5Z_DEBUG;H5T_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG>
+ $<$<BOOL:${HDF5_ENABLE_DEBUG_APIS}>:${HDF5_DEBUG_APIS}>
+ $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
)
TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC)
target_link_libraries (${HDF5_LIB_TARGET}
@@ -1153,7 +1150,8 @@ if (BUILD_SHARED_LIBS)
PRIVATE
$<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:H5_HAVE_THREADSAFE>
$<$<BOOL:${HDF5_ENABLE_TRACE}>:H5_DEBUG_API> # Enable tracing of the API
- $<$<BOOL:${HDF5_ENABLE_DEBUG_APIS}>:H5Z_DEBUG;H5T_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG>
+ $<$<BOOL:${HDF5_ENABLE_DEBUG_APIS}>:${HDF5_DEBUG_APIS}>
+ $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
)
TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_LIBSH_TARGET}
diff --git a/src/H5AC.c b/src/H5AC.c
index feffa21..8aad330 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -316,7 +316,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co
aux_ptr->dirty_bytes_threshold = H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD;
aux_ptr->dirty_bytes = 0;
aux_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY;
-#if H5AC_DEBUG_DIRTY_BYTES_CREATION
+#ifdef H5AC_DEBUG_DIRTY_BYTES_CREATION
aux_ptr->dirty_bytes_propagations = 0;
aux_ptr->unprotect_dirty_bytes = 0;
aux_ptr->unprotect_dirty_bytes_updates = 0;
diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c
index c0a9856..a7da851 100644
--- a/src/H5ACmpio.c
+++ b/src/H5ACmpio.c
@@ -763,7 +763,7 @@ H5AC__log_dirtied_entry(const H5AC_info_t *entry_ptr)
HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "can't insert entry into dirty entry slist.")
aux_ptr->dirty_bytes += entry_ptr->size;
-#if H5AC_DEBUG_DIRTY_BYTES_CREATION
+#ifdef H5AC_DEBUG_DIRTY_BYTES_CREATION
aux_ptr->unprotect_dirty_bytes += entry_ptr->size;
aux_ptr->unprotect_dirty_bytes_updates += 1;
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
@@ -778,7 +778,7 @@ H5AC__log_dirtied_entry(const H5AC_info_t *entry_ptr)
} /* end if */
else {
aux_ptr->dirty_bytes += entry_ptr->size;
-#if H5AC_DEBUG_DIRTY_BYTES_CREATION
+#ifdef H5AC_DEBUG_DIRTY_BYTES_CREATION
aux_ptr->unprotect_dirty_bytes += entry_ptr->size;
aux_ptr->unprotect_dirty_bytes_updates += 1;
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
@@ -976,7 +976,7 @@ H5AC__log_inserted_entry(const H5AC_info_t *entry_ptr)
aux_ptr->dirty_bytes += entry_ptr->size;
-#if H5AC_DEBUG_DIRTY_BYTES_CREATION
+#ifdef H5AC_DEBUG_DIRTY_BYTES_CREATION
aux_ptr->insert_dirty_bytes += entry_ptr->size;
aux_ptr->insert_dirty_bytes_updates += 1;
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
@@ -1093,7 +1093,7 @@ H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr)
aux_ptr->dirty_bytes += entry_size;
-#if H5AC_DEBUG_DIRTY_BYTES_CREATION
+#ifdef H5AC_DEBUG_DIRTY_BYTES_CREATION
aux_ptr->move_dirty_bytes += entry_size;
aux_ptr->move_dirty_bytes_updates += 1;
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
@@ -1106,7 +1106,7 @@ H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr)
else if (!entry_dirty) {
aux_ptr->dirty_bytes += entry_size;
-#if H5AC_DEBUG_DIRTY_BYTES_CREATION
+#ifdef H5AC_DEBUG_DIRTY_BYTES_CREATION
aux_ptr->move_dirty_bytes += entry_size;
aux_ptr->move_dirty_bytes_updates += 1;
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
@@ -2117,7 +2117,7 @@ H5AC__run_sync_point(H5F_t *f, int sync_point_op)
HDassert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) ||
(sync_point_op == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED));
-#if H5AC_DEBUG_DIRTY_BYTES_CREATION
+#ifdef H5AC_DEBUG_DIRTY_BYTES_CREATION
HDfprintf(stdout, "%d:H5AC_propagate...:%u: (u/uu/i/iu/m/mu) = %zu/%u/%zu/%u/%zu/%u\n", aux_ptr->mpi_rank,
aux_ptr->dirty_bytes_propagations, aux_ptr->unprotect_dirty_bytes,
aux_ptr->unprotect_dirty_bytes_updates, aux_ptr->insert_dirty_bytes,
@@ -2180,7 +2180,7 @@ H5AC__run_sync_point(H5F_t *f, int sync_point_op)
/* reset the dirty bytes count */
aux_ptr->dirty_bytes = 0;
-#if H5AC_DEBUG_DIRTY_BYTES_CREATION
+#ifdef H5AC_DEBUG_DIRTY_BYTES_CREATION
aux_ptr->dirty_bytes_propagations += 1;
aux_ptr->unprotect_dirty_bytes = 0;
aux_ptr->unprotect_dirty_bytes_updates = 0;
diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h
index 5f59c96..45fa966 100644
--- a/src/H5ACpkg.h
+++ b/src/H5ACpkg.h
@@ -50,7 +50,7 @@ H5FL_EXTERN(H5AC_aux_t);
/* Package Private Macros */
/**************************/
-#define H5AC_DEBUG_DIRTY_BYTES_CREATION 0
+/* #define H5AC_DEBUG_DIRTY_BYTES_CREATION */
#ifdef H5_HAVE_PARALLEL
@@ -372,7 +372,7 @@ typedef struct H5AC_aux_t {
int32_t metadata_write_strategy;
-#if H5AC_DEBUG_DIRTY_BYTES_CREATION
+#ifdef H5AC_DEBUG_DIRTY_BYTES_CREATION
unsigned dirty_bytes_propagations;
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index 0c81b8f..18b89f9 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -124,7 +124,7 @@ typedef enum {
#define H5AC__DEFAULT_MIN_CLEAN_SIZE H5C__DEFAULT_MIN_CLEAN_SIZE
/* Check if we are sanity checking tagging */
-#if H5C_DO_TAGGING_SANITY_CHECKS
+#ifdef H5C_DO_TAGGING_SANITY_CHECKS
#define H5AC_DO_TAGGING_SANITY_CHECKS 1
#else
#define H5AC_DO_TAGGING_SANITY_CHECKS 0
diff --git a/src/H5C.c b/src/H5C.c
index 984185c..e8aa964 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -154,11 +154,11 @@ static herr_t H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_
static herr_t H5C__verify_len_eoa(H5F_t *f, const H5C_class_t *type, haddr_t addr, size_t *len,
hbool_t actual);
-#if H5C_DO_SLIST_SANITY_CHECKS
+#ifdef H5C_DO_SLIST_SANITY_CHECKS
static hbool_t H5C_entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr);
#endif /* H5C_DO_SLIST_SANITY_CHECKS */
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
static herr_t H5C_validate_lru_list(H5C_t *cache_ptr);
static herr_t H5C_validate_pinned_entry_list(H5C_t *cache_ptr);
static herr_t H5C_validate_protected_entry_list(H5C_t *cache_ptr);
@@ -390,7 +390,7 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id,
* slist_ptr initialized above.
*/
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
cache_ptr->slist_len_increase = 0;
cache_ptr->slist_size_increase = 0;
#endif /* H5C_DO_SANITY_CHECKS */
@@ -872,7 +872,7 @@ H5C_dest(H5F_t *f)
H5MM_xfree(cache_ptr->log_info);
#ifndef NDEBUG
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
if (cache_ptr->get_entry_ptr_from_addr_counter > 0) {
@@ -982,7 +982,7 @@ H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flag
HDassert(type);
HDassert(H5F_addr_defined(addr));
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if (H5C_validate_lru_list(cache_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -1017,7 +1017,7 @@ H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flag
HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "can't flush entry")
done:
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if (H5C_validate_lru_list(cache_ptr) < 0)
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on exit")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -1075,7 +1075,7 @@ done:
herr_t
H5C_flush_cache(H5F_t *f, unsigned flags)
{
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
int i;
uint32_t index_len = 0;
size_t index_size = (size_t)0;
@@ -1099,7 +1099,7 @@ H5C_flush_cache(H5F_t *f, unsigned flags)
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(cache_ptr->slist_ptr);
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
HDassert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0);
HDassert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0);
HDassert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0);
@@ -1125,7 +1125,7 @@ H5C_flush_cache(H5F_t *f, unsigned flags)
HDassert(cache_ptr->slist_size == slist_size);
#endif /* H5C_DO_SANITY_CHECKS */
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
@@ -1300,7 +1300,7 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u
HDassert(H5F_addr_defined(addr));
HDassert(thing);
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
/* no need to verify that entry is not already in the index as */
/* we already make that check below. */
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
@@ -1491,7 +1491,7 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u
H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL)
H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, FAIL)
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed just before done")
@@ -1530,7 +1530,7 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u
#endif
done:
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit")
@@ -1855,7 +1855,7 @@ H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type, haddr_t old_addr, hadd
HDassert(H5F_addr_defined(new_addr));
HDassert(H5F_addr_ne(old_addr, new_addr));
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
@@ -1961,7 +1961,7 @@ H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type, haddr_t old_addr, hadd
H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr)
done:
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit")
@@ -2008,7 +2008,7 @@ H5C_resize_entry(void *thing, size_t new_size)
if (!(entry_ptr->is_pinned || entry_ptr->is_protected))
HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "Entry isn't pinned or protected??")
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || (H5C_validate_pinned_entry_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -2104,7 +2104,7 @@ H5C_resize_entry(void *thing, size_t new_size)
} /* end if */
done:
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || (H5C_validate_pinned_entry_list(cache_ptr) < 0))
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -2144,7 +2144,7 @@ H5C_pin_protected_entry(void *thing)
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
@@ -2159,7 +2159,7 @@ H5C_pin_protected_entry(void *thing)
HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client")
done:
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit")
@@ -2223,7 +2223,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign
HDassert(type->mem_type == cache_ptr->class_table_ptr[type->id]->mem_type);
HDassert(H5F_addr_defined(addr));
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on entry")
@@ -2328,7 +2328,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign
} /* end if */
#endif /* H5_HAVE_PARALLEL */
-#if H5C_DO_TAGGING_SANITY_CHECKS
+#ifdef H5C_DO_TAGGING_SANITY_CHECKS
{
/* Verify tag value */
if (cache_ptr->ignore_tags != TRUE) {
@@ -2611,7 +2611,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign
#endif /* H5_HAVE_PARALLEL */
done:
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on exit")
@@ -3086,7 +3086,7 @@ H5C_unpin_entry(void *_entry_ptr)
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
@@ -3097,7 +3097,7 @@ H5C_unpin_entry(void *_entry_ptr)
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry from client")
done:
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit")
@@ -3265,7 +3265,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags)
dirtied |= entry_ptr->dirtied;
was_clean = !(entry_ptr->is_dirty);
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
@@ -3532,7 +3532,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags)
done:
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
@@ -5347,7 +5347,7 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags)
HDassert(cache_ptr->slist_ptr);
HDassert(cache_ptr->slist_enabled);
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
{
int32_t i;
uint32_t index_len = 0;
@@ -5524,7 +5524,7 @@ H5C_flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags)
H5SL_node_t *node_ptr = NULL;
H5C_cache_entry_t *entry_ptr = NULL;
H5C_cache_entry_t *next_entry_ptr = NULL;
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
uint32_t initial_slist_len = 0;
size_t initial_slist_size = 0;
#endif /* H5C_DO_SANITY_CHECKS */
@@ -5606,7 +5606,7 @@ H5C_flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags)
* that the slist will not be empty after we finish the scan.
*/
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
/* Depending on circumstances, H5C__flush_single_entry() will
* remove dirty entries from the slist as it flushes them.
* Thus for sanity checks we must make note of the initial
@@ -5782,7 +5782,7 @@ H5C_flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags)
} /* end if */
} /* end while loop scanning skip list */
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
/* It is possible that entries were added to the slist during
* the scan, either before or after scan pointer. The following
* asserts take this into account.
@@ -6045,7 +6045,7 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags)
H5SL_node_t *node_ptr = NULL;
H5C_cache_entry_t *entry_ptr = NULL;
H5C_cache_entry_t *next_entry_ptr = NULL;
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
uint32_t initial_slist_len = 0;
size_t initial_slist_size = 0;
#endif /* H5C_DO_SANITY_CHECKS */
@@ -6062,7 +6062,7 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags)
HDassert(ring > H5C_RING_UNDEFINED);
HDassert(ring < H5C_RING_NTYPES);
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
@@ -6103,7 +6103,7 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags)
flushed_entries_last_pass = FALSE;
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
/* For sanity checking, try to verify that the skip list has
* the expected size and number of entries at the end of each
* internal while loop (see below).
@@ -6276,7 +6276,7 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags)
} /* end if */
} /* while ( ( restart_slist_scan ) || ( node_ptr != NULL ) ) */
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
/* Verify that the slist size and length are as expected. */
HDassert((uint32_t)((int32_t)initial_slist_len + cache_ptr->slist_len_increase) ==
cache_ptr->slist_len);
@@ -6292,7 +6292,7 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "cache has protected items")
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
if (!flush_marked_entries) {
HDassert(cache_ptr->slist_ring_len[ring] == 0);
@@ -6489,7 +6489,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags)
} /* end if */
/* run initial sanity checks */
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
if (cache_ptr->slist_enabled) {
if (entry_ptr->in_slist) {
@@ -6590,7 +6590,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags)
HDassert(entry_ptr->is_dirty);
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
if ((cache_ptr->check_write_permitted) && (!(cache_ptr->write_permitted)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Write when writes are always forbidden!?!?!")
@@ -7760,7 +7760,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
static herr_t
H5C_validate_lru_list(H5C_t *cache_ptr)
@@ -7862,7 +7862,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
static herr_t
H5C_validate_pinned_entry_list(H5C_t *cache_ptr)
@@ -7969,7 +7969,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
static herr_t
H5C_validate_protected_entry_list(H5C_t *cache_ptr)
@@ -8072,7 +8072,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5C_DO_SLIST_SANITY_CHECKS
+#ifdef H5C_DO_SLIST_SANITY_CHECKS
static hbool_t
H5C_entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr)
@@ -8545,7 +8545,7 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t *entry, const H5C_cache_en
herr_t
H5C__serialize_cache(H5F_t *f)
{
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
int i;
uint32_t index_len = 0;
size_t index_size = (size_t)0;
@@ -8568,7 +8568,7 @@ H5C__serialize_cache(H5F_t *f)
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(cache_ptr->slist_ptr);
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
HDassert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0);
HDassert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0);
HDassert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0);
@@ -8594,7 +8594,7 @@ H5C__serialize_cache(H5F_t *f)
HDassert(cache_ptr->slist_size == slist_size);
#endif /* H5C_DO_SANITY_CHECKS */
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c
index 8c85145..6babb9c 100644
--- a/src/H5Cmpio.c
+++ b/src/H5Cmpio.c
@@ -168,7 +168,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
unsigned entries_to_clear[H5C_RING_NTYPES];
haddr_t addr;
H5C_cache_entry_t *entry_ptr = NULL;
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
haddr_t last_addr;
#endif /* H5C_DO_SANITY_CHECKS */
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
@@ -247,7 +247,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
} /* end else */
HDassert((candidate_assignment_table[mpi_size - 1] + n) == num_candidates);
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
/* Verify that the candidate assignment table has the expected form */
for (u = 1; u < (unsigned)(mpi_size - 1); u++) {
unsigned a, b;
@@ -283,7 +283,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
addr = candidates_list_ptr[u];
HDassert(H5F_addr_defined(addr));
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
if (u > 0) {
if (last_addr == addr)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "duplicate entry in cleaned list")
@@ -341,7 +341,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
} /* end if */
} /* end for */
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
m = 0;
n = 0;
for (u = 0; u < H5C_RING_NTYPES; u++) {
@@ -682,7 +682,7 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr
unsigned initial_list_len;
haddr_t addr;
unsigned pinned_entries_marked = 0;
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
unsigned protected_entries_marked = 0;
unsigned other_entries_marked = 0;
haddr_t last_addr;
@@ -703,7 +703,7 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr
HDassert(ce_array_len > 0);
HDassert(ce_array_ptr != NULL);
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if (H5C_validate_protected_entry_list(cache_ptr) < 0 || H5C_validate_pinned_entry_list(cache_ptr) < 0 ||
H5C_validate_lru_list(cache_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
@@ -712,7 +712,7 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr
for (u = 0; u < ce_array_len; u++) {
addr = ce_array_ptr[u];
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
if (u == 0)
last_addr = addr;
else {
@@ -722,7 +722,7 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "cleaned list not sorted")
} /* end else */
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if (H5C_validate_protected_entry_list(cache_ptr) < 0 ||
H5C_validate_pinned_entry_list(cache_ptr) < 0 || H5C_validate_lru_list(cache_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed in for loop")
@@ -734,14 +734,14 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr
H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL)
if (entry_ptr == NULL) {
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
HDfprintf(stdout, "H5C_mark_entries_as_clean: entry[%u] = %" PRIuHADDR " not in cache.\n", u,
addr);
#endif /* H5C_DO_SANITY_CHECKS */
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not in cache?!?!?")
} /* end if */
else if (!entry_ptr->is_dirty) {
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
HDfprintf(stdout, "H5C_mark_entries_as_clean: entry %" PRIuHADDR " is not dirty!?!\n", addr);
#endif /* H5C_DO_SANITY_CHECKS */
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not dirty?!?!?")
@@ -762,7 +762,7 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr
entry_ptr->clear_on_unprotect = TRUE;
if (entry_ptr->is_pinned)
pinned_entries_marked++;
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
else if (entry_ptr->is_protected)
protected_entries_marked++;
else
@@ -817,7 +817,7 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr
entries_examined++;
} /* end while */
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
HDassert(entries_cleared == other_entries_marked);
#endif /* H5C_DO_SANITY_CHECKS */
@@ -848,14 +848,14 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr
} /* end while */
} /* end while */
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
HDassert(entries_cleared == pinned_entries_marked + other_entries_marked);
HDassert(entries_cleared + protected_entries_marked == ce_array_len);
#endif /* H5C_DO_SANITY_CHECKS */
HDassert((entries_cleared == ce_array_len) || ((ce_array_len - entries_cleared) <= cache_ptr->pl_len));
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
u = 0;
entry_ptr = cache_ptr->pl_head_ptr;
while (entry_ptr != NULL) {
@@ -869,7 +869,7 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr
#endif /* H5C_DO_SANITY_CHECKS */
done:
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if (H5C_validate_protected_entry_list(cache_ptr) < 0 || H5C_validate_pinned_entry_list(cache_ptr) < 0 ||
H5C_validate_lru_list(cache_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit")
@@ -1119,7 +1119,7 @@ static herr_t
H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES],
unsigned entries_to_clear[H5C_RING_NTYPES])
{
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
int i;
uint32_t index_len = 0;
size_t index_size = (size_t)0;
@@ -1146,7 +1146,7 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES
HDassert(entries_to_flush[H5C_RING_UNDEFINED] == 0);
HDassert(entries_to_clear[H5C_RING_UNDEFINED] == 0);
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
HDassert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0);
HDassert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0);
HDassert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0);
@@ -1172,7 +1172,7 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES
HDassert(cache_ptr->slist_size == slist_size);
#endif /* H5C_DO_SANITY_CHECKS */
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if (H5C_validate_protected_entry_list(cache_ptr) < 0 || H5C_validate_pinned_entry_list(cache_ptr) < 0 ||
H5C_validate_lru_list(cache_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
@@ -1241,7 +1241,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu
hbool_t restart_scan = FALSE;
unsigned entries_flushed = 0;
unsigned entries_cleared = 0;
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
unsigned init_index_len;
#endif /* H5C_DO_SANITY_CHECKS */
unsigned clear_flags =
@@ -1264,13 +1264,13 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu
HDassert(ring > H5C_RING_UNDEFINED);
HDassert(ring < H5C_RING_NTYPES);
-#if H5C_DO_EXTREME_SANITY_CHECKS
+#ifdef H5C_DO_EXTREME_SANITY_CHECKS
if ((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
/* index len should not change */
init_index_len = cache_ptr->index_len;
#endif /* H5C_DO_SANITY_CHECKS */
@@ -1553,7 +1553,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu
* ( progress ) )
*/
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
HDassert(init_index_len == cache_ptr->index_len);
#endif /* H5C_DO_SANITY_CHECKS */
diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h
index 6afa38f..adc43e9 100644
--- a/src/H5Cpkg.h
+++ b/src/H5Cpkg.h
@@ -169,7 +169,7 @@
*
****************************************************************************/
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
#define H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \
if ( ( (head_ptr) == NULL ) || \
@@ -334,7 +334,7 @@ if ( ( (new_size) > (dll_size) ) || \
H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \
} /* H5C__DLL_UPDATE_FOR_SIZE_CHANGE() */
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
#define H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \
if ( ( (hd_ptr) == NULL ) || \
@@ -471,7 +471,7 @@ if ( ( (entry_ptr) == NULL ) || \
} \
} /* H5C__AUX_DLL_REMOVE() */
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
#define H5C__IL_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \
if ( ( (hd_ptr) == NULL ) || \
@@ -996,7 +996,7 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \
#define H5C__HASH_FCN(x) (int)((unsigned)((x) & H5C__HASH_MASK) >> 3)
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
#define H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) \
if ( ( (cache_ptr) == NULL ) || \
@@ -1600,7 +1600,7 @@ if ( ( (cache_ptr)->index_size != \
* two #defines are easy to confuse.
*/
-#if H5C_DO_SLIST_SANITY_CHECKS
+#ifdef H5C_DO_SLIST_SANITY_CHECKS
#define ENTRY_IN_SLIST(cache_ptr, entry_ptr) \
H5C_entry_in_skip_list((cache_ptr), (entry_ptr))
@@ -1612,7 +1612,7 @@ if ( ( (cache_ptr)->index_size != \
#endif /* H5C_DO_SLIST_SANITY_CHECKS */
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
#define H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, fail_val) \
{ \
@@ -1746,7 +1746,7 @@ if ( ( (cache_ptr)->index_size != \
*-------------------------------------------------------------------------
*/
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
#define H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, during_flush) \
{ \
HDassert( (cache_ptr) ); \
@@ -1883,7 +1883,7 @@ if ( ( (cache_ptr)->index_size != \
*-------------------------------------------------------------------------
*/
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
#define H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size) \
{ \
@@ -3307,7 +3307,7 @@ if ( ( (cache_ptr)->index_size != \
#ifdef H5_HAVE_PARALLEL
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
#define H5C__COLL_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \
if ( ( (hd_ptr) == NULL ) || \
@@ -4861,7 +4861,7 @@ struct H5C_t {
size_t slist_ring_size[H5C_RING_NTYPES];
H5SL_t * slist_ptr;
uint32_t num_last_entries;
-#if H5C_DO_SANITY_CHECKS
+#ifdef H5C_DO_SANITY_CHECKS
int32_t slist_len_increase;
int64_t slist_size_increase;
#endif /* H5C_DO_SANITY_CHECKS */
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index 5d5f9ca..e7513f9 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -206,20 +206,24 @@
#define H5C__UPDATE_PAGE_BUFFER_FLAG 0x40000 /* Set during parallel I/O */
/* Debugging/sanity checking/statistics settings */
-#ifndef NDEBUG
-#define H5C_DO_SANITY_CHECKS 1
-#define H5C_DO_SLIST_SANITY_CHECKS 0
-#define H5C_DO_TAGGING_SANITY_CHECKS 1
-#define H5C_DO_EXTREME_SANITY_CHECKS 0
-#else /* NDEBUG */
-/* With rare exceptions, the following defines should be set
- * to 0 if NDEBUG is defined
+/* #define H5C_DO_SANITY_CHECKS */
+/* #define H5C_DO_SLIST_SANITY_CHECKS */
+/* #define H5C_DO_TAGGING_SANITY_CHECKS */
+/* #define H5C_DO_EXTREME_SANITY_CHECKS */
+
+/*
+ * If not already set externally (e.g., from the build
+ * system), set a few debugging options for debug builds.
*/
-#define H5C_DO_SANITY_CHECKS 0
-#define H5C_DO_SLIST_SANITY_CHECKS 0
-#define H5C_DO_TAGGING_SANITY_CHECKS 0
-#define H5C_DO_EXTREME_SANITY_CHECKS 0
-#endif /* NDEBUG */
+#ifndef NDEBUG
+#ifndef H5C_DO_SANITY_CHECKS
+#define H5C_DO_SANITY_CHECKS
+#endif
+
+#ifndef H5C_DO_TAGGING_SANITY_CHECKS
+#define H5C_DO_TAGGING_SANITY_CHECKS
+#endif
+#endif
/* Cork actions: cork/uncork/get cork status of an object */
#define H5C__SET_CORK 0x1
@@ -2236,7 +2240,7 @@ H5_DLL herr_t H5C_force_cache_image_load(H5F_t *f);
H5_DLL herr_t H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, hbool_t match_global);
H5_DLL herr_t H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags);
H5_DLL herr_t H5C_get_tag(const void *thing, /*OUT*/ haddr_t *tag);
-#if H5C_DO_TAGGING_SANITY_CHECKS
+#ifdef H5C_DO_TAGGING_SANITY_CHECKS
herr_t H5C_verify_tag(int id, haddr_t tag);
#endif
H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f);
diff --git a/src/H5Ctag.c b/src/H5Ctag.c
index 87af41f..67f44c9 100644
--- a/src/H5Ctag.c
+++ b/src/H5Ctag.c
@@ -230,7 +230,7 @@ H5C__tag_entry(H5C_t *cache, H5C_cache_entry_t *entry)
if (!H5F_addr_defined(tag))
tag = H5AC__IGNORE_TAG;
}
-#if H5C_DO_TAGGING_SANITY_CHECKS
+#ifdef H5C_DO_TAGGING_SANITY_CHECKS
else {
/* Perform some sanity checks to ensure that a correct tag is being applied */
if (H5C_verify_tag(entry->type->id, tag) < 0)
@@ -629,7 +629,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C__mark_tagged_entries() */
-#if H5C_DO_TAGGING_SANITY_CHECKS
+#ifdef H5C_DO_TAGGING_SANITY_CHECKS
/*-------------------------------------------------------------------------
*
diff --git a/src/H5EAprivate.h b/src/H5EAprivate.h
index eddbb87..93f3fcc 100644
--- a/src/H5EAprivate.h
+++ b/src/H5EAprivate.h
@@ -150,8 +150,4 @@ H5_DLL herr_t H5EA_patch_file(H5EA_t *fa, H5F_t *f);
/* Statistics routines */
H5_DLL herr_t H5EA_get_stats(const H5EA_t *ea, H5EA_stat_t *stats);
-/* Debugging routines */
-#ifdef H5EA_DEBUGGING
-#endif /* H5EA_DEBUGGING */
-
#endif /* H5EAprivate_H */