summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MANIFEST107
-rw-r--r--README.txt2
-rwxr-xr-xbin/trace2
-rw-r--r--c++/src/Makefile.in2
-rw-r--r--c++/src/cpp_doc_config2
-rwxr-xr-xconfig/cmake/scripts/HDF518config.cmake47
-rw-r--r--config/lt_vers.am2
-rwxr-xr-xconfigure22
-rw-r--r--configure.ac2
-rw-r--r--fortran/src/Makefile.in2
-rw-r--r--hl/c++/src/Makefile.in2
-rw-r--r--hl/fortran/src/Makefile.in2
-rw-r--r--hl/src/Makefile.in2
-rw-r--r--hl/test/test_lite.c16
-rw-r--r--hl/test/test_packet.c4
-rw-r--r--hl/test/test_table.c26
-rw-r--r--release_docs/RELEASE.txt2
-rw-r--r--src/H5.c26
-rw-r--r--src/H5AC.c3041
-rw-r--r--src/H5ACpkg.h68
-rw-r--r--src/H5ACprivate.h25
-rw-r--r--src/H5ACpublic.h2
-rw-r--r--src/H5B2hdr.c2
-rw-r--r--src/H5B2pkg.h20
-rw-r--r--src/H5C.c118
-rw-r--r--src/H5Cpkg.h2656
-rw-r--r--src/H5Cprivate.h625
-rw-r--r--src/H5Dchunk.c8
-rw-r--r--src/H5Dpkg.h1
-rw-r--r--src/H5EAcache.c4
-rw-r--r--src/H5EAdblkpage.c2
-rw-r--r--src/H5EAhdr.c2
-rw-r--r--src/H5EApkg.h30
-rw-r--r--src/H5Eint.c12
-rw-r--r--src/H5F.c1
-rw-r--r--src/H5FAcache.c4
-rw-r--r--src/H5FAdblkpage.c2
-rw-r--r--src/H5FAhdr.c2
-rw-r--r--src/H5FApkg.h20
-rw-r--r--src/H5FS.c2
-rw-r--r--src/H5Fint.c80
-rw-r--r--src/H5Fpkg.h44
-rw-r--r--src/H5Fprivate.h4
-rw-r--r--src/H5Fsuper.c8
-rw-r--r--src/H5Gent.c4
-rw-r--r--src/H5Gpkg.h2
-rw-r--r--src/H5Gprivate.h8
-rw-r--r--src/H5HFcache.c16
-rw-r--r--src/H5HGcache.c10
-rw-r--r--src/H5MF.c6
-rw-r--r--src/H5MFdbg.c4
-rw-r--r--src/H5MFprivate.h2
-rw-r--r--src/H5MFsection.c2
-rw-r--r--src/H5Oprivate.h1
-rw-r--r--src/H5Pfapl.c8
-rw-r--r--src/H5SMcache.c72
-rw-r--r--src/H5public.h4
-rw-r--r--src/Makefile.in2
-rw-r--r--test/CMakeTests.cmake47
-rw-r--r--test/cache.c546
-rw-r--r--test/cache_api.c275
-rw-r--r--test/cache_common.c123
-rw-r--r--test/cache_common.h26
-rw-r--r--test/cmpd_dset.c20
-rw-r--r--test/cross_read.c2
-rw-r--r--test/dsets.c20
-rw-r--r--test/h5test.c158
-rw-r--r--test/h5test.h18
-rw-r--r--test/hyperslab.c2
-rw-r--r--test/tarray.c18
-rw-r--r--test/tattr.c10
-rw-r--r--test/tgenprop.c12
-rw-r--r--test/th5s.c2
-rw-r--r--test/tmisc.c16
-rw-r--r--test/tvltypes.c14
-rw-r--r--testpar/CMakeLists.txt1
-rw-r--r--testpar/Makefile.am5
-rw-r--r--testpar/Makefile.in24
-rw-r--r--testpar/t_cache.c422
-rw-r--r--testpar/t_init_term.c76
-rw-r--r--tools/h5dump/CMakeTestsPBITS.cmake146
-rw-r--r--tools/h5dump/testh5dumppbits.sh.in128
-rw-r--r--tools/lib/h5tools.c14
-rw-r--r--tools/testfiles/pbits/tnofilename-with-packed-bits.ddl (renamed from tools/testfiles/tnofilename-with-packed-bits.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsArray.ddl (renamed from tools/testfiles/tpbitsArray.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl (renamed from tools/testfiles/tpbitsCharLengthExceeded.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl (renamed from tools/testfiles/tpbitsCharOffsetExceeded.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsCompound.ddl (renamed from tools/testfiles/tpbitsCompound.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsIncomplete.ddl (renamed from tools/testfiles/tpbitsIncomplete.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl (renamed from tools/testfiles/tpbitsIntLengthExceeded.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl (renamed from tools/testfiles/tpbitsIntOffsetExceeded.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsLengthExceeded.ddl (renamed from tools/testfiles/tpbitsLengthExceeded.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsLengthPositive.ddl (renamed from tools/testfiles/tpbitsLengthPositive.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl (renamed from tools/testfiles/tpbitsLongLengthExceeded.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl (renamed from tools/testfiles/tpbitsLongOffsetExceeded.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsMax.ddl (renamed from tools/testfiles/tpbitsMax.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsMaxExceeded.ddl (renamed from tools/testfiles/tpbitsMaxExceeded.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsOffsetExceeded.ddl (renamed from tools/testfiles/tpbitsOffsetExceeded.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsOffsetNegative.ddl (renamed from tools/testfiles/tpbitsOffsetNegative.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsOverlapped.ddl (renamed from tools/testfiles/tpbitsOverlapped.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSigned.ddl (renamed from tools/testfiles/tpbitsSigned.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSigned2.ddl (renamed from tools/testfiles/tpbitsSigned2.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSigned4.ddl (renamed from tools/testfiles/tpbitsSigned4.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedInt.ddl (renamed from tools/testfiles/tpbitsSignedInt.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedInt4.ddl (renamed from tools/testfiles/tpbitsSignedInt4.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedInt8.ddl (renamed from tools/testfiles/tpbitsSignedInt8.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedIntWhole.ddl (renamed from tools/testfiles/tpbitsSignedIntWhole.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedLong.ddl (renamed from tools/testfiles/tpbitsSignedLong.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedLong16.ddl (renamed from tools/testfiles/tpbitsSignedLong16.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedLong8.ddl (renamed from tools/testfiles/tpbitsSignedLong8.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedLongLong.ddl (renamed from tools/testfiles/tpbitsSignedLongLong.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedLongLong16.ddl (renamed from tools/testfiles/tpbitsSignedLongLong16.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedLongLong32.ddl (renamed from tools/testfiles/tpbitsSignedLongLong32.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedLongLongWhole.ddl (renamed from tools/testfiles/tpbitsSignedLongLongWhole.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedLongLongWhole1.ddl (renamed from tools/testfiles/tpbitsSignedLongLongWhole1.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedLongLongWhole63.ddl (renamed from tools/testfiles/tpbitsSignedLongLongWhole63.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedLongWhole.ddl (renamed from tools/testfiles/tpbitsSignedLongWhole.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsSignedWhole.ddl (renamed from tools/testfiles/tpbitsSignedWhole.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsigned.ddl (renamed from tools/testfiles/tpbitsUnsigned.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsigned2.ddl (renamed from tools/testfiles/tpbitsUnsigned2.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsigned4.ddl (renamed from tools/testfiles/tpbitsUnsigned4.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedInt.ddl (renamed from tools/testfiles/tpbitsUnsignedInt.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedInt4.ddl (renamed from tools/testfiles/tpbitsUnsignedInt4.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedInt8.ddl (renamed from tools/testfiles/tpbitsUnsignedInt8.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl (renamed from tools/testfiles/tpbitsUnsignedIntWhole.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedLong.ddl (renamed from tools/testfiles/tpbitsUnsignedLong.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedLong16.ddl (renamed from tools/testfiles/tpbitsUnsignedLong16.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedLong8.ddl (renamed from tools/testfiles/tpbitsUnsignedLong8.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl (renamed from tools/testfiles/tpbitsUnsignedLongLong.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl (renamed from tools/testfiles/tpbitsUnsignedLongLong16.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl (renamed from tools/testfiles/tpbitsUnsignedLongLong32.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedLongLongWhole.ddl (renamed from tools/testfiles/tpbitsUnsignedLongLongWhole.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl (renamed from tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl (renamed from tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl (renamed from tools/testfiles/tpbitsUnsignedLongWhole.ddl)0
-rw-r--r--tools/testfiles/pbits/tpbitsUnsignedWhole.ddl (renamed from tools/testfiles/tpbitsUnsignedWhole.ddl)0
136 files changed, 4147 insertions, 5172 deletions
diff --git a/MANIFEST b/MANIFEST
index 1384bb2..ff42001 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1157,6 +1157,7 @@
./testpar/t_pshutdown.c
./testpar/t_prestart.c
./testpar/t_span_tree.c
+./testpar/t_init_term.c
./testpar/testpar.h
./testpar/testphdf5.c
./testpar/testphdf5.h
@@ -1690,60 +1691,60 @@
./tools/h5dump/errfiles/tslink-D.err
# h5dump packed bits validation
-./tools/testfiles/tnofilename-with-packed-bits.ddl
-./tools/testfiles/tpbitsLengthPositive.ddl
-./tools/testfiles/tpbitsMaxExceeded.ddl
-./tools/testfiles/tpbitsSigned.ddl
-./tools/testfiles/tpbitsSigned2.ddl
-./tools/testfiles/tpbitsSigned4.ddl
-./tools/testfiles/tpbitsSignedWhole.ddl
-./tools/testfiles/tpbitsSignedInt.ddl
-./tools/testfiles/tpbitsSignedInt4.ddl
-./tools/testfiles/tpbitsSignedInt8.ddl
-./tools/testfiles/tpbitsSignedIntWhole.ddl
-./tools/testfiles/tpbitsSignedLong.ddl
-./tools/testfiles/tpbitsSignedLong8.ddl
-./tools/testfiles/tpbitsSignedLong16.ddl
-./tools/testfiles/tpbitsSignedLongWhole.ddl
-./tools/testfiles/tpbitsSignedLongLong.ddl
-./tools/testfiles/tpbitsSignedLongLong16.ddl
-./tools/testfiles/tpbitsSignedLongLong32.ddl
-./tools/testfiles/tpbitsSignedLongLongWhole.ddl
-./tools/testfiles/tpbitsSignedLongLongWhole1.ddl
-./tools/testfiles/tpbitsSignedLongLongWhole63.ddl
-./tools/testfiles/tpbitsOffsetNegative.ddl
-./tools/testfiles/tpbitsUnsigned.ddl
-./tools/testfiles/tpbitsUnsigned2.ddl
-./tools/testfiles/tpbitsUnsigned4.ddl
-./tools/testfiles/tpbitsUnsignedWhole.ddl
-./tools/testfiles/tpbitsUnsignedInt.ddl
-./tools/testfiles/tpbitsUnsignedInt4.ddl
-./tools/testfiles/tpbitsUnsignedInt8.ddl
-./tools/testfiles/tpbitsUnsignedIntWhole.ddl
-./tools/testfiles/tpbitsUnsignedLong.ddl
-./tools/testfiles/tpbitsUnsignedLong8.ddl
-./tools/testfiles/tpbitsUnsignedLong16.ddl
-./tools/testfiles/tpbitsUnsignedLongWhole.ddl
-./tools/testfiles/tpbitsUnsignedLongLong.ddl
-./tools/testfiles/tpbitsUnsignedLongLong16.ddl
-./tools/testfiles/tpbitsUnsignedLongLong32.ddl
-./tools/testfiles/tpbitsUnsignedLongLongWhole.ddl
-./tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl
-./tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl
-./tools/testfiles/tpbitsMax.ddl
+./tools/testfiles/pbits/tnofilename-with-packed-bits.ddl
+./tools/testfiles/pbits/tpbitsLengthPositive.ddl
+./tools/testfiles/pbits/tpbitsMaxExceeded.ddl
+./tools/testfiles/pbits/tpbitsSigned.ddl
+./tools/testfiles/pbits/tpbitsSigned2.ddl
+./tools/testfiles/pbits/tpbitsSigned4.ddl
+./tools/testfiles/pbits/tpbitsSignedWhole.ddl
+./tools/testfiles/pbits/tpbitsSignedInt.ddl
+./tools/testfiles/pbits/tpbitsSignedInt4.ddl
+./tools/testfiles/pbits/tpbitsSignedInt8.ddl
+./tools/testfiles/pbits/tpbitsSignedIntWhole.ddl
+./tools/testfiles/pbits/tpbitsSignedLong.ddl
+./tools/testfiles/pbits/tpbitsSignedLong8.ddl
+./tools/testfiles/pbits/tpbitsSignedLong16.ddl
+./tools/testfiles/pbits/tpbitsSignedLongWhole.ddl
+./tools/testfiles/pbits/tpbitsSignedLongLong.ddl
+./tools/testfiles/pbits/tpbitsSignedLongLong16.ddl
+./tools/testfiles/pbits/tpbitsSignedLongLong32.ddl
+./tools/testfiles/pbits/tpbitsSignedLongLongWhole.ddl
+./tools/testfiles/pbits/tpbitsSignedLongLongWhole1.ddl
+./tools/testfiles/pbits/tpbitsSignedLongLongWhole63.ddl
+./tools/testfiles/pbits/tpbitsOffsetNegative.ddl
+./tools/testfiles/pbits/tpbitsUnsigned.ddl
+./tools/testfiles/pbits/tpbitsUnsigned2.ddl
+./tools/testfiles/pbits/tpbitsUnsigned4.ddl
+./tools/testfiles/pbits/tpbitsUnsignedWhole.ddl
+./tools/testfiles/pbits/tpbitsUnsignedInt.ddl
+./tools/testfiles/pbits/tpbitsUnsignedInt4.ddl
+./tools/testfiles/pbits/tpbitsUnsignedInt8.ddl
+./tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl
+./tools/testfiles/pbits/tpbitsUnsignedLong.ddl
+./tools/testfiles/pbits/tpbitsUnsignedLong8.ddl
+./tools/testfiles/pbits/tpbitsUnsignedLong16.ddl
+./tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl
+./tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl
+./tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl
+./tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl
+./tools/testfiles/pbits/tpbitsUnsignedLongLongWhole.ddl
+./tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl
+./tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl
+./tools/testfiles/pbits/tpbitsMax.ddl
+./tools/testfiles/pbits/tpbitsArray.ddl
+./tools/testfiles/pbits/tpbitsCompound.ddl
+./tools/testfiles/pbits/tpbitsIncomplete.ddl
+./tools/testfiles/pbits/tpbitsLengthExceeded.ddl
+./tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl
+./tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl
+./tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl
+./tools/testfiles/pbits/tpbitsOffsetExceeded.ddl
+./tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl
+./tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl
+./tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl
+./tools/testfiles/pbits/tpbitsOverlapped.ddl
./tools/testfiles/packedbits.h5
-./tools/testfiles/tpbitsArray.ddl
-./tools/testfiles/tpbitsCompound.ddl
-./tools/testfiles/tpbitsIncomplete.ddl
-./tools/testfiles/tpbitsLengthExceeded.ddl
-./tools/testfiles/tpbitsCharLengthExceeded.ddl
-./tools/testfiles/tpbitsIntLengthExceeded.ddl
-./tools/testfiles/tpbitsLongLengthExceeded.ddl
-./tools/testfiles/tpbitsOffsetExceeded.ddl
-./tools/testfiles/tpbitsCharOffsetExceeded.ddl
-./tools/testfiles/tpbitsIntOffsetExceeded.ddl
-./tools/testfiles/tpbitsLongOffsetExceeded.ddl
-./tools/testfiles/tpbitsOverlapped.ddl
# h5dump h5import validation
./tools/testfiles/out3.h5import
diff --git a/README.txt b/README.txt
index 155f050..4e8aacc 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.9.221 currently under development
+HDF5 version 1.9.222 currently under development
Please refer to the release_docs/INSTALL file for installation instructions.
------------------------------------------------------------------------------
diff --git a/bin/trace b/bin/trace
index adb2c7a..4a0e90e 100755
--- a/bin/trace
+++ b/bin/trace
@@ -198,7 +198,7 @@ sub argstring ($$$) {
# Normalize the data type by removing redundant white space,
# certain type qualifiers, and indirection.
$atype =~ s/^\bconst\b//;
- $atype =~ s/\bUNUSED\b//g;
+ $atype =~ s/\bH5_ATTR_UNUSED\b//g;
$atype =~ s/\s+/ /g;
$ptr = length $1 if $atype =~ s/(\*+)//;
$atype =~ s/^\s+//;
diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in
index 1e446dc..9df8eff 100644
--- a/c++/src/Makefile.in
+++ b/c++/src/Makefile.in
@@ -670,7 +670,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
# After making changes, run bin/reconfigure to update other configure related
# files like Makefile.in.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 211
+LT_VERS_REVISION = 212
LT_VERS_AGE = 0
# This is our main target
diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config
index d2a0d28..a4aa9af 100644
--- a/c++/src/cpp_doc_config
+++ b/c++/src/cpp_doc_config
@@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API"
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = HDF5 version 1.9.221 currently under development
+PROJECT_NUMBER = HDF5 version 1.9.222 currently under development
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
diff --git a/config/cmake/scripts/HDF518config.cmake b/config/cmake/scripts/HDF518config.cmake
index f0aceea..aee5389 100755
--- a/config/cmake/scripts/HDF518config.cmake
+++ b/config/cmake/scripts/HDF518config.cmake
@@ -9,7 +9,8 @@
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
set(CTEST_SOURCE_VERSION 1.8.15)
-set(CTEST_SOURCE_NAME hdf5-${CTEST_SOURCE_VERSION})
+set(CTEST_SOURCE_VERSEXT "")
+set(CTEST_SOURCE_NAME hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT})
set(CTEST_BINARY_NAME "build")
set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}")
if(WIN32)
@@ -86,7 +87,7 @@ set(SITE_BUILDNAME_SUFFIX "STATIC")
#set(LOCAL_UPDATE "TRUE")
set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8")
#uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows
-#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}")
+#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}")
###################################################################
###################################################################
@@ -100,7 +101,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
#### ext libraries ####
### ext libs from tgz
-set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=\"${CTEST_SCRIPT_DIRECTORY}\"")
+set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}")
### ext libs from svn
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=SVN")
### ext libs on system
@@ -131,41 +132,41 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON")
if(WIN32)
include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake)
- if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.exe")
- file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe")
+ file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
- if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.msi")
- file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi")
+ file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
- if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.zip")
- file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip")
+ file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
else()
include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake)
if(APPLE)
- if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.dmg")
- file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg")
+ file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
- if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.tar.gz")
- file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz")
+ file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
- if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.sh")
- file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh")
+ file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
else()
if(CYGWIN)
- if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.sh")
- file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh")
+ file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
- if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.tar.gz")
- file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz")
+ file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
else()
- if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.sh")
- file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh")
+ file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
- if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.tar.gz")
- file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
+ if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz")
+ file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
endif()
endif()
diff --git a/config/lt_vers.am b/config/lt_vers.am
index ac9150e..f9e6f77 100644
--- a/config/lt_vers.am
+++ b/config/lt_vers.am
@@ -19,7 +19,7 @@
# After making changes, run bin/reconfigure to update other configure related
# files like Makefile.in.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 211
+LT_VERS_REVISION = 212
LT_VERS_AGE = 0
## If the API changes *at all*, increment LT_VERS_INTERFACE and
diff --git a/configure b/configure
index de77d27..6812849 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for HDF5 1.9.221.
+# Generated by GNU Autoconf 2.69 for HDF5 1.9.222.
#
# Report bugs to <help@hdfgroup.org>.
#
@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='HDF5'
PACKAGE_TARNAME='hdf5'
-PACKAGE_VERSION='1.9.221'
-PACKAGE_STRING='HDF5 1.9.221'
+PACKAGE_VERSION='1.9.222'
+PACKAGE_STRING='HDF5 1.9.222'
PACKAGE_BUGREPORT='help@hdfgroup.org'
PACKAGE_URL=''
@@ -1472,7 +1472,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures HDF5 1.9.221 to adapt to many kinds of systems.
+\`configure' configures HDF5 1.9.222 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1542,7 +1542,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of HDF5 1.9.221:";;
+ short | recursive ) echo "Configuration of HDF5 1.9.222:";;
esac
cat <<\_ACEOF
@@ -1731,7 +1731,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-HDF5 configure 1.9.221
+HDF5 configure 1.9.222
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2668,7 +2668,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by HDF5 $as_me 1.9.221, which was
+It was created by HDF5 $as_me 1.9.222, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3539,7 +3539,7 @@ fi
# Define the identity of the package.
PACKAGE='hdf5'
- VERSION='1.9.221'
+ VERSION='1.9.222'
cat >>confdefs.h <<_ACEOF
@@ -28577,7 +28577,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-HDF5 config.lt 1.9.221
+HDF5 config.lt 1.9.222
configured by $0, generated by GNU Autoconf 2.69.
Copyright (C) 2011 Free Software Foundation, Inc.
@@ -30693,7 +30693,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by HDF5 $as_me 1.9.221, which was
+This file was extended by HDF5 $as_me 1.9.222, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -30759,7 +30759,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-HDF5 config.status 1.9.221
+HDF5 config.status 1.9.222
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 4cc4c96..7229453 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ AC_PREREQ([2.69])
## NOTE: Do not forget to change the version number here when we do a
## release!!!
##
-AC_INIT([HDF5], [1.9.221], [help@hdfgroup.org])
+AC_INIT([HDF5], [1.9.222], [help@hdfgroup.org])
AC_CONFIG_SRCDIR([src/H5.c])
AC_CONFIG_HEADER([src/H5config.h])
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index 4c15976..2c36b8c 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -724,7 +724,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
# After making changes, run bin/reconfigure to update other configure related
# files like Makefile.in.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 211
+LT_VERS_REVISION = 212
LT_VERS_AGE = 0
AM_FCLIBS = $(LIBHDF5)
diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in
index 5b0071b..6b6bc67 100644
--- a/hl/c++/src/Makefile.in
+++ b/hl/c++/src/Makefile.in
@@ -662,7 +662,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
# After making changes, run bin/reconfigure to update other configure related
# files like Makefile.in.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 211
+LT_VERS_REVISION = 212
LT_VERS_AGE = 0
# This is our main target
diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in
index a0d0bc0..8820964 100644
--- a/hl/fortran/src/Makefile.in
+++ b/hl/fortran/src/Makefile.in
@@ -680,7 +680,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
# After making changes, run bin/reconfigure to update other configure related
# files like Makefile.in.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 211
+LT_VERS_REVISION = 212
LT_VERS_AGE = 0
# Our main target, the high-level fortran library
diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in
index 3ed70ec..314b11d 100644
--- a/hl/src/Makefile.in
+++ b/hl/src/Makefile.in
@@ -661,7 +661,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
# After making changes, run bin/reconfigure to update other configure related
# files like Makefile.in.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 211
+LT_VERS_REVISION = 212
LT_VERS_AGE = 0
# This library is our main target.
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index 2337610..d4e5f93 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -300,7 +300,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
- if(!FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
+ if(!H5_FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
goto out;
}
}
@@ -311,7 +311,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
- if(!FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
+ if(!H5_FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
goto out;
}
}
@@ -336,7 +336,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
- if(!DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
+ if(!H5_DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
goto out;
}
}
@@ -347,7 +347,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
- if(!DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
+ if(!H5_DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
goto out;
}
}
@@ -959,7 +959,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
- if(!FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
+ if(!H5_FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
return -1;
}
}
@@ -970,7 +970,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
- if(!FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
+ if(!H5_FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
return -1;
}
}
@@ -1003,7 +1003,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
- if(!DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
+ if(!H5_DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
return -1;
}
}
@@ -1014,7 +1014,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
- if(!DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
+ if(!H5_DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
return -1;
}
}
diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c
index 256892b..345aecb 100644
--- a/hl/test/test_packet.c
+++ b/hl/test/test_packet.c
@@ -75,8 +75,8 @@ static int cmp_par(size_t i, size_t j, particle_t *rbuf, particle_t *wbuf )
if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
- !FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
- !DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) ) {
+ !H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
+ !H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) ) {
return -1;
}
return 0;
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index 3bc5e5f..c9c3c19 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -166,8 +166,8 @@ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf )
if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
- !FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
- !DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
+ !H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
+ !H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
{
HDfprintf(stderr,"read and write buffers have differences\n");
HDfprintf(stderr,"%s %ld %f %f %d\n",
@@ -1140,7 +1140,7 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
- !FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
+ !H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
{
HDfprintf(stderr,"%ld %f %d\n",
rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].lati);
@@ -1202,7 +1202,7 @@ static int test_table(hid_t fid, int do_write)
/* Compare the extracted table with the initial values */
for ( i = 0; i < NRECORDS; i++ )
{
- if ( !FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
+ if ( !H5_FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
goto out;
}
}
@@ -1265,7 +1265,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
- !FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
goto out;
}
}
@@ -1294,7 +1294,7 @@ static int test_table(hid_t fid, int do_write)
{
hsize_t iistart = start;
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) ||
- !FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
goto out;
}
}
@@ -1353,7 +1353,7 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
- !FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
+ !H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
goto out;
}
}
@@ -1406,7 +1406,7 @@ static int test_table(hid_t fid, int do_write)
/* compare the extracted table with the initial values */
for( i = 0; i < NRECORDS; i++ )
{
- if ( !FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
+ if ( !H5_FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
goto out;
}
}
@@ -1472,7 +1472,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
- !FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
goto out;
}
}
@@ -1503,7 +1503,7 @@ static int test_table(hid_t fid, int do_write)
{
int iistart = (int) start;
if ( ( HDstrcmp( namepre_out[i].name, wbuf[iistart+(int)i].name ) != 0 ) ||
- !FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
goto out;
}
}
@@ -1546,8 +1546,8 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) ||
rbuf2[i].lati != wbuf[i].lati ||
rbuf2[i].longi != wbuf[i].longi ||
- !FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
- !DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
+ !H5_FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
+ !H5_DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
rbuf2[i].new_field != buf_new[i] ) {
goto out;
}
@@ -1587,7 +1587,7 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) ||
rbuf3[i].lati != wbuf[i].lati ||
rbuf3[i].longi != wbuf[i].longi ||
- !DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
+ !H5_DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
goto out;
}
}
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index df1117b..18b800e 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.9.221 currently under development
+HDF5 version 1.9.222 currently under development
================================================================================
diff --git a/src/H5.c b/src/H5.c
index f3cf6e7..27f05ee 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -115,26 +115,27 @@ H5_init_library(void)
#ifdef H5_HAVE_PARALLEL
{
int mpi_initialized;
+ int mpi_finalized;
int mpi_code;
MPI_Initialized(&mpi_initialized);
+ MPI_Finalized(&mpi_finalized);
#ifdef H5_HAVE_MPE
/* Initialize MPE instrumentation library. */
- if (!H5_MPEinit_g)
- {
- int mpe_code;
- if (mpi_initialized){
- mpe_code = MPE_Init_log();
- HDassert(mpe_code >=0);
- H5_MPEinit_g = TRUE;
- }
+ if (!H5_MPEinit_g) {
+ int mpe_code;
+ if (mpi_initialized && !mpi_finalized) {
+ mpe_code = MPE_Init_log();
+ HDassert(mpe_code >=0);
+ H5_MPEinit_g = TRUE;
}
+ }
#endif /*H5_HAVE_MPE*/
/* add an attribute on MPI_COMM_SELF to call H5_term_library
when it is destroyed, i.e. on MPI_Finalize */
- if (mpi_initialized) {
+ if (mpi_initialized && !mpi_finalized) {
int key_val;
if(MPI_SUCCESS != (mpi_code = MPI_Comm_create_keyval(MPI_NULL_COPY_FN,
@@ -338,11 +339,14 @@ H5_term_library(void)
* down if any of the below code involves using the instrumentation code.
*/
if(H5_MPEinit_g) {
- int mpe_code;
int mpi_initialized;
+ int mpi_finalized;
+ int mpe_code;
MPI_Initialized(&mpi_initialized);
- if(mpi_initialized) {
+ MPI_Finalized(&mpi_finalized);
+
+ if (mpi_initialized && !mpi_finalized) {
mpe_code = MPE_Finish_log("h5log");
HDassert(mpe_code >=0);
} /* end if */
diff --git a/src/H5AC.c b/src/H5AC.c
index 9f5b88d..db5a06f 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -27,6 +27,10 @@
*-------------------------------------------------------------------------
*/
+/****************/
+/* Module Setup */
+/****************/
+
#define H5AC_PACKAGE /*suppress error about including H5ACpkg */
#define H5C_PACKAGE /*suppress error about including H5Cpkg */
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
@@ -34,10 +38,9 @@
/* Interface initialization */
#define H5_INTERFACE_INIT_FUNC H5AC_init_interface
-#ifdef H5_HAVE_PARALLEL
-#include <mpi.h>
-#endif /* H5_HAVE_PARALLEL */
-
+/***********/
+/* Headers */
+/***********/
#include "H5private.h" /* Generic Functions */
#include "H5ACpkg.h" /* Metadata cache */
#include "H5Cpkg.h" /* Cache */
@@ -51,13 +54,16 @@
#include "H5Pprivate.h" /* Property lists */
-#ifdef H5_HAVE_PARALLEL
+/****************/
+/* Local Macros */
+/****************/
-/* Declare a free list to manage the H5AC_aux_t struct */
-H5FL_DEFINE_STATIC(H5AC_aux_t);
-#endif /* H5_HAVE_PARALLEL */
+/******************/
+/* Local Typedefs */
+/******************/
+#ifdef H5_HAVE_PARALLEL
/****************************************************************************
*
* structure H5AC_slist_entry_t
@@ -69,143 +75,135 @@ H5FL_DEFINE_STATIC(H5AC_aux_t);
* allocated structure to store these offsets in. This structure serves
* that purpose. Its fields are as follows:
*
- * magic: Unsigned 32 bit integer always set to
- * H5AC__H5AC_SLIST_ENTRY_T_MAGIC. This field is used to
- * validate pointers to instances of H5AC_slist_entry_t.
- *
* addr: file offset of a metadata entry. Entries are added to this
* list (if they aren't there already) when they are marked
* dirty in an unprotect, inserted, or moved. They are
* removed when they appear in a clean entries broadcast.
*
****************************************************************************/
-
-#ifdef H5_HAVE_PARALLEL
-
-#define H5AC__H5AC_SLIST_ENTRY_T_MAGIC 0x00D0A02
-
typedef struct H5AC_slist_entry_t
{
- uint32_t magic;
-
haddr_t addr;
} H5AC_slist_entry_t;
-/* Declare a free list to manage the H5AC_slist_entry_t struct */
-H5FL_DEFINE_STATIC(H5AC_slist_entry_t);
+/* User data for address list building callbacks */
+typedef struct H5AC_addr_list_ud_t
+{
+ H5AC_aux_t * aux_ptr; /* 'Auxiliary' parallel cache info */
+ haddr_t * addr_buf_ptr; /* Array to store addresses */
+ int i; /* Counter for position in array */
+} H5AC_addr_list_ud_t;
+#endif /* H5_HAVE_PARALLEL */
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+static herr_t H5AC__check_if_write_permitted(const H5F_t *f,
+ hbool_t *write_permitted_ptr);
+static herr_t H5AC__ext_config_2_int_config(H5AC_cache_config_t *ext_conf_ptr,
+ H5C_auto_size_ctl_t *int_conf_ptr);
+
+#ifdef H5_HAVE_PARALLEL
+static herr_t H5AC__broadcast_candidate_list(H5AC_t *cache_ptr,
+ int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr);
+static herr_t H5AC__broadcast_clean_list(H5AC_t *cache_ptr);
+static herr_t H5AC__construct_candidate_list(H5AC_t *cache_ptr,
+ H5AC_aux_t *aux_ptr, int sync_point_op);
+static herr_t H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr,
+ int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr);
+static herr_t H5AC__flush_entries(H5F_t *f, hid_t dxpl_id);
+static herr_t H5AC__log_deleted_entry(const H5AC_info_t *entry_ptr);
+static herr_t H5AC__log_dirtied_entry(const H5AC_info_t *entry_ptr);
+static herr_t H5AC__log_flushed_entry(H5C_t *cache_ptr, haddr_t addr,
+ hbool_t was_dirty, unsigned flags);
+static herr_t H5AC__log_inserted_entry(const H5AC_info_t *entry_ptr);
+static herr_t H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr,
+ haddr_t new_addr);
+static herr_t H5AC__propagate_and_apply_candidate_list(H5F_t *f, hid_t dxpl_id);
+static herr_t H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f,
+ hid_t dxpl_id);
+static herr_t H5AC__receive_haddr_list(MPI_Comm mpi_comm, int *num_entries_ptr,
+ haddr_t **haddr_buf_ptr_ptr);
+static herr_t H5AC__receive_candidate_list(const H5AC_t *cache_ptr,
+ int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr);
+static herr_t H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t primary_dxpl_id,
+ hid_t secondary_dxpl_id);
+static herr_t H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, int num_candidates,
+ haddr_t *candidates_list_ptr);
+static herr_t H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id);
+static herr_t H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f, hid_t dxpl_id);
+static herr_t H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id);
+static herr_t H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f, hid_t dxpl_id);
+static herr_t H5AC__run_sync_point(H5F_t *f, hid_t dxpl_id, int sync_point_op);
#endif /* H5_HAVE_PARALLEL */
-/*
- * Private file-scope variables.
- */
+/*********************/
+/* Package Variables */
+/*********************/
+
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
/* Default dataset transfer property list for metadata I/O calls */
/* (Collective set, "block before metadata write" set and "library internal" set) */
/* (Global variable definition, declaration is in H5ACprivate.h also) */
-hid_t H5AC_dxpl_id=(-1);
+hid_t H5AC_dxpl_id = (-1);
/* Dataset transfer property list for independent metadata I/O calls */
/* (just "library internal" set - i.e. independent transfer mode) */
/* (Global variable definition, declaration is in H5ACprivate.h also) */
H5P_genplist_t *H5AC_ind_dxpl_g = NULL;
-hid_t H5AC_ind_dxpl_id=(-1);
+hid_t H5AC_ind_dxpl_id = (-1);
-/*
- * Private file-scope function declarations:
- */
-
-static herr_t H5AC_check_if_write_permitted(const H5F_t *f,
- hid_t dxpl_id,
- hbool_t * write_permitted_ptr);
-
-static herr_t H5AC_ext_config_2_int_config(H5AC_cache_config_t * ext_conf_ptr,
- H5C_auto_size_ctl_t * int_conf_ptr);
+/*******************/
+/* Local Variables */
+/*******************/
#ifdef H5_HAVE_PARALLEL
-static herr_t H5AC_broadcast_candidate_list(H5AC_t * cache_ptr,
- int * num_entries_ptr,
- haddr_t ** haddr_buf_ptr_ptr);
-
-static herr_t H5AC_broadcast_clean_list(H5AC_t * cache_ptr);
-
-static herr_t H5AC_construct_candidate_list(H5AC_t * cache_ptr,
- H5AC_aux_t * aux_ptr,
- int sync_point_op);
-
-static herr_t H5AC_copy_candidate_list_to_buffer(H5AC_t * cache_ptr,
- int * num_entries_ptr,
- haddr_t ** haddr_buf_ptr_ptr,
- size_t * MPI_Offset_buf_size_ptr,
- MPI_Offset ** MPI_Offset_buf_ptr_ptr);
-
-static herr_t H5AC_flush_entries(H5F_t *f);
-
-static herr_t H5AC_log_deleted_entry(H5AC_t * cache_ptr,
- H5AC_info_t * entry_ptr,
- haddr_t addr,
- unsigned int flags);
-
-static herr_t H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr,
- haddr_t addr);
-
-static herr_t H5AC_log_flushed_entry(H5C_t * cache_ptr,
- haddr_t addr,
- hbool_t was_dirty,
- unsigned flags,
- int type_id);
-
-static herr_t H5AC_log_moved_entry(const H5F_t * f,
- haddr_t old_addr,
- haddr_t new_addr);
-
-static herr_t H5AC_log_inserted_entry(H5AC_t * cache_ptr,
- H5AC_info_t * entry_ptr);
-
-static herr_t H5AC_propagate_and_apply_candidate_list(H5F_t * f,
- hid_t dxpl_id,
- H5AC_t * cache_ptr);
-
-static herr_t H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f,
- hid_t dxpl_id,
- H5AC_t * cache_ptr);
-
-static herr_t H5AC_receive_candidate_list(H5AC_t * cache_ptr,
- int * num_entries_ptr,
- haddr_t ** haddr_buf_ptr_ptr);
-
-static herr_t H5AC_receive_and_apply_clean_list(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
- H5AC_t * cache_ptr);
-
-static herr_t H5AC_tidy_cache_0_lists(H5AC_t * cache_ptr,
- int num_candidates,
- haddr_t * candidates_list_ptr);
-
-herr_t H5AC_rsp__dist_md_write__flush(H5F_t *f,
- hid_t dxpl_id,
- H5AC_t * cache_ptr);
-
-herr_t H5AC_rsp__dist_md_write__flush_to_min_clean(H5F_t *f,
- hid_t dxpl_id,
- H5AC_t * cache_ptr);
-
-herr_t H5AC_rsp__p0_only__flush(H5F_t *f,
- hid_t dxpl_id,
- H5AC_t * cache_ptr);
+/* Declare a free list to manage the H5AC_aux_t struct */
+H5FL_DEFINE_STATIC(H5AC_aux_t);
-herr_t H5AC_rsp__p0_only__flush_to_min_clean(H5F_t *f,
- hid_t dxpl_id,
- H5AC_t * cache_ptr);
+/* Declare a free list to manage the H5AC_slist_entry_t struct */
+H5FL_DEFINE_STATIC(H5AC_slist_entry_t);
+#endif /* H5_HAVE_PARALLEL */
-static herr_t H5AC_run_sync_point(H5F_t *f,
- hid_t dxpl_id,
- int sync_point_op);
+static const char *H5AC_entry_type_names[H5AC_NTYPES] =
+{
+ "B-tree nodes",
+ "symbol table nodes",
+ "local heap prefixes",
+ "local heap data blocks",
+ "global heaps",
+ "object headers",
+ "object header chunks",
+ "v2 B-tree headers",
+ "v2 B-tree internal nodes",
+ "v2 B-tree leaf nodes",
+ "fractal heap headers",
+ "fractal heap direct blocks",
+ "fractal heap indirect blocks",
+ "free space headers",
+ "free space sections",
+ "shared OH message master table",
+ "shared OH message index",
+ "extensible array headers",
+ "extensible array index blocks",
+ "extensible array super blocks",
+ "extensible array data blocks",
+ "extensible array data block pages",
+ "fixed array headers",
+ "fixed array data block",
+ "fixed array data block pages",
+ "superblock",
+ "test entry" /* for testing only -- not used for actual files */
+};
-#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
@@ -232,7 +230,7 @@ H5AC_init(void)
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5AC_init() */
/*-------------------------------------------------------------------------
@@ -273,8 +271,8 @@ H5AC_init_interface(void)
/* Insert 'collective metadata write' property */
coll_meta_write = 1;
if(H5P_insert(xfer_plist, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property")
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property")
/* Get an ID for the independent H5AC dxpl */
if((H5AC_ind_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0)
@@ -287,8 +285,8 @@ H5AC_init_interface(void)
/* Insert 'collective metadata write' property */
coll_meta_write = 0;
if(H5P_insert(H5AC_ind_dxpl_g, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property")
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property")
#else /* H5_HAVE_PARALLEL */
/* Sanity check */
HDassert(H5P_LST_DATASET_XFER_ID_g!=(-1));
@@ -297,7 +295,7 @@ H5AC_init_interface(void)
H5AC_ind_dxpl_id = H5P_DATASET_XFER_DEFAULT;
/* Get the property list objects for the IDs */
- if (NULL == (H5AC_ind_dxpl_g = (H5P_genplist_t *)H5I_object(H5AC_ind_dxpl_id)))
+ if(NULL == (H5AC_ind_dxpl_g = (H5P_genplist_t *)H5I_object(H5AC_ind_dxpl_id)))
HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get property list object")
#endif /* H5_HAVE_PARALLEL */
@@ -328,15 +326,14 @@ H5AC_term_interface(void)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- if (H5_interface_initialize_g) {
+ if(H5_interface_initialize_g) {
#ifdef H5_HAVE_PARALLEL
if(H5AC_dxpl_id > 0 || H5AC_ind_dxpl_id > 0) {
/* Indicate more work to do */
n = 1; /* H5I */
/* Close H5AC dxpl */
- if(H5I_dec_ref(H5AC_dxpl_id) < 0 ||
- H5I_dec_ref(H5AC_ind_dxpl_id) < 0)
+ if(H5I_dec_ref(H5AC_dxpl_id) < 0 || H5I_dec_ref(H5AC_ind_dxpl_id) < 0)
H5E_clear_stack(NULL); /*ignore error*/
else {
/* Reset static IDs */
@@ -347,50 +344,22 @@ H5AC_term_interface(void)
H5_interface_initialize_g = 0;
} /* end else */
} /* end if */
- else
-#else /* H5_HAVE_PARALLEL */
+ else {
+#endif /* H5_HAVE_PARALLEL */
/* Reset static IDs */
- H5AC_dxpl_id=(-1);
- H5AC_ind_dxpl_id=(-1);
+ H5AC_dxpl_id = (-1);
+ H5AC_ind_dxpl_id = (-1);
+#ifdef H5_HAVE_PARALLEL
+ } /* end else */
#endif /* H5_HAVE_PARALLEL */
- /* Reset interface initialization flag */
- H5_interface_initialize_g = 0;
+
+ /* Reset interface initialization flag */
+ H5_interface_initialize_g = 0;
} /* end if */
FUNC_LEAVE_NOAPI(n)
} /* end H5AC_term_interface() */
-static const char * H5AC_entry_type_names[H5AC_NTYPES] =
-{
- "B-tree nodes",
- "symbol table nodes",
- "local heap prefixes",
- "local heap data blocks",
- "global heaps",
- "object headers",
- "object header chunks",
- "v2 B-tree headers",
- "v2 B-tree internal nodes",
- "v2 B-tree leaf nodes",
- "fractal heap headers",
- "fractal heap direct blocks",
- "fractal heap indirect blocks",
- "free space headers",
- "free space sections",
- "shared OH message master table",
- "shared OH message index",
- "extensible array headers",
- "extensible array index blocks",
- "extensible array super blocks",
- "extensible array data blocks",
- "extensible array data block pages",
- "fixed array headers",
- "fixed array data block",
- "fixed array data block pages",
- "superblock",
- "test entry" /* for testing only -- not used for actual files */
-};
-
/*-------------------------------------------------------------------------
* Function: H5AC_create
@@ -411,8 +380,7 @@ static const char * H5AC_entry_type_names[H5AC_NTYPES] =
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_create(const H5F_t *f,
- H5AC_cache_config_t *config_ptr)
+H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr)
{
#ifdef H5_HAVE_PARALLEL
char prefix[H5C__PREFIX_LEN] = "";
@@ -422,6 +390,7 @@ H5AC_create(const H5F_t *f,
FUNC_ENTER_NOAPI(FAIL)
+ /* Check arguments */
HDassert(f);
HDassert(NULL == f->shared->cache);
HDassert(config_ptr != NULL) ;
@@ -429,7 +398,7 @@ H5AC_create(const H5F_t *f,
HDcompile_assert(H5C__MAX_NUM_TYPE_IDS == H5AC_NTYPES);
if(H5AC_validate_config(config_ptr) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad cache configuration")
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad cache configuration")
#ifdef H5_HAVE_PARALLEL
if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) {
@@ -467,11 +436,8 @@ H5AC_create(const H5F_t *f,
aux_ptr->move_dirty_bytes_updates = 0;
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
aux_ptr->d_slist_ptr = NULL;
- aux_ptr->d_slist_len = 0;
aux_ptr->c_slist_ptr = NULL;
- aux_ptr->c_slist_len = 0;
aux_ptr->candidate_slist_ptr = NULL;
- aux_ptr->candidate_slist_len = 0;
aux_ptr->write_done = NULL;
aux_ptr->sync_point_done = NULL;
@@ -492,66 +458,50 @@ H5AC_create(const H5F_t *f,
if(NULL == (aux_ptr->candidate_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create candidate entry list.")
- if(aux_ptr != NULL) {
- if(aux_ptr->mpi_rank == 0) {
+ if(aux_ptr != NULL)
+ if(aux_ptr->mpi_rank == 0)
f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE,
- H5AC__DEFAULT_MIN_CLEAN_SIZE,
- (H5AC_NTYPES - 1),
- (const char **)H5AC_entry_type_names,
- H5AC_check_if_write_permitted,
- TRUE,
- H5AC_log_flushed_entry,
- (void *)aux_ptr);
- } else {
+ H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1),
+ (const char **)H5AC_entry_type_names,
+ H5AC__check_if_write_permitted, TRUE, H5AC__log_flushed_entry,
+ (void *)aux_ptr);
+ else
f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE,
- H5AC__DEFAULT_MIN_CLEAN_SIZE,
- (H5AC_NTYPES - 1),
- (const char **)H5AC_entry_type_names,
- H5AC_check_if_write_permitted,
- TRUE,
- NULL,
- (void *)aux_ptr);
- }
- } else {
+ H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1),
+ (const char **)H5AC_entry_type_names,
+ H5AC__check_if_write_permitted, TRUE, NULL,
+ (void *)aux_ptr);
+ else
f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE,
- H5AC__DEFAULT_MIN_CLEAN_SIZE,
- (H5AC_NTYPES - 1),
- (const char **)H5AC_entry_type_names,
- H5AC_check_if_write_permitted,
- TRUE,
- NULL,
- NULL);
- }
- } else {
+ H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1),
+ (const char **)H5AC_entry_type_names,
+ H5AC__check_if_write_permitted, TRUE, NULL, NULL);
+ } /* end if */
+ else {
#endif /* H5_HAVE_PARALLEL */
/* The default max cache size and min clean size will frequently be
* overwritten shortly by the subsequent set resize config call.
* -- JRM
*/
f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE,
- H5AC__DEFAULT_MIN_CLEAN_SIZE,
- (H5AC_NTYPES - 1),
- (const char **)H5AC_entry_type_names,
- H5AC_check_if_write_permitted,
- TRUE,
- NULL,
- NULL);
+ H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1),
+ (const char **)H5AC_entry_type_names,
+ H5AC__check_if_write_permitted, TRUE, NULL, NULL);
#ifdef H5_HAVE_PARALLEL
- }
+ } /* end else */
#endif /* H5_HAVE_PARALLEL */
if(NULL == f->shared->cache)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed")
#ifdef H5_HAVE_PARALLEL
- if(aux_ptr != NULL) {
+ if(aux_ptr != NULL)
if(H5C_set_prefix(f->shared->cache, prefix) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "H5C_set_prefix() failed")
- } /* end if */
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "H5C_set_prefix() failed")
#endif /* H5_HAVE_PARALLEL */
if(H5AC_set_cache_auto_resize_config(f->shared->cache, config_ptr) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "auto resize configuration failed")
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "auto resize configuration failed")
done:
#ifdef H5_HAVE_PARALLEL
@@ -560,13 +510,10 @@ done:
if(aux_ptr != NULL) {
if(aux_ptr->d_slist_ptr != NULL)
H5SL_close(aux_ptr->d_slist_ptr);
-
if(aux_ptr->c_slist_ptr != NULL)
H5SL_close(aux_ptr->c_slist_ptr);
-
if(aux_ptr->candidate_slist_ptr != NULL)
H5SL_close(aux_ptr->candidate_slist_ptr);
-
aux_ptr->magic = 0;
aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr);
} /* end if */
@@ -623,7 +570,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id)
HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
/* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */
- if(H5AC_flush_entries(f) < 0)
+ if(H5AC__flush_entries(f, dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.")
#endif /* H5_HAVE_PARALLEL */
@@ -665,13 +612,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_expunge_entry(H5F_t *f,
- hid_t dxpl_id,
- const H5AC_class_t *type,
- haddr_t addr,
- unsigned flags)
+H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type,
+ haddr_t addr, unsigned flags)
{
- herr_t result;
#if H5AC__TRACE_FILE_ENABLED
char trace[128] = "";
FILE * trace_file_ptr = NULL;
@@ -680,6 +623,7 @@ H5AC_expunge_entry(H5F_t *f,
FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity checks */
HDassert(f);
HDassert(f->shared);
HDassert(f->shared->cache);
@@ -696,41 +640,21 @@ H5AC_expunge_entry(H5F_t *f,
* necessary in the trace file. Write the return value to catch occult
* errors.
*/
- if ( ( cache_ptr != NULL ) &&
- ( H5C_get_trace_file_ptr(cache_ptr, &trace_file_ptr) >= 0 ) &&
- ( trace_file_ptr != NULL ) ) {
-
- sprintf(trace, "H5AC_expunge_entry 0x%lx %d",
- (unsigned long)addr,
- (int)(type->id));
- }
+ if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr)))
+ sprintf(trace, "%s 0x%lx %d", FUNC, (unsigned long)addr, (int)(type->id));
}
#endif /* H5AC__TRACE_FILE_ENABLED */
- result = H5C_expunge_entry(f,
- dxpl_id,
- H5AC_dxpl_id,
- type,
- addr,
- flags);
-
- if ( result < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, \
- "H5C_expunge_entry() failed.")
- }
+ if(H5C_expunge_entry(f, dxpl_id, H5AC_dxpl_id, type, addr, flags) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_expunge_entry() failed.")
done:
-
#if H5AC__TRACE_FILE_ENABLED
- if ( trace_file_ptr != NULL ) {
-
+ if(trace_file_ptr != NULL)
HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value);
- }
#endif /* H5AC__TRACE_FILE_ENABLED */
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC_expunge_entry() */
@@ -765,6 +689,7 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id)
FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity checks */
HDassert(f);
HDassert(f->shared);
HDassert(f->shared->cache);
@@ -773,21 +698,18 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id)
/* For the flush, only the flags are really necessary in the trace file.
* Write the result to catch occult errors.
*/
- if((f != NULL) &&
- (f->shared != NULL) &&
- (f->shared->cache != NULL) &&
- (H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) &&
- (trace_file_ptr != NULL))
- sprintf(trace, "H5AC_flush");
+ if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr)))
+ sprintf(trace, "%s", FUNC);
#endif /* H5AC__TRACE_FILE_ENABLED */
#ifdef H5_HAVE_PARALLEL
/* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */
- if(H5AC_flush_entries(f) < 0)
+ if(H5AC__flush_entries(f, dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.")
#endif /* H5_HAVE_PARALLEL */
/* Flush the cache */
+ /* (Again, in parallel - writes out the superblock) */
if(H5C_flush_cache(f, dxpl_id, H5AC_dxpl_id, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache.")
@@ -808,12 +730,12 @@ done:
* cache contains an entry at that location. If it does,
* also determine whether the entry is dirty, protected,
* pinned, etc. and return that information to the caller
- * in *status_ptr.
+ * in *status.
*
* If the specified entry doesn't exist, set *status_ptr
* to zero.
*
- * On error, the value of *status_ptr is undefined.
+ * On error, the value of *status is undefined.
*
* Return: Non-negative on success/Negative on failure
*
@@ -823,44 +745,40 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_get_entry_status(const H5F_t *f,
- haddr_t addr,
- unsigned * status_ptr)
+H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status)
{
- hbool_t in_cache;
- hbool_t is_dirty;
- hbool_t is_protected;
- hbool_t is_pinned;
- hbool_t is_flush_dep_child;
- hbool_t is_flush_dep_parent;
- size_t entry_size;
- unsigned status = 0;
+ hbool_t in_cache; /* Entry @ addr is in the cache */
+ hbool_t is_dirty; /* Entry @ addr is in the cache and dirty */
+ hbool_t is_protected; /* Entry @ addr is in the cache and protected */
+ hbool_t is_pinned; /* Entry @ addr is in the cache and pinned */
+ hbool_t is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */
+ hbool_t is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if((f == NULL) || (!H5F_addr_defined(addr)) || (status_ptr == NULL))
+ if((f == NULL) || (!H5F_addr_defined(addr)) || (status == NULL))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry.")
- if(H5C_get_entry_status(f, addr, &entry_size, &in_cache, &is_dirty,
+ if(H5C_get_entry_status(f, addr, NULL, &in_cache, &is_dirty,
&is_protected, &is_pinned, &is_flush_dep_parent, &is_flush_dep_child) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_status() failed.")
if(in_cache) {
- status |= H5AC_ES__IN_CACHE;
+ *status |= H5AC_ES__IN_CACHE;
if(is_dirty)
- status |= H5AC_ES__IS_DIRTY;
+ *status |= H5AC_ES__IS_DIRTY;
if(is_protected)
- status |= H5AC_ES__IS_PROTECTED;
+ *status |= H5AC_ES__IS_PROTECTED;
if(is_pinned)
- status |= H5AC_ES__IS_PINNED;
+ *status |= H5AC_ES__IS_PINNED;
if(is_flush_dep_parent)
- status |= H5AC_ES__IS_FLUSH_DEP_PARENT;
+ *status |= H5AC_ES__IS_FLUSH_DEP_PARENT;
if(is_flush_dep_child)
- status |= H5AC_ES__IS_FLUSH_DEP_CHILD;
+ *status |= H5AC_ES__IS_FLUSH_DEP_CHILD;
} /* end if */
-
- *status_ptr = status;
+ else
+ *status = 0;
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -895,6 +813,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add
FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity checks */
HDassert(f);
HDassert(f->shared);
HDassert(f->shared->cache);
@@ -916,17 +835,9 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add
* Note that some data is not available right now -- put what we can
* in the trace buffer now, and fill in the rest at the end.
*/
- if ( ( f != NULL ) &&
- ( f->shared != NULL ) &&
- ( f->shared->cache != NULL ) &&
- ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) &&
- ( trace_file_ptr != NULL ) ) {
-
- sprintf(trace, "H5AC_insert_entry 0x%lx %d 0x%x",
- (unsigned long)addr,
- type->id,
- flags);
- }
+ if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr)))
+ sprintf(trace, "%s 0x%lx %d 0x%x", FUNC, (unsigned long)addr, type->id,
+ flags);
#endif /* H5AC__TRACE_FILE_ENABLED */
/* Insert entry into metadata cache */
@@ -934,10 +845,9 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add
HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C_insert_entry() failed")
#if H5AC__TRACE_FILE_ENABLED
- if(trace_file_ptr != NULL) {
+ if(trace_file_ptr != NULL)
/* make note of the entry size */
trace_entry_size = ((H5C_cache_entry_t *)thing)->size;
- }
#endif /* H5AC__TRACE_FILE_ENABLED */
#ifdef H5_HAVE_PARALLEL
@@ -946,12 +856,12 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add
if(NULL != (aux_ptr = (H5AC_aux_t *)f->shared->cache->aux_ptr)) {
/* Log the new entry */
- if(H5AC_log_inserted_entry(f->shared->cache, (H5AC_info_t *)thing) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5AC_log_inserted_entry() failed")
+ if(H5AC__log_inserted_entry((H5AC_info_t *)thing) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5AC__log_inserted_entry() failed")
/* Check if we should try to flush */
if(aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)
- if(H5AC_run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
+ if(H5AC__run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.")
} /* end if */
}
@@ -959,11 +869,8 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add
done:
#if H5AC__TRACE_FILE_ENABLED
- if(trace_file_ptr != NULL) {
- HDfprintf(trace_file_ptr, "%s %d %d\n", trace,
- (int)trace_entry_size,
- (int)ret_value);
- }
+ if(trace_file_ptr != NULL)
+ HDfprintf(trace_file_ptr, "%s %d %d\n", trace, (int)trace_entry_size, (int)ret_value);
#endif /* H5AC__TRACE_FILE_ENABLED */
FUNC_LEAVE_NOAPI(ret_value)
@@ -1002,8 +909,7 @@ H5AC_mark_entry_dirty(void *thing)
* is really necessary in the trace file. Write the result to catch
* occult errors.
*/
- if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) &&
- (NULL != trace_file_ptr))
+ if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr_from_entry(thing)))
sprintf(trace, "%s 0x%lx", FUNC,
(unsigned long)(((H5C_cache_entry_t *)thing)->addr));
#endif /* H5AC__TRACE_FILE_ENABLED */
@@ -1017,10 +923,9 @@ H5AC_mark_entry_dirty(void *thing)
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
if((!entry_ptr->is_dirty) && (!entry_ptr->is_protected) &&
- (entry_ptr->is_pinned) && (NULL != cache_ptr->aux_ptr)) {
- if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr) < 0)
+ (entry_ptr->is_pinned) && (NULL != cache_ptr->aux_ptr))
+ if(H5AC__log_dirtied_entry(entry_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry")
- } /* end if */
}
#endif /* H5_HAVE_PARALLEL */
@@ -1059,12 +964,13 @@ H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t ne
FILE * trace_file_ptr = NULL;
#endif /* H5AC__TRACE_FILE_ENABLED */
#ifdef H5_HAVE_PARALLEL
- H5AC_aux_t * aux_ptr;
+ H5AC_aux_t *aux_ptr;
#endif /* H5_HAVE_PARALLEL */
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity checks */
HDassert(f);
HDassert(f->shared->cache);
HDassert(type);
@@ -1077,25 +983,16 @@ H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t ne
* necessary in the trace file. Include the type id so we don't have to
* look it up. Also write the result to catch occult errors.
*/
- if ( ( f != NULL ) &&
- ( f->shared != NULL ) &&
- ( f->shared->cache != NULL ) &&
- ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) &&
- ( trace_file_ptr != NULL ) ) {
-
- sprintf(trace, "H5AC_move_entry 0x%lx 0x%lx %d",
- (unsigned long)old_addr,
- (unsigned long)new_addr,
- (int)(type->id));
- }
+ if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr)))
+ sprintf(trace, "%s 0x%lx 0x%lx %d", FUNC, (unsigned long)old_addr,
+ (unsigned long)new_addr, (int)(type->id));
#endif /* H5AC__TRACE_FILE_ENABLED */
#ifdef H5_HAVE_PARALLEL
/* Log moving the entry */
- if(NULL != (aux_ptr = (H5AC_aux_t *)f->shared->cache->aux_ptr)) {
- if(H5AC_log_moved_entry(f, old_addr, new_addr) < 0)
+ if(NULL != (aux_ptr = (H5AC_aux_t *)f->shared->cache->aux_ptr))
+ if(H5AC__log_moved_entry(f, old_addr, new_addr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "can't log moved entry")
- } /* end if */
#endif /* H5_HAVE_PARALLEL */
if(H5C_move_entry(f->shared->cache, type, old_addr, new_addr) < 0)
@@ -1103,10 +1000,9 @@ H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t ne
#ifdef H5_HAVE_PARALLEL
/* Check if we should try to flush */
- if(NULL != aux_ptr && aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold) {
- if(H5AC_run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
+ if(NULL != aux_ptr && aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)
+ if(H5AC__run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.")
- } /* end if */
#endif /* H5_HAVE_PARALLEL */
done:
@@ -1150,8 +1046,7 @@ H5AC_pin_protected_entry(void *thing)
/* For the pin protected entry call, only the addr is really necessary
* in the trace file. Also write the result to catch occult errors.
*/
- if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) &&
- (NULL != trace_file_ptr))
+ if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr_from_entry(thing)))
sprintf(trace, "%s 0x%lx", FUNC,
(unsigned long)(((H5C_cache_entry_t *)thing)->addr));
#endif /* H5AC__TRACE_FILE_ENABLED */
@@ -1198,10 +1093,8 @@ H5AC_create_flush_dependency(void * parent_thing, void * child_thing)
HDassert(child_thing);
#if H5AC__TRACE_FILE_ENABLED
- if((H5C_get_trace_file_ptr_from_entry(parent_thing, &trace_file_ptr) >= 0) &&
- (NULL != trace_file_ptr))
- sprintf(trace, "%s %lx %lx",
- FUNC,
+ if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr_from_entry(parent_thing)))
+ sprintf(trace, "%s %lx %lx", FUNC,
(unsigned long)(((H5C_cache_entry_t *)parent_thing)->addr),
(unsigned long)(((H5C_cache_entry_t *)child_thing)->addr));
#endif /* H5AC__TRACE_FILE_ENABLED */
@@ -1244,15 +1137,11 @@ done:
*-------------------------------------------------------------------------
*/
void *
-H5AC_protect(H5F_t *f,
- hid_t dxpl_id,
- const H5AC_class_t *type,
- haddr_t addr,
- void *udata,
- H5AC_protect_t rw)
+H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
+ void *udata, H5AC_protect_t rw)
{
unsigned protect_flags = H5C__NO_FLAGS_SET;
- void * thing = (void *)NULL;
+ void * thing; /* Pointer to native data structure for entry */
#if H5AC__TRACE_FILE_ENABLED
char trace[128] = "";
size_t trace_entry_size = 0;
@@ -1262,7 +1151,7 @@ H5AC_protect(H5F_t *f,
FUNC_ENTER_NOAPI(NULL)
- /* check args */
+ /* Sanity check */
HDassert(f);
HDassert(f->shared);
HDassert(f->shared->cache);
@@ -1281,11 +1170,7 @@ H5AC_protect(H5F_t *f,
* sanity check. Also indicate whether the call was successful to
* catch occult errors.
*/
- if ( ( f != NULL ) &&
- ( f->shared != NULL ) &&
- ( f->shared->cache != NULL ) &&
- ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) &&
- ( trace_file_ptr != NULL ) ) {
+ if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr))) {
const char * rw_string;
@@ -1302,55 +1187,34 @@ H5AC_protect(H5F_t *f,
rw_string = "???";
}
- sprintf(trace, "H5AC_protect 0x%lx %d %s",
- (unsigned long)addr,
- (int)(type->id),
- rw_string);
+ sprintf(trace, "%s 0x%lx %d %s", FUNC, (unsigned long)addr,
+ (int)(type->id), rw_string);
}
#endif /* H5AC__TRACE_FILE_ENABLED */
- if ( rw == H5AC_READ ) {
-
+ if ( rw == H5AC_READ )
protect_flags |= H5C__READ_ONLY_FLAG;
- }
- thing = H5C_protect(f,
- dxpl_id,
- H5AC_dxpl_id,
- type,
- addr,
- udata,
- protect_flags);
-
- if ( thing == NULL ) {
+ if(NULL == (thing = H5C_protect(f, dxpl_id, H5AC_dxpl_id, type, addr, udata, protect_flags)))
HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_protect() failed.")
- }
#if H5AC__TRACE_FILE_ENABLED
- if ( trace_file_ptr != NULL ) {
-
- /* make note of the entry size */
+ if(trace_file_ptr != NULL)
+ /* Make note of the entry size */
trace_entry_size = ((H5C_cache_entry_t *)thing)->size;
- }
#endif /* H5AC__TRACE_FILE_ENABLED */
/* Set return value */
ret_value = thing;
done:
-
#if H5AC__TRACE_FILE_ENABLED
- if ( trace_file_ptr != NULL ) {
-
- HDfprintf(trace_file_ptr, "%s %d %d\n", trace,
- (int)trace_entry_size,
- (int)(ret_value != NULL));
- }
+ if(trace_file_ptr != NULL)
+ HDfprintf(trace_file_ptr, "%s %d %d\n", trace, (int)trace_entry_size, (int)(ret_value != NULL));
#endif /* H5AC__TRACE_FILE_ENABLED */
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC_protect() */
@@ -1385,8 +1249,7 @@ H5AC_resize_entry(void *thing, size_t new_size)
* really necessary in the trace file. Write the result to catch
* occult errors.
*/
- if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) &&
- (NULL != trace_file_ptr))
+ if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr_from_entry(thing)))
sprintf(trace, "%s 0x%lx %d", FUNC,
(unsigned long)(((H5C_cache_entry_t *)thing)->addr),
(int)new_size);
@@ -1403,10 +1266,9 @@ H5AC_resize_entry(void *thing, size_t new_size)
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
- if((!entry_ptr->is_dirty) && (NULL != cache_ptr->aux_ptr)) {
- if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr) < 0)
+ if((!entry_ptr->is_dirty) && (NULL != cache_ptr->aux_ptr))
+ if(H5AC__log_dirtied_entry(entry_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry")
- } /* end if */
}
#endif /* H5_HAVE_PARALLEL */
@@ -1451,8 +1313,7 @@ H5AC_unpin_entry(void *thing)
/* For the unpin entry call, only the addr is really necessary
* in the trace file. Also write the result to catch occult errors.
*/
- if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) &&
- (NULL != trace_file_ptr))
+ if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr_from_entry(thing)))
sprintf(trace, "%s 0x%lx", FUNC,
(unsigned long)(((H5C_cache_entry_t *)thing)->addr));
#endif /* H5AC__TRACE_FILE_ENABLED */
@@ -1498,10 +1359,8 @@ H5AC_destroy_flush_dependency(void * parent_thing, void * child_thing)
HDassert(child_thing);
#if H5AC__TRACE_FILE_ENABLED
- if((H5C_get_trace_file_ptr_from_entry(parent_thing, &trace_file_ptr) >= 0) &&
- (NULL != trace_file_ptr))
- sprintf(trace, "%s %llx %llx",
- FUNC,
+ if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr_from_entry(parent_thing)))
+ sprintf(trace, "%s %llx %llx", FUNC,
(unsigned long long)(((H5C_cache_entry_t *)parent_thing)->addr),
(unsigned long long)(((H5C_cache_entry_t *)child_thing)->addr));
#endif /* H5AC__TRACE_FILE_ENABLED */
@@ -1574,6 +1433,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity checks */
HDassert(f);
HDassert(f->shared);
HDassert(f->shared->cache);
@@ -1590,21 +1450,13 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
* new size are really necessary in the trace file. Write the return
* value to catch occult errors.
*/
- if ( ( f != NULL ) &&
- ( f->shared != NULL ) &&
- ( f->shared->cache != NULL ) &&
- ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) &&
- ( trace_file_ptr != NULL ) ) {
-
- sprintf(trace, "H5AC_unprotect 0x%lx %d",
- (unsigned long)addr,
- (int)(type->id));
- }
+ if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr)))
+ sprintf(trace, "%s 0x%lx %d", FUNC, (unsigned long)addr, (int)(type->id));
#endif /* H5AC__TRACE_FILE_ENABLED */
- dirtied = (hbool_t)( ( (flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG ) ||
- ( ((H5AC_info_t *)thing)->dirtied ) );
- deleted = (hbool_t)( (flags & H5C__DELETED_FLAG) == H5C__DELETED_FLAG );
+ dirtied = (hbool_t)(((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG) ||
+ (((H5AC_info_t *)thing)->dirtied));
+ deleted = (hbool_t)((flags & H5C__DELETED_FLAG) == H5C__DELETED_FLAG);
/* Check if the size changed out from underneath us, if we're not deleting
* the entry.
@@ -1613,24 +1465,21 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
size_t curr_size = 0;
if((type->size)(f, thing, &curr_size) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing")
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing")
if(((H5AC_info_t *)thing)->size != curr_size)
HGOTO_ERROR(H5E_CACHE, H5E_BADSIZE, FAIL, "size of entry changed")
} /* end if */
#ifdef H5_HAVE_PARALLEL
- if((dirtied) && (((H5AC_info_t *)thing)->is_dirty == FALSE) &&
- (NULL != (aux_ptr = (H5AC_aux_t *)f->shared->cache->aux_ptr))) {
- if(H5AC_log_dirtied_entry((H5AC_info_t *)thing, addr) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "can't log dirtied entry")
- } /* end if */
+ if(NULL != (aux_ptr = (H5AC_aux_t *)f->shared->cache->aux_ptr)) {
+ if(dirtied && ((H5AC_info_t *)thing)->is_dirty == FALSE)
+ if(H5AC__log_dirtied_entry((H5AC_info_t *)thing) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "can't log dirtied entry")
- if((deleted) &&
- (NULL != (aux_ptr = (H5AC_aux_t *)(f->shared->cache->aux_ptr))) &&
- (aux_ptr->mpi_rank == 0)) {
- if(H5AC_log_deleted_entry(f->shared->cache, (H5AC_info_t *)thing, addr, flags) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5AC_log_deleted_entry() failed.")
+ if(deleted && aux_ptr->mpi_rank == 0)
+ if(H5AC__log_deleted_entry((H5AC_info_t *)thing) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5AC__log_deleted_entry() failed.")
} /* end if */
#endif /* H5_HAVE_PARALLEL */
@@ -1639,17 +1488,15 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
#ifdef H5_HAVE_PARALLEL
/* Check if we should try to flush */
- if((aux_ptr != NULL) && (aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)) {
- if(H5AC_run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
+ if((aux_ptr != NULL) && (aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold))
+ if(H5AC__run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.")
- } /* end if */
#endif /* H5_HAVE_PARALLEL */
done:
#if H5AC__TRACE_FILE_ENABLED
if(trace_file_ptr != NULL)
- HDfprintf(trace_file_ptr, "%s %x %d\n",
- trace, (unsigned)flags, (int)ret_value);
+ HDfprintf(trace_file_ptr, "%s 0x%x %d\n", trace, (unsigned)flags, (int)ret_value);
#endif /* H5AC__TRACE_FILE_ENABLED */
FUNC_LEAVE_NOAPI(ret_value)
@@ -1680,12 +1527,11 @@ H5AC_set_sync_point_done_callback(H5C_t * cache_ptr,
FUNC_ENTER_NOAPI_NOINIT_NOERR
+ /* Sanity checks */
HDassert(cache_ptr && (cache_ptr->magic == H5C__H5C_T_MAGIC));
-
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
aux_ptr->sync_point_done = sync_point_done;
@@ -1710,17 +1556,15 @@ H5AC_set_sync_point_done_callback(H5C_t * cache_ptr,
*/
#ifdef H5_HAVE_PARALLEL
herr_t
-H5AC_set_write_done_callback(H5C_t * cache_ptr,
- void (* write_done)(void))
+H5AC_set_write_done_callback(H5C_t * cache_ptr, void (* write_done)(void))
{
H5AC_aux_t * aux_ptr;
FUNC_ENTER_NOAPI_NOINIT_NOERR
+ /* Sanity checks */
HDassert(cache_ptr && (cache_ptr->magic == H5C__H5C_T_MAGIC));
-
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
HDassert( aux_ptr != NULL );
HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
@@ -1730,6 +1574,7 @@ H5AC_set_write_done_callback(H5C_t * cache_ptr,
} /* H5AC_set_write_done_callback() */
#endif /* H5_HAVE_PARALLEL */
+#ifndef NDEBUG /* debugging functions */
/*-------------------------------------------------------------------------
* Function: H5AC_stats
@@ -1746,10 +1591,9 @@ H5AC_set_write_done_callback(H5C_t * cache_ptr,
herr_t
H5AC_stats(const H5F_t *f)
{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+ /* Sanity checks */
HDassert(f);
HDassert(f->shared);
HDassert(f->shared->cache);
@@ -1757,8 +1601,7 @@ H5AC_stats(const H5F_t *f)
/* at present, this can't fail */
(void)H5C_stats(f->shared->cache, H5F_OPEN_NAME(f), FALSE);
-done:
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5AC_stats() */
@@ -1782,18 +1625,18 @@ H5AC_dump_cache(const H5F_t *f)
FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity checks */
HDassert(f);
HDassert(f->shared);
HDassert(f->shared->cache);
- if ( H5C_dump_cache(f->shared->cache, H5F_OPEN_NAME(f)) < 0 ) {
-
+ if(H5C_dump_cache(f->shared->cache, H5F_OPEN_NAME(f)) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_dump_cache() failed.")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_dump_cache() */
+#endif /* NDEBUG */
/*-------------------------------------------------------------------------
@@ -1809,59 +1652,36 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr,
- H5AC_cache_config_t *config_ptr)
+H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr,
+ H5AC_cache_config_t *config_ptr)
{
- herr_t result;
- herr_t ret_value = SUCCEED; /* Return value */
- hbool_t evictions_enabled;
H5C_auto_size_ctl_t internal_config;
+ hbool_t evictions_enabled;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if ( ( cache_ptr == NULL )
- ||
+ /* Check args */
+ if((cache_ptr == NULL) ||
#ifdef H5_HAVE_PARALLEL
- ( ( cache_ptr->aux_ptr != NULL )
- &&
- ( ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic
- !=
- H5AC__H5AC_AUX_T_MAGIC
- )
- )
- ||
+ ((cache_ptr->aux_ptr != NULL) &&
+ (((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic != H5AC__H5AC_AUX_T_MAGIC))
+ ||
#endif /* H5_HAVE_PARALLEL */
- ( config_ptr == NULL )
- ||
- ( config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION )
- )
- {
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "Bad cache_ptr or config_ptr on entry.")
-
- }
-
- result = H5C_get_cache_auto_resize_config((const H5C_t *)cache_ptr,
- &internal_config);
-
- if ( result < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "H5C_get_cache_auto_resize_config() failed.")
- }
+ (config_ptr == NULL) || (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION))
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr or config_ptr on entry.")
+ /* Retrieve the configuration */
+ if(H5C_get_cache_auto_resize_config((const H5C_t *)cache_ptr, &internal_config) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_auto_resize_config() failed.")
if(H5C_get_evictions_enabled((const H5C_t *)cache_ptr, &evictions_enabled) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_resize_enabled() failed.")
- if ( internal_config.rpt_fcn == NULL ) {
-
+ /* Set the information to return */
+ if(internal_config.rpt_fcn == NULL)
config_ptr->rpt_fcn_enabled = FALSE;
-
- } else {
-
+ else
config_ptr->rpt_fcn_enabled = TRUE;
- }
-
config_ptr->open_trace_file = FALSE;
config_ptr->close_trace_file = FALSE;
config_ptr->trace_file_name[0] = '\0';
@@ -1885,35 +1705,24 @@ H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr,
config_ptr->decrement = internal_config.decrement;
config_ptr->apply_max_decrement = internal_config.apply_max_decrement;
config_ptr->max_decrement = internal_config.max_decrement;
- config_ptr->epochs_before_eviction =
- (int)(internal_config.epochs_before_eviction);
+ config_ptr->epochs_before_eviction = (int)(internal_config.epochs_before_eviction);
config_ptr->apply_empty_reserve = internal_config.apply_empty_reserve;
config_ptr->empty_reserve = internal_config.empty_reserve;
-
#ifdef H5_HAVE_PARALLEL
- if ( cache_ptr->aux_ptr != NULL ) {
-
- config_ptr->dirty_bytes_threshold =
- ((H5AC_aux_t *)(cache_ptr->aux_ptr))->dirty_bytes_threshold;
- config_ptr->metadata_write_strategy =
- ((H5AC_aux_t *)(cache_ptr->aux_ptr))->metadata_write_strategy;
-
- } else {
+ if(cache_ptr->aux_ptr != NULL) {
+ config_ptr->dirty_bytes_threshold = ((H5AC_aux_t *)(cache_ptr->aux_ptr))->dirty_bytes_threshold;
+ config_ptr->metadata_write_strategy = ((H5AC_aux_t *)(cache_ptr->aux_ptr))->metadata_write_strategy;
+ } /* end if */
+ else {
#endif /* H5_HAVE_PARALLEL */
-
- config_ptr->dirty_bytes_threshold =
- H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD;
- config_ptr->metadata_write_strategy =
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY;
-
+ config_ptr->dirty_bytes_threshold = H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD;
+ config_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY;
#ifdef H5_HAVE_PARALLEL
- }
+ } /* end else */
#endif /* H5_HAVE_PARALLEL */
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC_get_cache_auto_resize_config() */
@@ -1930,33 +1739,19 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_get_cache_size(H5AC_t * cache_ptr,
- size_t * max_size_ptr,
- size_t * min_clean_size_ptr,
- size_t * cur_size_ptr,
- int32_t * cur_num_entries_ptr)
+H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr,
+ size_t *cur_size_ptr, int32_t *cur_num_entries_ptr)
{
- herr_t result;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- result = H5C_get_cache_size((H5C_t *)cache_ptr,
- max_size_ptr,
- min_clean_size_ptr,
- cur_size_ptr,
- cur_num_entries_ptr);
-
- if ( result < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "H5C_get_cache_size() failed.")
- }
+ if(H5C_get_cache_size((H5C_t *)cache_ptr, max_size_ptr, min_clean_size_ptr,
+ cur_size_ptr, cur_num_entries_ptr) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_size() failed.")
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC_get_cache_size() */
@@ -1973,7 +1768,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_get_cache_hit_rate(H5AC_t * cache_ptr, double * hit_rate_ptr)
+H5AC_get_cache_hit_rate(H5AC_t *cache_ptr, double *hit_rate_ptr)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -2002,23 +1797,15 @@ done:
herr_t
H5AC_reset_cache_hit_rate_stats(H5AC_t * cache_ptr)
{
- herr_t result;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- result = H5C_reset_cache_hit_rate_stats((H5C_t *)cache_ptr);
-
- if ( result < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "H5C_reset_cache_hit_rate_stats() failed.")
- }
+ if(H5C_reset_cache_hit_rate_stats((H5C_t *)cache_ptr) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats() failed.")
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC_reset_cache_hit_rate_stats() */
@@ -2035,126 +1822,86 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr,
- H5AC_cache_config_t *config_ptr)
+H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr)
{
- herr_t result;
- herr_t ret_value = SUCCEED; /* Return value */
H5C_auto_size_ctl_t internal_config;
#if H5AC__TRACE_FILE_ENABLED
H5AC_cache_config_t trace_config = H5AC__DEFAULT_CACHE_CONFIG;
FILE * trace_file_ptr = NULL;
#endif /* H5AC__TRACE_FILE_ENABLED */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- HDassert( cache_ptr );
+ /* Sanity checks */
+ HDassert(cache_ptr);
#if H5AC__TRACE_FILE_ENABLED
/* Make note of the new configuration. Don't look up the trace file
* pointer, as that may change before we use it.
*/
- if ( config_ptr != NULL ) {
-
+ if(config_ptr != NULL)
trace_config = *config_ptr;
-
- }
#endif /* H5AC__TRACE_FILE_ENABLED */
- if ( ( cache_ptr == NULL )
+ if((cache_ptr == NULL)
#ifdef H5_HAVE_PARALLEL
- ||
- ( ( cache_ptr->aux_ptr != NULL )
- &&
- (
- ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic
- !=
- H5AC__H5AC_AUX_T_MAGIC
- )
- )
+ || ((cache_ptr->aux_ptr != NULL) &&
+ (((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic != H5AC__H5AC_AUX_T_MAGIC))
#endif /* H5_HAVE_PARALLEL */
- ) {
-
+ )
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad cache_ptr on entry.")
- }
-
- result = H5AC_validate_config(config_ptr);
-
- if ( result != SUCCEED ) {
-
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad cache configuration");
- }
-
- if ( config_ptr->open_trace_file ) {
-
- FILE * file_ptr = NULL;
-
- if ( H5C_get_trace_file_ptr(cache_ptr, &file_ptr) < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "H5C_get_trace_file_ptr() failed.")
- }
- if ( ( ! ( config_ptr->close_trace_file ) ) &&
- ( file_ptr != NULL ) ) {
+ /* Validate external configuration */
+ if(H5AC_validate_config(config_ptr) != SUCCEED)
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad cache configuration");
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \
- "Trace file already open.")
- }
- }
-
- if ( config_ptr->close_trace_file ) {
-
- if ( H5AC_close_trace_file(cache_ptr) < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "H5AC_close_trace_file() failed.")
- }
- }
+ if(config_ptr->open_trace_file) {
+ FILE * file_ptr;
- if ( config_ptr->open_trace_file ) {
+ if(NULL == (file_ptr = H5C_get_trace_file_ptr(cache_ptr)))
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_trace_file_ptr() failed.")
- if ( H5AC_open_trace_file(cache_ptr, config_ptr->trace_file_name) < 0 )
- {
+ if((!(config_ptr->close_trace_file)) && (file_ptr != NULL))
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Trace file already open.")
+ } /* end if */
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \
- "H5AC_open_trace_file() failed.")
- }
- }
+ /* Close & reopen trace file, if requested */
+ if(config_ptr->close_trace_file)
+ if(H5AC_close_trace_file(cache_ptr) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_close_trace_file() failed.")
+ if(config_ptr->open_trace_file)
+ if(H5AC_open_trace_file(cache_ptr, config_ptr->trace_file_name) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "H5AC_open_trace_file() failed.")
- if(H5AC_ext_config_2_int_config(config_ptr, &internal_config) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_ext_config_2_int_config() failed.")
+ /* Convert external configuration to internal representation */
+ if(H5AC__ext_config_2_int_config(config_ptr, &internal_config) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed.")
+ /* Set configuration */
if(H5C_set_cache_auto_resize_config(cache_ptr, &internal_config) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_cache_auto_resize_config() failed.")
-
if(H5C_set_evictions_enabled(cache_ptr, config_ptr->evictions_enabled) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_evictions_enabled() failed.")
#ifdef H5_HAVE_PARALLEL
- if ( cache_ptr->aux_ptr != NULL ) {
-
- ((H5AC_aux_t *)(cache_ptr->aux_ptr))->dirty_bytes_threshold =
- config_ptr->dirty_bytes_threshold;
-
- ((H5AC_aux_t *)(cache_ptr->aux_ptr))->metadata_write_strategy =
- config_ptr->metadata_write_strategy;
- }
+ /* Set parallel configuration values */
+ /* (Which are only held in the H5AC layer -QAK) */
+ if(cache_ptr->aux_ptr != NULL) {
+ ((H5AC_aux_t *)(cache_ptr->aux_ptr))->dirty_bytes_threshold = config_ptr->dirty_bytes_threshold;
+ ((H5AC_aux_t *)(cache_ptr->aux_ptr))->metadata_write_strategy = config_ptr->metadata_write_strategy;
+ } /* end if */
#endif /* H5_HAVE_PARALLEL */
done:
-
#if H5AC__TRACE_FILE_ENABLED
/* For the set cache auto resize config call, only the contents
* of the config is necessary in the trace file. Write the return
* value to catch occult errors.
*/
- if ( ( cache_ptr != NULL ) &&
- ( H5C_get_trace_file_ptr(cache_ptr, &trace_file_ptr) >= 0 ) &&
- ( trace_file_ptr != NULL ) ) {
-
+ if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr)))
HDfprintf(trace_file_ptr,
- "%s %d %d %d %d \"%s\" %d %d %d %f %d %d %ld %d %f %f %d %f %f %d %d %d %f %f %d %d %d %d %f %d %d %d\n",
+ "%s %d %d %d %d \"%s\" %d %d %d %f %d %d %ld %d %f %f %d %f %f %d %d %d %f %f %d %d %d %d %f %zu %d %d\n",
"H5AC_set_cache_auto_resize_config",
trace_config.version,
(int)(trace_config.rpt_fcn_enabled),
@@ -2187,11 +1934,9 @@ done:
trace_config.dirty_bytes_threshold,
trace_config.metadata_write_strategy,
(int)ret_value);
- }
#endif /* H5AC__TRACE_FILE_ENABLED */
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC_set_cache_auto_resize_config() */
@@ -2218,27 +1963,18 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_validate_config(H5AC_cache_config_t * config_ptr)
+H5AC_validate_config(H5AC_cache_config_t *config_ptr)
{
H5C_auto_size_ctl_t internal_config;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
+ /* Check args */
if(config_ptr == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.")
-
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.")
if(config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown config version.")
-
- if((config_ptr->rpt_fcn_enabled != TRUE) && (config_ptr->rpt_fcn_enabled != FALSE))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->rpt_fcn_enabled must be either TRUE or FALSE.")
-
- if((config_ptr->open_trace_file != TRUE) && (config_ptr->open_trace_file != FALSE))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->open_trace_file must be either TRUE or FALSE.")
-
- if((config_ptr->close_trace_file != TRUE) && (config_ptr->close_trace_file != FALSE))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->close_trace_file must be either TRUE or FALSE.")
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown config version.")
/* don't bother to test trace_file_name unless open_trace_file is TRUE */
if(config_ptr->open_trace_file) {
@@ -2249,45 +1985,32 @@ H5AC_validate_config(H5AC_cache_config_t * config_ptr)
* sanity checks on the length of the file name.
*/
name_len = HDstrlen(config_ptr->trace_file_name);
+ if(name_len == 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name is empty.")
+ else if(name_len > H5AC__MAX_TRACE_FILE_NAME_LEN)
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name too long.")
+ } /* end if */
- if(name_len == 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name is empty.")
- } else if(name_len > H5AC__MAX_TRACE_FILE_NAME_LEN) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name too long.")
- }
- }
-
- if ( ( config_ptr->evictions_enabled != TRUE ) &&
- ( config_ptr->evictions_enabled != FALSE ) ) {
-
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \
- "config_ptr->evictions_enabled must be either TRUE or FALSE.")
- }
-
- if ( ( config_ptr->evictions_enabled == FALSE ) &&
- ( ( config_ptr->incr_mode != H5C_incr__off ) ||
- ( config_ptr->flash_incr_mode != H5C_flash_incr__off ) ||
- ( config_ptr->decr_mode != H5C_decr__off ) ) ) {
+ if((config_ptr->evictions_enabled == FALSE) &&
+ ((config_ptr->incr_mode != H5C_incr__off) ||
+ (config_ptr->flash_incr_mode != H5C_flash_incr__off) ||
+ (config_ptr->decr_mode != H5C_decr__off)))
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Can't disable evictions while auto-resize is enabled.")
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \
- "Can't disable evictions while auto-resize is enabled.")
- }
-
- if(config_ptr->dirty_bytes_threshold < H5AC__MIN_DIRTY_BYTES_THRESHOLD) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too small.")
- } else if(config_ptr->dirty_bytes_threshold > H5AC__MAX_DIRTY_BYTES_THRESHOLD) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too big.")
- }
+ if(config_ptr->dirty_bytes_threshold < H5AC__MIN_DIRTY_BYTES_THRESHOLD)
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too small.")
+ else if(config_ptr->dirty_bytes_threshold > H5AC__MAX_DIRTY_BYTES_THRESHOLD)
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too big.")
if((config_ptr->metadata_write_strategy != H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY) &&
(config_ptr->metadata_write_strategy != H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->metadata_write_strategy out of range.")
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->metadata_write_strategy out of range.")
- if(H5AC_ext_config_2_int_config(config_ptr, &internal_config) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_ext_config_2_int_config() failed.")
+ if(H5AC__ext_config_2_int_config(config_ptr, &internal_config) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed.")
if(H5C_validate_resize_config(&internal_config, H5C_RESIZE_CFG__VALIDATE_ALL) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error(s) in new config.")
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "error(s) in new config.")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -2311,44 +2034,29 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_close_trace_file(H5AC_t * cache_ptr)
-
+H5AC_close_trace_file(H5AC_t *cache_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
FILE * trace_file_ptr = NULL;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if ( cache_ptr == NULL ) {
-
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL cache_ptr on entry.")
- }
+ if(cache_ptr == NULL)
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "NULL cache_ptr on entry.")
- if ( H5C_get_trace_file_ptr(cache_ptr, &trace_file_ptr) < 0 ) {
+ if(NULL == (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr)))
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_trace_file_ptr() failed.")
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "H5C_get_trace_file_ptr() failed.")
- }
-
- if ( trace_file_ptr != NULL ) {
-
- if ( H5C_set_trace_file_ptr(cache_ptr, NULL) < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "H5C_set_trace_file_ptr() failed.")
- }
-
- if ( HDfclose(trace_file_ptr) != 0 ) {
+ if(trace_file_ptr != NULL) {
+ if(H5C_set_trace_file_ptr(cache_ptr, NULL) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_trace_file_ptr() failed.")
- HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, \
- "can't close metadata cache trace file")
- }
- }
+ if(HDfclose(trace_file_ptr) != 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close metadata cache trace file")
+ } /* end if */
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC_close_trace_file() */
@@ -2369,99 +2077,57 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_open_trace_file(H5AC_t * cache_ptr,
- const char * trace_file_name)
+H5AC_open_trace_file(H5AC_t *cache_ptr, const char *trace_file_name)
{
- herr_t ret_value = SUCCEED; /* Return value */
char file_name[H5AC__MAX_TRACE_FILE_NAME_LEN + H5C__PREFIX_LEN + 2];
FILE * file_ptr = NULL;
#ifdef H5_HAVE_PARALLEL
H5AC_aux_t * aux_ptr = NULL;
#endif /* H5_HAVE_PARALLEL */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
HDassert(cache_ptr);
- if ( cache_ptr == NULL ) {
-
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cache_ptr NULL on entry.")
- }
-
- if ( trace_file_name == NULL ) {
-
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \
- "NULL trace_file_name on entry.")
- }
-
- if ( HDstrlen(trace_file_name) > H5AC__MAX_TRACE_FILE_NAME_LEN ) {
-
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trace file name too long.")
- }
-
- if ( H5C_get_trace_file_ptr(cache_ptr, &file_ptr) < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "H5C_get_trace_file_ptr() failed.")
- }
-
- if ( file_ptr != NULL ) {
-
- HGOTO_ERROR(H5E_FILE, H5E_FILEOPEN, FAIL, "trace file already open.")
- }
+ /* Check args */
+ if(cache_ptr == NULL)
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "cache_ptr NULL on entry.")
+ if(trace_file_name == NULL)
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "NULL trace_file_name on entry.")
+ if(HDstrlen(trace_file_name) > H5AC__MAX_TRACE_FILE_NAME_LEN)
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "trace file name too long.")
+ if(NULL != (file_ptr = H5C_get_trace_file_ptr(cache_ptr)))
+ HGOTO_ERROR(H5E_CACHE, H5E_FILEOPEN, FAIL, "trace file already open.")
#ifdef H5_HAVE_PARALLEL
-
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
- if ( cache_ptr->aux_ptr == NULL ) {
-
+ if(cache_ptr->aux_ptr == NULL)
sprintf(file_name, "%s", trace_file_name);
-
- } else {
-
- if ( aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC ) {
-
+ else {
+ if(aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad aux_ptr->magic.")
- }
sprintf(file_name, "%s.%d", trace_file_name, aux_ptr->mpi_rank);
+ } /* end else */
- }
-
- if ( HDstrlen(file_name) >
- H5AC__MAX_TRACE_FILE_NAME_LEN + H5C__PREFIX_LEN + 1 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "cooked trace file name too long.")
- }
-
+ if(HDstrlen(file_name) > H5AC__MAX_TRACE_FILE_NAME_LEN + H5C__PREFIX_LEN + 1)
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "cooked trace file name too long.")
#else /* H5_HAVE_PARALLEL */
-
- HDsnprintf(file_name,
- (size_t)(H5AC__MAX_TRACE_FILE_NAME_LEN + H5C__PREFIX_LEN + 1),
+ HDsnprintf(file_name, (size_t)(H5AC__MAX_TRACE_FILE_NAME_LEN + H5C__PREFIX_LEN + 1),
"%s", trace_file_name);
-
#endif /* H5_HAVE_PARALLEL */
- if ( (file_ptr = HDfopen(file_name, "w")) == NULL ) {
-
- /* trace file open failed */
+ if((file_ptr = HDfopen(file_name, "w")) == NULL)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "trace file open failed.")
- }
- HDfprintf(file_ptr, "### HDF5 metadata cache trace file ###\n");
+ HDfprintf(file_ptr, "### HDF5 metadata cache trace file version 1 ###\n");
- if ( H5C_set_trace_file_ptr(cache_ptr, file_ptr) < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "H5C_set_trace_file_ptr() failed.")
- }
+ if(H5C_set_trace_file_ptr(cache_ptr, file_ptr) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_trace_file_ptr() failed.")
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC_open_trace_file() */
@@ -2485,8 +2151,7 @@ done:
*/
#ifdef H5_HAVE_PARALLEL
herr_t
-H5AC_add_candidate(H5AC_t * cache_ptr,
- haddr_t addr)
+H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr)
{
H5AC_aux_t * aux_ptr;
H5AC_slist_entry_t * slist_entry_ptr = NULL;
@@ -2494,36 +2159,31 @@ H5AC_add_candidate(H5AC_t * cache_ptr,
FUNC_ENTER_NOAPI(FAIL)
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
-
+ /* Sanity checks */
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED);
+ HDassert(aux_ptr->candidate_slist_ptr != NULL);
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- HDassert( aux_ptr->metadata_write_strategy ==
- H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED );
- HDassert( aux_ptr->candidate_slist_ptr != NULL );
-
- /* If the supplied address appears in the candidate list, scream and die. */
- if(NULL != H5SL_search(aux_ptr->candidate_slist_ptr, (void *)(&addr)))
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry already in candidate slist.")
-
- /* otherwise, construct an entry for the supplied address, and insert
+ /* Construct an entry for the supplied address, and insert
* it into the candidate slist.
*/
- if(NULL == (slist_entry_ptr = H5FL_CALLOC(H5AC_slist_entry_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "Can't allocate candidate slist entry .")
-
- slist_entry_ptr->magic = H5AC__H5AC_SLIST_ENTRY_T_MAGIC;
+ if(NULL == (slist_entry_ptr = H5FL_MALLOC(H5AC_slist_entry_t)))
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate candidate slist entry")
slist_entry_ptr->addr = addr;
if(H5SL_insert(aux_ptr->candidate_slist_ptr, slist_entry_ptr, &(slist_entry_ptr->addr)) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "can't insert entry into dirty entry slist.")
-
- aux_ptr->candidate_slist_len += 1;
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "can't insert entry into dirty entry slist")
done:
+ /* Clean up on error */
+ if(ret_value < 0)
+ if(slist_entry_ptr)
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_add_candidate() */
#endif /* H5_HAVE_PARALLEL */
@@ -2570,33 +2230,22 @@ done:
*
* Programmer: John Mainzer, 5/30/14
*
- * Changes:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
#ifndef NDEBUG
herr_t
-H5AC_get_entry_ptr_from_addr(const H5F_t *f,
- haddr_t addr,
- void ** entry_ptr_ptr)
+H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr, void **entry_ptr_ptr)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if ( H5C_get_entry_ptr_from_addr(f, addr, entry_ptr_ptr) < 0 )
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "H5C_get_entry_ptr_from_addr() failed.")
+ if(H5C_get_entry_ptr_from_addr(f, addr, entry_ptr_ptr) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_ptr_from_addr() failed")
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC_get_entry_ptr_from_addr() */
-
#endif /* NDEBUG */
@@ -2626,36 +2275,23 @@ done:
*
* Programmer: John Mainzer, 5/30/14
*
- * Changes:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
#ifndef NDEBUG
herr_t
-H5AC_verify_entry_type(const H5F_t *f,
- haddr_t addr,
- const H5AC_class_t * expected_type,
- hbool_t * in_cache_ptr,
- hbool_t * type_ok_ptr)
+H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, const H5AC_class_t *expected_type,
+ hbool_t *in_cache_ptr, hbool_t *type_ok_ptr)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if ( H5C_verify_entry_type(f, addr, (const H5C_class_t *)expected_type,
- in_cache_ptr, type_ok_ptr) < 0 )
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "H5C_verify_entry_type() failed.")
+ if(H5C_verify_entry_type(f, addr, expected_type, in_cache_ptr, type_ok_ptr) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_verify_entry_type() failed")
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC_verify_entry_type() */
-
#endif /* NDEBUG */
@@ -2666,7 +2302,7 @@ done:
/*-------------------------------------------------------------------------
*
- * Function: H5AC_broadcast_candidate_list()
+ * Function: H5AC__broadcast_candidate_list()
*
* Purpose: Broadcast the contents of the process 0 candidate entry
* slist. In passing, also remove all entries from said
@@ -2690,98 +2326,125 @@ done:
*/
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_broadcast_candidate_list(H5AC_t * cache_ptr,
- int * num_entries_ptr,
- haddr_t ** haddr_buf_ptr_ptr)
+H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, int *num_entries_ptr,
+ haddr_t **haddr_buf_ptr_ptr)
{
- hbool_t success = FALSE;
H5AC_aux_t * aux_ptr = NULL;
haddr_t * haddr_buf_ptr = NULL;
- MPI_Offset * MPI_Offset_buf_ptr = NULL;
- size_t buf_size = 0;
int mpi_result;
- int chk_num_entries = 0;
- int num_entries = 0;
+ int num_entries;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- HDassert( aux_ptr->mpi_rank == 0 );
- HDassert( aux_ptr->metadata_write_strategy ==
- H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED );
- HDassert( aux_ptr->candidate_slist_ptr != NULL );
- HDassert( H5SL_count(aux_ptr->candidate_slist_ptr) ==
- (size_t)(aux_ptr->candidate_slist_len) );
- HDassert( num_entries_ptr != NULL );
- HDassert( *num_entries_ptr == 0 );
- HDassert( haddr_buf_ptr_ptr != NULL );
- HDassert( *haddr_buf_ptr_ptr == NULL );
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->mpi_rank == 0);
+ HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED);
+ HDassert(aux_ptr->candidate_slist_ptr != NULL);
+ HDassert(num_entries_ptr != NULL);
+ HDassert(*num_entries_ptr == 0);
+ HDassert(haddr_buf_ptr_ptr != NULL);
+ HDassert(*haddr_buf_ptr_ptr == NULL);
/* First broadcast the number of entries in the list so that the
* receivers can set up buffers to receive them. If there aren't
* any, we are done.
*/
- num_entries = aux_ptr->candidate_slist_len;
+ num_entries = (int)H5SL_count(aux_ptr->candidate_slist_ptr);
if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, aux_ptr->mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 1", mpi_result)
+ HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result)
if(num_entries > 0) {
+ size_t buf_size = 0;
+ int chk_num_entries = 0;
+
/* convert the candidate list into the format we
* are used to receiving from process 0, and also load it
* into a buffer for transmission.
*/
- if(H5AC_copy_candidate_list_to_buffer(cache_ptr, &chk_num_entries,
- &haddr_buf_ptr, &buf_size, &MPI_Offset_buf_ptr) < 0)
+ if(H5AC__copy_candidate_list_to_buffer(cache_ptr, &chk_num_entries, &haddr_buf_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate buffer.")
+ HDassert(chk_num_entries == num_entries);
+ HDassert(haddr_buf_ptr != NULL);
- HDassert( chk_num_entries == num_entries );
- HDassert( haddr_buf_ptr != NULL );
- HDassert( MPI_Offset_buf_ptr != NULL );
- HDassert( aux_ptr->candidate_slist_len == 0 );
-
- /* Now broadcast the list of candidate entries -- if there is one.
- *
- * The peculiar structure of the following call to MPI_Bcast is
- * due to MPI's (?) failure to believe in the MPI_Offset type.
- * Thus the element type is MPI_BYTE, with size equal to the
- * buf_size computed above.
- */
- if(MPI_SUCCESS != (mpi_result = MPI_Bcast((void *)MPI_Offset_buf_ptr, (int)buf_size, MPI_BYTE, 0, aux_ptr->mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 2", mpi_result)
+ /* Now broadcast the list of candidate entries */
+ buf_size = sizeof(haddr_t) * (size_t)num_entries;
+ if(MPI_SUCCESS != (mpi_result = MPI_Bcast((void *)haddr_buf_ptr, (int)buf_size, MPI_BYTE, 0, aux_ptr->mpi_comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result)
} /* end if */
- success = TRUE;
+ /* Pass the number of entries and the buffer pointer
+ * back to the caller. Do this so that we can use the same code
+ * to apply the candidate list to all the processes.
+ */
+ *num_entries_ptr = num_entries;
+ *haddr_buf_ptr_ptr = haddr_buf_ptr;
done:
- if(MPI_Offset_buf_ptr != NULL)
- MPI_Offset_buf_ptr = (MPI_Offset *)H5MM_xfree((void *)MPI_Offset_buf_ptr);
-
- if(success) {
- /* Pass the number of entries and the buffer pointer
- * back to the caller. Do this so that we can use the same code
- * to apply the candidate list to all the processes.
- */
- *num_entries_ptr = num_entries;
- *haddr_buf_ptr_ptr = haddr_buf_ptr;
- } else if(haddr_buf_ptr != NULL) {
- haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr);
- }
+ if(ret_value < 0)
+ if(haddr_buf_ptr)
+ haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr);
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_broadcast_candidate_list() */
+} /* H5AC__broadcast_candidate_list() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
*
- * Function: H5AC_broadcast_clean_list()
+ * Function: H5AC__broadcast_clean_list_cb()
+ *
+ * Purpose: Skip list callback for building array of addresses for
+ * broadcasting the clean list.
+ *
+ * Return: Non-negative on success/Negative on failure.
+ *
+ * Programmer: Quincey Koziol, 6/12/15
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_PARALLEL
+static herr_t
+H5AC__broadcast_clean_list_cb(void *_item, void H5_ATTR_UNUSED *_key,
+ void *_udata)
+{
+ H5AC_slist_entry_t * slist_entry_ptr = (H5AC_slist_entry_t *)_item; /* Address of item */
+ H5AC_addr_list_ud_t * udata = (H5AC_addr_list_ud_t *)_udata; /* Context for callback */
+ haddr_t addr;
+
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Sanity checks */
+ HDassert(slist_entry_ptr);
+ HDassert(udata);
+
+ /* Store the entry's address in the buffer */
+ addr = slist_entry_ptr->addr;
+ udata->addr_buf_ptr[udata->i] = addr;
+ udata->i++;
+
+ /* now release the entry */
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
+
+ /* and also remove the matching entry from the dirtied list
+ * if it exists.
+ */
+ if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(udata->aux_ptr->d_slist_ptr, (void *)(&addr))))
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5AC__broadcast_clean_list_cb() */
+#endif /* H5_HAVE_PARALLEL */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5AC__broadcast_clean_list()
*
* Purpose: Broadcast the contents of the process 0 cleaned entry
* slist. In passing, also remove all entries from said
@@ -2801,174 +2464,76 @@ done:
*/
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_broadcast_clean_list(H5AC_t * cache_ptr)
+H5AC__broadcast_clean_list(H5AC_t * cache_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
- haddr_t addr;
haddr_t * addr_buf_ptr = NULL;
- H5AC_aux_t * aux_ptr = NULL;
- H5SL_node_t * slist_node_ptr = NULL;
- H5AC_slist_entry_t * slist_entry_ptr = NULL;
- MPI_Offset * buf_ptr = NULL;
- size_t buf_size;
- int i = 0;
+ H5AC_aux_t * aux_ptr;
int mpi_result;
int num_entries = 0;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)cache_ptr->aux_ptr;
-
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- HDassert( aux_ptr->mpi_rank == 0 );
- HDassert( aux_ptr->c_slist_ptr != NULL );
- HDassert( H5SL_count(aux_ptr->c_slist_ptr) ==
- (size_t)(aux_ptr->c_slist_len) );
-
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->mpi_rank == 0);
+ HDassert(aux_ptr->c_slist_ptr != NULL);
/* First broadcast the number of entries in the list so that the
* receives can set up a buffer to receive them. If there aren't
* any, we are done.
*/
- num_entries = aux_ptr->c_slist_len;
-
- mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, aux_ptr->mpi_comm);
-
- if ( mpi_result != MPI_SUCCESS ) {
-
- HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 1", mpi_result)
+ num_entries = (int)H5SL_count(aux_ptr->c_slist_ptr);
+ if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, aux_ptr->mpi_comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result)
- }
+ if(num_entries > 0) {
+ H5AC_addr_list_ud_t udata;
+ size_t buf_size;
- if ( num_entries > 0 )
- {
/* allocate a buffer to store the list of entry base addresses in */
+ buf_size = sizeof(haddr_t) * (size_t)num_entries;
+ if(NULL == (addr_buf_ptr = (haddr_t *)H5MM_malloc(buf_size)))
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for addr buffer")
+
+ /* Set up user data for callback */
+ udata.aux_ptr = aux_ptr;
+ udata.addr_buf_ptr = addr_buf_ptr;
+ udata.i = 0;
+
+ /* Free all the clean list entries, building the address list in the callback */
+ /* (Callback also removes the matching entries from the dirtied list) */
+ if(H5SL_free(aux_ptr->c_slist_ptr, H5AC__broadcast_clean_list_cb, &udata) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "Can't build address list for clean entries")
+
+ /* Now broadcast the list of cleaned entries */
+ if(MPI_SUCCESS != (mpi_result = MPI_Bcast((void *)addr_buf_ptr, (int)buf_size, MPI_BYTE, 0, aux_ptr->mpi_comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result)
+ } /* end if */
- buf_size = sizeof(MPI_Offset) * (size_t)num_entries;
-
- buf_ptr = (MPI_Offset *)H5MM_malloc(buf_size);
-
- if ( buf_ptr == NULL ) {
-
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \
- "memory allocation failed for clean entry buffer")
- }
-
- /* if the sync_point_done callback is defined, allocate the
- * addr buffer as well.
- */
- if ( aux_ptr->sync_point_done != NULL ) {
-
- addr_buf_ptr = (haddr_t *)H5MM_malloc((size_t)num_entries * sizeof(haddr_t));
-
- if ( addr_buf_ptr == NULL ) {
-
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \
- "memory allocation failed for addr buffer")
- }
- }
-
-
- /* now load the entry base addresses into the buffer, emptying the
- * cleaned entry list in passing
- */
-
- while ( NULL != (slist_node_ptr = H5SL_first(aux_ptr->c_slist_ptr) ) )
- {
- slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_item(slist_node_ptr);
-
- HDassert(slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC);
-
- HDassert( i < num_entries );
-
- addr = slist_entry_ptr->addr;
-
- if ( addr_buf_ptr != NULL ) {
-
- addr_buf_ptr[i] = addr;
- }
-
- if ( H5FD_mpi_haddr_to_MPIOff(addr, &(buf_ptr[i])) < 0 ) {
-
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, \
- "can't convert from haddr to MPI off")
- }
-
- i++;
-
- /* now remove the entry from the cleaned entry list */
- if ( H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr))
- != slist_entry_ptr ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, \
- "Can't delete entry from cleaned entry slist.")
- }
-
- slist_entry_ptr->magic = 0;
- slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
-
- aux_ptr->c_slist_len -= 1;
-
- HDassert( aux_ptr->c_slist_len >= 0 );
-
- /* and also remove the matching entry from the dirtied list
- * if it exists.
- */
- if((slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_search(aux_ptr->d_slist_ptr, (void *)(&addr))) != NULL) {
- HDassert( slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC );
- HDassert( slist_entry_ptr->addr == addr );
-
- if(H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&addr)) != slist_entry_ptr)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from dirty entry slist.")
-
- slist_entry_ptr->magic = 0;
- slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
-
- aux_ptr->d_slist_len -= 1;
-
- HDassert( aux_ptr->d_slist_len >= 0 );
- } /* end if */
- } /* while */
-
-
- /* Now broadcast the list of cleaned entries -- if there is one.
- *
- * The peculiar structure of the following call to MPI_Bcast is
- * due to MPI's (?) failure to believe in the MPI_Offset type.
- * Thus the element type is MPI_BYTE, with size equal to the
- * buf_size computed above.
- */
-
- mpi_result = MPI_Bcast((void *)buf_ptr, (int)buf_size, MPI_BYTE, 0,
- aux_ptr->mpi_comm);
-
- if ( mpi_result != MPI_SUCCESS ) {
-
- HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 2", mpi_result)
- }
- }
-
- if(aux_ptr->sync_point_done != NULL)
+ /* if it is defined, call the sync point done callback. Note
+ * that this callback is defined purely for testing purposes,
+ * and should be undefined under normal operating circumstances.
+ */
+ if(aux_ptr->sync_point_done)
(aux_ptr->sync_point_done)(num_entries, addr_buf_ptr);
done:
- if(buf_ptr != NULL)
- buf_ptr = (MPI_Offset *)H5MM_xfree((void *)buf_ptr);
- if(addr_buf_ptr != NULL)
+ if(addr_buf_ptr)
addr_buf_ptr = (haddr_t *)H5MM_xfree((void *)addr_buf_ptr);
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_broadcast_clean_list() */
+} /* H5AC__broadcast_clean_list() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
*
- * Function: H5AC_check_if_write_permitted
+ * Function: H5AC__check_if_write_permitted
*
* Purpose: Determine if a write is permitted under the current
* circumstances, and set *write_permitted_ptr accordingly.
@@ -2985,62 +2550,44 @@ done:
*
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_PARALLEL
-static herr_t
-H5AC_check_if_write_permitted(const H5F_t *f,
- hid_t H5_ATTR_UNUSED dxpl_id,
- hbool_t * write_permitted_ptr)
-#else /* H5_HAVE_PARALLEL */
static herr_t
-H5AC_check_if_write_permitted(const H5F_t H5_ATTR_UNUSED * f,
- hid_t H5_ATTR_UNUSED dxpl_id,
- hbool_t * write_permitted_ptr)
+H5AC__check_if_write_permitted(const H5F_t
+#ifndef H5_HAVE_PARALLEL
+H5_ATTR_UNUSED
#endif /* H5_HAVE_PARALLEL */
+ *f, hbool_t *write_permitted_ptr)
{
- hbool_t write_permitted = TRUE;
- herr_t ret_value = SUCCEED; /* Return value */
#ifdef H5_HAVE_PARALLEL
H5AC_aux_t * aux_ptr = NULL;
#endif /* H5_HAVE_PARALLEL */
+ hbool_t write_permitted = TRUE;
-
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC_NOERR
#ifdef H5_HAVE_PARALLEL
- HDassert( f != NULL );
- HDassert( f->shared != NULL );
- HDassert( f->shared->cache != NULL );
-
+ /* Sanity checks */
+ HDassert(f != NULL);
+ HDassert(f->shared != NULL);
+ HDassert(f->shared->cache != NULL);
aux_ptr = (H5AC_aux_t *)(f->shared->cache->aux_ptr);
+ if(aux_ptr != NULL) {
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
- if ( aux_ptr != NULL ) {
-
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
-
- if ( ( aux_ptr->mpi_rank == 0 ) ||
- ( aux_ptr->metadata_write_strategy ==
- H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED ) ) {
-
+ if((aux_ptr->mpi_rank == 0) || (aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED))
write_permitted = aux_ptr->write_permitted;
-
- } else {
-
+ else
write_permitted = FALSE;
- }
- }
+ } /* end if */
#endif /* H5_HAVE_PARALLEL */
*write_permitted_ptr = write_permitted;
-done:
-
- FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5AC_check_if_write_permitted() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5AC__check_if_write_permitted() */
/*-------------------------------------------------------------------------
- * Function: H5AC_construct_candidate_list()
+ * Function: H5AC__construct_candidate_list()
*
* Purpose: In the parallel case when the metadata_write_strategy is
* H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, process 0 uses
@@ -3060,29 +2607,26 @@ done:
*/
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_construct_candidate_list(H5AC_t * cache_ptr,
- H5AC_aux_t * aux_ptr,
- int sync_point_op)
+H5AC__construct_candidate_list(H5AC_t *cache_ptr, H5AC_aux_t *aux_ptr,
+ int sync_point_op)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- HDassert( aux_ptr->metadata_write_strategy ==
- H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED );
- HDassert( ( sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_CACHE ) ||
- ( aux_ptr->mpi_rank == 0 ) );
- HDassert( aux_ptr->d_slist_ptr != NULL );
- HDassert( aux_ptr->c_slist_ptr != NULL );
- HDassert( aux_ptr->c_slist_len == 0 );
- HDassert( aux_ptr->candidate_slist_ptr != NULL );
- HDassert( aux_ptr->candidate_slist_len == 0 );
- HDassert( ( sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN ) ||
- ( sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_CACHE ) );
+ /* Sanity checks */
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED);
+ HDassert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_CACHE) || (aux_ptr->mpi_rank == 0));
+ HDassert(aux_ptr->d_slist_ptr != NULL);
+ HDassert(aux_ptr->c_slist_ptr != NULL);
+ HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0);
+ HDassert(aux_ptr->candidate_slist_ptr != NULL);
+ HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0);
+ HDassert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) || (sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_CACHE));
switch(sync_point_op) {
case H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN:
@@ -3102,13 +2646,52 @@ H5AC_construct_candidate_list(H5AC_t * cache_ptr,
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_construct_candidate_list() */
+} /* H5AC__construct_candidate_list() */
+#endif /* H5_HAVE_PARALLEL */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5AC__copy_candidate_list_to_buffer_cb
+ *
+ * Purpose: Skip list callback for building array of addresses for
+ * broadcasting the candidate list.
+ *
+ * Return: Return SUCCEED on success, and FAIL on failure.
+ *
+ * Programmer: Quincey Koziol, 6/12/15
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_PARALLEL
+static herr_t
+H5AC__copy_candidate_list_to_buffer_cb(void *_item, void H5_ATTR_UNUSED *_key,
+ void *_udata)
+{
+ H5AC_slist_entry_t * slist_entry_ptr = (H5AC_slist_entry_t *)_item; /* Address of item */
+ H5AC_addr_list_ud_t * udata = (H5AC_addr_list_ud_t *)_udata; /* Context for callback */
+
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Sanity checks */
+ HDassert(slist_entry_ptr);
+ HDassert(udata);
+
+ /* Store the entry's address in the buffer */
+ udata->addr_buf_ptr[udata->i] = slist_entry_ptr->addr;
+ udata->i++;
+
+ /* now release the entry */
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5AC__copy_candidate_list_to_buffer_cb() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
*
- * Function: H5AC_copy_candidate_list_to_buffer
+ * Function: H5AC__copy_candidate_list_to_buffer
*
* Purpose: Allocate buffer(s) and copy the contents of the candidate
* entry slist into it (them). In passing, remove all
@@ -3139,123 +2722,68 @@ done:
*/
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_copy_candidate_list_to_buffer(H5AC_t * cache_ptr,
- int * num_entries_ptr,
- haddr_t ** haddr_buf_ptr_ptr,
- size_t * MPI_Offset_buf_size_ptr,
- MPI_Offset ** MPI_Offset_buf_ptr_ptr)
+H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, int *num_entries_ptr,
+ haddr_t **haddr_buf_ptr_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
- hbool_t success = FALSE;
- haddr_t addr;
H5AC_aux_t * aux_ptr = NULL;
- H5SL_node_t * slist_node_ptr = NULL;
- H5AC_slist_entry_t * slist_entry_ptr = NULL;
- MPI_Offset * MPI_Offset_buf_ptr = NULL;
+ H5AC_addr_list_ud_t udata;
haddr_t * haddr_buf_ptr = NULL;
size_t buf_size;
- int i = 0;
int num_entries = 0;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED);
+ HDassert(aux_ptr->candidate_slist_ptr != NULL);
+ HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) > 0);
+ HDassert(num_entries_ptr != NULL);
+ HDassert(*num_entries_ptr == 0);
+ HDassert(haddr_buf_ptr_ptr != NULL);
+ HDassert(*haddr_buf_ptr_ptr == NULL);
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- HDassert( aux_ptr->metadata_write_strategy ==
- H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED );
- HDassert( aux_ptr->candidate_slist_ptr != NULL );
- HDassert( H5SL_count(aux_ptr->candidate_slist_ptr) ==
- (size_t)(aux_ptr->candidate_slist_len) );
- HDassert( aux_ptr->candidate_slist_len > 0 );
- HDassert( num_entries_ptr != NULL );
- HDassert( *num_entries_ptr == 0 );
- HDassert( haddr_buf_ptr_ptr != NULL );
- HDassert( *haddr_buf_ptr_ptr == NULL );
-
- num_entries = aux_ptr->candidate_slist_len;
+ num_entries = (int)H5SL_count(aux_ptr->candidate_slist_ptr);
/* allocate a buffer(s) to store the list of candidate entry
* base addresses in
*/
- if(MPI_Offset_buf_ptr_ptr != NULL) {
- HDassert( MPI_Offset_buf_size_ptr != NULL );
+ buf_size = sizeof(haddr_t) * (size_t)num_entries;
+ if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(buf_size)))
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for haddr buffer")
- /* allocate a buffer of MPI_Offset */
- buf_size = sizeof(MPI_Offset) * (size_t)num_entries;
- if(NULL == (MPI_Offset_buf_ptr = (MPI_Offset *)H5MM_malloc(buf_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for MPI_Offset buffer")
- } /* end if */
+ /* Set up user data for callback */
+ udata.aux_ptr = aux_ptr;
+ udata.addr_buf_ptr = haddr_buf_ptr;
+ udata.i = 0;
- /* allocate a buffer of haddr_t */
- if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(sizeof(haddr_t) * (size_t)num_entries)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for haddr buffer")
+ /* Free all the candidate list entries, building the address list in the callback */
+ if(H5SL_free(aux_ptr->candidate_slist_ptr, H5AC__copy_candidate_list_to_buffer_cb, &udata) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "Can't build address list for candidate entries")
- /* now load the entry base addresses into the buffer, emptying the
- * candidate entry list in passing
+ /* Pass the number of entries and the buffer pointer
+ * back to the caller.
*/
- while(NULL != (slist_node_ptr = H5SL_first(aux_ptr->candidate_slist_ptr))) {
- slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_item(slist_node_ptr);
-
- HDassert(slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC);
- HDassert( i < num_entries );
-
- addr = slist_entry_ptr->addr;
- haddr_buf_ptr[i] = addr;
- if(MPI_Offset_buf_ptr != NULL) {
- if(H5FD_mpi_haddr_to_MPIOff(addr, &(MPI_Offset_buf_ptr[i])) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from haddr to MPI off")
- } /* end if */
-
- i++;
-
- /* now remove the entry from the cleaned entry list */
- if(H5SL_remove(aux_ptr->candidate_slist_ptr, (void *)(&addr)) != slist_entry_ptr)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from candidate entry slist.")
-
- slist_entry_ptr->magic = 0;
- slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
-
- aux_ptr->candidate_slist_len -= 1;
-
- HDassert( aux_ptr->candidate_slist_len >= 0 );
- } /* while */
- HDassert( aux_ptr->candidate_slist_len == 0 );
-
- success = TRUE;
+ *num_entries_ptr = num_entries;
+ *haddr_buf_ptr_ptr = haddr_buf_ptr;
done:
- if(success) {
- /* Pass the number of entries and the buffer pointer
- * back to the caller.
- */
- *num_entries_ptr = num_entries;
- *haddr_buf_ptr_ptr = haddr_buf_ptr;
-
- if(MPI_Offset_buf_ptr_ptr != NULL) {
- HDassert( MPI_Offset_buf_ptr != NULL);
- *MPI_Offset_buf_size_ptr = buf_size;
- *MPI_Offset_buf_ptr_ptr = MPI_Offset_buf_ptr;
- } /* end if */
- } /* end if */
- else {
- if(MPI_Offset_buf_ptr != NULL)
- MPI_Offset_buf_ptr = (MPI_Offset *)H5MM_xfree((void *)MPI_Offset_buf_ptr);
- if(haddr_buf_ptr != NULL)
+ if(ret_value < 0)
+ if(haddr_buf_ptr)
haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr);
- } /* end else */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_copy_candidate_list_to_buffer() */
+} /* H5AC__copy_candidate_list_to_buffer() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
- * Function: H5AC_ext_config_2_int_config()
+ * Function: H5AC__ext_config_2_int_config()
*
* Purpose: Utility function to translate an instance of
* H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t.
@@ -3273,30 +2801,22 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5AC_ext_config_2_int_config(H5AC_cache_config_t * ext_conf_ptr,
- H5C_auto_size_ctl_t * int_conf_ptr)
+H5AC__ext_config_2_int_config(H5AC_cache_config_t *ext_conf_ptr,
+ H5C_auto_size_ctl_t *int_conf_ptr)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
- if ( ( ext_conf_ptr == NULL ) ||
- ( ext_conf_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION ) ||
- ( int_conf_ptr == NULL ) ) {
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "Bad ext_conf_ptr or inf_conf_ptr on entry.")
- }
+ if((ext_conf_ptr == NULL) || (ext_conf_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION) ||
+ (int_conf_ptr == NULL))
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad ext_conf_ptr or inf_conf_ptr on entry.")
int_conf_ptr->version = H5C__CURR_AUTO_SIZE_CTL_VER;
-
- if ( ext_conf_ptr->rpt_fcn_enabled ) {
-
+ if(ext_conf_ptr->rpt_fcn_enabled)
int_conf_ptr->rpt_fcn = H5C_def_auto_resize_rpt_fcn;
-
- } else {
-
+ else
int_conf_ptr->rpt_fcn = NULL;
- }
int_conf_ptr->set_initial_size = ext_conf_ptr->set_initial_size;
int_conf_ptr->initial_size = ext_conf_ptr->initial_size;
@@ -3325,18 +2845,17 @@ H5AC_ext_config_2_int_config(H5AC_cache_config_t * ext_conf_ptr,
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_ext_config_2_int_config() */
+} /* H5AC__ext_config_2_int_config() */
/*-------------------------------------------------------------------------
*
- * Function: H5AC_log_deleted_entry()
+ * Function: H5AC__log_deleted_entry()
*
- * Purpose: Log an entry for which H5C__DELETED_FLAG has been set.
+ * Purpose: Log an entry which has been deleted.
*
- * If mpi_rank is 0, we must make sure that the entry doesn't
- * appear in the cleaned or dirty entry lists. Otherwise,
- * we have nothing to do.
+ * Only called for mpi_rank 0. We must make sure that the entry
+ * doesn't appear in the cleaned or dirty entry lists.
*
* Return SUCCEED on success, and FAIL on failure.
*
@@ -3348,80 +2867,48 @@ done:
*/
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_log_deleted_entry(H5AC_t * cache_ptr,
- H5AC_info_t * entry_ptr,
- haddr_t addr,
- unsigned int flags)
+H5AC__log_deleted_entry(const H5AC_info_t *entry_ptr)
{
+ H5AC_t * cache_ptr;
H5AC_aux_t * aux_ptr;
H5AC_slist_entry_t * slist_entry_ptr = NULL;
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
+ haddr_t addr;
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
+ FUNC_ENTER_STATIC_NOERR
+ /* Sanity checks */
+ HDassert(entry_ptr);
+ addr = entry_ptr->addr;
+ cache_ptr = entry_ptr->cache_ptr;
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->mpi_rank == 0);
+ HDassert(aux_ptr->d_slist_ptr != NULL);
+ HDassert(aux_ptr->c_slist_ptr != NULL);
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
-
- HDassert( entry_ptr != NULL );
- HDassert( entry_ptr->addr == addr );
-
- HDassert( (flags & H5C__DELETED_FLAG) != 0 );
-
- if(aux_ptr->mpi_rank == 0) {
- HDassert( aux_ptr->d_slist_ptr != NULL );
- HDassert( aux_ptr->c_slist_ptr != NULL );
-
- /* if the entry appears in the dirtied entry slist, remove it. */
- if((slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_search(aux_ptr->d_slist_ptr, (void *)(&addr))) != NULL) {
- HDassert(slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC);
- HDassert(slist_entry_ptr->addr == addr);
-
- if(H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&addr)) != slist_entry_ptr)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from dirty entry slist.")
-
- slist_entry_ptr->magic = 0;
- slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
-
- aux_ptr->d_slist_len -= 1;
-
- HDassert( aux_ptr->d_slist_len >= 0 );
- } /* end if */
-
- /* if the entry appears in the cleaned entry slist, remove it. */
- if((slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_search(aux_ptr->c_slist_ptr, (void *)(&addr))) != NULL) {
- HDassert(slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC);
- HDassert(slist_entry_ptr->addr == addr);
-
- if(H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr)) != slist_entry_ptr)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from cleaned entry slist.")
-
- slist_entry_ptr->magic = 0;
- slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
-
- aux_ptr->c_slist_len -= 1;
+ /* if the entry appears in the dirtied entry slist, remove it. */
+ if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&addr))))
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
- HDassert( aux_ptr->c_slist_len >= 0 );
- } /* end if */
- } /* if */
+ /* if the entry appears in the cleaned entry slist, remove it. */
+ if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr))))
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_log_deleted_entry() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5AC__log_deleted_entry() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
*
- * Function: H5AC_log_dirtied_entry()
+ * Function: H5AC__log_dirtied_entry()
*
* Purpose: Update the dirty_bytes count for a newly dirtied entry.
*
- * If mpi_rank isnt 0, this simply means adding the size
+ * If mpi_rank isn't 0, this simply means adding the size
* of the entries to the dirty_bytes count.
*
* If mpi_rank is 0, we must first check to see if the entry
@@ -3440,103 +2927,73 @@ done:
*/
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr,
- haddr_t addr)
+H5AC__log_dirtied_entry(const H5AC_info_t *entry_ptr)
{
H5AC_t * cache_ptr;
H5AC_aux_t * aux_ptr;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert( entry_ptr );
- HDassert( entry_ptr->addr == addr );
- HDassert( entry_ptr->is_dirty == FALSE );
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
+ HDassert(entry_ptr);
+ HDassert(entry_ptr->is_dirty == FALSE);
cache_ptr = entry_ptr->cache_ptr;
-
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
-
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
-
- if ( aux_ptr->mpi_rank == 0 ) {
- H5AC_slist_entry_t * slist_entry_ptr;
-
- HDassert( aux_ptr->d_slist_ptr != NULL );
- HDassert( aux_ptr->c_slist_ptr != NULL );
+ if(aux_ptr->mpi_rank == 0) {
+ H5AC_slist_entry_t *slist_entry_ptr;
+ haddr_t addr = entry_ptr->addr;
- if ( H5SL_search(aux_ptr->d_slist_ptr, (void *)(&addr)) == NULL ) {
+ /* Sanity checks */
+ HDassert(aux_ptr->d_slist_ptr != NULL);
+ HDassert(aux_ptr->c_slist_ptr != NULL);
+ if(NULL == H5SL_search(aux_ptr->d_slist_ptr, (void *)(&addr))) {
/* insert the address of the entry in the dirty entry list, and
* add its size to the dirty_bytes count.
*/
- if ( NULL == (slist_entry_ptr = H5FL_CALLOC(H5AC_slist_entry_t)) ) {
-
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \
- "Can't allocate dirty slist entry .")
- }
-
- slist_entry_ptr->magic = H5AC__H5AC_SLIST_ENTRY_T_MAGIC;
+ if(NULL == (slist_entry_ptr = H5FL_MALLOC(H5AC_slist_entry_t)))
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate dirty slist entry .")
slist_entry_ptr->addr = addr;
- if ( H5SL_insert(aux_ptr->d_slist_ptr, slist_entry_ptr,
- &(slist_entry_ptr->addr)) < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, \
- "can't insert entry into dirty entry slist.")
- }
+ if(H5SL_insert(aux_ptr->d_slist_ptr, slist_entry_ptr, &(slist_entry_ptr->addr)) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "can't insert entry into dirty entry slist.")
- aux_ptr->d_slist_len += 1;
aux_ptr->dirty_bytes += entry_ptr->size;
#if 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 */
- }
-
- if(H5SL_search(aux_ptr->c_slist_ptr, (void *)(&addr)) != NULL) {
- /* the entry is dirty. If it exists on the cleaned entries list,
- * remove it.
- */
- if((slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_search(aux_ptr->c_slist_ptr, (void *)(&addr))) != NULL) {
- HDassert(slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC);
- HDassert(slist_entry_ptr->addr == addr);
-
- if(H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr)) != slist_entry_ptr)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from clean entry slist.")
-
- slist_entry_ptr->magic = 0;
- slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
-
- aux_ptr->c_slist_len -= 1;
-
- HDassert( aux_ptr->c_slist_len >= 0 );
- } /* end if */
} /* end if */
- } else {
+ /* the entry is dirty. If it exists on the cleaned entries list,
+ * remove it.
+ */
+ if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr))))
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
+ } /* end if */
+ else {
aux_ptr->dirty_bytes += entry_ptr->size;
#if H5AC_DEBUG_DIRTY_BYTES_CREATION
aux_ptr->unprotect_dirty_bytes += entry_size;
aux_ptr->unprotect_dirty_bytes_updates += 1;
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
- }
+ } /* end else */
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5AC_log_dirtied_entry() */
+} /* H5AC__log_dirtied_entry() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
*
- * Function: H5AC_log_flushed_entry()
+ * Function: H5AC__log_flushed_entry()
*
* Purpose: Update the clean entry slist for the flush of an entry --
* specifically, if the entry has been cleared, remove it
@@ -3557,117 +3014,58 @@ done:
*/
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_log_flushed_entry(H5C_t * cache_ptr,
- haddr_t addr,
- hbool_t was_dirty,
- unsigned flags,
- int H5_ATTR_UNUSED type_id)
+H5AC__log_flushed_entry(H5C_t *cache_ptr, haddr_t addr, hbool_t was_dirty,
+ unsigned flags)
{
- herr_t ret_value = SUCCEED; /* Return value */
hbool_t cleared;
H5AC_aux_t * aux_ptr;
H5AC_slist_entry_t * slist_entry_ptr = NULL;
+ herr_t ret_value = SUCCEED; /* Return value */
+ FUNC_ENTER_STATIC
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
-
+ /* Sanity check */
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->mpi_rank == 0);
+ HDassert(aux_ptr->c_slist_ptr != NULL);
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- HDassert( aux_ptr->mpi_rank == 0 );
- HDassert( aux_ptr->c_slist_ptr != NULL );
-
- cleared = ( (flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0 );
-
- if ( cleared ) {
+ /* Set local flags */
+ cleared = ((flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0);
+ if(cleared) {
/* If the entry has been cleared, must remove it from both the
* cleaned list and the dirtied list.
*/
-
- if ( (slist_entry_ptr = (H5AC_slist_entry_t *)
- H5SL_search(aux_ptr->c_slist_ptr,
- (void *)(&addr))) != NULL ) {
-
- HDassert( slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC);
- HDassert( slist_entry_ptr->addr == addr );
-
- if ( H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr))
- != slist_entry_ptr ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, \
- "Can't delete entry from clean entry slist.")
- }
-
- slist_entry_ptr->magic = 0;
+ if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr))))
slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
-
- aux_ptr->c_slist_len -= 1;
-
- HDassert( aux_ptr->c_slist_len >= 0 );
- }
-
- if ( (slist_entry_ptr = (H5AC_slist_entry_t *)
- H5SL_search(aux_ptr->d_slist_ptr, (void *)(&addr))) != NULL ) {
-
- HDassert( slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC);
- HDassert( slist_entry_ptr->addr == addr );
-
- if ( H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&addr))
- != slist_entry_ptr ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, \
- "Can't delete entry from dirty entry slist.")
- }
-
- slist_entry_ptr->magic = 0;
+ if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&addr))))
slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
-
- aux_ptr->d_slist_len -= 1;
-
- HDassert( aux_ptr->d_slist_len >= 0 );
- }
- } else if ( was_dirty ) {
-
- if ( H5SL_search(aux_ptr->c_slist_ptr, (void *)(&addr)) == NULL ) {
-
+ } /* end if */
+ else if(was_dirty) {
+ if(NULL == H5SL_search(aux_ptr->c_slist_ptr, (void *)(&addr))) {
/* insert the address of the entry in the clean entry list. */
+ if(NULL == (slist_entry_ptr = H5FL_MALLOC(H5AC_slist_entry_t)))
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate clean slist entry .")
+ slist_entry_ptr->addr = addr;
- if ( NULL == (slist_entry_ptr = H5FL_CALLOC(H5AC_slist_entry_t)) ) {
-
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \
- "Can't allocate clean slist entry .")
- }
-
- slist_entry_ptr->magic = H5AC__H5AC_SLIST_ENTRY_T_MAGIC;
- slist_entry_ptr->addr = addr;
-
- if ( H5SL_insert(aux_ptr->c_slist_ptr, slist_entry_ptr,
- &(slist_entry_ptr->addr)) < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, \
- "can't insert entry into clean entry slist.")
- }
-
- aux_ptr->c_slist_len += 1;
- }
- }
+ if(H5SL_insert(aux_ptr->c_slist_ptr, slist_entry_ptr, &(slist_entry_ptr->addr)) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "can't insert entry into clean entry slist.")
+ } /* end if */
+ } /* end else-if */
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5AC_log_flushed_entry() */
+} /* H5AC__log_flushed_entry() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
*
- * Function: H5AC_log_inserted_entry()
+ * Function: H5AC__log_inserted_entry()
*
* Purpose: Update the dirty_bytes count for a newly inserted entry.
*
@@ -3687,48 +3085,44 @@ done:
*/
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_log_inserted_entry(H5AC_t * cache_ptr,
- H5AC_info_t * entry_ptr)
+H5AC__log_inserted_entry(const H5AC_info_t *entry_ptr)
{
+ H5AC_t * cache_ptr;
H5AC_aux_t * aux_ptr;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
+ HDassert(entry_ptr);
+ cache_ptr = entry_ptr->cache_ptr;
HDassert(cache_ptr != NULL);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
-
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
HDassert(aux_ptr != NULL);
HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
- HDassert( entry_ptr != NULL );
-
if(aux_ptr->mpi_rank == 0) {
- H5AC_slist_entry_t * slist_entry_ptr;
+ H5AC_slist_entry_t *slist_entry_ptr;
HDassert(aux_ptr->d_slist_ptr != NULL);
HDassert(aux_ptr->c_slist_ptr != NULL);
- if(NULL != H5SL_search(aux_ptr->d_slist_ptr, (void *)(&entry_ptr->addr)))
+ /* Entry to insert should not be in dirty list currently */
+ if(NULL != H5SL_search(aux_ptr->d_slist_ptr, (const void *)(&entry_ptr->addr)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Inserted entry already in dirty slist.")
/* insert the address of the entry in the dirty entry list, and
* add its size to the dirty_bytes count.
*/
- if(NULL == (slist_entry_ptr = H5FL_CALLOC(H5AC_slist_entry_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "Can't allocate dirty slist entry .")
-
- slist_entry_ptr->magic = H5AC__H5AC_SLIST_ENTRY_T_MAGIC;
+ if(NULL == (slist_entry_ptr = H5FL_MALLOC(H5AC_slist_entry_t)))
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate dirty slist entry .")
slist_entry_ptr->addr = entry_ptr->addr;
-
- if(H5SL_insert(aux_ptr->d_slist_ptr, slist_entry_ptr, &(slist_entry_ptr->addr)) < 0 )
+ if(H5SL_insert(aux_ptr->d_slist_ptr, slist_entry_ptr, &(slist_entry_ptr->addr)) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "can't insert entry into dirty entry slist.")
- aux_ptr->d_slist_len += 1;
-
- if(NULL != H5SL_search(aux_ptr->c_slist_ptr, (void *)(&entry_ptr->addr)))
+ /* Entry to insert should not be in clean list either */
+ if(NULL != H5SL_search(aux_ptr->c_slist_ptr, (const void *)(&entry_ptr->addr)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Inserted entry in clean slist.")
} /* end if */
@@ -3741,13 +3135,13 @@ H5AC_log_inserted_entry(H5AC_t * cache_ptr,
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_log_inserted_entry() */
+} /* H5AC__log_inserted_entry() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
*
- * Function: H5AC_log_moved_entry()
+ * Function: H5AC__log_moved_entry()
*
* Purpose: Update the dirty_bytes count for a moved entry.
*
@@ -3758,8 +3152,8 @@ done:
* moving in a collective operation and immediately after
* unprotecting the target entry.
*
- * This function uses this invarient, and will cause arcane
- * failures if it is not met. If maintaining this invarient
+ * This function uses this invariant, and will cause arcane
+ * failures if it is not met. If maintaining this invariant
* becomes impossible, we will have to rework this function
* extensively, and likely include a bit of IPC for
* synchronization. A better option might be to subsume
@@ -3793,100 +3187,52 @@ done:
*/
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_log_moved_entry(const H5F_t *f,
- haddr_t old_addr,
- haddr_t new_addr)
+H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr)
{
- H5AC_t * cache_ptr;
+ H5AC_t * cache_ptr;
+ H5AC_aux_t * aux_ptr;
hbool_t entry_in_cache;
hbool_t entry_dirty;
size_t entry_size;
- H5AC_aux_t * aux_ptr = NULL;
- H5AC_slist_entry_t * slist_entry_ptr = NULL;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert( f );
- HDassert( f->shared );
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
+ HDassert(f);
+ HDassert(f->shared);
cache_ptr = (H5AC_t *)f->shared->cache;
-
- HDassert( cache_ptr );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
-
+ HDassert(cache_ptr);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
/* get entry status, size, etc here */
- if ( H5C_get_entry_status(f, old_addr, &entry_size, &entry_in_cache,
- &entry_dirty, NULL, NULL, NULL, NULL) < 0 ) {
-
+ if(H5C_get_entry_status(f, old_addr, &entry_size, &entry_in_cache,
+ &entry_dirty, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get entry status.")
-
- } else if ( ! entry_in_cache ) {
-
- HDassert( entry_in_cache );
+ if(!entry_in_cache)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry not in cache.")
- }
- if ( aux_ptr->mpi_rank == 0 ) {
+ if(aux_ptr->mpi_rank == 0) {
+ H5AC_slist_entry_t * slist_entry_ptr;
- HDassert( aux_ptr->d_slist_ptr != NULL );
- HDassert( aux_ptr->c_slist_ptr != NULL );
+ HDassert(aux_ptr->d_slist_ptr != NULL);
+ HDassert(aux_ptr->c_slist_ptr != NULL);
/* if the entry appears in the cleaned entry slist, under its old
* address, remove it.
*/
- if ( (slist_entry_ptr = (H5AC_slist_entry_t *)
- H5SL_search(aux_ptr->c_slist_ptr, (void *)(&old_addr))) != NULL ) {
-
- HDassert( slist_entry_ptr->magic ==
- H5AC__H5AC_SLIST_ENTRY_T_MAGIC );
- HDassert( slist_entry_ptr->addr == old_addr );
-
- if ( H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&old_addr))
- != slist_entry_ptr ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, \
- "Can't delete entry from cleaned entry slist.")
- }
-
- slist_entry_ptr->magic = 0;
+ if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&old_addr))))
slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
- aux_ptr->c_slist_len -= 1;
-
- HDassert( aux_ptr->c_slist_len >= 0 );
- }
-
/* if the entry appears in the dirtied entry slist under its old
* address, remove it, but don't free it. Set addr to new_addr.
*/
- if ( (slist_entry_ptr = (H5AC_slist_entry_t *)
- H5SL_search(aux_ptr->d_slist_ptr, (void *)(&old_addr))) != NULL ) {
-
- HDassert( slist_entry_ptr->magic ==
- H5AC__H5AC_SLIST_ENTRY_T_MAGIC );
- HDassert( slist_entry_ptr->addr == old_addr );
-
- if ( H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&old_addr))
- != slist_entry_ptr ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, \
- "Can't delete entry from dirty entry slist.")
- }
-
+ if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&old_addr))))
slist_entry_ptr->addr = new_addr;
-
- aux_ptr->d_slist_len -= 1;
-
- HDassert( aux_ptr->d_slist_len >= 0 );
-
- } else {
-
+ else {
/* otherwise, allocate a new entry that is ready
* for insertion, and increment dirty_bytes.
*
@@ -3894,17 +3240,10 @@ H5AC_log_moved_entry(const H5F_t *f,
* list under its old address implies that it must have
* been clean to start with.
*/
-
- HDassert( !entry_dirty );
-
- if ( NULL == (slist_entry_ptr = H5FL_CALLOC(H5AC_slist_entry_t)) ) {
-
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \
- "Can't allocate dirty slist entry .")
- }
-
- slist_entry_ptr->magic = H5AC__H5AC_SLIST_ENTRY_T_MAGIC;
- slist_entry_ptr->addr = new_addr;
+ HDassert(!entry_dirty);
+ if(NULL == (slist_entry_ptr = H5FL_MALLOC(H5AC_slist_entry_t)))
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate dirty slist entry .")
+ slist_entry_ptr->addr = new_addr;
aux_ptr->dirty_bytes += entry_size;
@@ -3912,43 +3251,29 @@ H5AC_log_moved_entry(const H5F_t *f,
aux_ptr->move_dirty_bytes += entry_size;
aux_ptr->move_dirty_bytes_updates += 1;
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
- }
-
- /* verify that there is no entry at new_addr in the dirty slist */
- if ( H5SL_search(aux_ptr->d_slist_ptr, (void *)(&new_addr)) != NULL ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "dirty slist already contains entry at new_addr.")
- }
+ } /* end else */
/* insert / reinsert the entry in the dirty slist */
- if ( H5SL_insert(aux_ptr->d_slist_ptr, slist_entry_ptr,
- &(slist_entry_ptr->addr)) < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, \
- "can't insert entry into dirty entry slist.")
- }
-
- aux_ptr->d_slist_len += 1;
-
- } else if ( ! entry_dirty ) {
-
+ if(H5SL_insert(aux_ptr->d_slist_ptr, slist_entry_ptr, &(slist_entry_ptr->addr)) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "can't insert entry into dirty entry slist.")
+ } /* end if */
+ else if(!entry_dirty) {
aux_ptr->dirty_bytes += entry_size;
#if 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 */
- }
+ } /* end else-if */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_log_moved_entry() */
+} /* H5AC__log_moved_entry() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
- * Function: H5AC_propagate_and_apply_candidate_list
+ * Function: H5AC__propagate_and_apply_candidate_list
*
* Purpose: Prior to the addition of support for multiple metadata
* write strategies, in PHDF5, only the metadata cache with
@@ -4044,42 +3369,41 @@ done:
*/
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_propagate_and_apply_candidate_list(H5F_t * f,
- hid_t dxpl_id,
- H5AC_t * cache_ptr)
+H5AC__propagate_and_apply_candidate_list(H5F_t *f, hid_t dxpl_id)
{
- int mpi_code;
- int num_candidates = 0;
- haddr_t * candidates_list_ptr = NULL;
+ H5AC_t * cache_ptr;
H5AC_aux_t * aux_ptr;
+ haddr_t * candidates_list_ptr = NULL;
+ int mpi_result;
+ int num_candidates = 0;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
+ HDassert(f != NULL);
+ cache_ptr = f->shared->cache;
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- HDassert( aux_ptr->metadata_write_strategy ==
- H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED );
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED);
/* to prevent "messages from the future" we must synchronize all
* processes before we write any entries.
*/
- if(MPI_SUCCESS != (mpi_code = MPI_Barrier(aux_ptr->mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed 1", mpi_code)
+ if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result)
if(aux_ptr->mpi_rank == 0) {
- if(H5AC_broadcast_candidate_list(cache_ptr, &num_candidates, &candidates_list_ptr) < 0)
+ if(H5AC__broadcast_candidate_list(cache_ptr, &num_candidates, &candidates_list_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't broadcast candidate slist.")
- HDassert( aux_ptr->candidate_slist_len == 0 );
+ HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0);
} /* end if */
else {
- if(H5AC_receive_candidate_list(cache_ptr, &num_candidates, &candidates_list_ptr) < 0)
+ if(H5AC__receive_candidate_list(cache_ptr, &num_candidates, &candidates_list_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't receive candidate broadcast.")
} /* end else */
@@ -4091,55 +3415,59 @@ H5AC_propagate_and_apply_candidate_list(H5F_t * f,
* distributing the writes across the processes.
*/
+ /* Enable writes during this operation */
aux_ptr->write_permitted = TRUE;
- result = H5C_apply_candidate_list(f,
- dxpl_id,
- dxpl_id,
- cache_ptr,
- num_candidates,
- candidates_list_ptr,
- aux_ptr->mpi_rank,
- aux_ptr->mpi_size);
+ /* Apply the candidate list */
+ result = H5C_apply_candidate_list(f, dxpl_id, dxpl_id, cache_ptr, num_candidates,
+ candidates_list_ptr, aux_ptr->mpi_rank, aux_ptr->mpi_size);
+ /* Disable writes again */
aux_ptr->write_permitted = FALSE;
+ /* Check for error on the write operation */
if(result < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't apply candidate list.")
- if(aux_ptr->write_done != NULL)
+ /* this code exists primarily for the test bed -- it allows us to
+ * enforce posix semantics on the server that pretends to be a
+ * file system in our parallel tests.
+ */
+ if(aux_ptr->write_done)
(aux_ptr->write_done)();
/* to prevent "messages from the past" we must synchronize all
* processes again before we go on.
*/
- if(MPI_SUCCESS != (mpi_code = MPI_Barrier(aux_ptr->mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed 2", mpi_code)
+ if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result)
- if(aux_ptr->mpi_rank == 0) {
- if(H5AC_tidy_cache_0_lists(cache_ptr, num_candidates, candidates_list_ptr) < 0)
+ /* if this is process zero, tidy up the dirtied,
+ * and flushed and still clean lists.
+ */
+ if(aux_ptr->mpi_rank == 0)
+ if(H5AC__tidy_cache_0_lists(cache_ptr, num_candidates, candidates_list_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't tidy up process 0 lists.")
- } /* end if */
} /* end if */
/* if it is defined, call the sync point done callback. Note
* that this callback is defined purely for testing purposes,
* and should be undefined under normal operating circumstances.
*/
- if(aux_ptr->sync_point_done != NULL)
+ if(aux_ptr->sync_point_done)
(aux_ptr->sync_point_done)(num_candidates, candidates_list_ptr);
done:
- if(candidates_list_ptr != NULL)
+ if(candidates_list_ptr)
candidates_list_ptr = (haddr_t *)H5MM_xfree((void *)candidates_list_ptr);
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_propagate_and_apply_candidate_list() */
+} /* H5AC__propagate_and_apply_candidate_list() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
- * Function: H5AC_propagate_flushed_and_still_clean_entries_list
+ * Function: H5AC__propagate_flushed_and_still_clean_entries_list
*
* Purpose: In PHDF5, if the process 0 only metadata write strategy
* is selected, only the metadata cache with mpi rank 0 is
@@ -4211,47 +3539,48 @@ done:
*/
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f,
- hid_t dxpl_id,
- H5AC_t * cache_ptr)
+H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f, hid_t dxpl_id)
{
+ H5AC_t * cache_ptr;
H5AC_aux_t * aux_ptr;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
+ HDassert(f != NULL);
+ cache_ptr = f->shared->cache;
HDassert(cache_ptr != NULL);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
-
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
HDassert(aux_ptr != NULL);
HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
- HDassert(aux_ptr->metadata_write_strategy ==
- H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY);
+ HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY);
if(aux_ptr->mpi_rank == 0) {
- if(H5AC_broadcast_clean_list(cache_ptr) < 0)
+ if(H5AC__broadcast_clean_list(cache_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't broadcast clean slist.")
- HDassert( aux_ptr->c_slist_len == 0 );
+ HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0);
} /* end if */
else {
- if(H5AC_receive_and_apply_clean_list(f, dxpl_id, H5AC_dxpl_id, cache_ptr) < 0)
+ if(H5AC__receive_and_apply_clean_list(f, dxpl_id, H5AC_dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't receive and/or process clean slist broadcast.")
} /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_propagate_flushed_and_still_clean_entries_list() */
+} /* H5AC__propagate_flushed_and_still_clean_entries_list() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
*
- * Function: H5AC_receive_and_apply_clean_list()
+ * Function: H5AC_receive_haddr_list()
*
- * Purpose: Receive the list of cleaned entries from process 0,
- * and mark the specified entries as clean.
+ * Purpose: Receive the list of entry addresses from process 0,
+ * and return it in a buffer pointed to by *haddr_buf_ptr_ptr.
+ * Note that the caller must free this buffer if it is
+ * returned.
*
* This function must only be called by the process with
* MPI_rank greater than 0.
@@ -4260,104 +3589,132 @@ done:
*
* Return: Non-negative on success/Negative on failure.
*
- * Programmer: John Mainzer, 7/4/05
+ * Programmer: Quincey Koziol, 6/11/2015
*
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_receive_and_apply_clean_list(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
- H5AC_t * cache_ptr)
+H5AC__receive_haddr_list(MPI_Comm mpi_comm, int *num_entries_ptr,
+ haddr_t **haddr_buf_ptr_ptr)
{
- H5AC_aux_t * aux_ptr;
haddr_t * haddr_buf_ptr = NULL;
- MPI_Offset * MPI_Offset_buf_ptr = NULL;
int mpi_result;
- int num_entries = 0;
+ int num_entries;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
- HDassert( f != NULL );
- HDassert( f->shared->cache == cache_ptr );
-
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
-
- aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- HDassert( aux_ptr->mpi_rank != 0 );
+ /* Sanity checks */
+ HDassert(num_entries_ptr != NULL);
+ HDassert(*num_entries_ptr == 0);
+ HDassert(haddr_buf_ptr_ptr != NULL);
+ HDassert(*haddr_buf_ptr_ptr == NULL);
/* First receive the number of entries in the list so that we
* can set up a buffer to receive them. If there aren't
* any, we are done.
*/
- if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, aux_ptr->mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 1", mpi_result)
+ if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, mpi_comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result)
if(num_entries > 0) {
size_t buf_size;
- int i;
/* allocate buffers to store the list of entry base addresses in */
- buf_size = sizeof(MPI_Offset) * (size_t)num_entries;
- if(NULL == (MPI_Offset_buf_ptr = (MPI_Offset *)H5MM_malloc(buf_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for receive buffer")
- if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(sizeof(haddr_t) * (size_t)num_entries)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for haddr buffer")
-
- /* Now receive the list of cleaned entries
- *
- * The peculiar structure of the following call to MPI_Bcast is
- * due to MPI's (?) failure to believe in the MPI_Offset type.
- * Thus the element type is MPI_BYTE, with size equal to the
- * buf_size computed above.
- */
- if(MPI_SUCCESS != (mpi_result = MPI_Bcast((void *)MPI_Offset_buf_ptr, (int)buf_size, MPI_BYTE, 0, aux_ptr->mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 2", mpi_result)
+ buf_size = sizeof(haddr_t) * (size_t)num_entries;
+ if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(buf_size)))
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for haddr buffer")
- /* translate the MPI_Offsets to haddr_t */
- i = 0;
- while(i < num_entries) {
- haddr_buf_ptr[i] = H5FD_mpi_MPIOff_to_haddr(MPI_Offset_buf_ptr[i]);
+ /* Now receive the list of candidate entries */
+ if(MPI_SUCCESS != (mpi_result = MPI_Bcast((void *)haddr_buf_ptr, (int)buf_size, MPI_BYTE, 0, mpi_comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result)
+ } /* end if */
- if(haddr_buf_ptr[i] == HADDR_UNDEF)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert MPI off to haddr")
+ /* finally, pass the number of entries and the buffer pointer
+ * back to the caller.
+ */
+ *num_entries_ptr = num_entries;
+ *haddr_buf_ptr_ptr = haddr_buf_ptr;
- i++;
- } /* end while */
+done:
+ if(ret_value < 0)
+ if(haddr_buf_ptr)
+ haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5AC_receive_haddr_list() */
+#endif /* H5_HAVE_PARALLEL */
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5AC__receive_and_apply_clean_list()
+ *
+ * Purpose: Receive the list of cleaned entries from process 0,
+ * and mark the specified entries as clean.
+ *
+ * This function must only be called by the process with
+ * MPI_rank greater than 0.
+ *
+ * Return SUCCEED on success, and FAIL on failure.
+ *
+ * Return: Non-negative on success/Negative on failure.
+ *
+ * Programmer: John Mainzer, 7/4/05
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_PARALLEL
+static herr_t
+H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id)
+{
+ H5AC_t * cache_ptr;
+ H5AC_aux_t * aux_ptr;
+ haddr_t * haddr_buf_ptr = NULL;
+ int num_entries = 0;
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity check */
+ HDassert(f != NULL);
+ cache_ptr = f->shared->cache;
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
+ aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->mpi_rank != 0);
+
+ /* Retrieve the clean list from process 0 */
+ if(H5AC__receive_haddr_list(aux_ptr->mpi_comm, &num_entries, &haddr_buf_ptr) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't receive clean list")
+
+ if(num_entries > 0)
/* mark the indicated entries as clean */
- if(H5C_mark_entries_as_clean(f, primary_dxpl_id, secondary_dxpl_id,
- (int32_t)num_entries, &(haddr_buf_ptr[0])) < 0)
+ if(H5C_mark_entries_as_clean(f, primary_dxpl_id, secondary_dxpl_id, (int32_t)num_entries, haddr_buf_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't mark entries clean.")
- } /* end if */
/* if it is defined, call the sync point done callback. Note
* that this callback is defined purely for testing purposes,
* and should be undefined under normal operating circumstances.
*/
- if(aux_ptr->sync_point_done != NULL)
+ if(aux_ptr->sync_point_done)
(aux_ptr->sync_point_done)(num_entries, haddr_buf_ptr);
done:
- if(MPI_Offset_buf_ptr != NULL)
- MPI_Offset_buf_ptr = (MPI_Offset *)H5MM_xfree((void *)MPI_Offset_buf_ptr);
- if(haddr_buf_ptr != NULL)
+ if(haddr_buf_ptr)
haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr);
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_receive_and_apply_clean_list() */
+} /* H5AC__receive_and_apply_clean_list() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
*
- * Function: H5AC_receive_candidate_list()
+ * Function: H5AC__receive_candidate_list()
*
* Purpose: Receive the list of candidate entries from process 0,
* and return it in a buffer pointed to by *haddr_buf_ptr_ptr.
@@ -4377,105 +3734,39 @@ done:
*/
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_receive_candidate_list(H5AC_t * cache_ptr,
- int * num_entries_ptr,
- haddr_t ** haddr_buf_ptr_ptr)
+H5AC__receive_candidate_list(const H5AC_t *cache_ptr, int *num_entries_ptr,
+ haddr_t **haddr_buf_ptr_ptr)
{
- hbool_t success = FALSE;
H5AC_aux_t * aux_ptr;
- haddr_t * haddr_buf_ptr = NULL;
- MPI_Offset * MPI_Offset_buf_ptr = NULL;
- int mpi_result;
- int num_entries;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->mpi_rank != 0);
+ HDassert(aux_ptr-> metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED);
+ HDassert(num_entries_ptr != NULL);
+ HDassert(*num_entries_ptr == 0);
+ HDassert(haddr_buf_ptr_ptr != NULL);
+ HDassert(*haddr_buf_ptr_ptr == NULL);
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- HDassert( aux_ptr->mpi_rank != 0 );
- HDassert( aux_ptr-> metadata_write_strategy ==
- H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED );
-
- HDassert( num_entries_ptr != NULL );
- HDassert( *num_entries_ptr == 0 );
-
- HDassert( haddr_buf_ptr_ptr != NULL );
- HDassert( *haddr_buf_ptr_ptr == NULL );
-
-
- /* First receive the number of entries in the list so that we
- * can set up a buffer to receive them. If there aren't
- * any, we are done.
- */
- if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, aux_ptr->mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 1", mpi_result)
-
- if(num_entries > 0) {
- size_t buf_size;
- int i;
-
- /* allocate buffers to store the list of entry base addresses in */
- buf_size = sizeof(MPI_Offset) * (size_t)num_entries;
-
- if(NULL == (MPI_Offset_buf_ptr = (MPI_Offset *)H5MM_malloc(buf_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for receive buffer")
- if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(sizeof(haddr_t) * (size_t)num_entries)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for haddr buffer")
-
- /* Now receive the list of candidate entries
- *
- * The peculiar structure of the following call to MPI_Bcast is
- * due to MPI's (?) failure to believe in the MPI_Offset type.
- * Thus the element type is MPI_BYTE, with size equal to the
- * buf_size computed above.
- */
- if(MPI_SUCCESS != (mpi_result = MPI_Bcast((void *)MPI_Offset_buf_ptr, (int)buf_size, MPI_BYTE, 0, aux_ptr->mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 2", mpi_result)
-
- /* translate the MPI_Offsets to haddr_t */
- i = 0;
- while(i < num_entries) {
- haddr_buf_ptr[i] = H5FD_mpi_MPIOff_to_haddr(MPI_Offset_buf_ptr[i]);
-
- if(haddr_buf_ptr[i] == HADDR_UNDEF)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert MPI off to haddr")
-
- i++;
- } /* end while */
- } /* end if */
-
- success = TRUE;
+ /* Retrieve the candidate list from process 0 */
+ if(H5AC__receive_haddr_list(aux_ptr->mpi_comm, num_entries_ptr, haddr_buf_ptr_ptr) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't receive clean list")
done:
- if(MPI_Offset_buf_ptr != NULL)
- MPI_Offset_buf_ptr = (MPI_Offset *)H5MM_xfree((void *)MPI_Offset_buf_ptr);
-
- if(success) {
- /* finally, pass the number of entries and the buffer pointer
- * back to the caller. Do this so that we can use the same code
- * to apply the candidate list to all the processes.
- */
- *num_entries_ptr = num_entries;
- *haddr_buf_ptr_ptr = haddr_buf_ptr;
- } /* end if */
- else {
- if(haddr_buf_ptr != NULL)
- haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr);
- } /* end else */
-
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_receive_candidate_list() */
+} /* H5AC__receive_candidate_list() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
- * Function: H5AC_rsp__dist_md_write__flush
+ * Function: H5AC__rsp__dist_md_write__flush
*
* Purpose: Routine for handling the details of running a sync point
* that is triggered by a flush -- which in turn must have been
@@ -4524,31 +3815,27 @@ done:
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_PARALLEL
-herr_t
-H5AC_rsp__dist_md_write__flush(H5F_t *f,
- hid_t dxpl_id,
- H5AC_t * cache_ptr)
+static herr_t
+H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id)
{
- int mpi_code;
- int num_entries = 0;
- haddr_t * haddr_buf_ptr = NULL;
+ H5AC_t * cache_ptr;
H5AC_aux_t * aux_ptr;
+ haddr_t * haddr_buf_ptr = NULL;
+ int mpi_result;
+ int num_entries = 0;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert( f != NULL );
- HDassert( f->shared->cache == cache_ptr );
-
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
+ HDassert(f != NULL);
+ cache_ptr = f->shared->cache;
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- HDassert( aux_ptr->metadata_write_strategy ==
- H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED );
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED);
/* first construct the candidate list -- initially, this will be in the
* form of a skip list. We will convert it later.
@@ -4556,33 +3843,30 @@ H5AC_rsp__dist_md_write__flush(H5F_t *f,
if(H5C_construct_candidate_list__clean_cache(cache_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate list.")
- if(aux_ptr->candidate_slist_len > 0) {
+ if(H5SL_count(aux_ptr->candidate_slist_ptr) > 0) {
herr_t result;
/* convert the candidate list into the format we
* are used to receiving from process 0.
*/
- if(H5AC_copy_candidate_list_to_buffer(cache_ptr, &num_entries, &haddr_buf_ptr, NULL, NULL) < 0)
+ if(H5AC__copy_candidate_list_to_buffer(cache_ptr, &num_entries, &haddr_buf_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate buffer.")
/* initial sync point barrier */
- if(MPI_SUCCESS != (mpi_code = MPI_Barrier(aux_ptr->mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed 1", mpi_code)
+ if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result)
- /* apply the candidate list */
+ /* Enable writes during this operation */
aux_ptr->write_permitted = TRUE;
- result = H5C_apply_candidate_list(f,
- dxpl_id,
- dxpl_id,
- cache_ptr,
- num_entries,
- haddr_buf_ptr,
- aux_ptr->mpi_rank,
- aux_ptr->mpi_size);
+ /* Apply the candidate list */
+ result = H5C_apply_candidate_list(f, dxpl_id, dxpl_id, cache_ptr, num_entries,
+ haddr_buf_ptr, aux_ptr->mpi_rank, aux_ptr->mpi_size);
+ /* Disable writes again */
aux_ptr->write_permitted = FALSE;
+ /* Check for error on the write operation */
if(result < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't apply candidate list.")
@@ -4590,40 +3874,39 @@ H5AC_rsp__dist_md_write__flush(H5F_t *f,
* enforce posix semantics on the server that pretends to be a
* file system in our parallel tests.
*/
- if(aux_ptr->write_done != NULL)
+ if(aux_ptr->write_done)
(aux_ptr->write_done)();
/* final sync point barrier */
- if(MPI_SUCCESS != (mpi_code = MPI_Barrier(aux_ptr->mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed 1", mpi_code)
+ if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result)
/* if this is process zero, tidy up the dirtied,
* and flushed and still clean lists.
*/
- if(aux_ptr->mpi_rank == 0) {
- if(H5AC_tidy_cache_0_lists(cache_ptr, num_entries, haddr_buf_ptr) < 0)
+ if(aux_ptr->mpi_rank == 0)
+ if(H5AC__tidy_cache_0_lists(cache_ptr, num_entries, haddr_buf_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't tidy up process 0 lists.")
- } /* end if */
} /* end if */
/* if it is defined, call the sync point done callback. Note
* that this callback is defined purely for testing purposes,
* and should be undefined under normal operating circumstances.
*/
- if(aux_ptr->sync_point_done != NULL)
+ if(aux_ptr->sync_point_done)
(aux_ptr->sync_point_done)(num_entries, haddr_buf_ptr);
done:
- if(haddr_buf_ptr != NULL)
+ if(haddr_buf_ptr)
haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr);
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_rsp__dist_md_write__flush() */
+} /* H5AC__rsp__dist_md_write__flush() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
- * Function: H5AC_rsp__dist_md_write__flush_to_min_clean
+ * Function: H5AC__rsp__dist_md_write__flush_to_min_clean
*
* Purpose: Routine for handling the details of running a sync point
* triggered by the accumulation of dirty metadata (as
@@ -4677,29 +3960,25 @@ done:
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_PARALLEL
-herr_t
-H5AC_rsp__dist_md_write__flush_to_min_clean(H5F_t *f,
- hid_t dxpl_id,
- H5AC_t * cache_ptr)
+static herr_t
+H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f, hid_t dxpl_id)
{
- hbool_t evictions_enabled;
+ H5AC_t * cache_ptr;
H5AC_aux_t * aux_ptr;
+ hbool_t evictions_enabled;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert( f != NULL );
- HDassert( f->shared->cache == cache_ptr );
-
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
+ HDassert(f != NULL);
+ cache_ptr = f->shared->cache;
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- HDassert( aux_ptr->metadata_write_strategy ==
- H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED );
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED);
/* Query if evictions are allowed */
if(H5C_get_evictions_enabled((const H5C_t *)cache_ptr, &evictions_enabled) < 0)
@@ -4707,24 +3986,23 @@ H5AC_rsp__dist_md_write__flush_to_min_clean(H5F_t *f,
if(evictions_enabled) {
/* construct candidate list -- process 0 only */
- if(aux_ptr->mpi_rank == 0) {
- if(H5AC_construct_candidate_list(cache_ptr, aux_ptr, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
+ if(aux_ptr->mpi_rank == 0)
+ if(H5AC__construct_candidate_list(cache_ptr, aux_ptr, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate list.")
- } /* mpi rank == 0 */
/* propagate and apply candidate list -- all processes */
- if(H5AC_propagate_and_apply_candidate_list(f, dxpl_id, cache_ptr) < 0)
+ if(H5AC__propagate_and_apply_candidate_list(f, dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate and apply candidate list.")
} /* evictions enabled */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_rsp__dist_md_write__flush_to_min_clean() */
+} /* H5AC__rsp__dist_md_write__flush_to_min_clean() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
- * Function: H5AC_rsp__p0_only__flush
+ * Function: H5AC__rsp__p0_only__flush
*
* Purpose: Routine for handling the details of running a sync point
* that is triggered a flush -- which in turn must have been
@@ -4760,67 +4038,70 @@ done:
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_PARALLEL
-herr_t
-H5AC_rsp__p0_only__flush(H5F_t *f,
- hid_t dxpl_id,
- H5AC_t * cache_ptr)
+static herr_t
+H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id)
{
- int mpi_code;
+ H5AC_t * cache_ptr;
H5AC_aux_t * aux_ptr;
+ int mpi_result;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert( f != NULL );
- HDassert( f->shared->cache == cache_ptr );
-
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
+ HDassert(f != NULL);
+ cache_ptr = f->shared->cache;
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- HDassert( aux_ptr->metadata_write_strategy ==
- H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY );
-
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY);
/* to prevent "messages from the future" we must
* synchronize all processes before we start the flush.
* Hence the following barrier.
*/
- if(MPI_SUCCESS != (mpi_code = MPI_Barrier(aux_ptr->mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed 1", mpi_code)
+ if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result)
/* Flush data to disk, from rank 0 process */
if(aux_ptr->mpi_rank == 0) {
herr_t result;
+ /* Enable writes during this operation */
aux_ptr->write_permitted = TRUE;
+ /* Flush the cache */
result = H5C_flush_cache(f, dxpl_id, dxpl_id, H5AC__NO_FLAGS_SET);
+ /* Disable writes again */
aux_ptr->write_permitted = FALSE;
+ /* Check for error on the write operation */
if(result < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.")
- if(aux_ptr->write_done != NULL)
+ /* this code exists primarily for the test bed -- it allows us to
+ * enforce posix semantics on the server that pretends to be a
+ * file system in our parallel tests.
+ */
+ if(aux_ptr->write_done)
(aux_ptr->write_done)();
} /* end if */
/* Propagate cleaned entries to other ranks. */
- if(H5AC_propagate_flushed_and_still_clean_entries_list(f, H5AC_dxpl_id, cache_ptr) < 0)
+ if(H5AC__propagate_flushed_and_still_clean_entries_list(f, H5AC_dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_rsp__p0_only__flush() */
+} /* H5AC__rsp__p0_only__flush() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
- * Function: H5AC_rsp__p0_only__flush_to_min_clean
+ * Function: H5AC__rsp__p0_only__flush_to_min_clean
*
* Purpose: Routine for handling the details of running a sync point
* triggered by the accumulation of dirty metadata (as
@@ -4862,29 +4143,25 @@ done:
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_PARALLEL
-herr_t
-H5AC_rsp__p0_only__flush_to_min_clean(H5F_t *f,
- hid_t dxpl_id,
- H5AC_t * cache_ptr)
+static herr_t
+H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f, hid_t dxpl_id)
{
- hbool_t evictions_enabled;
+ H5AC_t * cache_ptr;
H5AC_aux_t * aux_ptr;
+ hbool_t evictions_enabled;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert( f != NULL );
- HDassert( f->shared->cache == cache_ptr );
-
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
+ HDassert(f != NULL);
+ cache_ptr = f->shared->cache;
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- HDassert( aux_ptr->metadata_write_strategy ==
- H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY );
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY);
/* Query if evictions are allowed */
if(H5C_get_evictions_enabled((const H5C_t *)cache_ptr, &evictions_enabled) < 0)
@@ -4898,14 +4175,14 @@ H5AC_rsp__p0_only__flush_to_min_clean(H5F_t *f,
* Otherwise, do nothing.
*/
if(evictions_enabled) {
- int mpi_code;
+ int mpi_result;
/* to prevent "messages from the future" we must synchronize all
* processes before we start the flush. This synchronization may
* already be done -- hence the do_barrier parameter.
*/
- if(MPI_SUCCESS != (mpi_code = MPI_Barrier(aux_ptr->mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code)
+ if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result)
if(0 == aux_ptr->mpi_rank) {
herr_t result;
@@ -4915,12 +4192,17 @@ H5AC_rsp__p0_only__flush_to_min_clean(H5F_t *f,
* Note that it is quite possible that no entries will be
* flushed.
*/
+
+ /* Enable writes during this operation */
aux_ptr->write_permitted = TRUE;
+ /* Flush the cache */
result = H5C_flush_to_min_clean(f, dxpl_id, H5AC_dxpl_id);
+ /* Disable writes again */
aux_ptr->write_permitted = FALSE;
+ /* Check for error on the write operation */
if(result < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_flush_to_min_clean() failed.")
@@ -4928,22 +4210,22 @@ H5AC_rsp__p0_only__flush_to_min_clean(H5F_t *f,
* to enforce POSIX semantics on the process used to simulate
* reads and writes in t_cache.c.
*/
- if(aux_ptr->write_done != NULL)
+ if(aux_ptr->write_done)
(aux_ptr->write_done)();
} /* end if */
- if(H5AC_propagate_flushed_and_still_clean_entries_list(f, dxpl_id, cache_ptr) < 0)
+ if(H5AC__propagate_flushed_and_still_clean_entries_list(f, dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.")
} /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_rsp__p0_only__flush_to_min_clean() */
+} /* H5AC__rsp__p0_only__flush_to_min_clean() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
- * Function: H5AC_run_sync_point
+ * Function: H5AC__run_sync_point
*
* Purpose: Top level routine for managing a sync point between all
* meta data caches in the parallel case. Since all caches
@@ -4974,56 +4256,49 @@ done:
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_PARALLEL
-herr_t
-H5AC_run_sync_point(H5F_t *f,
- hid_t dxpl_id,
- int sync_point_op)
+static herr_t
+H5AC__run_sync_point(H5F_t *f, hid_t dxpl_id, int sync_point_op)
{
- H5AC_t * cache_ptr;
+ H5AC_t * cache_ptr;
H5AC_aux_t * aux_ptr;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert( f != NULL );
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
+ HDassert(f != NULL);
cache_ptr = f->shared->cache;
-
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
-
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
-
- HDassert( ( sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN ) ||
- ( sync_point_op == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED ) );
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ 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
- HDfprintf(stdout,
- "%d:H5AC_propagate...:%d: (u/uu/i/iu/r/ru) = %d/%d/%d/%d/%d/%d\n",
- (int)(aux_ptr->mpi_rank),
- (int)(aux_ptr->dirty_bytes_propagations),
- (int)(aux_ptr->unprotect_dirty_bytes),
- (int)(aux_ptr->unprotect_dirty_bytes_updates),
- (int)(aux_ptr->insert_dirty_bytes),
- (int)(aux_ptr->insert_dirty_bytes_updates),
- (int)(aux_ptr->rename_dirty_bytes),
- (int)(aux_ptr->rename_dirty_bytes_updates));
+HDfprintf(stdout, "%d:H5AC_propagate...:%u: (u/uu/i/iu/r/ru) = %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,
+ aux_ptr->insert_dirty_bytes_updates,
+ aux_ptr->rename_dirty_bytes,
+ aux_ptr->rename_dirty_bytes_updates);
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
switch(aux_ptr->metadata_write_strategy) {
case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
switch(sync_point_op) {
case H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN:
- if(H5AC_rsp__p0_only__flush_to_min_clean(f, dxpl_id, cache_ptr) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC_rsp__p0_only__flush_to_min_clean() failed.")
+ if(H5AC__rsp__p0_only__flush_to_min_clean(f, dxpl_id) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__p0_only__flush_to_min_clean() failed.")
break;
case H5AC_SYNC_POINT_OP__FLUSH_CACHE:
- if(H5AC_rsp__p0_only__flush(f, dxpl_id, cache_ptr) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC_rsp__p0_only__flush() failed.")
+ if(H5AC__rsp__p0_only__flush(f, dxpl_id) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__p0_only__flush() failed.")
break;
default:
@@ -5035,13 +4310,13 @@ H5AC_run_sync_point(H5F_t *f,
case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
switch(sync_point_op) {
case H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN:
- if(H5AC_rsp__dist_md_write__flush_to_min_clean(f, dxpl_id, cache_ptr) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC_rsp__dist_md_write__flush() failed.")
+ if(H5AC__rsp__dist_md_write__flush_to_min_clean(f, dxpl_id) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__dist_md_write__flush_to_min_clean() failed.")
break;
case H5AC_SYNC_POINT_OP__FLUSH_CACHE:
- if(H5AC_rsp__dist_md_write__flush(f, dxpl_id, cache_ptr) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC_rsp__dist_md_write__flush() failed.")
+ if(H5AC__rsp__dist_md_write__flush(f, dxpl_id) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__dist_md_write__flush() failed.")
break;
default:
@@ -5070,12 +4345,12 @@ H5AC_run_sync_point(H5F_t *f,
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_run_sync_point() */
+} /* H5AC__run_sync_point() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
- * Function: H5AC_tidy_cache_0_lists()
+ * Function: H5AC__tidy_cache_0_lists()
*
* Purpose: In the distributed metadata write strategy, not all dirty
* entries are written by process 0 -- thus we must tidy
@@ -5111,29 +4386,24 @@ done:
*/
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_tidy_cache_0_lists(H5AC_t * cache_ptr,
- int num_candidates,
- haddr_t * candidates_list_ptr)
-
+H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, int num_candidates,
+ haddr_t *candidates_list_ptr)
{
- int i;
H5AC_aux_t * aux_ptr;
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
+ int i;
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
+ FUNC_ENTER_STATIC_NOERR
+ /* Sanity checks */
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr);
-
- HDassert( aux_ptr != NULL );
- HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- HDassert( aux_ptr->metadata_write_strategy ==
- H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED );
- HDassert( aux_ptr->mpi_rank == 0 );
- HDassert( num_candidates > 0 );
- HDassert( candidates_list_ptr != NULL );
+ HDassert(aux_ptr != NULL);
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+ HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED);
+ HDassert(aux_ptr->mpi_rank == 0);
+ HDassert(num_candidates > 0);
+ HDassert(candidates_list_ptr != NULL);
/* clean up dirtied and flushed and still clean lists by removing
* all entries on the candidate list. Cleared entries should
@@ -5149,50 +4419,22 @@ H5AC_tidy_cache_0_lists(H5AC_t * cache_ptr,
addr = candidates_list_ptr[i];
- /* addr must be either on the dirtied list, or on the flushed
+ /* addr may be either on the dirtied list, or on the flushed
* and still clean list. Remove it.
*/
- d_slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_search(aux_ptr->d_slist_ptr, (void *)&addr);
- if(d_slist_entry_ptr != NULL) {
- HDassert(d_slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC);
- HDassert(d_slist_entry_ptr->addr == addr);
-
- if(H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&addr)) != d_slist_entry_ptr)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from dirty entry slist.")
-
- d_slist_entry_ptr->magic = 0;
+ if(NULL != (d_slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->d_slist_ptr, (void *)&addr)))
d_slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, d_slist_entry_ptr);
-
- aux_ptr->d_slist_len -= 1;
-
- HDassert(aux_ptr->d_slist_len >= 0);
- } /* end if */
-
- c_slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_search(aux_ptr->c_slist_ptr, (void *)&addr);
- if(c_slist_entry_ptr != NULL) {
- HDassert(c_slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC);
- HDassert(c_slist_entry_ptr->addr == addr);
-
- if(H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr)) != c_slist_entry_ptr)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from clean entry slist.")
-
- c_slist_entry_ptr->magic = 0;
+ if(NULL != (c_slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->c_slist_ptr, (void *)&addr)))
c_slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, c_slist_entry_ptr);
-
- aux_ptr->c_slist_len -= 1;
-
- HDassert( aux_ptr->c_slist_len >= 0 );
- } /* end if */
} /* end for */
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_tidy_cache_0_lists() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5AC__tidy_cache_0_lists() */
#endif /* H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
- * Function: H5AC_flush_entries
+ * Function: H5AC__flush_entries
*
* Purpose: Flush the metadata cache associated with the specified file,
* only writing from rank 0, but propagating the cleaned entries
@@ -5208,25 +4450,25 @@ done:
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_PARALLEL
-herr_t
-H5AC_flush_entries(H5F_t *f)
+static herr_t
+H5AC__flush_entries(H5F_t *f, hid_t dxpl_id)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
HDassert(f);
HDassert(f->shared->cache);
/* Check if we have >1 ranks */
- if(f->shared->cache->aux_ptr) {
- if(H5AC_run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_CACHE) < 0)
+ if(f->shared->cache->aux_ptr)
+ if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_CACHE) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.")
- } /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_flush_entries() */
+} /* H5AC__flush_entries() */
#endif /* H5_HAVE_PARALLEL */
@@ -5246,15 +4488,13 @@ done:
*------------------------------------------------------------------------------
*/
herr_t
-H5AC_ignore_tags(H5F_t * f)
+H5AC_ignore_tags(const H5F_t *f)
{
- /* Variable Declarations */
herr_t ret_value = SUCCEED;
- /* Function Enter Macro */
FUNC_ENTER_NOAPI(FAIL)
- /* Assertions */
+ /* Sanity checks */
HDassert(f);
HDassert(f->shared);
HDassert(f->shared->cache);
@@ -5281,28 +4521,25 @@ done:
*------------------------------------------------------------------------------
*/
herr_t
-H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t * prev_tag)
+H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t *prev_tag)
{
- /* Variable Declarations */
- H5P_genplist_t *dxpl; /* dataset transfer property list */
+ H5P_genplist_t *dxpl; /* dataset transfer property list */
herr_t ret_value = SUCCEED;
- /* Function Enter Macro */
FUNC_ENTER_NOAPI(FAIL)
/* Check Arguments */
if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
+ HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "not a property list")
- /* Get the current tag value and return that (if prev_tag is NOT null)*/
- if(prev_tag) {
+ /* Get the current tag value and return that (if prev_tag is NOT null) */
+ if(prev_tag)
if((H5P_get(dxpl, "H5AC_metadata_tag", prev_tag)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to query dxpl")
- } /* end if */
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "unable to query dxpl")
/* Set the provided tag value in the dxpl_id. */
if(H5P_set(dxpl, "H5AC_metadata_tag", &metadata_tag) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set property in dxpl")
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set property in dxpl")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -5324,21 +4561,17 @@ done:
*------------------------------------------------------------------------------
*/
herr_t
-H5AC_retag_copied_metadata(H5F_t * f, haddr_t metadata_tag)
+H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag)
{
- herr_t ret_value = SUCCEED;
-
- /* Function Enter Macro */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
- /* Assertions */
+ /* Sanity checks */
HDassert(f);
HDassert(f->shared);
/* Call cache-level function to retag entries */
H5C_retag_copied_metadata(f->shared->cache, metadata_tag);
-done:
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5AC_retag_copied_metadata */
diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h
index ad768ef..950bdea 100644
--- a/src/H5ACpkg.h
+++ b/src/H5ACpkg.h
@@ -64,10 +64,10 @@
*-------------------------------------------------------------------------
*/
-#define H5AC__MIN_DIRTY_BYTES_THRESHOLD (int32_t) \
+#define H5AC__MIN_DIRTY_BYTES_THRESHOLD (size_t) \
(H5C__MIN_MAX_CACHE_SIZE / 2)
#define H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD (256 * 1024)
-#define H5AC__MAX_DIRTY_BYTES_THRESHOLD (int32_t) \
+#define H5AC__MAX_DIRTY_BYTES_THRESHOLD (size_t) \
(H5C__MAX_MAX_CACHE_SIZE / 4)
@@ -142,6 +142,29 @@
*
* JRM - 6/27/05
*
+ * Update: When the above was written, I planned to allow the process
+ * 0 metadata cache to write dirty metadata between sync points.
+ * However, testing indicated that this allowed occasional
+ * messages from the future to reach the caches on other processes.
+ *
+ * To resolve this, the code was altered to require that all metadata
+ * writes take place during sync points -- which solved the problem.
+ * Initially all writes were performed by the process 0 cache. This
+ * approach was later replaced with a distributed write approach
+ * in which each process writes a subset of the metadata to be
+ * written.
+ *
+ * After thinking on the matter for a while, I arrived at the
+ * conclusion that the process 0 cache could be allowed to write
+ * dirty metadata between sync points if it restricted itself to
+ * entries that had been dirty at the time of the previous sync point.
+ *
+ * To date, there has been no attempt to implement this optimization.
+ * However, should it be attempted, much of the supporting code
+ * should still be around.
+ *
+ * JRM -- 1/6/15
+ *
* magic: Unsigned 32 bit integer always set to
* H5AC__H5AC_AUX_T_MAGIC. This field is used to validate
* pointers to instances of H5AC_aux_t.
@@ -180,6 +203,10 @@
* field exists to facilitate experiments with other
* strategies.
*
+ * At present, this field must be set to either
+ * H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY or
+ * H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED.
+ *
* dirty_bytes_propagations: This field only exists when the
* H5AC_DEBUG_DIRTY_BYTES_CREATION #define is TRUE.
*
@@ -270,11 +297,6 @@
* To reitterate, this field is only used on process 0 -- it
* should be NULL on all other processes.
*
- * d_slist_len: Integer field containing the number of entries in the
- * dirty entry list. This field should always contain the
- * value 0 on all processes other than process 0. It exists
- * primarily for sanity checking.
- *
* c_slist_ptr: Pointer to an instance of H5SL_t used to maintain a list
* of entries that were dirty, have been flushed
* to disk since the last clean entries broadcast, and are
@@ -285,11 +307,6 @@
* the next clean entries broadcast. The list emptied after
* each broadcast.
*
- * c_slist_len: Integer field containing the number of entries in the clean
- * entries list (*c_slist_ptr). This field should always
- * contain the value 0 on all processes other than process 0.
- * It exists primarily for sanity checking.
- *
* The following two fields are used only when metadata_write_strategy
* is H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED.
*
@@ -298,9 +315,6 @@
* point. This list is then broadcast to the other processes,
* which then either flush or mark clean all entries on it.
*
- * candidate_slist_len: Integer field containing the number of entries on the
- * candidate list. It exists primarily for sanity checking.
- *
* write_done: In the parallel test bed, it is necessary to ensure that
* all writes to the server process from cache 0 complete
* before it enters the barrier call with the other caches.
@@ -344,39 +358,33 @@ typedef struct H5AC_aux_t
hbool_t write_permitted;
- int32_t dirty_bytes_threshold;
+ size_t dirty_bytes_threshold;
- int32_t dirty_bytes;
+ size_t dirty_bytes;
int32_t metadata_write_strategy;
#if H5AC_DEBUG_DIRTY_BYTES_CREATION
- int32_t dirty_bytes_propagations;
+ unsigned dirty_bytes_propagations;
- int32_t unprotect_dirty_bytes;
- int32_t unprotect_dirty_bytes_updates;
+ size_t unprotect_dirty_bytes;
+ unsigned unprotect_dirty_bytes_updates;
- int32_t insert_dirty_bytes;
- int32_t insert_dirty_bytes_updates;
+ size_t insert_dirty_bytes;
+ unsigned insert_dirty_bytes_updates;
- int32_t move_dirty_bytes;
- int32_t move_dirty_bytes_updates;
+ size_t move_dirty_bytes;
+ unsigned move_dirty_bytes_updates;
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
H5SL_t * d_slist_ptr;
- int32_t d_slist_len;
-
H5SL_t * c_slist_ptr;
- int32_t c_slist_len;
-
H5SL_t * candidate_slist_ptr;
- int32_t candidate_slist_len;
-
void (* write_done)(void);
void (* sync_point_done)(int num_writes,
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index cf4c122..a4e7c5a 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -255,7 +255,7 @@ H5_DLLVAR hid_t H5AC_ind_dxpl_id;
/* int epochs_before_eviction = */ 3, \
/* hbool_t apply_empty_reserve = */ TRUE, \
/* double empty_reserve = */ 0.1f, \
- /* int dirty_bytes_threshold = */ (256 * 1024), \
+ /* size_t dirty_bytes_threshold = */ (256 * 1024), \
/* int metadata_write_strategy = */ \
H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
}
@@ -291,7 +291,7 @@ H5_DLLVAR hid_t H5AC_ind_dxpl_id;
/* int epochs_before_eviction = */ 3, \
/* hbool_t apply_empty_reserve = */ TRUE, \
/* double empty_reserve = */ 0.1f, \
- /* int dirty_bytes_threshold = */ (256 * 1024), \
+ /* size_t dirty_bytes_threshold = */ (256 * 1024), \
/* int metadata_write_strategy = */ \
H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
}
@@ -363,8 +363,6 @@ H5_DLL herr_t H5AC_set_sync_point_done_callback(H5C_t *cache_ptr,
void (*sync_point_done)(int num_writes, haddr_t *written_entries_tbl));
H5_DLL herr_t H5AC_set_write_done_callback(H5C_t * cache_ptr,
void (* write_done)(void));
-H5_DLL herr_t H5AC_stats(const H5F_t *f);
-H5_DLL herr_t H5AC_dump_cache(const H5F_t *f);
H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr,
H5AC_cache_config_t *config_ptr);
H5_DLL herr_t H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr,
@@ -374,27 +372,24 @@ H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t *cache_ptr);
H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr,
H5AC_cache_config_t *config_ptr);
H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t *config_ptr);
-
H5_DLL herr_t H5AC_close_trace_file(H5AC_t *cache_ptr);
H5_DLL herr_t H5AC_open_trace_file(H5AC_t *cache_ptr, const char *trace_file_name);
-H5_DLL herr_t H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t * prev_tag);
-H5_DLL herr_t H5AC_retag_copied_metadata(H5F_t * f, haddr_t metadata_tag);
-H5_DLL herr_t H5AC_ignore_tags(H5F_t * f);
+H5_DLL herr_t H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t *prev_tag);
+H5_DLL herr_t H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag);
+H5_DLL herr_t H5AC_ignore_tags(const H5F_t *f);
#ifdef H5_HAVE_PARALLEL
H5_DLL herr_t H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr);
#endif /* H5_HAVE_PARALLEL */
#ifndef NDEBUG /* debugging functions */
-
+H5_DLL herr_t H5AC_stats(const H5F_t *f);
+H5_DLL herr_t H5AC_dump_cache(const H5F_t *f);
H5_DLL herr_t H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr,
- void ** entry_ptr_ptr);
-
+ void ** entry_ptr_ptr);
H5_DLL herr_t H5AC_verify_entry_type(const H5F_t * f, haddr_t addr,
- const H5AC_class_t * expected_type,
- hbool_t * in_cache_ptr,
- hbool_t * type_ok_ptr);
-
+ const H5AC_class_t * expected_type, hbool_t * in_cache_ptr,
+ hbool_t * type_ok_ptr);
#endif /* NDEBUG */ /* end debugging functions */
#endif /* !_H5ACprivate_H */
diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h
index 639179c..598197f 100644
--- a/src/H5ACpublic.h
+++ b/src/H5ACpublic.h
@@ -496,7 +496,7 @@ typedef struct H5AC_cache_config_t
/* parallel configuration fields: */
- int dirty_bytes_threshold;
+ size_t dirty_bytes_threshold;
int metadata_write_strategy;
} H5AC_cache_config_t;
diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c
index 97b979e..d873cf6 100644
--- a/src/H5B2hdr.c
+++ b/src/H5B2hdr.c
@@ -256,7 +256,7 @@ H5B2__hdr_alloc(H5F_t *f)
hdr->f = f;
hdr->sizeof_addr = H5F_SIZEOF_ADDR(f);
hdr->sizeof_size = H5F_SIZEOF_SIZE(f);
- hdr->hdr_size = H5B2_HEADER_SIZE(hdr);
+ hdr->hdr_size = H5B2_HEADER_SIZE_HDR(hdr);
hdr->root.addr = HADDR_UNDEF;
/* Set return value */
diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h
index 72476eb..a2d32e6 100644
--- a/src/H5B2pkg.h
+++ b/src/H5B2pkg.h
@@ -45,10 +45,10 @@
/* Size of a "tree pointer" (on disk) */
/* (essentially, the largest internal pointer allowed) */
-#define H5B2_TREE_POINTER_SIZE(h) ( \
- (h)->sizeof_addr + \
+#define H5B2_TREE_POINTER_SIZE(sizeof_addr, sizeof_size) ( \
+ (sizeof_addr) + \
H5B2_SIZEOF_RECORDS_PER_NODE + \
- (h)->sizeof_size \
+ (sizeof_size) \
)
/* Size of a internal node pointer (on disk) */
@@ -70,7 +70,7 @@
)
/* Size of the v2 B-tree header on disk */
-#define H5B2_HEADER_SIZE(h) ( \
+#define H5B2_HEADER_SIZE(sizeof_addr, sizeof_size) ( \
/* General metadata fields */ \
H5B2_METADATA_PREFIX_SIZE \
\
@@ -80,7 +80,17 @@
+ (unsigned)2 /* Depth of tree */ \
+ (unsigned)1 /* Split % of full (as integer, ie. "98" means 98%) */ \
+ (unsigned)1 /* Merge % of full (as integer, ie. "98" means 98%) */ \
- + H5B2_TREE_POINTER_SIZE(h) /* Node pointer to root node in tree */ \
+ + H5B2_TREE_POINTER_SIZE(sizeof_addr, sizeof_size) /* Node pointer to root node in tree */ \
+ )
+
+/* Size of the v2 B-tree header on disk (via file pointer) */
+#define H5B2_HEADER_SIZE_FILE(f) ( \
+ H5B2_HEADER_SIZE(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) \
+ )
+
+/* Size of the v2 B-tree header on disk (via v2 B-tree header) */
+#define H5B2_HEADER_SIZE_HDR(h) ( \
+ H5B2_HEADER_SIZE((h)->sizeof_addr, (h)->sizeof_size) \
)
/* Size of the v2 B-tree internal node prefix */
diff --git a/src/H5C.c b/src/H5C.c
index d05f686..5cdd65f 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -621,7 +621,7 @@ H5C_apply_candidate_list(H5F_t * f,
(int)(cache_ptr->LRU_list_len));
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
- /* ====================================================================== *
+ /* ===================================================================== *
* Now scan the LRU and PEL lists, flushing or clearing entries as
* needed.
*
@@ -632,7 +632,7 @@ H5C_apply_candidate_list(H5F_t * f,
* to account for this one case where they come into play. If these flags
* are ever expanded upon, this function and the following flushing steps
* should be reworked to account for additional cases.
- * ====================================================================== */
+ * ===================================================================== */
entries_examined = 0;
initial_list_len = cache_ptr->LRU_list_len;
@@ -1612,9 +1612,7 @@ H5C_expunge_entry(H5F_t * f,
HDassert(f);
HDassert(f->shared);
-
cache_ptr = f->shared->cache;
-
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(type);
@@ -1720,10 +1718,10 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
H5C_cache_entry_t * entry_ptr = NULL;
H5C_cache_entry_t * next_entry_ptr = NULL;
#if H5C_DO_SANITY_CHECKS
- int64_t flushed_entries_count;
- size_t flushed_entries_size;
- int64_t initial_slist_len;
- size_t initial_slist_size;
+ int64_t flushed_entries_count = 0;
+ int64_t flushed_entries_size = 0;
+ int64_t initial_slist_len = 0;
+ size_t initial_slist_size = 0;
#endif /* H5C_DO_SANITY_CHECKS */
FUNC_ENTER_NOAPI(FAIL)
@@ -1945,7 +1943,7 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
if(entry_ptr->flush_dep_height == curr_flush_dep_height ) {
#if H5C_DO_SANITY_CHECKS
flushed_entries_count++;
- flushed_entries_size += entry_ptr->size;
+ flushed_entries_size += (int64_t)entry_ptr->size;
#endif /* H5C_DO_SANITY_CHECKS */
status = H5C_flush_single_entry(f,
primary_dxpl_id,
@@ -1978,7 +1976,7 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
if(entry_ptr->flush_dep_height == curr_flush_dep_height ) {
#if H5C_DO_SANITY_CHECKS
flushed_entries_count++;
- flushed_entries_size += entry_ptr->size;
+ flushed_entries_size += (int64_t)entry_ptr->size;
#endif /* H5C_DO_SANITY_CHECKS */
status = H5C_flush_single_entry(f,
primary_dxpl_id,
@@ -2029,8 +2027,8 @@ end_of_inner_loop:
HDassert( (initial_slist_len + cache_ptr->slist_len_increase -
flushed_entries_count) == cache_ptr->slist_len );
- HDassert( (initial_slist_size +
- (size_t)(cache_ptr->slist_size_increase) -
+ HDassert( (size_t)((int64_t)initial_slist_size +
+ cache_ptr->slist_size_increase -
flushed_entries_size) == cache_ptr->slist_size );
#endif /* H5C_DO_SANITY_CHECKS */
@@ -2129,9 +2127,7 @@ H5C_flush_to_min_clean(H5F_t * f,
if ( cache_ptr->check_write_permitted != NULL ) {
- result = (cache_ptr->check_write_permitted)(f,
- primary_dxpl_id,
- &write_permitted);
+ result = (cache_ptr->check_write_permitted)(f, &write_permitted);
if ( result < 0 ) {
@@ -2394,7 +2390,7 @@ H5C_get_cache_hit_rate(H5C_t * cache_ptr, double * hit_rate_ptr)
FUNC_ENTER_NOAPI(FAIL)
- if((cache_ptr == NULL ) || (cache_ptr->magic != H5C__H5C_T_MAGIC))
+ if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry.")
if(hit_rate_ptr == NULL)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad hit_rate_ptr on entry.")
@@ -2571,25 +2567,23 @@ done:
* file logging is turned off), or contain a pointer to the
* open file to which trace file data is to be written.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-NULL trace file pointer (can't fail)
*
* Programmer: John Mainzer
* 1/20/06
*
*-------------------------------------------------------------------------
*/
-herr_t
-H5C_get_trace_file_ptr(const H5C_t *cache_ptr, FILE **trace_file_ptr_ptr)
+FILE *
+H5C_get_trace_file_ptr(const H5C_t *cache_ptr)
{
FUNC_ENTER_NOAPI_NOERR
+ /* Check arguments */
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
- HDassert(trace_file_ptr_ptr);
- *trace_file_ptr_ptr = cache_ptr->trace_file_ptr;
-
- FUNC_LEAVE_NOAPI(SUCCEED)
+ FUNC_LEAVE_NOAPI(cache_ptr->trace_file_ptr)
} /* H5C_get_trace_file_ptr() */
@@ -2602,16 +2596,15 @@ H5C_get_trace_file_ptr(const H5C_t *cache_ptr, FILE **trace_file_ptr_ptr)
* file logging is turned off), or contain a pointer to the
* open file to which trace file data is to be written.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-NULL trace file pointer (can't fail)
*
* Programmer: Quincey Koziol
* 6/9/08
*
*-------------------------------------------------------------------------
*/
-herr_t
-H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr,
- FILE **trace_file_ptr_ptr)
+FILE *
+H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr)
{
FUNC_ENTER_NOAPI_NOERR
@@ -2619,9 +2612,7 @@ H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr,
HDassert(entry_ptr);
HDassert(entry_ptr->cache_ptr);
- H5C_get_trace_file_ptr(entry_ptr->cache_ptr, trace_file_ptr_ptr);
-
- FUNC_LEAVE_NOAPI(SUCCEED)
+ FUNC_LEAVE_NOAPI(H5C_get_trace_file_ptr(entry_ptr->cache_ptr))
} /* H5C_get_trace_file_ptr_from_entry() */
@@ -2733,7 +2724,7 @@ H5C_insert_entry(H5F_t * f,
entry_ptr->cache_ptr = cache_ptr;
entry_ptr->addr = addr;
entry_ptr->type = type;
-
+
/* Apply tag to newly inserted entry */
if(H5C_tag_entry(cache_ptr, entry_ptr, primary_dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "Cannot tag metadata entry")
@@ -2822,9 +2813,7 @@ H5C_insert_entry(H5F_t * f,
if ( cache_ptr->check_write_permitted != NULL ) {
- result = (cache_ptr->check_write_permitted)(f,
- primary_dxpl_id,
- &write_permitted);
+ result = (cache_ptr->check_write_permitted)(f, &write_permitted);
if ( result < 0 ) {
@@ -3469,7 +3458,7 @@ H5C_move_entry(H5C_t * cache_ptr,
#endif /* H5C_DO_SANITY_CHECKS */
H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, FAIL)
- }
+ }
}
H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr)
@@ -3936,9 +3925,7 @@ H5C_protect(H5F_t * f,
if ( cache_ptr->check_write_permitted != NULL ) {
- result = (cache_ptr->check_write_permitted)(f,
- primary_dxpl_id,
- &write_permitted);
+ result = (cache_ptr->check_write_permitted)(f, &write_permitted);
if ( result < 0 ) {
@@ -4085,9 +4072,7 @@ H5C_protect(H5F_t * f,
if ( cache_ptr->check_write_permitted != NULL ) {
- result = (cache_ptr->check_write_permitted)(f,
- primary_dxpl_id,
- &write_permitted);
+ result = (cache_ptr->check_write_permitted)(f, &write_permitted);
if ( result < 0 ) {
@@ -4662,8 +4647,6 @@ H5C_stats(H5C_t * cache_ptr,
#endif /* H5C_COLLECT_CACHE_STATS */
display_detailed_stats)
{
- herr_t ret_value = SUCCEED; /* Return value */
-
#if H5C_COLLECT_CACHE_STATS
int i;
int64_t total_hits = 0;
@@ -4695,11 +4678,12 @@ H5C_stats(H5C_t * cache_ptr,
size_t aggregate_max_size = 0;
int32_t aggregate_max_pins = 0;
double hit_rate;
- double average_successful_search_depth = 0.0;
- double average_failed_search_depth = 0.0;
- double average_entries_skipped_per_calls_to_msic = 0.0;
- double average_entries_scanned_per_calls_to_msic = 0.0;
+ double average_successful_search_depth = 0.0f;
+ double average_failed_search_depth = 0.0f;
+ double average_entries_skipped_per_calls_to_msic = 0.0f;
+ double average_entries_scanned_per_calls_to_msic = 0.0f;
#endif /* H5C_COLLECT_CACHE_STATS */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -4729,11 +4713,9 @@ H5C_stats(H5C_t * cache_ptr,
total_clears += cache_ptr->clears[i];
total_flushes += cache_ptr->flushes[i];
total_evictions += cache_ptr->evictions[i];
- total_moves += cache_ptr->moves[i];
- total_entry_flush_moves
- += cache_ptr->entry_flush_moves[i];
- total_cache_flush_moves
- += cache_ptr->cache_flush_moves[i];
+ total_moves += cache_ptr->moves[i];
+ total_entry_flush_moves += cache_ptr->entry_flush_moves[i];
+ total_cache_flush_moves += cache_ptr->cache_flush_moves[i];
total_size_increases += cache_ptr->size_increases[i];
total_size_decreases += cache_ptr->size_decreases[i];
total_entry_flush_size_changes
@@ -4765,10 +4747,10 @@ H5C_stats(H5C_t * cache_ptr,
if ( ( total_hits > 0 ) || ( total_misses > 0 ) ) {
- hit_rate = 100.0 * ((double)(total_hits)) /
+ hit_rate = (double)100.0f * ((double)(total_hits)) /
((double)(total_hits + total_misses));
} else {
- hit_rate = 0.0;
+ hit_rate = 0.0f;
}
if ( cache_ptr->successful_ht_searches > 0 ) {
@@ -4889,14 +4871,14 @@ H5C_stats(H5C_t * cache_ptr,
(long)total_evictions);
HDfprintf(stdout,
- "%s Total insertions(pinned) / moves = %ld(%ld) / %ld\n",
+ "%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",
+ "%s Total entry / cache flush moves = %ld / %ld\n",
cache_ptr->prefix,
(long)total_entry_flush_moves,
(long)total_cache_flush_moves);
@@ -4935,7 +4917,7 @@ H5C_stats(H5C_t * cache_ptr,
HDfprintf(stdout, "%s MSIC: Average/max entries skipped = %lf / %ld\n",
cache_ptr->prefix,
- (float)average_entries_skipped_per_calls_to_msic,
+ (double)average_entries_skipped_per_calls_to_msic,
(long)(cache_ptr->max_entries_skipped_in_msic));
if (cache_ptr->calls_to_msic > 0) {
@@ -4946,7 +4928,7 @@ H5C_stats(H5C_t * cache_ptr,
HDfprintf(stdout, "%s MSIC: Average/max entries scanned = %lf / %ld\n",
cache_ptr->prefix,
- (float)average_entries_scanned_per_calls_to_msic,
+ (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",
@@ -4990,10 +4972,10 @@ H5C_stats(H5C_t * cache_ptr,
if ( ( cache_ptr->hits[i] > 0 ) || ( cache_ptr->misses[i] > 0 ) ) {
- hit_rate = 100.0 * ((double)(cache_ptr->hits[i])) /
+ hit_rate = (double)100.0f * ((double)(cache_ptr->hits[i])) /
((double)(cache_ptr->hits[i] + cache_ptr->misses[i]));
} else {
- hit_rate = 0.0;
+ hit_rate = 0.0f;
}
HDfprintf(stdout,
@@ -5018,14 +5000,14 @@ H5C_stats(H5C_t * cache_ptr,
(long)(cache_ptr->evictions[i]));
HDfprintf(stdout,
- "%s insertions(pinned) / moves = %ld(%ld) / %ld\n",
+ "%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",
+ "%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]));
@@ -5050,7 +5032,7 @@ H5C_stats(H5C_t * cache_ptr,
(long)(cache_ptr->unpins[i]));
HDfprintf(stdout,
- "%s entry dirty pins/pin'd flushes = %ld / %ld\n",
+ "%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]));
@@ -5144,8 +5126,8 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED * cache_ptr)
cache_ptr->flushes[i] = 0;
cache_ptr->evictions[i] = 0;
cache_ptr->moves[i] = 0;
- cache_ptr->entry_flush_moves[i] = 0;
- cache_ptr->cache_flush_moves[i] = 0;
+ cache_ptr->entry_flush_moves[i] = 0;
+ cache_ptr->cache_flush_moves[i] = 0;
cache_ptr->pins[i] = 0;
cache_ptr->unpins[i] = 0;
cache_ptr->dirty_pins[i] = 0;
@@ -8246,7 +8228,6 @@ H5C_flush_single_entry(H5F_t * f,
hbool_t was_dirty;
hbool_t destroy_entry;
herr_t status;
- int type_id;
unsigned flush_flags = H5C_CALLBACK__NO_FLAGS_SET;
H5C_cache_entry_t * entry_ptr = NULL;
herr_t ret_value = SUCCEED; /* Return value */
@@ -8347,7 +8328,6 @@ H5C_flush_single_entry(H5F_t * f,
#endif /* H5_HAVE_PARALLEL */
was_dirty = entry_ptr->is_dirty;
- type_id = entry_ptr->type->id;
entry_ptr->flush_marker = FALSE;
@@ -8615,8 +8595,7 @@ H5C_flush_single_entry(H5F_t * f,
if ( cache_ptr->log_flush ) {
- status = (cache_ptr->log_flush)(cache_ptr, addr, was_dirty,
- flags, type_id);
+ status = (cache_ptr->log_flush)(cache_ptr, addr, was_dirty, flags);
if ( status < 0 ) {
@@ -8943,7 +8922,6 @@ H5C_make_space_in_cache(H5F_t * f,
total_entries_scanned++;
#endif /* H5C_COLLECT_CACHE_STATS */
-
} else {
/* Skip epoch markers. Set result to SUCCEED to avoid
diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h
index ae6bdad..5df84cd 100644
--- a/src/H5Cpkg.h
+++ b/src/H5Cpkg.h
@@ -35,14 +35,16 @@
#ifndef _H5Cpkg_H
#define _H5Cpkg_H
-
/* Get package's private header */
#include "H5Cprivate.h"
-
-/* Get needed headers */
+/* Other private headers needed by this file */
#include "H5SLprivate.h" /* Skip lists */
+/**************************/
+/* Package Private Macros */
+/**************************/
+
/* With the introduction of the fractal heap, it is now possible for
* entries to be dirtied, resized, and/or moved in the flush callbacks.
* As a result, on flushes, it may be necessary to make multiple passes
@@ -53,980 +55,14 @@
*
* -- JRM
*/
-
#define H5C__MAX_PASSES_ON_FLUSH 4
-
-
-/****************************************************************************
- *
- * structure H5C_t
- *
- * Catchall structure for all variables specific to an instance of the cache.
- *
- * While the individual fields of the structure are discussed below, the
- * following overview may be helpful.
- *
- * Entries in the cache are stored in an instance of H5TB_TREE, indexed on
- * the entry's disk address. While the H5TB_TREE is less efficient than
- * hash table, it keeps the entries in address sorted order. As flushes
- * in parallel mode are more efficient if they are issued in increasing
- * address order, this is a significant benefit. Also the H5TB_TREE code
- * was readily available, which reduced development time.
- *
- * While the cache was designed with multiple replacement policies in mind,
- * at present only a modified form of LRU is supported.
- *
- * JRM - 4/26/04
- *
- * Profiling has indicated that searches in the instance of H5TB_TREE are
- * too expensive. To deal with this issue, I have augmented the cache
- * with a hash table in which all entries will be stored. Given the
- * advantages of flushing entries in increasing address order, the TBBT
- * is retained, but only dirty entries are stored in it. At least for
- * now, we will leave entries in the TBBT after they are flushed.
- *
- * Note that index_size and index_len now refer to the total size of
- * and number of entries in the hash table.
- *
- * JRM - 7/19/04
- *
- * The TBBT has since been replaced with a skip list. This change
- * greatly predates this note.
- *
- * JRM - 9/26/05
- *
- * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC.
- * This field is used to validate pointers to instances of
- * H5C_t.
- *
- * flush_in_progress: Boolean flag indicating whether a flush is in
- * progress.
- *
- * trace_file_ptr: File pointer pointing to the trace file, which is used
- * to record cache operations for use in simulations and design
- * studies. This field will usually be NULL, indicating that
- * no trace file should be recorded.
- *
- * Since much of the code supporting the parallel metadata
- * cache is in H5AC, we don't write the trace file from
- * H5C. Instead, H5AC reads the trace_file_ptr as needed.
- *
- * When we get to using H5C in other places, we may add
- * code to write trace file data at the H5C level as well.
- *
- * aux_ptr: Pointer to void used to allow wrapper code to associate
- * its data with an instance of H5C_t. The H5C cache code
- * sets this field to NULL, and otherwise leaves it alone.
- *
- * max_type_id: Integer field containing the maximum type id number assigned
- * to a type of entry in the cache. All type ids from 0 to
- * max_type_id inclusive must be defined. The names of the
- * types are stored in the type_name_table discussed below, and
- * indexed by the ids.
- *
- * type_name_table_ptr: Pointer to an array of pointer to char of length
- * max_type_id + 1. The strings pointed to by the entries
- * in the array are the names of the entry types associated
- * with the indexing type IDs.
- *
- * max_cache_size: Nominal maximum number of bytes that may be stored in the
- * cache. This value should be viewed as a soft limit, as the
- * cache can exceed this value under the following circumstances:
- *
- * a) All entries in the cache are protected, and the cache is
- * asked to insert a new entry. In this case the new entry
- * will be created. If this causes the cache to exceed
- * max_cache_size, it will do so. The cache will attempt
- * to reduce its size as entries are unprotected.
- *
- * b) When running in parallel mode, the cache may not be
- * permitted to flush a dirty entry in response to a read.
- * If there are no clean entries available to evict, the
- * cache will exceed its maximum size. Again the cache
- * will attempt to reduce its size to the max_cache_size
- * limit on the next cache write.
- *
- * c) When an entry increases in size, the cache may exceed
- * the max_cache_size limit until the next time the cache
- * attempts to load or insert an entry.
- *
- * min_clean_size: Nominal minimum number of clean bytes in the cache.
- * The cache attempts to maintain this number of bytes of
- * clean data so as to avoid case b) above. Again, this is
- * a soft limit.
- *
- *
- * In addition to the call back functions required for each entry, the
- * cache requires the following call back functions for this instance of
- * the cache as a whole:
- *
- * check_write_permitted: In certain applications, the cache may not
- * be allowed to write to disk at certain time. If specified,
- * the check_write_permitted function is used to determine if
- * a write is permissible at any given point in time.
- *
- * If no such function is specified (i.e. this field is NULL),
- * the cache uses the following write_permitted field to
- * determine whether writes are permitted.
- *
- * write_permitted: If check_write_permitted is NULL, this boolean flag
- * indicates whether writes are permitted.
- *
- * log_flush: If provided, this function is called whenever a dirty
- * entry is flushed to disk.
- *
- *
- * In cases where memory is plentiful, and performance is an issue, it may
- * be useful to disable all cache evictions, and thereby postpone metadata
- * writes. The following field is used to implement this.
- *
- * evictions_enabled: Boolean flag that is initialized to TRUE. When
- * this flag is set to FALSE, the metadata cache will not
- * attempt to evict entries to make space for newly protected
- * entries, and instead the will grow without limit.
- *
- * Needless to say, this feature must be used with care.
- *
- *
- * The cache requires an index to facilitate searching for entries. The
- * following fields support that index.
- *
- * index_len: Number of entries currently in the hash table used to index
- * the cache.
- *
- * index_size: Number of bytes of cache entries currently stored in the
- * hash table used to index the cache.
- *
- * This value should not be mistaken for footprint of the
- * cache in memory. The average cache entry is small, and
- * the cache has a considerable overhead. Multiplying the
- * index_size by two should yield a conservative estimate
- * of the cache's memory footprint.
- *
- * clean_index_size: Number of bytes of clean entries currently stored in
- * the hash table. Note that the index_size field (above)
- * is also the sum of the sizes of all entries in the cache.
- * Thus we should have the invarient that clean_index_size +
- * dirty_index_size == index_size.
- *
- * WARNING:
- *
- * 1) The clean_index_size field is not maintained by the
- * index macros, as the hash table doesn't care whether
- * the entry is clean or dirty. Instead the field is
- * maintained in the H5C__UPDATE_RP macros.
- *
- * 2) The value of the clean_index_size must not be mistaken
- * for the current clean size of the cache. Rather, the
- * clean size of the cache is the current value of
- * clean_index_size plus the amount of empty space (if any)
- * in the cache.
- *
- * dirty_index_size: Number of bytes of dirty entries currently stored in
- * the hash table. Note that the index_size field (above)
- * is also the sum of the sizes of all entries in the cache.
- * Thus we should have the invarient that clean_index_size +
- * dirty_index_size == index_size.
- *
- * WARNING:
- *
- * 1) The dirty_index_size field is not maintained by the
- * index macros, as the hash table doesn't care whether
- * the entry is clean or dirty. Instead the field is
- * maintained in the H5C__UPDATE_RP macros.
- *
- * index: Array of pointer to H5C_cache_entry_t of size
- * H5C__HASH_TABLE_LEN. At present, this value is a power
- * of two, not the usual prime number.
- *
- * I hope that the variable size of cache elements, the large
- * hash table size, and the way in which HDF5 allocates space
- * will combine to avoid problems with periodicity. If so, we
- * can use a trivial hash function (a bit-and and a 3 bit left
- * shift) with some small savings.
- *
- * If not, it will become evident in the statistics. Changing
- * to the usual prime number length hash table will require
- * changing the H5C__HASH_FCN macro and the deletion of the
- * H5C__HASH_MASK #define. No other changes should be required.
- *
- *
- * When we flush the cache, we need to write entries out in increasing
- * address order. An instance of a skip list is used to store dirty entries in
- * sorted order. Whether it is cheaper to sort the dirty entries as needed,
- * or to maintain the list is an open question. At a guess, it depends
- * on how frequently the cache is flushed. We will see how it goes.
- *
- * For now at least, I will not remove dirty entries from the list as they
- * are flushed. (this has been changed -- dirty entries are now removed from
- * the skip list as they are flushed. JRM - 10/25/05)
- *
- * slist_len: Number of entries currently in the skip list
- * used to maintain a sorted list of dirty entries in the
- * cache.
- *
- * slist_size: Number of bytes of cache entries currently stored in the
- * skip list used to maintain a sorted list of
- * dirty entries in the cache.
- *
- * slist_ptr: pointer to the instance of H5SL_t used maintain a sorted
- * list of dirty entries in the cache. This sorted list has
- * two uses:
- *
- * a) It allows us to flush dirty entries in increasing address
- * order, which results in significant savings.
- *
- * b) It facilitates checking for adjacent dirty entries when
- * attempting to evict entries from the cache. While we
- * don't use this at present, I hope that this will allow
- * some optimizations when I get to it.
- *
- * num_last_entries: The number of entries in the cache that can only be
- * flushed after all other entries in the cache have
- * been flushed. At this time, this will only ever be
- * one entry (the superblock), and the code has been
- * protected with HDasserts to enforce this. This restraint
- * can certainly be relaxed in the future if the need for
- * multiple entries being flushed last arises, though
- * explicit tests for that case should be added when said
- * HDasserts are removed.
- *
- * With the addition of the fractal heap, the cache must now deal with
- * the case in which entries may be dirtied, moved, or have their sizes
- * changed during a flush. To allow sanity checks in this situation, the
- * following two fields have been added. They are only compiled in when
- * H5C_DO_SANITY_CHECKS is TRUE.
- *
- * slist_len_increase: Number of entries that have been added to the
- * slist since the last time this field was set to zero.
- *
- * slist_size_increase: Total size of all entries that have been added
- * to the slist since the last time this field was set to
- * zero.
- *
- *
- * When a cache entry is protected, it must be removed from the LRU
- * list(s) as it cannot be either flushed or evicted until it is unprotected.
- * The following fields are used to implement the protected list (pl).
- *
- * pl_len: Number of entries currently residing on the protected list.
- *
- * pl_size: Number of bytes of cache entries currently residing on the
- * protected list.
- *
- * pl_head_ptr: Pointer to the head of the doubly linked list of protected
- * entries. Note that cache entries on this list are linked
- * by their next and prev fields.
- *
- * This field is NULL if the list is empty.
- *
- * pl_tail_ptr: Pointer to the tail of the doubly linked list of protected
- * entries. Note that cache entries on this list are linked
- * by their next and prev fields.
- *
- * This field is NULL if the list is empty.
- *
- *
- * For very frequently used entries, the protect/unprotect overhead can
- * become burdensome. To avoid this overhead, I have modified the cache
- * to allow entries to be "pinned". A pinned entry is similar to a
- * protected entry, in the sense that it cannot be evicted, and that
- * the entry can be modified at any time.
- *
- * Pinning an entry has the following implications:
- *
- * 1) A pinned entry cannot be evicted. Thus unprotected
- * pinned entries reside in the pinned entry list, instead
- * of the LRU list(s) (or other lists maintained by the current
- * replacement policy code).
- *
- * 2) A pinned entry can be accessed or modified at any time.
- * Therefore, the cache must check with the entry owner
- * before flushing it. If permission is denied, the
- * cache just skips the entry in the flush.
- *
- * 3) A pinned entry can be marked as dirty (and possibly
- * change size) while it is unprotected.
- *
- * 4) The flush-destroy code must allow pinned entries to
- * be unpinned (and possibly unprotected) during the
- * flush.
- *
- * Since pinned entries cannot be evicted, they must be kept on a pinned
- * entry list (pel), instead of being entrusted to the replacement policy
- * code.
- *
- * Maintaining the pinned entry list requires the following fields:
- *
- * pel_len: Number of entries currently residing on the pinned
- * entry list.
- *
- * pel_size: Number of bytes of cache entries currently residing on
- * the pinned entry list.
- *
- * pel_head_ptr: Pointer to the head of the doubly linked list of pinned
- * but not protected entries. Note that cache entries on
- * this list are linked by their next and prev fields.
- *
- * This field is NULL if the list is empty.
- *
- * pel_tail_ptr: Pointer to the tail of the doubly linked list of pinned
- * but not protected entries. Note that cache entries on
- * this list are linked by their next and prev fields.
- *
- * This field is NULL if the list is empty.
- *
- *
- * The cache must have a replacement policy, and the fields supporting this
- * policy must be accessible from this structure.
- *
- * While there has been interest in several replacement policies for
- * this cache, the initial development schedule is tight. Thus I have
- * elected to support only a modified LRU (least recently used) policy
- * for the first cut.
- *
- * To further simplify matters, I have simply included the fields needed
- * by the modified LRU in this structure. When and if we add support for
- * other policies, it will probably be easiest to just add the necessary
- * fields to this structure as well -- we only create one instance of this
- * structure per file, so the overhead is not excessive.
- *
- *
- * Fields supporting the modified LRU policy:
- *
- * See most any OS text for a discussion of the LRU replacement policy.
- *
- * When operating in parallel mode, we must ensure that a read does not
- * cause a write. If it does, the process will hang, as the write will
- * be collective and the other processes will not know to participate.
- *
- * To deal with this issue, I have modified the usual LRU policy by adding
- * clean and dirty LRU lists to the usual LRU list.
- *
- * The clean LRU list is simply the regular LRU list with all dirty cache
- * entries removed.
- *
- * Similarly, the dirty LRU list is the regular LRU list with all the clean
- * cache entries removed.
- *
- * When reading in parallel mode, we evict from the clean LRU list only.
- * This implies that we must try to ensure that the clean LRU list is
- * reasonably well stocked at all times.
- *
- * We attempt to do this by trying to flush enough entries on each write
- * to keep the cLRU_list_size >= min_clean_size.
- *
- * Even if we start with a completely clean cache, a sequence of protects
- * without unprotects can empty the clean LRU list. In this case, the
- * cache must grow temporarily. At the next write, we will attempt to
- * evict enough entries to reduce index_size to less than max_cache_size.
- * While this will usually be possible, all bets are off if enough entries
- * are protected.
- *
- * Discussions of the individual fields used by the modified LRU replacement
- * policy follow:
- *
- * LRU_list_len: Number of cache entries currently on the LRU list.
- *
- * Observe that LRU_list_len + pl_len must always equal
- * index_len.
- *
- * LRU_list_size: Number of bytes of cache entries currently residing on the
- * LRU list.
- *
- * Observe that LRU_list_size + pl_size must always equal
- * index_size.
- *
- * LRU_head_ptr: Pointer to the head of the doubly linked LRU list. Cache
- * entries on this list are linked by their next and prev fields.
- *
- * This field is NULL if the list is empty.
- *
- * LRU_tail_ptr: Pointer to the tail of the doubly linked LRU list. Cache
- * entries on this list are linked by their next and prev fields.
- *
- * This field is NULL if the list is empty.
- *
- * cLRU_list_len: Number of cache entries currently on the clean LRU list.
- *
- * Observe that cLRU_list_len + dLRU_list_len must always
- * equal LRU_list_len.
- *
- * cLRU_list_size: Number of bytes of cache entries currently residing on
- * the clean LRU list.
- *
- * Observe that cLRU_list_size + dLRU_list_size must always
- * equal LRU_list_size.
- *
- * cLRU_head_ptr: Pointer to the head of the doubly linked clean LRU list.
- * Cache entries on this list are linked by their aux_next and
- * aux_prev fields.
- *
- * This field is NULL if the list is empty.
- *
- * cLRU_tail_ptr: Pointer to the tail of the doubly linked clean LRU list.
- * Cache entries on this list are linked by their aux_next and
- * aux_prev fields.
- *
- * This field is NULL if the list is empty.
- *
- * dLRU_list_len: Number of cache entries currently on the dirty LRU list.
- *
- * Observe that cLRU_list_len + dLRU_list_len must always
- * equal LRU_list_len.
- *
- * dLRU_list_size: Number of cache entries currently on the dirty LRU list.
- *
- * Observe that cLRU_list_len + dLRU_list_len must always
- * equal LRU_list_len.
- *
- * dLRU_head_ptr: Pointer to the head of the doubly linked dirty LRU list.
- * Cache entries on this list are linked by their aux_next and
- * aux_prev fields.
- *
- * This field is NULL if the list is empty.
- *
- * dLRU_tail_ptr: Pointer to the tail of the doubly linked dirty LRU list.
- * Cache entries on this list are linked by their aux_next and
- * aux_prev fields.
- *
- * This field is NULL if the list is empty.
- *
- *
- * Automatic cache size adjustment:
- *
- * While the default cache size is adequate for most cases, we can run into
- * cases where the default is too small. Ideally, we will let the user
- * adjust the cache size as required. However, this is not possible in all
- * cases. Thus I have added automatic cache size adjustment code.
- *
- * The configuration for the automatic cache size adjustment is stored in
- * the structure described below:
- *
- * size_increase_possible: Depending on the configuration data given
- * in the resize_ctl field, it may or may not be possible
- * to increase the size of the cache. Rather than test for
- * all the ways this can happen, we simply set this flag when
- * we receive a new configuration.
- *
- * flash_size_increase_possible: Depending on the configuration data given
- * in the resize_ctl field, it may or may not be possible
- * for a flash size increase to occur. We set this flag
- * whenever we receive a new configuration so as to avoid
- * repeated calculations.
- *
- * flash_size_increase_threshold: If a flash cache size increase is possible,
- * this field is used to store the minimum size of a new entry
- * or size increase needed to trigger a flash cache size
- * increase. Note that this field must be updated whenever
- * the size of the cache is changed.
- *
- * size_decrease_possible: Depending on the configuration data given
- * in the resize_ctl field, it may or may not be possible
- * to decrease the size of the cache. Rather than test for
- * all the ways this can happen, we simply set this flag when
- * we receive a new configuration.
- *
- * cache_full: Boolean flag used to keep track of whether the cache is
- * full, so we can refrain from increasing the size of a
- * cache which hasn't used up the space alotted to it.
- *
- * The field is initialized to FALSE, and then set to TRUE
- * whenever we attempt to make space in the cache.
- *
- * resize_enabled: This is another convenience flag which is set whenever
- * a new set of values for resize_ctl are provided. Very
- * simply,
- *
- * resize_enabled = size_increase_possible ||
- * size_decrease_possible;
- *
- * size_decreased: Boolean flag set to TRUE whenever the maximun cache
- * size is decreased. The flag triggers a call to
- * H5C_make_space_in_cache() on the next call to H5C_protect().
- *
- * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration
- * data for automatic cache resizing.
- *
- * epoch_markers_active: Integer field containing the number of epoch
- * markers currently in use in the LRU list. This value
- * must be in the range [0, H5C__MAX_EPOCH_MARKERS - 1].
- *
- * epoch_marker_active: Array of boolean of length H5C__MAX_EPOCH_MARKERS.
- * This array is used to track which epoch markers are currently
- * in use.
- *
- * epoch_marker_ringbuf: Array of int of length H5C__MAX_EPOCH_MARKERS + 1.
- *
- * To manage the epoch marker cache entries, it is necessary
- * to track their order in the LRU list. This is done with
- * epoch_marker_ringbuf. When markers are inserted at the
- * head of the LRU list, the index of the marker in the
- * epoch_markers array is inserted at the tail of the ring
- * buffer. When it becomes the epoch_marker_active'th marker
- * in the LRU list, it will have worked its way to the head
- * of the ring buffer as well. This allows us to remove it
- * without scanning the LRU list if such is required.
- *
- * epoch_marker_ringbuf_first: Integer field containing the index of the
- * first entry in the ring buffer.
- *
- * epoch_marker_ringbuf_last: Integer field containing the index of the
- * last entry in the ring buffer.
- *
- * epoch_marker_ringbuf_size: Integer field containing the number of entries
- * in the ring buffer.
- *
- * epoch_markers: Array of instances of H5C_cache_entry_t of length
- * H5C__MAX_EPOCH_MARKERS. The entries are used as markers
- * in the LRU list to identify cache entries that haven't
- * been accessed for some (small) specified number of
- * epochs. These entries (if any) can then be evicted and
- * the cache size reduced -- ideally without evicting any
- * of the current working set. Needless to say, the epoch
- * length and the number of epochs before an unused entry
- * must be chosen so that all, or almost all, the working
- * set will be accessed before the limit.
- *
- * Epoch markers only appear in the LRU list, never in
- * the index or slist. While they are of type
- * H5C__EPOCH_MARKER_TYPE, and have associated class
- * functions, these functions should never be called.
- *
- * The addr fields of these instances of H5C_cache_entry_t
- * are set to the index of the instance in the epoch_markers
- * array, the size is set to 0, and the type field points
- * to the constant structure epoch_marker_class defined
- * in H5C.c. The next and prev fields are used as usual
- * to link the entry into the LRU list.
- *
- * All other fields are unused.
- *
- *
- * Cache hit rate collection fields:
- *
- * We supply the current cache hit rate on request, so we must keep a
- * simple cache hit rate computation regardless of whether statistics
- * collection is enabled. The following fields support this capability.
- *
- * cache_hits: Number of cache hits since the last time the cache hit
- * rate statistics were reset. Note that when automatic cache
- * re-sizing is enabled, this field will be reset every automatic
- * resize epoch.
- *
- * cache_accesses: Number of times the cache has been accessed while
- * since the last since the last time the cache hit rate statistics
- * were reset. Note that when automatic cache re-sizing is enabled,
- * this field will be reset every automatic resize epoch.
- *
- *
- * Statistics collection fields:
- *
- * When enabled, these fields are used to collect statistics as described
- * below. The first set are collected only when H5C_COLLECT_CACHE_STATS
- * is true.
- *
- * hits: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type id
- * equal to the array index has been in cache when requested in
- * the current epoch.
- *
- * misses: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type id
- * equal to the array index has not been in cache when
- * requested in the current epoch.
- *
- * write_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The
- * cells are used to record the number of times an entry with
- * type id equal to the array index has been write protected
- * in the current epoch.
- *
- * Observe that (hits + misses) = (write_protects + read_protects).
- *
- * read_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The
- * cells are used to record the number of times an entry with
- * type id equal to the array index has been read protected in
- * the current epoch.
- *
- * Observe that (hits + misses) = (write_protects + read_protects).
- *
- * max_read_protects: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1.
- * The cells are used to maximum number of simultaneous read
- * protects on any entry with type id equal to the array index
- * in the current epoch.
- *
- * insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type
- * id equal to the array index has been inserted into the
- * cache in the current epoch.
- *
- * pinned_insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
- * The cells are used to record the number of times an entry
- * with type id equal to the array index has been inserted
- * pinned into the cache in the current epoch.
- *
- * clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type
- * id equal to the array index has been cleared in the current
- * epoch.
- *
- * flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type id
- * equal to the array index has been written to disk in the
- * current epoch.
- *
- * evictions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type id
- * equal to the array index has been evicted from the cache in
- * the current epoch.
- *
- * moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type
- * id equal to the array index has been moved in the current
- * epoch.
- *
- * entry_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
- * The cells are used to record the number of times an entry
- * with type id equal to the array index has been moved
- * during its flush callback in the current epoch.
- *
- * cache_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
- * The cells are used to record the number of times an entry
- * with type id equal to the array index has been moved
- * during a cache flush in the current epoch.
- *
- * pins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type
- * id equal to the array index has been pinned in the current
- * epoch.
- *
- * unpins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type
- * id equal to the array index has been unpinned in the current
- * epoch.
- *
- * dirty_pins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the number of times an entry with type
- * id equal to the array index has been marked dirty while pinned
- * in the current epoch.
- *
- * pinned_flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The
- * cells are used to record the number of times an entry
- * with type id equal to the array index has been flushed while
- * pinned in the current epoch.
- *
- * pinned_clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The
- * cells are used to record the number of times an entry
- * with type id equal to the array index has been cleared while
- * pinned in the current epoch.
- *
- * size_increases: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
- * The cells are used to record the number of times an entry
- * with type id equal to the array index has increased in
- * size in the current epoch.
- *
- * size_decreases: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
- * The cells are used to record the number of times an entry
- * with type id equal to the array index has decreased in
- * size in the current epoch.
- *
- * entry_flush_size_changes: Array of int64 of length
- * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record
- * the number of times an entry with type id equal to the
- * array index has changed size while in its flush callback.
- *
- * cache_flush_size_changes: Array of int64 of length
- * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record
- * the number of times an entry with type id equal to the
- * array index has changed size during a cache flush
- *
- * total_ht_insertions: Number of times entries have been inserted into the
- * hash table in the current epoch.
- *
- * total_ht_deletions: Number of times entries have been deleted from the
- * hash table in the current epoch.
- *
- * successful_ht_searches: int64 containing the total number of successful
- * searches of the hash table in the current epoch.
- *
- * total_successful_ht_search_depth: int64 containing the total number of
- * entries other than the targets examined in successful
- * searches of the hash table in the current epoch.
- *
- * failed_ht_searches: int64 containing the total number of unsuccessful
- * searches of the hash table in the current epoch.
- *
- * total_failed_ht_search_depth: int64 containing the total number of
- * entries examined in unsuccessful searches of the hash
- * table in the current epoch.
- *
- * max_index_len: Largest value attained by the index_len field in the
- * current epoch.
- *
- * max_index_size: Largest value attained by the index_size field in the
- * current epoch.
- *
- * max_clean_index_size: Largest value attained by the clean_index_size field
- * in the current epoch.
- *
- * max_dirty_index_size: Largest value attained by the dirty_index_size field
- * in the current epoch.
- *
- * max_slist_len: Largest value attained by the slist_len field in the
- * current epoch.
- *
- * max_slist_size: Largest value attained by the slist_size field in the
- * current epoch.
- *
- * max_pl_len: Largest value attained by the pl_len field in the
- * current epoch.
- *
- * max_pl_size: Largest value attained by the pl_size field in the
- * current epoch.
- *
- * max_pel_len: Largest value attained by the pel_len field in the
- * current epoch.
- *
- * max_pel_size: Largest value attained by the pel_size field in the
- * current epoch.
- *
- * calls_to_msic: Total number of calls to H5C_make_space_in_cache
- *
- * total_entries_skipped_in_msic: Number of clean entries skipped while
- * enforcing the min_clean_fraction in H5C_make_space_in_cache().
- *
- * total_entries_scanned_in_msic: Number of clean entries skipped while
- * enforcing the min_clean_fraction in H5C_make_space_in_cache().
- *
- * max_entries_skipped_in_msic: Maximum number of clean entries skipped
- * in any one call to H5C_make_space_in_cache().
- *
- * max_entries_scanned_in_msic: Maximum number of entries scanned over
- * in any one call to H5C_make_space_in_cache().
- *
- * entries_scanned_to_make_space: Number of entries scanned only when looking
- * for entries to evict in order to make space in cache.
-
- * The remaining stats are collected only when both H5C_COLLECT_CACHE_STATS
- * and H5C_COLLECT_CACHE_ENTRY_STATS are true.
- *
- * max_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the maximum number of times any single
- * entry with type id equal to the array index has been
- * accessed in the current epoch.
- *
- * min_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the minimum number of times any single
- * entry with type id equal to the array index has been
- * accessed in the current epoch.
- *
- * max_clears: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the maximum number of times any single
- * entry with type id equal to the array index has been cleared
- * in the current epoch.
- *
- * max_flushes: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the maximum number of times any single
- * entry with type id equal to the array index has been
- * flushed in the current epoch.
- *
- * max_size: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the maximum size of any single entry
- * with type id equal to the array index that has resided in
- * the cache in the current epoch.
- *
- * max_pins: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
- * are used to record the maximum number of times that any single
- * entry with type id equal to the array index that has been
- * marked as pinned in the cache in the current epoch.
- *
- *
- * Fields supporting testing:
- *
- * prefix Array of char used to prefix debugging output. The
- * field is intended to allow marking of output of with
- * the processes mpi rank.
- *
- * get_entry_ptr_from_addr_counter: Counter used to track the number of
- * times the H5C_get_entry_ptr_from_addr() function has been
- * called successfully. This field is only defined when
- * NDEBUG is not #defined.
- *
- ****************************************************************************/
-
+/* Cache configuration settings */
#define H5C__HASH_TABLE_LEN (64 * 1024) /* must be a power of 2 */
-
#define H5C__H5C_T_MAGIC 0x005CAC0E
#define H5C__MAX_NUM_TYPE_IDS 27
#define H5C__PREFIX_LEN 32
-struct H5C_t
-{
- uint32_t magic;
-
- hbool_t flush_in_progress;
-
- FILE * trace_file_ptr;
-
- void * aux_ptr;
-
- int32_t max_type_id;
- const char * (* type_name_table_ptr);
-
- size_t max_cache_size;
- size_t min_clean_size;
-
- H5C_write_permitted_func_t check_write_permitted;
- hbool_t write_permitted;
-
- H5C_log_flush_func_t log_flush;
-
- hbool_t evictions_enabled;
-
- int32_t index_len;
- size_t index_size;
- size_t clean_index_size;
- size_t dirty_index_size;
- H5C_cache_entry_t * (index[H5C__HASH_TABLE_LEN]);
-
- hbool_t ignore_tags;
-
- int32_t slist_len;
- size_t slist_size;
- H5SL_t * slist_ptr;
- int32_t num_last_entries;
-#if H5C_DO_SANITY_CHECKS
- int64_t slist_len_increase;
- int64_t slist_size_increase;
-#endif /* H5C_DO_SANITY_CHECKS */
-
- int32_t pl_len;
- size_t pl_size;
- H5C_cache_entry_t * pl_head_ptr;
- H5C_cache_entry_t * pl_tail_ptr;
-
- int32_t pel_len;
- size_t pel_size;
- H5C_cache_entry_t * pel_head_ptr;
- H5C_cache_entry_t * pel_tail_ptr;
-
- int32_t LRU_list_len;
- size_t LRU_list_size;
- H5C_cache_entry_t * LRU_head_ptr;
- H5C_cache_entry_t * LRU_tail_ptr;
-
- int32_t cLRU_list_len;
- size_t cLRU_list_size;
- H5C_cache_entry_t * cLRU_head_ptr;
- H5C_cache_entry_t * cLRU_tail_ptr;
-
- int32_t dLRU_list_len;
- size_t dLRU_list_size;
- H5C_cache_entry_t * dLRU_head_ptr;
- H5C_cache_entry_t * dLRU_tail_ptr;
-
- hbool_t size_increase_possible;
- hbool_t flash_size_increase_possible;
- size_t flash_size_increase_threshold;
- hbool_t size_decrease_possible;
- hbool_t resize_enabled;
- hbool_t cache_full;
- hbool_t size_decreased;
- H5C_auto_size_ctl_t resize_ctl;
-
- int32_t epoch_markers_active;
- hbool_t epoch_marker_active[H5C__MAX_EPOCH_MARKERS];
- int32_t epoch_marker_ringbuf[H5C__MAX_EPOCH_MARKERS+1];
- int32_t epoch_marker_ringbuf_first;
- int32_t epoch_marker_ringbuf_last;
- int32_t epoch_marker_ringbuf_size;
- H5C_cache_entry_t epoch_markers[H5C__MAX_EPOCH_MARKERS];
-
- int64_t cache_hits;
- int64_t cache_accesses;
-
-#if H5C_COLLECT_CACHE_STATS
-
- /* stats fields */
- int64_t hits[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t misses[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t write_protects[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t read_protects[H5C__MAX_NUM_TYPE_IDS + 1];
- int32_t max_read_protects[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t insertions[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t pinned_insertions[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t clears[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t flushes[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t evictions[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t moves[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t entry_flush_moves[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t cache_flush_moves[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t pins[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t unpins[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t dirty_pins[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t pinned_flushes[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t pinned_clears[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t size_increases[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t size_decreases[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t entry_flush_size_changes[H5C__MAX_NUM_TYPE_IDS + 1];
- int64_t cache_flush_size_changes[H5C__MAX_NUM_TYPE_IDS + 1];
-
- int64_t total_ht_insertions;
- int64_t total_ht_deletions;
- int64_t successful_ht_searches;
- int64_t total_successful_ht_search_depth;
- int64_t failed_ht_searches;
- int64_t total_failed_ht_search_depth;
-
- int32_t max_index_len;
- size_t max_index_size;
- size_t max_clean_index_size;
- size_t max_dirty_index_size;
-
- int32_t max_slist_len;
- size_t max_slist_size;
-
- int32_t max_pl_len;
- size_t max_pl_size;
-
- int32_t max_pel_len;
- size_t max_pel_size;
-
- int64_t calls_to_msic;
- int64_t total_entries_skipped_in_msic;
- int64_t total_entries_scanned_in_msic;
- int32_t max_entries_skipped_in_msic;
- int32_t max_entries_scanned_in_msic;
- int64_t entries_scanned_to_make_space;
-
-#if H5C_COLLECT_CACHE_ENTRY_STATS
-
- int32_t max_accesses[H5C__MAX_NUM_TYPE_IDS + 1];
- int32_t min_accesses[H5C__MAX_NUM_TYPE_IDS + 1];
- int32_t max_clears[H5C__MAX_NUM_TYPE_IDS + 1];
- int32_t max_flushes[H5C__MAX_NUM_TYPE_IDS + 1];
- size_t max_size[H5C__MAX_NUM_TYPE_IDS + 1];
- int32_t max_pins[H5C__MAX_NUM_TYPE_IDS + 1];
-
-#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
-
-#endif /* H5C_COLLECT_CACHE_STATS */
-
- char prefix[H5C__PREFIX_LEN];
-
-#ifndef NDEBUG
-
- int64_t get_entry_ptr_from_addr_counter;
-
-#endif /* NDEBUG */
-};
-
-
-/****************************************************************************/
-/***************************** Macro Definitions ****************************/
-/****************************************************************************/
-
/****************************************************************************
*
* We maintain doubly linked lists of instances of H5C_cache_entry_t for a
@@ -1055,11 +91,11 @@ struct H5C_t
*
* from the H5C__DLL_PRE_REMOVE_SC macro. With the addition of the
* epoch markers used in the age out based cache size reduction algorithm,
- * this invarient need not hold, as the epoch markers are of size 0.
+ * this invariant need not hold, as the epoch markers are of size 0.
*
* One could argue that I should have given the epoch markers a positive
* size, but this would break the index_size = LRU_list_size + pl_size
- * + pel_size invarient.
+ * + pel_size invariant.
*
* Alternatively, I could pass the current decr_mode in to the macro,
* and just skip the check whenever epoch markers may be in use.
@@ -1217,78 +253,78 @@ if ( ( (new_size) > (dll_size) ) || \
#define H5C__DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \
- H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \
- fail_val) \
- if ( (head_ptr) == NULL ) \
- { \
- (head_ptr) = (entry_ptr); \
- (tail_ptr) = (entry_ptr); \
- } \
- else \
- { \
- (tail_ptr)->next = (entry_ptr); \
- (entry_ptr)->prev = (tail_ptr); \
- (tail_ptr) = (entry_ptr); \
- } \
- (len)++; \
- (Size) += (entry_ptr)->size;
+{ \
+ H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \
+ fail_val) \
+ if ( (head_ptr) == NULL ) \
+ { \
+ (head_ptr) = (entry_ptr); \
+ (tail_ptr) = (entry_ptr); \
+ } \
+ else \
+ { \
+ (tail_ptr)->next = (entry_ptr); \
+ (entry_ptr)->prev = (tail_ptr); \
+ (tail_ptr) = (entry_ptr); \
+ } \
+ (len)++; \
+ (Size) += (entry_ptr)->size; \
+} /* H5C__DLL_APPEND() */
#define H5C__DLL_PREPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \
- H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \
- fail_val) \
- if ( (head_ptr) == NULL ) \
- { \
- (head_ptr) = (entry_ptr); \
- (tail_ptr) = (entry_ptr); \
- } \
- else \
- { \
- (head_ptr)->prev = (entry_ptr); \
- (entry_ptr)->next = (head_ptr); \
- (head_ptr) = (entry_ptr); \
- } \
- (len)++; \
- (Size) += entry_ptr->size;
+{ \
+ H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \
+ fail_val) \
+ if ( (head_ptr) == NULL ) \
+ { \
+ (head_ptr) = (entry_ptr); \
+ (tail_ptr) = (entry_ptr); \
+ } \
+ else \
+ { \
+ (head_ptr)->prev = (entry_ptr); \
+ (entry_ptr)->next = (head_ptr); \
+ (head_ptr) = (entry_ptr); \
+ } \
+ (len)++; \
+ (Size) += entry_ptr->size; \
+} /* H5C__DLL_PREPEND() */
#define H5C__DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \
- H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \
- fail_val) \
- { \
- if ( (head_ptr) == (entry_ptr) ) \
- { \
- (head_ptr) = (entry_ptr)->next; \
- if ( (head_ptr) != NULL ) \
- { \
- (head_ptr)->prev = NULL; \
- } \
- } \
- else \
- { \
- (entry_ptr)->prev->next = (entry_ptr)->next; \
- } \
- if ( (tail_ptr) == (entry_ptr) ) \
- { \
- (tail_ptr) = (entry_ptr)->prev; \
- if ( (tail_ptr) != NULL ) \
- { \
- (tail_ptr)->next = NULL; \
- } \
- } \
- else \
- { \
- (entry_ptr)->next->prev = (entry_ptr)->prev; \
- } \
- entry_ptr->next = NULL; \
- entry_ptr->prev = NULL; \
- (len)--; \
- (Size) -= entry_ptr->size; \
- }
+{ \
+ H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \
+ fail_val) \
+ { \
+ if ( (head_ptr) == (entry_ptr) ) \
+ { \
+ (head_ptr) = (entry_ptr)->next; \
+ if ( (head_ptr) != NULL ) \
+ (head_ptr)->prev = NULL; \
+ } \
+ else \
+ (entry_ptr)->prev->next = (entry_ptr)->next; \
+ if ( (tail_ptr) == (entry_ptr) ) \
+ { \
+ (tail_ptr) = (entry_ptr)->prev; \
+ if ( (tail_ptr) != NULL ) \
+ (tail_ptr)->next = NULL; \
+ } \
+ else \
+ (entry_ptr)->next->prev = (entry_ptr)->prev; \
+ entry_ptr->next = NULL; \
+ entry_ptr->prev = NULL; \
+ (len)--; \
+ (Size) -= entry_ptr->size; \
+ } \
+} /* H5C__DLL_REMOVE() */
#define H5C__DLL_UPDATE_FOR_SIZE_CHANGE(dll_len, dll_size, old_size, new_size) \
- H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \
- (dll_size) -= (old_size); \
- (dll_size) += (new_size); \
- H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size)
+{ \
+ H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \
+ (dll_size) -= (old_size); \
+ (dll_size) += (new_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
@@ -1365,72 +401,68 @@ if ( ( (entry_ptr) == NULL ) || \
#define H5C__AUX_DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val)\
- H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \
- fail_val) \
- if ( (head_ptr) == NULL ) \
- { \
- (head_ptr) = (entry_ptr); \
- (tail_ptr) = (entry_ptr); \
- } \
- else \
- { \
- (tail_ptr)->aux_next = (entry_ptr); \
- (entry_ptr)->aux_prev = (tail_ptr); \
- (tail_ptr) = (entry_ptr); \
- } \
- (len)++; \
- (Size) += entry_ptr->size;
+{ \
+ H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \
+ fail_val) \
+ if ( (head_ptr) == NULL ) \
+ { \
+ (head_ptr) = (entry_ptr); \
+ (tail_ptr) = (entry_ptr); \
+ } \
+ else \
+ { \
+ (tail_ptr)->aux_next = (entry_ptr); \
+ (entry_ptr)->aux_prev = (tail_ptr); \
+ (tail_ptr) = (entry_ptr); \
+ } \
+ (len)++; \
+ (Size) += entry_ptr->size; \
+} /* H5C__AUX_DLL_APPEND() */
#define H5C__AUX_DLL_PREPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \
- H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \
- fv) \
- if ( (head_ptr) == NULL ) \
- { \
- (head_ptr) = (entry_ptr); \
- (tail_ptr) = (entry_ptr); \
- } \
- else \
- { \
- (head_ptr)->aux_prev = (entry_ptr); \
- (entry_ptr)->aux_next = (head_ptr); \
- (head_ptr) = (entry_ptr); \
- } \
- (len)++; \
- (Size) += entry_ptr->size;
+{ \
+ H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \
+ if ( (head_ptr) == NULL ) \
+ { \
+ (head_ptr) = (entry_ptr); \
+ (tail_ptr) = (entry_ptr); \
+ } \
+ else \
+ { \
+ (head_ptr)->aux_prev = (entry_ptr); \
+ (entry_ptr)->aux_next = (head_ptr); \
+ (head_ptr) = (entry_ptr); \
+ } \
+ (len)++; \
+ (Size) += entry_ptr->size; \
+} /* H5C__AUX_DLL_PREPEND() */
#define H5C__AUX_DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \
- H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \
- fv) \
- { \
- if ( (head_ptr) == (entry_ptr) ) \
- { \
- (head_ptr) = (entry_ptr)->aux_next; \
- if ( (head_ptr) != NULL ) \
- { \
- (head_ptr)->aux_prev = NULL; \
- } \
- } \
- else \
- { \
- (entry_ptr)->aux_prev->aux_next = (entry_ptr)->aux_next; \
- } \
- if ( (tail_ptr) == (entry_ptr) ) \
- { \
- (tail_ptr) = (entry_ptr)->aux_prev; \
- if ( (tail_ptr) != NULL ) \
- { \
- (tail_ptr)->aux_next = NULL; \
- } \
- } \
- else \
- { \
- (entry_ptr)->aux_next->aux_prev = (entry_ptr)->aux_prev; \
- } \
- entry_ptr->aux_next = NULL; \
- entry_ptr->aux_prev = NULL; \
- (len)--; \
- (Size) -= entry_ptr->size; \
- }
+{ \
+ H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \
+ { \
+ if ( (head_ptr) == (entry_ptr) ) \
+ { \
+ (head_ptr) = (entry_ptr)->aux_next; \
+ if ( (head_ptr) != NULL ) \
+ (head_ptr)->aux_prev = NULL; \
+ } \
+ else \
+ (entry_ptr)->aux_prev->aux_next = (entry_ptr)->aux_next; \
+ if ( (tail_ptr) == (entry_ptr) ) \
+ { \
+ (tail_ptr) = (entry_ptr)->aux_prev; \
+ if ( (tail_ptr) != NULL ) \
+ (tail_ptr)->aux_next = NULL; \
+ } \
+ else \
+ (entry_ptr)->aux_next->aux_prev = (entry_ptr)->aux_prev; \
+ entry_ptr->aux_next = NULL; \
+ entry_ptr->aux_prev = NULL; \
+ (len)--; \
+ (Size) -= entry_ptr->size; \
+ } \
+} /* H5C__AUX_DLL_REMOVE() */
/***********************************************************************
@@ -1544,185 +576,194 @@ if ( ( (entry_ptr) == NULL ) || \
#if H5C_COLLECT_CACHE_ENTRY_STATS
#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) \
- (entry_ptr)->accesses = 0; \
- (entry_ptr)->clears = 0; \
- (entry_ptr)->flushes = 0; \
- (entry_ptr)->pins = 0;
-
-#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \
- (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \
- if ( (entry_ptr)->is_pinned ) { \
- (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \
- } \
- ((entry_ptr)->clears)++;
-
-#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \
- (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \
- if ( (entry_ptr)->is_pinned ) { \
- (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \
- } \
- ((entry_ptr)->flushes)++;
-
-#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \
- (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; \
- if ( (entry_ptr)->accesses > \
- ((cache_ptr)->max_accesses)[(entry_ptr)->type->id] ) { \
- ((cache_ptr)->max_accesses)[(entry_ptr)->type->id] \
- = (entry_ptr)->accesses; \
- } \
- if ( (entry_ptr)->accesses < \
- ((cache_ptr)->min_accesses)[(entry_ptr)->type->id] ) { \
- ((cache_ptr)->min_accesses)[(entry_ptr)->type->id] \
- = (entry_ptr)->accesses; \
- } \
- if ( (entry_ptr)->clears > \
- ((cache_ptr)->max_clears)[(entry_ptr)->type->id] ) { \
- ((cache_ptr)->max_clears)[(entry_ptr)->type->id] \
- = (entry_ptr)->clears; \
- } \
- if ( (entry_ptr)->flushes > \
- ((cache_ptr)->max_flushes)[(entry_ptr)->type->id] ) { \
- ((cache_ptr)->max_flushes)[(entry_ptr)->type->id] \
- = (entry_ptr)->flushes; \
- } \
- if ( (entry_ptr)->size > \
- ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) { \
- ((cache_ptr)->max_size)[(entry_ptr)->type->id] \
- = (entry_ptr)->size; \
- } \
- if ( (entry_ptr)->pins > \
- ((cache_ptr)->max_pins)[(entry_ptr)->type->id] ) { \
- ((cache_ptr)->max_pins)[(entry_ptr)->type->id] \
- = (entry_ptr)->pins; \
- }
-
-#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \
- (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \
- if ( (entry_ptr)->is_pinned ) { \
- (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \
- ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
- (entry_ptr)->pins++; \
- if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
- (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
- if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
- (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \
- } \
- if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \
- (cache_ptr)->max_index_len = (cache_ptr)->index_len; \
- H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \
- if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \
- (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \
- if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \
- (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \
- if ( (entry_ptr)->size > \
- ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) { \
- ((cache_ptr)->max_size)[(entry_ptr)->type->id] \
- = (entry_ptr)->size; \
- }
-
-#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \
- if ( hit ) \
- ((cache_ptr)->hits)[(entry_ptr)->type->id]++; \
- else \
- ((cache_ptr)->misses)[(entry_ptr)->type->id]++; \
- if ( ! ((entry_ptr)->is_read_only) ) { \
- ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \
- } else { \
- ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \
- if ( ((entry_ptr)->ro_ref_count) > \
- ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) { \
- ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \
- ((entry_ptr)->ro_ref_count); \
- } \
- } \
- if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \
- (cache_ptr)->max_index_len = (cache_ptr)->index_len; \
- H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \
- if ( (cache_ptr)->pl_len > (cache_ptr)->max_pl_len ) \
- (cache_ptr)->max_pl_len = (cache_ptr)->pl_len; \
- if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \
- (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \
- if ( (entry_ptr)->size > \
- ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) { \
- ((cache_ptr)->max_size)[(entry_ptr)->type->id] \
- = (entry_ptr)->size; \
- } \
- ((entry_ptr)->accesses)++;
-
-#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \
- ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
- (entry_ptr)->pins++; \
- if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
- (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
- if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
- (cache_ptr)->max_pel_size = (cache_ptr)->pel_size;
+{ \
+ (entry_ptr)->accesses = 0; \
+ (entry_ptr)->clears = 0; \
+ (entry_ptr)->flushes = 0; \
+ (entry_ptr)->pins = 0; \
+}
+
+#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \
+{ \
+ (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \
+ if ( (entry_ptr)->is_pinned ) \
+ (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \
+ ((entry_ptr)->clears)++; \
+}
+
+#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \
+{ \
+ (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \
+ if ( (entry_ptr)->is_pinned ) \
+ (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \
+ ((entry_ptr)->flushes)++; \
+}
+
+#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \
+{ \
+ (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; \
+ if ( (entry_ptr)->accesses > \
+ ((cache_ptr)->max_accesses)[(entry_ptr)->type->id] ) \
+ ((cache_ptr)->max_accesses)[(entry_ptr)->type->id] = \
+ (entry_ptr)->accesses; \
+ if ( (entry_ptr)->accesses < \
+ ((cache_ptr)->min_accesses)[(entry_ptr)->type->id] ) \
+ ((cache_ptr)->min_accesses)[(entry_ptr)->type->id] = \
+ (entry_ptr)->accesses; \
+ if ( (entry_ptr)->clears > \
+ ((cache_ptr)->max_clears)[(entry_ptr)->type->id] ) \
+ ((cache_ptr)->max_clears)[(entry_ptr)->type->id] \
+ = (entry_ptr)->clears; \
+ if ( (entry_ptr)->flushes > \
+ ((cache_ptr)->max_flushes)[(entry_ptr)->type->id] ) \
+ ((cache_ptr)->max_flushes)[(entry_ptr)->type->id] \
+ = (entry_ptr)->flushes; \
+ if ( (entry_ptr)->size > \
+ ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \
+ ((cache_ptr)->max_size)[(entry_ptr)->type->id] \
+ = (entry_ptr)->size; \
+ if ( (entry_ptr)->pins > \
+ ((cache_ptr)->max_pins)[(entry_ptr)->type->id] ) \
+ ((cache_ptr)->max_pins)[(entry_ptr)->type->id] \
+ = (entry_ptr)->pins; \
+}
+
+#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \
+{ \
+ (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \
+ if ( (entry_ptr)->is_pinned ) { \
+ (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \
+ ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
+ (entry_ptr)->pins++; \
+ if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
+ (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
+ if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
+ (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \
+ } \
+ if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \
+ (cache_ptr)->max_index_len = (cache_ptr)->index_len; \
+ H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \
+ if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \
+ (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \
+ if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \
+ (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \
+ if ( (entry_ptr)->size > \
+ ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \
+ ((cache_ptr)->max_size)[(entry_ptr)->type->id] \
+ = (entry_ptr)->size; \
+}
+
+#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \
+{ \
+ if ( hit ) \
+ ((cache_ptr)->hits)[(entry_ptr)->type->id]++; \
+ else \
+ ((cache_ptr)->misses)[(entry_ptr)->type->id]++; \
+ if ( ! ((entry_ptr)->is_read_only) ) { \
+ ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \
+ } else { \
+ ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \
+ if ( ((entry_ptr)->ro_ref_count) > \
+ ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) \
+ ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \
+ ((entry_ptr)->ro_ref_count); \
+ } \
+ if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \
+ (cache_ptr)->max_index_len = (cache_ptr)->index_len; \
+ H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \
+ if ( (cache_ptr)->pl_len > (cache_ptr)->max_pl_len ) \
+ (cache_ptr)->max_pl_len = (cache_ptr)->pl_len; \
+ if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \
+ (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \
+ if ( (entry_ptr)->size > \
+ ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \
+ ((cache_ptr)->max_size)[(entry_ptr)->type->id] = (entry_ptr)->size; \
+ ((entry_ptr)->accesses)++; \
+}
+
+#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \
+{ \
+ ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
+ (entry_ptr)->pins++; \
+ if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
+ (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
+ if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
+ (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \
+}
#else /* H5C_COLLECT_CACHE_ENTRY_STATS */
#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr)
-#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \
- if ( (entry_ptr)->is_pinned ) { \
- (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \
- } \
- (((cache_ptr)->clears)[(entry_ptr)->type->id])++;
+#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \
+{ \
+ if ( (entry_ptr)->is_pinned ) \
+ (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \
+ (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \
+}
-#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \
- (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \
- if ( (entry_ptr)->is_pinned ) { \
- (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \
- }
+#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \
+{ \
+ (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \
+ if ( (entry_ptr)->is_pinned ) \
+ (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \
+}
-#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \
- (((cache_ptr)->evictions)[(entry_ptr)->type->id])++;
-
-#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \
- (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \
- if ( (entry_ptr)->is_pinned ) { \
- (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \
- ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
- if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
- (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
- if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
- (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \
- } \
- if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \
- (cache_ptr)->max_index_len = (cache_ptr)->index_len; \
- H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \
- if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \
- (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \
- if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \
- (cache_ptr)->max_slist_size = (cache_ptr)->slist_size;
-
-#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \
- if ( hit ) \
- ((cache_ptr)->hits)[(entry_ptr)->type->id]++; \
- else \
- ((cache_ptr)->misses)[(entry_ptr)->type->id]++; \
- if ( ! ((entry_ptr)->is_read_only) ) { \
- ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \
- } else { \
- ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \
- if ( ((entry_ptr)->ro_ref_count) > \
- ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) { \
- ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \
- ((entry_ptr)->ro_ref_count); \
- } \
- } \
- if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \
- (cache_ptr)->max_index_len = (cache_ptr)->index_len; \
- H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \
- if ( (cache_ptr)->pl_len > (cache_ptr)->max_pl_len ) \
- (cache_ptr)->max_pl_len = (cache_ptr)->pl_len; \
- if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \
- (cache_ptr)->max_pl_size = (cache_ptr)->pl_size;
-
-#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \
- ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
- if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
- (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
- if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
- (cache_ptr)->max_pel_size = (cache_ptr)->pel_size;
+#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \
+ (((cache_ptr)->evictions)[(entry_ptr)->type->id])++;
+
+#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \
+{ \
+ (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \
+ if ( (entry_ptr)->is_pinned ) { \
+ (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \
+ ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
+ if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
+ (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
+ if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
+ (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \
+ } \
+ if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \
+ (cache_ptr)->max_index_len = (cache_ptr)->index_len; \
+ H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \
+ if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \
+ (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \
+ if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \
+ (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \
+}
+
+#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \
+{ \
+ if ( hit ) \
+ ((cache_ptr)->hits)[(entry_ptr)->type->id]++; \
+ else \
+ ((cache_ptr)->misses)[(entry_ptr)->type->id]++; \
+ if ( ! ((entry_ptr)->is_read_only) ) \
+ ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \
+ else { \
+ ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \
+ if ( ((entry_ptr)->ro_ref_count) > \
+ ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) \
+ ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \
+ ((entry_ptr)->ro_ref_count); \
+ } \
+ if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \
+ (cache_ptr)->max_index_len = (cache_ptr)->index_len; \
+ H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \
+ if ( (cache_ptr)->pl_len > (cache_ptr)->max_pl_len ) \
+ (cache_ptr)->max_pl_len = (cache_ptr)->pl_len; \
+ if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \
+ (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \
+}
+
+#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \
+{ \
+ ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \
+ if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \
+ (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \
+ if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \
+ (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \
+}
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
@@ -1775,21 +816,21 @@ if ( ( (entry_ptr) == NULL ) || \
#if H5C_DO_SANITY_CHECKS
-#define H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) \
-if ( ( (cache_ptr) == NULL ) || \
- ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \
- ( (entry_ptr) == NULL ) || \
- ( ! H5F_addr_defined((entry_ptr)->addr) ) || \
- ( (entry_ptr)->ht_next != NULL ) || \
- ( (entry_ptr)->ht_prev != NULL ) || \
- ( (entry_ptr)->size <= 0 ) || \
- ( (k = H5C__HASH_FCN((entry_ptr)->addr)) < 0 ) || \
- ( k >= H5C__HASH_TABLE_LEN ) || \
- ( (cache_ptr)->index_size != \
- ((cache_ptr)->clean_index_size + \
- (cache_ptr)->dirty_index_size) ) ) { \
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \
- "Pre HT insert SC failed") \
+#define H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) \
+if ( ( (cache_ptr) == NULL ) || \
+ ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \
+ ( (entry_ptr) == NULL ) || \
+ ( ! H5F_addr_defined((entry_ptr)->addr) ) || \
+ ( (entry_ptr)->ht_next != NULL ) || \
+ ( (entry_ptr)->ht_prev != NULL ) || \
+ ( (entry_ptr)->size <= 0 ) || \
+ ( H5C__HASH_FCN((entry_ptr)->addr) < 0 ) || \
+ ( H5C__HASH_FCN((entry_ptr)->addr) >= H5C__HASH_TABLE_LEN ) || \
+ ( (cache_ptr)->index_size != \
+ ((cache_ptr)->clean_index_size + \
+ (cache_ptr)->dirty_index_size) ) ) { \
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \
+ "Pre HT insert SC failed") \
}
#define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) \
@@ -1874,7 +915,6 @@ if ( ( (cache_ptr) == NULL ) || \
( (cache_ptr)->index_size != \
((cache_ptr)->clean_index_size + \
(cache_ptr)->dirty_index_size) ) || \
- ( (entry_ptr == NULL) ) || \
( ( !( was_clean ) || \
( (cache_ptr)->clean_index_size < (old_size) ) ) && \
( ( (was_clean) ) || \
@@ -1972,22 +1012,18 @@ if ( (cache_ptr)->index_size != \
H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) \
k = H5C__HASH_FCN((entry_ptr)->addr); \
if ( ((cache_ptr)->index)[k] == NULL ) \
- { \
((cache_ptr)->index)[k] = (entry_ptr); \
- } \
- else \
- { \
+ else { \
(entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \
(entry_ptr)->ht_next->ht_prev = (entry_ptr); \
((cache_ptr)->index)[k] = (entry_ptr); \
} \
(cache_ptr)->index_len++; \
(cache_ptr)->index_size += (entry_ptr)->size; \
- if ( (entry_ptr)->is_dirty ) { \
+ if ( (entry_ptr)->is_dirty ) \
(cache_ptr)->dirty_index_size += (entry_ptr)->size; \
- } else { \
+ else \
(cache_ptr)->clean_index_size += (entry_ptr)->size; \
- } \
if ((entry_ptr)->flush_me_last) { \
(cache_ptr)->num_last_entries++; \
HDassert((cache_ptr)->num_last_entries == 1); \
@@ -2001,26 +1037,19 @@ if ( (cache_ptr)->index_size != \
H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) \
k = H5C__HASH_FCN((entry_ptr)->addr); \
if ( (entry_ptr)->ht_next ) \
- { \
(entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \
- } \
if ( (entry_ptr)->ht_prev ) \
- { \
(entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \
- } \
if ( ((cache_ptr)->index)[k] == (entry_ptr) ) \
- { \
((cache_ptr)->index)[k] = (entry_ptr)->ht_next; \
- } \
(entry_ptr)->ht_next = NULL; \
(entry_ptr)->ht_prev = NULL; \
(cache_ptr)->index_len--; \
(cache_ptr)->index_size -= (entry_ptr)->size; \
- if ( (entry_ptr)->is_dirty ) { \
+ if ( (entry_ptr)->is_dirty ) \
(cache_ptr)->dirty_index_size -= (entry_ptr)->size; \
- } else { \
+ else \
(cache_ptr)->clean_index_size -= (entry_ptr)->size; \
- } \
if ((entry_ptr)->flush_me_last) { \
(cache_ptr)->num_last_entries--; \
HDassert((cache_ptr)->num_last_entries == 0); \
@@ -2035,20 +1064,15 @@ if ( (cache_ptr)->index_size != \
H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) \
k = H5C__HASH_FCN(Addr); \
entry_ptr = ((cache_ptr)->index)[k]; \
- while ( ( entry_ptr ) && ( H5F_addr_ne(Addr, (entry_ptr)->addr) ) ) \
- { \
+ while ( ( entry_ptr ) && ( H5F_addr_ne(Addr, (entry_ptr)->addr) ) ) { \
(entry_ptr) = (entry_ptr)->ht_next; \
(depth)++; \
} \
- if ( entry_ptr ) \
- { \
+ if ( entry_ptr ) { \
H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) \
- if ( entry_ptr != ((cache_ptr)->index)[k] ) \
- { \
+ if ( entry_ptr != ((cache_ptr)->index)[k] ) { \
if ( (entry_ptr)->ht_next ) \
- { \
(entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \
- } \
HDassert( (entry_ptr)->ht_prev != NULL ); \
(entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \
((cache_ptr)->index)[k]->ht_prev = (entry_ptr); \
@@ -2068,20 +1092,15 @@ if ( (cache_ptr)->index_size != \
H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) \
k = H5C__HASH_FCN(Addr); \
entry_ptr = ((cache_ptr)->index)[k]; \
- while ( ( entry_ptr ) && ( H5F_addr_ne(Addr, (entry_ptr)->addr) ) ) \
- { \
+ while ( ( entry_ptr ) && ( H5F_addr_ne(Addr, (entry_ptr)->addr) ) ) { \
(entry_ptr) = (entry_ptr)->ht_next; \
(depth)++; \
} \
- if ( entry_ptr ) \
- { \
+ if ( entry_ptr ) { \
H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) \
- if ( entry_ptr != ((cache_ptr)->index)[k] ) \
- { \
+ if ( entry_ptr != ((cache_ptr)->index)[k] ) { \
if ( (entry_ptr)->ht_next ) \
- { \
(entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \
- } \
HDassert( (entry_ptr)->ht_prev != NULL ); \
(entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \
((cache_ptr)->index)[k]->ht_prev = (entry_ptr); \
@@ -2116,16 +1135,14 @@ if ( (cache_ptr)->index_size != \
entry_ptr, was_clean) \
(cache_ptr)->index_size -= (old_size); \
(cache_ptr)->index_size += (new_size); \
- if ( was_clean ) { \
+ if ( was_clean ) \
(cache_ptr)->clean_index_size -= (old_size); \
- } else { \
+ else \
(cache_ptr)->dirty_index_size -= (old_size); \
- } \
- if ( (entry_ptr)->is_dirty ) { \
+ if ( (entry_ptr)->is_dirty ) \
(cache_ptr)->dirty_index_size += (new_size); \
- } else { \
+ else \
(cache_ptr)->clean_index_size += (new_size); \
- } \
H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \
entry_ptr) \
}
@@ -2202,8 +1219,7 @@ if ( (cache_ptr)->index_size != \
HDassert( H5F_addr_defined((entry_ptr)->addr) ); \
HDassert( !((entry_ptr)->in_slist) ); \
\
- if ( H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) \
- < 0 ) \
+ if(H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) < 0) \
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \
"Can't insert entry in skip list") \
\
@@ -2229,8 +1245,7 @@ if ( (cache_ptr)->index_size != \
HDassert( H5F_addr_defined((entry_ptr)->addr) ); \
HDassert( !((entry_ptr)->in_slist) ); \
\
- if ( H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) \
- < 0 ) \
+ if(H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) < 0) \
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \
"Can't insert entry in skip list") \
\
@@ -2291,8 +1306,7 @@ if ( (cache_ptr)->index_size != \
HDassert( (cache_ptr)->slist_ptr ); \
\
if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \
- != (entry_ptr) ) \
- \
+ != (entry_ptr) ) \
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, \
"Can't delete entry from skip list.") \
\
@@ -3595,5 +2609,983 @@ if ( (cache_ptr)->index_size != \
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
+/****************************/
+/* Package Private Typedefs */
+/****************************/
+
+/****************************************************************************
+ *
+ * structure H5C_t
+ *
+ * Catchall structure for all variables specific to an instance of the cache.
+ *
+ * While the individual fields of the structure are discussed below, the
+ * following overview may be helpful.
+ *
+ * Entries in the cache are stored in an instance of H5TB_TREE, indexed on
+ * the entry's disk address. While the H5TB_TREE is less efficient than
+ * hash table, it keeps the entries in address sorted order. As flushes
+ * in parallel mode are more efficient if they are issued in increasing
+ * address order, this is a significant benefit. Also the H5TB_TREE code
+ * was readily available, which reduced development time.
+ *
+ * While the cache was designed with multiple replacement policies in mind,
+ * at present only a modified form of LRU is supported.
+ *
+ * JRM - 4/26/04
+ *
+ * Profiling has indicated that searches in the instance of H5TB_TREE are
+ * too expensive. To deal with this issue, I have augmented the cache
+ * with a hash table in which all entries will be stored. Given the
+ * advantages of flushing entries in increasing address order, the TBBT
+ * is retained, but only dirty entries are stored in it. At least for
+ * now, we will leave entries in the TBBT after they are flushed.
+ *
+ * Note that index_size and index_len now refer to the total size of
+ * and number of entries in the hash table.
+ *
+ * JRM - 7/19/04
+ *
+ * The TBBT has since been replaced with a skip list. This change
+ * greatly predates this note.
+ *
+ * JRM - 9/26/05
+ *
+ * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC.
+ * This field is used to validate pointers to instances of
+ * H5C_t.
+ *
+ * flush_in_progress: Boolean flag indicating whether a flush is in
+ * progress.
+ *
+ * trace_file_ptr: File pointer pointing to the trace file, which is used
+ * to record cache operations for use in simulations and design
+ * studies. This field will usually be NULL, indicating that
+ * no trace file should be recorded.
+ *
+ * Since much of the code supporting the parallel metadata
+ * cache is in H5AC, we don't write the trace file from
+ * H5C. Instead, H5AC reads the trace_file_ptr as needed.
+ *
+ * When we get to using H5C in other places, we may add
+ * code to write trace file data at the H5C level as well.
+ *
+ * aux_ptr: Pointer to void used to allow wrapper code to associate
+ * its data with an instance of H5C_t. The H5C cache code
+ * sets this field to NULL, and otherwise leaves it alone.
+ *
+ * max_type_id: Integer field containing the maximum type id number assigned
+ * to a type of entry in the cache. All type ids from 0 to
+ * max_type_id inclusive must be defined. The names of the
+ * types are stored in the type_name_table discussed below, and
+ * indexed by the ids.
+ *
+ * type_name_table_ptr: Pointer to an array of pointer to char of length
+ * max_type_id + 1. The strings pointed to by the entries
+ * in the array are the names of the entry types associated
+ * with the indexing type IDs.
+ *
+ * max_cache_size: Nominal maximum number of bytes that may be stored in the
+ * cache. This value should be viewed as a soft limit, as the
+ * cache can exceed this value under the following circumstances:
+ *
+ * a) All entries in the cache are protected, and the cache is
+ * asked to insert a new entry. In this case the new entry
+ * will be created. If this causes the cache to exceed
+ * max_cache_size, it will do so. The cache will attempt
+ * to reduce its size as entries are unprotected.
+ *
+ * b) When running in parallel mode, the cache may not be
+ * permitted to flush a dirty entry in response to a read.
+ * If there are no clean entries available to evict, the
+ * cache will exceed its maximum size. Again the cache
+ * will attempt to reduce its size to the max_cache_size
+ * limit on the next cache write.
+ *
+ * c) When an entry increases in size, the cache may exceed
+ * the max_cache_size limit until the next time the cache
+ * attempts to load or insert an entry.
+ *
+ * min_clean_size: Nominal minimum number of clean bytes in the cache.
+ * The cache attempts to maintain this number of bytes of
+ * clean data so as to avoid case b) above. Again, this is
+ * a soft limit.
+ *
+ *
+ * In addition to the call back functions required for each entry, the
+ * cache requires the following call back functions for this instance of
+ * the cache as a whole:
+ *
+ * check_write_permitted: In certain applications, the cache may not
+ * be allowed to write to disk at certain time. If specified,
+ * the check_write_permitted function is used to determine if
+ * a write is permissible at any given point in time.
+ *
+ * If no such function is specified (i.e. this field is NULL),
+ * the cache uses the following write_permitted field to
+ * determine whether writes are permitted.
+ *
+ * write_permitted: If check_write_permitted is NULL, this boolean flag
+ * indicates whether writes are permitted.
+ *
+ * log_flush: If provided, this function is called whenever a dirty
+ * entry is flushed to disk.
+ *
+ *
+ * In cases where memory is plentiful, and performance is an issue, it may
+ * be useful to disable all cache evictions, and thereby postpone metadata
+ * writes. The following field is used to implement this.
+ *
+ * evictions_enabled: Boolean flag that is initialized to TRUE. When
+ * this flag is set to FALSE, the metadata cache will not
+ * attempt to evict entries to make space for newly protected
+ * entries, and instead the will grow without limit.
+ *
+ * Needless to say, this feature must be used with care.
+ *
+ *
+ * The cache requires an index to facilitate searching for entries. The
+ * following fields support that index.
+ *
+ * index_len: Number of entries currently in the hash table used to index
+ * the cache.
+ *
+ * index_size: Number of bytes of cache entries currently stored in the
+ * hash table used to index the cache.
+ *
+ * This value should not be mistaken for footprint of the
+ * cache in memory. The average cache entry is small, and
+ * the cache has a considerable overhead. Multiplying the
+ * index_size by two should yield a conservative estimate
+ * of the cache's memory footprint.
+ *
+ * clean_index_size: Number of bytes of clean entries currently stored in
+ * the hash table. Note that the index_size field (above)
+ * is also the sum of the sizes of all entries in the cache.
+ * Thus we should have the invariant that clean_index_size +
+ * dirty_index_size == index_size.
+ *
+ * WARNING:
+ *
+ * 1) The clean_index_size field is not maintained by the
+ * index macros, as the hash table doesn't care whether
+ * the entry is clean or dirty. Instead the field is
+ * maintained in the H5C__UPDATE_RP macros.
+ *
+ * 2) The value of the clean_index_size must not be mistaken
+ * for the current clean size of the cache. Rather, the
+ * clean size of the cache is the current value of
+ * clean_index_size plus the amount of empty space (if any)
+ * in the cache.
+ *
+ * dirty_index_size: Number of bytes of dirty entries currently stored in
+ * the hash table. Note that the index_size field (above)
+ * is also the sum of the sizes of all entries in the cache.
+ * Thus we should have the invariant that clean_index_size +
+ * dirty_index_size == index_size.
+ *
+ * WARNING:
+ *
+ * 1) The dirty_index_size field is not maintained by the
+ * index macros, as the hash table doesn't care whether
+ * the entry is clean or dirty. Instead the field is
+ * maintained in the H5C__UPDATE_RP macros.
+ *
+ * index: Array of pointer to H5C_cache_entry_t of size
+ * H5C__HASH_TABLE_LEN. At present, this value is a power
+ * of two, not the usual prime number.
+ *
+ * I hope that the variable size of cache elements, the large
+ * hash table size, and the way in which HDF5 allocates space
+ * will combine to avoid problems with periodicity. If so, we
+ * can use a trivial hash function (a bit-and and a 3 bit left
+ * shift) with some small savings.
+ *
+ * If not, it will become evident in the statistics. Changing
+ * to the usual prime number length hash table will require
+ * changing the H5C__HASH_FCN macro and the deletion of the
+ * H5C__HASH_MASK #define. No other changes should be required.
+ *
+ *
+ * With the addition of cache entry tagging, it is possible that
+ * an entry may be inserted into the cache without a tag during testing
+ * and the tag's validity shouldn't be checked.
+ *
+ * The following field is maintained to facilitate this.
+ *
+ * ignore_tags: Boolean flag to disable tag validation during entry insertion.
+ *
+ * When we flush the cache, we need to write entries out in increasing
+ * address order. An instance of a skip list is used to store dirty entries in
+ * sorted order. Whether it is cheaper to sort the dirty entries as needed,
+ * or to maintain the list is an open question. At a guess, it depends
+ * on how frequently the cache is flushed. We will see how it goes.
+ *
+ * For now at least, I will not remove dirty entries from the list as they
+ * are flushed. (this has been changed -- dirty entries are now removed from
+ * the skip list as they are flushed. JRM - 10/25/05)
+ *
+ * slist_len: Number of entries currently in the skip list
+ * used to maintain a sorted list of dirty entries in the
+ * cache.
+ *
+ * slist_size: Number of bytes of cache entries currently stored in the
+ * skip list used to maintain a sorted list of
+ * dirty entries in the cache.
+ *
+ * slist_ptr: pointer to the instance of H5SL_t used maintain a sorted
+ * list of dirty entries in the cache. This sorted list has
+ * two uses:
+ *
+ * a) It allows us to flush dirty entries in increasing address
+ * order, which results in significant savings.
+ *
+ * b) It facilitates checking for adjacent dirty entries when
+ * attempting to evict entries from the cache. While we
+ * don't use this at present, I hope that this will allow
+ * some optimizations when I get to it.
+ *
+ * num_last_entries: The number of entries in the cache that can only be
+ * flushed after all other entries in the cache have
+ * been flushed. At this time, this will only ever be
+ * one entry (the superblock), and the code has been
+ * protected with HDasserts to enforce this. This restraint
+ * can certainly be relaxed in the future if the need for
+ * multiple entries being flushed last arises, though
+ * explicit tests for that case should be added when said
+ * HDasserts are removed.
+ *
+ * With the addition of the fractal heap, the cache must now deal with
+ * the case in which entries may be dirtied, moved, or have their sizes
+ * changed during a flush. To allow sanity checks in this situation, the
+ * following two fields have been added. They are only compiled in when
+ * H5C_DO_SANITY_CHECKS is TRUE.
+ *
+ * slist_len_increase: Number of entries that have been added to the
+ * slist since the last time this field was set to zero.
+ *
+ * slist_size_increase: Total size of all entries that have been added
+ * to the slist since the last time this field was set to
+ * zero.
+ *
+ *
+ * When a cache entry is protected, it must be removed from the LRU
+ * list(s) as it cannot be either flushed or evicted until it is unprotected.
+ * The following fields are used to implement the protected list (pl).
+ *
+ * pl_len: Number of entries currently residing on the protected list.
+ *
+ * pl_size: Number of bytes of cache entries currently residing on the
+ * protected list.
+ *
+ * pl_head_ptr: Pointer to the head of the doubly linked list of protected
+ * entries. Note that cache entries on this list are linked
+ * by their next and prev fields.
+ *
+ * This field is NULL if the list is empty.
+ *
+ * pl_tail_ptr: Pointer to the tail of the doubly linked list of protected
+ * entries. Note that cache entries on this list are linked
+ * by their next and prev fields.
+ *
+ * This field is NULL if the list is empty.
+ *
+ *
+ * For very frequently used entries, the protect/unprotect overhead can
+ * become burdensome. To avoid this overhead, I have modified the cache
+ * to allow entries to be "pinned". A pinned entry is similar to a
+ * protected entry, in the sense that it cannot be evicted, and that
+ * the entry can be modified at any time.
+ *
+ * Pinning an entry has the following implications:
+ *
+ * 1) A pinned entry cannot be evicted. Thus unprotected
+ * pinned entries reside in the pinned entry list, instead
+ * of the LRU list(s) (or other lists maintained by the current
+ * replacement policy code).
+ *
+ * 2) A pinned entry can be accessed or modified at any time.
+ * Therefore, the cache must check with the entry owner
+ * before flushing it. If permission is denied, the
+ * cache just skips the entry in the flush.
+ *
+ * 3) A pinned entry can be marked as dirty (and possibly
+ * change size) while it is unprotected.
+ *
+ * 4) The flush-destroy code must allow pinned entries to
+ * be unpinned (and possibly unprotected) during the
+ * flush.
+ *
+ * Since pinned entries cannot be evicted, they must be kept on a pinned
+ * entry list (pel), instead of being entrusted to the replacement policy
+ * code.
+ *
+ * Maintaining the pinned entry list requires the following fields:
+ *
+ * pel_len: Number of entries currently residing on the pinned
+ * entry list.
+ *
+ * pel_size: Number of bytes of cache entries currently residing on
+ * the pinned entry list.
+ *
+ * pel_head_ptr: Pointer to the head of the doubly linked list of pinned
+ * but not protected entries. Note that cache entries on
+ * this list are linked by their next and prev fields.
+ *
+ * This field is NULL if the list is empty.
+ *
+ * pel_tail_ptr: Pointer to the tail of the doubly linked list of pinned
+ * but not protected entries. Note that cache entries on
+ * this list are linked by their next and prev fields.
+ *
+ * This field is NULL if the list is empty.
+ *
+ *
+ * The cache must have a replacement policy, and the fields supporting this
+ * policy must be accessible from this structure.
+ *
+ * While there has been interest in several replacement policies for
+ * this cache, the initial development schedule is tight. Thus I have
+ * elected to support only a modified LRU (least recently used) policy
+ * for the first cut.
+ *
+ * To further simplify matters, I have simply included the fields needed
+ * by the modified LRU in this structure. When and if we add support for
+ * other policies, it will probably be easiest to just add the necessary
+ * fields to this structure as well -- we only create one instance of this
+ * structure per file, so the overhead is not excessive.
+ *
+ *
+ * Fields supporting the modified LRU policy:
+ *
+ * See most any OS text for a discussion of the LRU replacement policy.
+ *
+ * When operating in parallel mode, we must ensure that a read does not
+ * cause a write. If it does, the process will hang, as the write will
+ * be collective and the other processes will not know to participate.
+ *
+ * To deal with this issue, I have modified the usual LRU policy by adding
+ * clean and dirty LRU lists to the usual LRU list.
+ *
+ * The clean LRU list is simply the regular LRU list with all dirty cache
+ * entries removed.
+ *
+ * Similarly, the dirty LRU list is the regular LRU list with all the clean
+ * cache entries removed.
+ *
+ * When reading in parallel mode, we evict from the clean LRU list only.
+ * This implies that we must try to ensure that the clean LRU list is
+ * reasonably well stocked at all times.
+ *
+ * We attempt to do this by trying to flush enough entries on each write
+ * to keep the cLRU_list_size >= min_clean_size.
+ *
+ * Even if we start with a completely clean cache, a sequence of protects
+ * without unprotects can empty the clean LRU list. In this case, the
+ * cache must grow temporarily. At the next write, we will attempt to
+ * evict enough entries to reduce index_size to less than max_cache_size.
+ * While this will usually be possible, all bets are off if enough entries
+ * are protected.
+ *
+ * Discussions of the individual fields used by the modified LRU replacement
+ * policy follow:
+ *
+ * LRU_list_len: Number of cache entries currently on the LRU list.
+ *
+ * Observe that LRU_list_len + pl_len must always equal
+ * index_len.
+ *
+ * LRU_list_size: Number of bytes of cache entries currently residing on the
+ * LRU list.
+ *
+ * Observe that LRU_list_size + pl_size must always equal
+ * index_size.
+ *
+ * LRU_head_ptr: Pointer to the head of the doubly linked LRU list. Cache
+ * entries on this list are linked by their next and prev fields.
+ *
+ * This field is NULL if the list is empty.
+ *
+ * LRU_tail_ptr: Pointer to the tail of the doubly linked LRU list. Cache
+ * entries on this list are linked by their next and prev fields.
+ *
+ * This field is NULL if the list is empty.
+ *
+ * cLRU_list_len: Number of cache entries currently on the clean LRU list.
+ *
+ * Observe that cLRU_list_len + dLRU_list_len must always
+ * equal LRU_list_len.
+ *
+ * cLRU_list_size: Number of bytes of cache entries currently residing on
+ * the clean LRU list.
+ *
+ * Observe that cLRU_list_size + dLRU_list_size must always
+ * equal LRU_list_size.
+ *
+ * cLRU_head_ptr: Pointer to the head of the doubly linked clean LRU list.
+ * Cache entries on this list are linked by their aux_next and
+ * aux_prev fields.
+ *
+ * This field is NULL if the list is empty.
+ *
+ * cLRU_tail_ptr: Pointer to the tail of the doubly linked clean LRU list.
+ * Cache entries on this list are linked by their aux_next and
+ * aux_prev fields.
+ *
+ * This field is NULL if the list is empty.
+ *
+ * dLRU_list_len: Number of cache entries currently on the dirty LRU list.
+ *
+ * Observe that cLRU_list_len + dLRU_list_len must always
+ * equal LRU_list_len.
+ *
+ * dLRU_list_size: Number of cache entries currently on the dirty LRU list.
+ *
+ * Observe that cLRU_list_len + dLRU_list_len must always
+ * equal LRU_list_len.
+ *
+ * dLRU_head_ptr: Pointer to the head of the doubly linked dirty LRU list.
+ * Cache entries on this list are linked by their aux_next and
+ * aux_prev fields.
+ *
+ * This field is NULL if the list is empty.
+ *
+ * dLRU_tail_ptr: Pointer to the tail of the doubly linked dirty LRU list.
+ * Cache entries on this list are linked by their aux_next and
+ * aux_prev fields.
+ *
+ * This field is NULL if the list is empty.
+ *
+ *
+ * Automatic cache size adjustment:
+ *
+ * While the default cache size is adequate for most cases, we can run into
+ * cases where the default is too small. Ideally, we will let the user
+ * adjust the cache size as required. However, this is not possible in all
+ * cases. Thus I have added automatic cache size adjustment code.
+ *
+ * The configuration for the automatic cache size adjustment is stored in
+ * the structure described below:
+ *
+ * size_increase_possible: Depending on the configuration data given
+ * in the resize_ctl field, it may or may not be possible
+ * to increase the size of the cache. Rather than test for
+ * all the ways this can happen, we simply set this flag when
+ * we receive a new configuration.
+ *
+ * flash_size_increase_possible: Depending on the configuration data given
+ * in the resize_ctl field, it may or may not be possible
+ * for a flash size increase to occur. We set this flag
+ * whenever we receive a new configuration so as to avoid
+ * repeated calculations.
+ *
+ * flash_size_increase_threshold: If a flash cache size increase is possible,
+ * this field is used to store the minimum size of a new entry
+ * or size increase needed to trigger a flash cache size
+ * increase. Note that this field must be updated whenever
+ * the size of the cache is changed.
+ *
+ * size_decrease_possible: Depending on the configuration data given
+ * in the resize_ctl field, it may or may not be possible
+ * to decrease the size of the cache. Rather than test for
+ * all the ways this can happen, we simply set this flag when
+ * we receive a new configuration.
+ *
+ * cache_full: Boolean flag used to keep track of whether the cache is
+ * full, so we can refrain from increasing the size of a
+ * cache which hasn't used up the space allotted to it.
+ *
+ * The field is initialized to FALSE, and then set to TRUE
+ * whenever we attempt to make space in the cache.
+ *
+ * resize_enabled: This is another convenience flag which is set whenever
+ * a new set of values for resize_ctl are provided. Very
+ * simply,
+ *
+ * resize_enabled = size_increase_possible ||
+ * size_decrease_possible;
+ *
+ * size_decreased: Boolean flag set to TRUE whenever the maximum cache
+ * size is decreased. The flag triggers a call to
+ * H5C_make_space_in_cache() on the next call to H5C_protect().
+ *
+ * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration
+ * data for automatic cache resizing.
+ *
+ * epoch_markers_active: Integer field containing the number of epoch
+ * markers currently in use in the LRU list. This value
+ * must be in the range [0, H5C__MAX_EPOCH_MARKERS - 1].
+ *
+ * epoch_marker_active: Array of boolean of length H5C__MAX_EPOCH_MARKERS.
+ * This array is used to track which epoch markers are currently
+ * in use.
+ *
+ * epoch_marker_ringbuf: Array of int of length H5C__MAX_EPOCH_MARKERS + 1.
+ *
+ * To manage the epoch marker cache entries, it is necessary
+ * to track their order in the LRU list. This is done with
+ * epoch_marker_ringbuf. When markers are inserted at the
+ * head of the LRU list, the index of the marker in the
+ * epoch_markers array is inserted at the tail of the ring
+ * buffer. When it becomes the epoch_marker_active'th marker
+ * in the LRU list, it will have worked its way to the head
+ * of the ring buffer as well. This allows us to remove it
+ * without scanning the LRU list if such is required.
+ *
+ * epoch_marker_ringbuf_first: Integer field containing the index of the
+ * first entry in the ring buffer.
+ *
+ * epoch_marker_ringbuf_last: Integer field containing the index of the
+ * last entry in the ring buffer.
+ *
+ * epoch_marker_ringbuf_size: Integer field containing the number of entries
+ * in the ring buffer.
+ *
+ * epoch_markers: Array of instances of H5C_cache_entry_t of length
+ * H5C__MAX_EPOCH_MARKERS. The entries are used as markers
+ * in the LRU list to identify cache entries that haven't
+ * been accessed for some (small) specified number of
+ * epochs. These entries (if any) can then be evicted and
+ * the cache size reduced -- ideally without evicting any
+ * of the current working set. Needless to say, the epoch
+ * length and the number of epochs before an unused entry
+ * must be chosen so that all, or almost all, the working
+ * set will be accessed before the limit.
+ *
+ * Epoch markers only appear in the LRU list, never in
+ * the index or slist. While they are of type
+ * H5C__EPOCH_MARKER_TYPE, and have associated class
+ * functions, these functions should never be called.
+ *
+ * The addr fields of these instances of H5C_cache_entry_t
+ * are set to the index of the instance in the epoch_markers
+ * array, the size is set to 0, and the type field points
+ * to the constant structure epoch_marker_class defined
+ * in H5C.c. The next and prev fields are used as usual
+ * to link the entry into the LRU list.
+ *
+ * All other fields are unused.
+ *
+ *
+ * Cache hit rate collection fields:
+ *
+ * We supply the current cache hit rate on request, so we must keep a
+ * simple cache hit rate computation regardless of whether statistics
+ * collection is enabled. The following fields support this capability.
+ *
+ * cache_hits: Number of cache hits since the last time the cache hit
+ * rate statistics were reset. Note that when automatic cache
+ * re-sizing is enabled, this field will be reset every automatic
+ * resize epoch.
+ *
+ * cache_accesses: Number of times the cache has been accessed while
+ * since the last since the last time the cache hit rate statistics
+ * were reset. Note that when automatic cache re-sizing is enabled,
+ * this field will be reset every automatic resize epoch.
+ *
+ *
+ * Statistics collection fields:
+ *
+ * When enabled, these fields are used to collect statistics as described
+ * below. The first set are collected only when H5C_COLLECT_CACHE_STATS
+ * is true.
+ *
+ * hits: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the number of times an entry with type id
+ * equal to the array index has been in cache when requested in
+ * the current epoch.
+ *
+ * misses: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the number of times an entry with type id
+ * equal to the array index has not been in cache when
+ * requested in the current epoch.
+ *
+ * write_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The
+ * cells are used to record the number of times an entry with
+ * type id equal to the array index has been write protected
+ * in the current epoch.
+ *
+ * Observe that (hits + misses) = (write_protects + read_protects).
+ *
+ * read_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The
+ * cells are used to record the number of times an entry with
+ * type id equal to the array index has been read protected in
+ * the current epoch.
+ *
+ * Observe that (hits + misses) = (write_protects + read_protects).
+ *
+ * max_read_protects: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1.
+ * The cells are used to maximum number of simultaneous read
+ * protects on any entry with type id equal to the array index
+ * in the current epoch.
+ *
+ * insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the number of times an entry with type
+ * id equal to the array index has been inserted into the
+ * cache in the current epoch.
+ *
+ * pinned_insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
+ * The cells are used to record the number of times an entry
+ * with type id equal to the array index has been inserted
+ * pinned into the cache in the current epoch.
+ *
+ * clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the number of times a dirty entry with type
+ * id equal to the array index has been cleared in the current
+ * epoch.
+ *
+ * flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the number of times an entry with type id
+ * equal to the array index has been written to disk in the
+ * current epoch.
+ *
+ * evictions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the number of times an entry with type id
+ * equal to the array index has been evicted from the cache in
+ * the current epoch.
+ *
+ * moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the number of times an entry with type
+ * id equal to the array index has been moved in the current
+ * epoch.
+ *
+ * entry_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
+ * The cells are used to record the number of times an entry
+ * with type id equal to the array index has been moved
+ * during its flush callback in the current epoch.
+ *
+ * cache_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
+ * The cells are used to record the number of times an entry
+ * with type id equal to the array index has been moved
+ * during a cache flush in the current epoch.
+ *
+ * pins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the number of times an entry with type
+ * id equal to the array index has been pinned in the current
+ * epoch.
+ *
+ * unpins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the number of times an entry with type
+ * id equal to the array index has been unpinned in the current
+ * epoch.
+ *
+ * dirty_pins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the number of times an entry with type
+ * id equal to the array index has been marked dirty while pinned
+ * in the current epoch.
+ *
+ * pinned_flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The
+ * cells are used to record the number of times an entry
+ * with type id equal to the array index has been flushed while
+ * pinned in the current epoch.
+ *
+ * pinned_clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The
+ * cells are used to record the number of times an entry
+ * with type id equal to the array index has been cleared while
+ * pinned in the current epoch.
+ *
+ * size_increases: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
+ * The cells are used to record the number of times an entry
+ * with type id equal to the array index has increased in
+ * size in the current epoch.
+ *
+ * size_decreases: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1.
+ * The cells are used to record the number of times an entry
+ * with type id equal to the array index has decreased in
+ * size in the current epoch.
+ *
+ * entry_flush_size_changes: Array of int64 of length
+ * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record
+ * the number of times an entry with type id equal to the
+ * array index has changed size while in its flush callback.
+ *
+ * cache_flush_size_changes: Array of int64 of length
+ * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record
+ * the number of times an entry with type id equal to the
+ * array index has changed size during a cache flush
+ *
+ * total_ht_insertions: Number of times entries have been inserted into the
+ * hash table in the current epoch.
+ *
+ * total_ht_deletions: Number of times entries have been deleted from the
+ * hash table in the current epoch.
+ *
+ * successful_ht_searches: int64 containing the total number of successful
+ * searches of the hash table in the current epoch.
+ *
+ * total_successful_ht_search_depth: int64 containing the total number of
+ * entries other than the targets examined in successful
+ * searches of the hash table in the current epoch.
+ *
+ * failed_ht_searches: int64 containing the total number of unsuccessful
+ * searches of the hash table in the current epoch.
+ *
+ * total_failed_ht_search_depth: int64 containing the total number of
+ * entries examined in unsuccessful searches of the hash
+ * table in the current epoch.
+ *
+ * max_index_len: Largest value attained by the index_len field in the
+ * current epoch.
+ *
+ * max_index_size: Largest value attained by the index_size field in the
+ * current epoch.
+ *
+ * max_clean_index_size: Largest value attained by the clean_index_size field
+ * in the current epoch.
+ *
+ * max_dirty_index_size: Largest value attained by the dirty_index_size field
+ * in the current epoch.
+ *
+ * max_slist_len: Largest value attained by the slist_len field in the
+ * current epoch.
+ *
+ * max_slist_size: Largest value attained by the slist_size field in the
+ * current epoch.
+ *
+ * max_pl_len: Largest value attained by the pl_len field in the
+ * current epoch.
+ *
+ * max_pl_size: Largest value attained by the pl_size field in the
+ * current epoch.
+ *
+ * max_pel_len: Largest value attained by the pel_len field in the
+ * current epoch.
+ *
+ * max_pel_size: Largest value attained by the pel_size field in the
+ * current epoch.
+ *
+ * calls_to_msic: Total number of calls to H5C_make_space_in_cache
+ *
+ * total_entries_skipped_in_msic: Number of clean entries skipped while
+ * enforcing the min_clean_fraction in H5C_make_space_in_cache().
+ *
+ * total_entries_scanned_in_msic: Number of clean entries skipped while
+ * enforcing the min_clean_fraction in H5C_make_space_in_cache().
+ *
+ * max_entries_skipped_in_msic: Maximum number of clean entries skipped
+ * in any one call to H5C_make_space_in_cache().
+ *
+ * max_entries_scanned_in_msic: Maximum number of entries scanned over
+ * in any one call to H5C_make_space_in_cache().
+ *
+ * entries_scanned_to_make_space: Number of entries scanned only when looking
+ * for entries to evict in order to make space in cache.
+
+ * The remaining stats are collected only when both H5C_COLLECT_CACHE_STATS
+ * and H5C_COLLECT_CACHE_ENTRY_STATS are true.
+ *
+ * max_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the maximum number of times any single
+ * entry with type id equal to the array index has been
+ * accessed in the current epoch.
+ *
+ * min_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the minimum number of times any single
+ * entry with type id equal to the array index has been
+ * accessed in the current epoch.
+ *
+ * max_clears: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the maximum number of times any single
+ * entry with type id equal to the array index has been cleared
+ * in the current epoch.
+ *
+ * max_flushes: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the maximum number of times any single
+ * entry with type id equal to the array index has been
+ * flushed in the current epoch.
+ *
+ * max_size: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the maximum size of any single entry
+ * with type id equal to the array index that has resided in
+ * the cache in the current epoch.
+ *
+ * max_pins: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells
+ * are used to record the maximum number of times that any single
+ * entry with type id equal to the array index that has been
+ * marked as pinned in the cache in the current epoch.
+ *
+ *
+ * Fields supporting testing:
+ *
+ * prefix Array of char used to prefix debugging output. The
+ * field is intended to allow marking of output of with
+ * the processes mpi rank.
+ *
+ * get_entry_ptr_from_addr_counter: Counter used to track the number of
+ * times the H5C_get_entry_ptr_from_addr() function has been
+ * called successfully. This field is only defined when
+ * NDEBUG is not #defined.
+ *
+ ****************************************************************************/
+struct H5C_t {
+ uint32_t magic;
+ hbool_t flush_in_progress;
+ FILE * trace_file_ptr;
+ void * aux_ptr;
+ int32_t max_type_id;
+ const char * (* type_name_table_ptr);
+ size_t max_cache_size;
+ size_t min_clean_size;
+ H5C_write_permitted_func_t check_write_permitted;
+ hbool_t write_permitted;
+ H5C_log_flush_func_t log_flush;
+ hbool_t evictions_enabled;
+
+ /* Fields for maintaining [hash table] index of entries */
+ int32_t index_len;
+ size_t index_size;
+ size_t clean_index_size;
+ size_t dirty_index_size;
+ H5C_cache_entry_t * (index[H5C__HASH_TABLE_LEN]);
+
+ /* Field to disable tag validation */
+ hbool_t ignore_tags;
+
+ int32_t slist_len;
+ size_t slist_size;
+ H5SL_t * slist_ptr;
+ int32_t num_last_entries;
+#if H5C_DO_SANITY_CHECKS
+ int64_t slist_len_increase;
+ int64_t slist_size_increase;
+#endif /* H5C_DO_SANITY_CHECKS */
+
+ /* Fields for tracking protected entries */
+ int32_t pl_len;
+ size_t pl_size;
+ H5C_cache_entry_t * pl_head_ptr;
+ H5C_cache_entry_t * pl_tail_ptr;
+
+ /* Fields for tracking pinned entries */
+ int32_t pel_len;
+ size_t pel_size;
+ H5C_cache_entry_t * pel_head_ptr;
+ H5C_cache_entry_t * pel_tail_ptr;
+
+ /* Fields for complete LRU list of entries */
+ int32_t LRU_list_len;
+ size_t LRU_list_size;
+ H5C_cache_entry_t * LRU_head_ptr;
+ H5C_cache_entry_t * LRU_tail_ptr;
+
+ /* Fields for clean LRU list of entries */
+ int32_t cLRU_list_len;
+ size_t cLRU_list_size;
+ H5C_cache_entry_t * cLRU_head_ptr;
+ H5C_cache_entry_t * cLRU_tail_ptr;
+
+ /* Fields for dirty LRU list of entries */
+ int32_t dLRU_list_len;
+ size_t dLRU_list_size;
+ H5C_cache_entry_t * dLRU_head_ptr;
+ H5C_cache_entry_t * dLRU_tail_ptr;
+
+ /* Fields for automatic cache size adjustment */
+ hbool_t size_increase_possible;
+ hbool_t flash_size_increase_possible;
+ size_t flash_size_increase_threshold;
+ hbool_t size_decrease_possible;
+ hbool_t resize_enabled;
+ hbool_t cache_full;
+ hbool_t size_decreased;
+ H5C_auto_size_ctl_t resize_ctl;
+
+ /* Fields for epoch markers used in automatic cache size adjustment */
+ int32_t epoch_markers_active;
+ hbool_t epoch_marker_active[H5C__MAX_EPOCH_MARKERS];
+ int32_t epoch_marker_ringbuf[H5C__MAX_EPOCH_MARKERS+1];
+ int32_t epoch_marker_ringbuf_first;
+ int32_t epoch_marker_ringbuf_last;
+ int32_t epoch_marker_ringbuf_size;
+ H5C_cache_entry_t epoch_markers[H5C__MAX_EPOCH_MARKERS];
+
+ /* Fields for cache hit rate collection */
+ int64_t cache_hits;
+ int64_t cache_accesses;
+
+#if H5C_COLLECT_CACHE_STATS
+ /* stats fields */
+ int64_t hits[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t misses[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t write_protects[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t read_protects[H5C__MAX_NUM_TYPE_IDS + 1];
+ int32_t max_read_protects[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t insertions[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t pinned_insertions[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t clears[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t flushes[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t evictions[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t moves[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t entry_flush_moves[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t cache_flush_moves[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t pins[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t unpins[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t dirty_pins[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t pinned_flushes[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t pinned_clears[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t size_increases[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t size_decreases[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t entry_flush_size_changes[H5C__MAX_NUM_TYPE_IDS + 1];
+ int64_t cache_flush_size_changes[H5C__MAX_NUM_TYPE_IDS + 1];
+
+ /* Fields for hash table operations */
+ int64_t total_ht_insertions;
+ int64_t total_ht_deletions;
+ int64_t successful_ht_searches;
+ int64_t total_successful_ht_search_depth;
+ int64_t failed_ht_searches;
+ int64_t total_failed_ht_search_depth;
+ int32_t max_index_len;
+ size_t max_index_size;
+ size_t max_clean_index_size;
+ size_t max_dirty_index_size;
+
+ /* Fields for in-order skip list */
+ int32_t max_slist_len;
+ size_t max_slist_size;
+
+ /* Fields for protected entry list */
+ int32_t max_pl_len;
+ size_t max_pl_size;
+
+ /* Fields for pinned entry list */
+ int32_t max_pel_len;
+ size_t max_pel_size;
+
+ /* Fields for tacking 'make space in cache' (msic) operations */
+ int64_t calls_to_msic;
+ int64_t total_entries_skipped_in_msic;
+ int64_t total_entries_scanned_in_msic;
+ int32_t max_entries_skipped_in_msic;
+ int32_t max_entries_scanned_in_msic;
+ int64_t entries_scanned_to_make_space;
+
+#if H5C_COLLECT_CACHE_ENTRY_STATS
+ int32_t max_accesses[H5C__MAX_NUM_TYPE_IDS + 1];
+ int32_t min_accesses[H5C__MAX_NUM_TYPE_IDS + 1];
+ int32_t max_clears[H5C__MAX_NUM_TYPE_IDS + 1];
+ int32_t max_flushes[H5C__MAX_NUM_TYPE_IDS + 1];
+ size_t max_size[H5C__MAX_NUM_TYPE_IDS + 1];
+ int32_t max_pins[H5C__MAX_NUM_TYPE_IDS + 1];
+#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
+#endif /* H5C_COLLECT_CACHE_STATS */
+
+ char prefix[H5C__PREFIX_LEN];
+
+#ifndef NDEBUG
+ int64_t get_entry_ptr_from_addr_counter;
+#endif /* NDEBUG */
+};
+
+/*****************************/
+/* Package Private Variables */
+/*****************************/
+
+
+/******************************/
+/* Package Private Prototypes */
+/******************************/
+
+
#endif /* _H5Cpkg_H */
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index c9679f4..3413381 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -36,6 +36,9 @@
#include "H5private.h" /* Generic Functions */
#include "H5Fprivate.h" /* File access */
+/**************************/
+/* Library Private Macros */
+/**************************/
#define H5C_DO_SANITY_CHECKS 0
#define H5C_DO_TAGGING_SANITY_CHECKS 1
@@ -61,36 +64,162 @@
* H5C_COLLECT_CACHE_STATS is also defined to true.
*/
#if H5C_COLLECT_CACHE_STATS
-
#define H5C_COLLECT_CACHE_ENTRY_STATS 1
-
#else
-
#define H5C_COLLECT_CACHE_ENTRY_STATS 0
-
#endif /* H5C_COLLECT_CACHE_STATS */
-
#ifdef H5_HAVE_PARALLEL
-
/* we must maintain the clean and dirty LRU lists when we are compiled
* with parallel support.
*/
#define H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS 1
-
#else /* H5_HAVE_PARALLEL */
-
/* The clean and dirty LRU lists don't buy us anything here -- we may
* want them on for testing on occasion, but in general they should be
* off.
*/
#define H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS 0
-
#endif /* H5_HAVE_PARALLEL */
+/* Flags returned from the 'flush' callback */
+#define H5C_CALLBACK__NO_FLAGS_SET 0x0
+#define H5C_CALLBACK__SIZE_CHANGED_FLAG 0x1
+#define H5C_CALLBACK__MOVED_FLAG 0x2
-/* Typedef for the main structure for the cache (defined in H5Cpkg.h) */
+/* Upper and lower limits on cache size. These limits are picked
+ * out of a hat -- you should be able to change them as necessary.
+ *
+ * However, if you need a very big cache, you should also increase the
+ * size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current
+ * upper bound on cache size is rather large for the current hash table
+ * size.
+ */
+#define H5C__MAX_MAX_CACHE_SIZE ((size_t)(128 * 1024 * 1024))
+#define H5C__MIN_MAX_CACHE_SIZE ((size_t)(1024))
+
+/* Default max cache size and min clean size are give here to make
+ * them generally accessable.
+ */
+#define H5C__DEFAULT_MAX_CACHE_SIZE ((size_t)(4 * 1024 * 1024))
+#define H5C__DEFAULT_MIN_CLEAN_SIZE ((size_t)(2 * 1024 * 1024))
+
+/* Maximum height of flush dependency relationships between entries. This is
+ * currently tuned to the extensible array (H5EA) data structure, which only
+ * requires 6 levels of dependency (i.e. heights 0-6) (actually, the extensible
+ * array needs 4 levels, plus another 2 levels are needed: one for the layer
+ * under the extensible array and one for the layer above it).
+ */
+#define H5C__NUM_FLUSH_DEP_HEIGHTS 6
+
+#ifndef NDEBUG
+/* Values for cache entry magic field */
+#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A
+#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef
+#endif /* NDEBUG */
+
+/* Cache configuration validation definitions */
+#define H5C_RESIZE_CFG__VALIDATE_GENERAL 0x1
+#define H5C_RESIZE_CFG__VALIDATE_INCREMENT 0x2
+#define H5C_RESIZE_CFG__VALIDATE_DECREMENT 0x4
+#define H5C_RESIZE_CFG__VALIDATE_INTERACTIONS 0x8
+#define H5C_RESIZE_CFG__VALIDATE_ALL \
+( \
+ H5C_RESIZE_CFG__VALIDATE_GENERAL | \
+ H5C_RESIZE_CFG__VALIDATE_INCREMENT | \
+ H5C_RESIZE_CFG__VALIDATE_DECREMENT | \
+ H5C_RESIZE_CFG__VALIDATE_INTERACTIONS \
+)
+
+/* Cache configuration versions */
+#define H5C__CURR_AUTO_SIZE_CTL_VER 1
+#define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1
+
+/* Number of epoch markers active */
+#define H5C__MAX_EPOCH_MARKERS 10
+
+/* Default configuration settings */
+#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f
+#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f
+#define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024))
+#define H5C__DEF_AR_INIT_SIZE ((size_t)( 1 * 1024 * 1024))
+#define H5C__DEF_AR_MIN_SIZE ((size_t)( 1 * 1024 * 1024))
+#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f
+#define H5C__DEF_AR_INCREMENT 2.0f
+#define H5C__DEF_AR_MAX_INCREMENT ((size_t)( 2 * 1024 * 1024))
+#define H5C__DEF_AR_FLASH_MULTIPLE 1.0f
+#define H5C__DEV_AR_FLASH_THRESHOLD 0.25f
+#define H5C__DEF_AR_DECREMENT 0.9f
+#define H5C__DEF_AR_MAX_DECREMENT ((size_t)( 1 * 1024 * 1024))
+#define H5C__DEF_AR_EPCHS_B4_EVICT 3
+#define H5C__DEF_AR_EMPTY_RESERVE 0.05f
+#define H5C__MIN_AR_EPOCH_LENGTH 100
+#define H5C__DEF_AR_EPOCH_LENGTH 50000
+#define H5C__MAX_AR_EPOCH_LENGTH 1000000
+
+/* #defines of flags used in the flags parameters in some of the
+ * cache calls. Note that not all flags are applicable
+ * to all function calls. Flags that don't apply to a particular
+ * function are ignored in that function.
+ *
+ * These flags apply to all function calls:
+ * H5C__NO_FLAGS_SET (generic "no flags set" for all fcn calls)
+ *
+ *
+ * These flags apply to H5C_insert_entry():
+ * H5C__SET_FLUSH_MARKER_FLAG
+ * H5C__PIN_ENTRY_FLAG
+ *
+ * These flags apply to H5C_protect()
+ * H5C__READ_ONLY_FLAG
+ *
+ * These flags apply to H5C_unprotect():
+ * H5C__SET_FLUSH_MARKER_FLAG
+ * H5C__DELETED_FLAG
+ * H5C__DIRTIED_FLAG
+ * H5C__PIN_ENTRY_FLAG
+ * H5C__UNPIN_ENTRY_FLAG
+ * H5C__FREE_FILE_SPACE_FLAG
+ * H5C__TAKE_OWNERSHIP_FLAG
+ *
+ * These flags apply to H5C_expunge_entry():
+ * H5C__FREE_FILE_SPACE_FLAG
+ *
+ * These flags apply to H5C_flush_cache():
+ * H5C__FLUSH_INVALIDATE_FLAG
+ * H5C__FLUSH_CLEAR_ONLY_FLAG
+ * H5C__FLUSH_MARKED_ENTRIES_FLAG
+ * H5C__FLUSH_IGNORE_PROTECTED_FLAG (can't use this flag in combination
+ * with H5C__FLUSH_INVALIDATE_FLAG)
+ *
+ * These flags apply to H5C_flush_single_entry():
+ * H5C__FLUSH_INVALIDATE_FLAG
+ * H5C__FLUSH_CLEAR_ONLY_FLAG
+ * H5C__FLUSH_MARKED_ENTRIES_FLAG
+ * H5C__TAKE_OWNERSHIP_FLAG
+ */
+#define H5C__NO_FLAGS_SET 0x0000
+#define H5C__SET_FLUSH_MARKER_FLAG 0x0001
+#define H5C__DELETED_FLAG 0x0002
+#define H5C__DIRTIED_FLAG 0x0004
+#define H5C__PIN_ENTRY_FLAG 0x0008
+#define H5C__UNPIN_ENTRY_FLAG 0x0010
+#define H5C__FLUSH_INVALIDATE_FLAG 0x0020
+#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x0040
+#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x0080
+#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x0100
+#define H5C__READ_ONLY_FLAG 0x0200
+#define H5C__FREE_FILE_SPACE_FLAG 0x0800
+#define H5C__TAKE_OWNERSHIP_FLAG 0x1000
+#define H5C__FLUSH_LAST_FLAG 0x2000
+#define H5C__FLUSH_COLLECTIVELY_FLAG 0x4000
+
+
+/****************************/
+/* Library Private Typedefs */
+/****************************/
+/* Typedef for the main structure for the cache (defined in H5Cpkg.h) */
typedef struct H5C_t H5C_t;
@@ -121,10 +250,6 @@ typedef struct H5C_t H5C_t;
* Note that the space allocated on disk may not be contiguous.
*/
-#define H5C_CALLBACK__NO_FLAGS_SET 0x0
-#define H5C_CALLBACK__SIZE_CHANGED_FLAG 0x1
-#define H5C_CALLBACK__MOVED_FLAG 0x2
-
/* Actions that can be reported to 'notify' client callback */
typedef enum H5C_notify_action_t {
H5C_NOTIFY_ACTION_AFTER_INSERT, /* Entry has been added to the cache */
@@ -135,27 +260,18 @@ typedef enum H5C_notify_action_t {
H5C_NOTIFY_ACTION_BEFORE_EVICT /* Entry is about to be evicted from cache */
} H5C_notify_action_t;
-typedef void *(*H5C_load_func_t)(H5F_t *f,
- hid_t dxpl_id,
- haddr_t addr,
- void *udata);
-typedef herr_t (*H5C_flush_func_t)(H5F_t *f,
- hid_t dxpl_id,
- hbool_t dest,
- haddr_t addr,
- void *thing,
- unsigned * flags_ptr);
-typedef herr_t (*H5C_dest_func_t)(H5F_t *f,
- void *thing);
-typedef herr_t (*H5C_clear_func_t)(H5F_t *f,
- void *thing,
- hbool_t dest);
-typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action,
- void *thing);
-typedef herr_t (*H5C_size_func_t)(const H5F_t *f,
- const void *thing,
- size_t *size_ptr);
-
+/* Cache client callback function pointers */
+typedef void *(*H5C_load_func_t)(H5F_t *f, hid_t dxpl_id, haddr_t addr,
+ void *udata);
+typedef herr_t (*H5C_flush_func_t)(H5F_t *f, hid_t dxpl_id, hbool_t dest,
+ haddr_t addr, void *thing, unsigned *flags_ptr);
+typedef herr_t (*H5C_dest_func_t)(H5F_t *f, void *thing);
+typedef herr_t (*H5C_clear_func_t)(H5F_t *f, void *thing, hbool_t dest);
+typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action, void *thing);
+typedef herr_t (*H5C_size_func_t)(const H5F_t *f, const void *thing,
+ size_t *size_ptr);
+
+/* Metadata cache client class definition */
typedef struct H5C_class_t {
int id;
H5C_load_func_t load;
@@ -166,49 +282,11 @@ typedef struct H5C_class_t {
H5C_size_func_t size;
} H5C_class_t;
-
-/* Type defintions of call back functions used by the cache as a whole */
-
+/* Type defintions of callback functions used by the cache as a whole */
typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f,
- hid_t dxpl_id,
- hbool_t * write_permitted_ptr);
-
-typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
- haddr_t addr,
- hbool_t was_dirty,
- unsigned flags,
- int type_id);
-
-/* Upper and lower limits on cache size. These limits are picked
- * out of a hat -- you should be able to change them as necessary.
- *
- * However, if you need a very big cache, you should also increase the
- * size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current
- * upper bound on cache size is rather large for the current hash table
- * size.
- */
-
-#define H5C__MAX_MAX_CACHE_SIZE ((size_t)(128 * 1024 * 1024))
-#define H5C__MIN_MAX_CACHE_SIZE ((size_t)(1024))
-
-
-/* Default max cache size and min clean size are give here to make
- * them generally accessable.
- */
-
-#define H5C__DEFAULT_MAX_CACHE_SIZE ((size_t)(4 * 1024 * 1024))
-#define H5C__DEFAULT_MIN_CLEAN_SIZE ((size_t)(2 * 1024 * 1024))
-
-/* Maximum height of flush dependency relationships between entries. This is
- * currently tuned to the extensible array (H5EA) data structure, which only
- * requires 6 levels of dependency (i.e. heights 0-6) (actually, the extensible
- * array needs 4 levels, plus another 2 levels are needed: one for the layer
- * under the extensible array and one for the layer above it).
- */
-
-#define H5C__NUM_FLUSH_DEP_HEIGHTS 6
-
-
+ hbool_t *write_permitted_ptr);
+typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr,
+ hbool_t was_dirty, unsigned flags);
/****************************************************************************
*
@@ -580,21 +658,14 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
* been pinned in cache in its life time.
*
****************************************************************************/
-
-#ifndef NDEBUG
-#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A
-#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef
-#endif /* NDEBUG */
-
-typedef struct H5C_cache_entry_t
-{
+typedef struct H5C_cache_entry_t {
#ifndef NDEBUG
uint32_t magic;
#endif /* NDEBUG */
- H5C_t * cache_ptr;
+ H5C_t * cache_ptr;
haddr_t addr;
size_t size;
- const H5C_class_t * type;
+ const H5C_class_t * type;
haddr_t tag;
hbool_t is_dirty;
hbool_t dirtied;
@@ -615,39 +686,31 @@ typedef struct H5C_cache_entry_t
hbool_t free_file_space_on_destroy;
/* fields supporting the 'flush dependency' feature: */
-
- struct H5C_cache_entry_t * flush_dep_parent;
+ struct H5C_cache_entry_t * flush_dep_parent;
uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS];
unsigned flush_dep_height;
hbool_t pinned_from_client;
hbool_t pinned_from_cache;
/* fields supporting the hash table: */
-
- struct H5C_cache_entry_t * ht_next;
- struct H5C_cache_entry_t * ht_prev;
+ struct H5C_cache_entry_t * ht_next;
+ struct H5C_cache_entry_t * ht_prev;
/* fields supporting replacement policies: */
-
- struct H5C_cache_entry_t * next;
- struct H5C_cache_entry_t * prev;
- struct H5C_cache_entry_t * aux_next;
- struct H5C_cache_entry_t * aux_prev;
+ struct H5C_cache_entry_t * next;
+ struct H5C_cache_entry_t * prev;
+ struct H5C_cache_entry_t * aux_next;
+ struct H5C_cache_entry_t * aux_prev;
#if H5C_COLLECT_CACHE_ENTRY_STATS
-
/* cache entry stats fields */
-
int32_t accesses;
int32_t clears;
int32_t flushes;
int32_t pins;
-
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
-
} H5C_cache_entry_t;
-
/****************************************************************************
*
* structure H5C_auto_size_ctl_t
@@ -888,41 +951,6 @@ typedef struct H5C_cache_entry_t
*
****************************************************************************/
-#define H5C_RESIZE_CFG__VALIDATE_GENERAL 0x1
-#define H5C_RESIZE_CFG__VALIDATE_INCREMENT 0x2
-#define H5C_RESIZE_CFG__VALIDATE_DECREMENT 0x4
-#define H5C_RESIZE_CFG__VALIDATE_INTERACTIONS 0x8
-#define H5C_RESIZE_CFG__VALIDATE_ALL \
-( \
- H5C_RESIZE_CFG__VALIDATE_GENERAL | \
- H5C_RESIZE_CFG__VALIDATE_INCREMENT | \
- H5C_RESIZE_CFG__VALIDATE_DECREMENT | \
- H5C_RESIZE_CFG__VALIDATE_INTERACTIONS \
-)
-
-#define H5C__CURR_AUTO_SIZE_CTL_VER 1
-#define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1
-
-#define H5C__MAX_EPOCH_MARKERS 10
-
-#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f
-#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f
-#define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024))
-#define H5C__DEF_AR_INIT_SIZE ((size_t)( 1 * 1024 * 1024))
-#define H5C__DEF_AR_MIN_SIZE ((size_t)( 1 * 1024 * 1024))
-#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f
-#define H5C__DEF_AR_INCREMENT 2.0f
-#define H5C__DEF_AR_MAX_INCREMENT ((size_t)( 2 * 1024 * 1024))
-#define H5C__DEF_AR_FLASH_MULTIPLE 1.0f
-#define H5C__DEV_AR_FLASH_THRESHOLD 0.25f
-#define H5C__DEF_AR_DECREMENT 0.9f
-#define H5C__DEF_AR_MAX_DECREMENT ((size_t)( 1 * 1024 * 1024))
-#define H5C__DEF_AR_EPCHS_B4_EVICT 3
-#define H5C__DEF_AR_EMPTY_RESERVE 0.05f
-#define H5C__MIN_AR_EPOCH_LENGTH 100
-#define H5C__DEF_AR_EPOCH_LENGTH 50000
-#define H5C__MAX_AR_EPOCH_LENGTH 1000000
-
enum H5C_resize_status
{
in_spec,
@@ -936,303 +964,118 @@ enum H5C_resize_status
not_full
}; /* enum H5C_resize_conditions */
-typedef void (*H5C_auto_resize_rpt_fcn)(H5C_t * cache_ptr,
- int32_t version,
- double hit_rate,
- enum H5C_resize_status status,
- size_t old_max_cache_size,
- size_t new_max_cache_size,
- size_t old_min_clean_size,
- size_t new_min_clean_size);
+typedef void (*H5C_auto_resize_rpt_fcn)(H5C_t * cache_ptr, int32_t version,
+ double hit_rate, enum H5C_resize_status status, size_t old_max_cache_size,
+ size_t new_max_cache_size, size_t old_min_clean_size, size_t new_min_clean_size);
-typedef struct H5C_auto_size_ctl_t
-{
+typedef struct H5C_auto_size_ctl_t {
/* general configuration fields: */
int32_t version;
H5C_auto_resize_rpt_fcn rpt_fcn;
-
hbool_t set_initial_size;
size_t initial_size;
-
double min_clean_fraction;
-
size_t max_size;
size_t min_size;
-
int64_t epoch_length;
-
/* size increase control fields: */
enum H5C_cache_incr_mode incr_mode;
-
double lower_hr_threshold;
-
double increment;
-
hbool_t apply_max_increment;
size_t max_increment;
-
enum H5C_cache_flash_incr_mode flash_incr_mode;
double flash_multiple;
double flash_threshold;
-
/* size decrease control fields: */
enum H5C_cache_decr_mode decr_mode;
-
double upper_hr_threshold;
-
double decrement;
-
hbool_t apply_max_decrement;
size_t max_decrement;
-
int32_t epochs_before_eviction;
-
hbool_t apply_empty_reserve;
double empty_reserve;
-
} H5C_auto_size_ctl_t;
-
-/*
- * Library prototypes.
- */
-
-/* #defines of flags used in the flags parameters in some of the
- * following function calls. Note that not all flags are applicable
- * to all function calls. Flags that don't apply to a particular
- * function are ignored in that function.
- *
- * These flags apply to all function calls:
- *
- * H5C__NO_FLAGS_SET (generic "no flags set" for all fcn calls)
- *
- *
- * These flags apply to H5C_insert_entry():
- *
- * H5C__SET_FLUSH_MARKER_FLAG
- * H5C__PIN_ENTRY_FLAG
- *
- * These flags apply to H5C_protect()
- *
- * H5C__READ_ONLY_FLAG
- *
- * These flags apply to H5C_unprotect():
- *
- * H5C__SET_FLUSH_MARKER_FLAG
- * H5C__DELETED_FLAG
- * H5C__DIRTIED_FLAG
- * H5C__PIN_ENTRY_FLAG
- * H5C__UNPIN_ENTRY_FLAG
- * H5C__FREE_FILE_SPACE_FLAG
- * H5C__TAKE_OWNERSHIP_FLAG
- *
- * These flags apply to H5C_expunge_entry():
- *
- * H5C__FREE_FILE_SPACE_FLAG
- *
- * These flags apply to H5C_flush_cache():
- *
- * H5C__FLUSH_INVALIDATE_FLAG
- * H5C__FLUSH_CLEAR_ONLY_FLAG
- * H5C__FLUSH_MARKED_ENTRIES_FLAG
- * H5C__FLUSH_IGNORE_PROTECTED_FLAG (can't use this flag in combination
- * with H5C__FLUSH_INVALIDATE_FLAG)
- *
- * These flags apply to H5C_flush_single_entry():
- *
- * H5C__FLUSH_INVALIDATE_FLAG
- * H5C__FLUSH_CLEAR_ONLY_FLAG
- * H5C__FLUSH_MARKED_ENTRIES_FLAG
- * H5C__TAKE_OWNERSHIP_FLAG
- */
-
-#define H5C__NO_FLAGS_SET 0x0000
-#define H5C__SET_FLUSH_MARKER_FLAG 0x0001
-#define H5C__DELETED_FLAG 0x0002
-#define H5C__DIRTIED_FLAG 0x0004
-#define H5C__PIN_ENTRY_FLAG 0x0008
-#define H5C__UNPIN_ENTRY_FLAG 0x0010
-#define H5C__FLUSH_INVALIDATE_FLAG 0x0020
-#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x0040
-#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x0080
-#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x0100
-#define H5C__READ_ONLY_FLAG 0x0200
-#define H5C__FREE_FILE_SPACE_FLAG 0x0800
-#define H5C__TAKE_OWNERSHIP_FLAG 0x1000
-#define H5C__FLUSH_LAST_FLAG 0x2000
-#define H5C__FLUSH_COLLECTIVELY_FLAG 0x4000
-
-#ifdef H5_HAVE_PARALLEL
-H5_DLL herr_t H5C_apply_candidate_list(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
- H5C_t * cache_ptr,
- int num_candidates,
- haddr_t * candidates_list_ptr,
- int mpi_rank,
- int mpi_size);
-
-H5_DLL herr_t H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr);
-
-H5_DLL herr_t H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr);
-#endif /* H5_HAVE_PARALLEL */
-
-H5_DLL H5C_t * H5C_create(size_t max_cache_size,
- size_t min_clean_size,
- int max_type_id,
- const char * (* type_name_table_ptr),
- H5C_write_permitted_func_t check_write_permitted,
- hbool_t write_permitted,
- H5C_log_flush_func_t log_flush,
- void * aux_ptr);
-
-H5_DLL void H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr,
- int32_t version,
- double hit_rate,
- enum H5C_resize_status status,
- size_t old_max_cache_size,
- size_t new_max_cache_size,
- size_t old_min_clean_size,
- size_t new_min_clean_size);
-
-H5_DLL herr_t H5C_dest(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id);
-
-H5_DLL herr_t H5C_expunge_entry(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
- const H5C_class_t * type,
- haddr_t addr,
- unsigned flags);
-
-H5_DLL herr_t H5C_flush_cache(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
- unsigned flags);
-
-H5_DLL herr_t H5C_flush_to_min_clean(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id);
-
-H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t * cache_ptr,
- H5C_auto_size_ctl_t *config_ptr);
-
-H5_DLL herr_t H5C_get_cache_size(H5C_t * cache_ptr,
- size_t * max_size_ptr,
- size_t * min_clean_size_ptr,
- size_t * cur_size_ptr,
- int32_t * cur_num_entries_ptr);
-
-H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t * cache_ptr,
- double * hit_rate_ptr);
-
-H5_DLL herr_t H5C_get_entry_status(const H5F_t *f,
- haddr_t addr,
- size_t * size_ptr,
- hbool_t * in_cache_ptr,
- hbool_t * is_dirty_ptr,
- hbool_t * is_protected_ptr,
- hbool_t * is_pinned_ptr,
- hbool_t * is_flush_dep_parent_ptr,
- hbool_t * is_flush_dep_child_ptr);
-
-H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t * cache_ptr,
- hbool_t * evictions_enabled_ptr);
-
-H5_DLL herr_t H5C_get_trace_file_ptr(const H5C_t *cache_ptr,
- FILE **trace_file_ptr_ptr);
-H5_DLL herr_t H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr,
- FILE **trace_file_ptr_ptr);
-
-H5_DLL herr_t H5C_insert_entry(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
- const H5C_class_t * type,
- haddr_t addr,
- void * thing,
- unsigned int flags);
-
-H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
- int32_t ce_array_len,
- haddr_t *ce_array_ptr);
-
+/***************************************/
+/* Library-private Function Prototypes */
+/***************************************/
+
+H5_DLL H5C_t *H5C_create(size_t max_cache_size, size_t min_clean_size,
+ int max_type_id, const char *(*type_name_table_ptr),
+ H5C_write_permitted_func_t check_write_permitted, hbool_t write_permitted,
+ H5C_log_flush_func_t log_flush, void *aux_ptr);
+H5_DLL void H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, int32_t version,
+ double hit_rate, enum H5C_resize_status status,
+ size_t old_max_cache_size, size_t new_max_cache_size,
+ size_t old_min_clean_size, size_t new_min_clean_size);
+H5_DLL herr_t H5C_dest(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id);
+H5_DLL herr_t H5C_expunge_entry(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id,
+ const H5C_class_t *type, haddr_t addr, unsigned flags);
+H5_DLL herr_t H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id,
+ unsigned flags);
+H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id);
+H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t *cache_ptr,
+ H5C_auto_size_ctl_t *config_ptr);
+H5_DLL herr_t H5C_get_cache_size(H5C_t *cache_ptr, size_t *max_size_ptr,
+ size_t *min_clean_size_ptr, size_t *cur_size_ptr,
+ int32_t *cur_num_entries_ptr);
+H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t *cache_ptr, double *hit_rate_ptr);
+H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, haddr_t addr,
+ size_t *size_ptr, hbool_t *in_cache_ptr, hbool_t *is_dirty_ptr,
+ hbool_t *is_protected_ptr, hbool_t *is_pinned_ptr,
+ hbool_t *is_flush_dep_parent_ptr, hbool_t *is_flush_dep_child_ptr);
+H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t *cache_ptr, hbool_t *evictions_enabled_ptr);
+H5_DLL FILE *H5C_get_trace_file_ptr(const H5C_t *cache_ptr);
+H5_DLL FILE *H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr);
+H5_DLL herr_t H5C_insert_entry(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id,
+ const H5C_class_t *type, haddr_t addr, void *thing, unsigned int flags);
+H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, hid_t primary_dxpl_id,
+ hid_t secondary_dxpl_id, int32_t ce_array_len, haddr_t *ce_array_ptr);
H5_DLL herr_t H5C_mark_entry_dirty(void *thing);
-
-H5_DLL herr_t H5C_move_entry(H5C_t * cache_ptr,
- const H5C_class_t * type,
- haddr_t old_addr,
- haddr_t new_addr);
-
+H5_DLL herr_t H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type,
+ haddr_t old_addr, haddr_t new_addr);
H5_DLL herr_t H5C_pin_protected_entry(void *thing);
-
H5_DLL herr_t H5C_create_flush_dependency(void *parent_thing, void *child_thing);
-
-H5_DLL void * H5C_protect(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
- const H5C_class_t * type,
- haddr_t addr,
- void * udata,
- unsigned flags);
-
-H5_DLL herr_t H5C_reset_cache_hit_rate_stats(H5C_t * cache_ptr);
-
+H5_DLL void * H5C_protect(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id,
+ const H5C_class_t *type, haddr_t addr, void *udata, unsigned flags);
+H5_DLL herr_t H5C_reset_cache_hit_rate_stats(H5C_t *cache_ptr);
H5_DLL herr_t H5C_resize_entry(void *thing, size_t new_size);
-
H5_DLL herr_t H5C_set_cache_auto_resize_config(H5C_t *cache_ptr,
- H5C_auto_size_ctl_t *config_ptr);
-
-H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr,
- hbool_t evictions_enabled);
-
-H5_DLL herr_t H5C_set_prefix(H5C_t * cache_ptr, char * prefix);
-
-H5_DLL herr_t H5C_set_trace_file_ptr(H5C_t * cache_ptr,
- FILE * trace_file_ptr);
-
-H5_DLL herr_t H5C_stats(H5C_t * cache_ptr,
- const char * cache_name,
- hbool_t display_detailed_stats);
-
-H5_DLL void H5C_stats__reset(H5C_t * cache_ptr);
-
-H5_DLL herr_t H5C_dump_cache(H5C_t * cache_ptr,
- const char * cache_name);
-
+ H5C_auto_size_ctl_t *config_ptr);
+H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled);
+H5_DLL herr_t H5C_set_prefix(H5C_t *cache_ptr, char *prefix);
+H5_DLL herr_t H5C_set_trace_file_ptr(H5C_t *cache_ptr, FILE *trace_file_ptr);
+H5_DLL herr_t H5C_stats(H5C_t *cache_ptr, const char *cache_name,
+ hbool_t display_detailed_stats);
+H5_DLL void H5C_stats__reset(H5C_t *cache_ptr);
+H5_DLL herr_t H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name);
H5_DLL herr_t H5C_unpin_entry(void *thing);
-
H5_DLL herr_t H5C_destroy_flush_dependency(void *parent_thing, void *child_thing);
+H5_DLL herr_t H5C_unprotect(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id,
+ const H5C_class_t *type, haddr_t addr, void *thing, unsigned int flags);
+H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr,
+ unsigned int tests);
+H5_DLL herr_t H5C_ignore_tags(H5C_t *cache_ptr);
+H5_DLL void H5C_retag_copied_metadata(H5C_t *cache_ptr, haddr_t metadata_tag);
-H5_DLL herr_t H5C_unprotect(H5F_t * f,
- hid_t primary_dxpl_id,
- hid_t secondary_dxpl_id,
- const H5C_class_t * type,
- haddr_t addr,
- void * thing,
- unsigned int flags);
-
-H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr,
- unsigned int tests);
-
-H5_DLL herr_t H5C_ignore_tags(H5C_t * cache_ptr);
-
-H5_DLL void H5C_retag_copied_metadata(H5C_t * cache_ptr, haddr_t metadata_tag);
+#ifdef H5_HAVE_PARALLEL
+H5_DLL herr_t H5C_apply_candidate_list(H5F_t *f, hid_t primary_dxpl_id,
+ hid_t secondary_dxpl_id, H5C_t *cache_ptr, int num_candidates,
+ haddr_t *candidates_list_ptr, int mpi_rank, int mpi_size);
+H5_DLL herr_t H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr);
+H5_DLL herr_t H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr);
+#endif /* H5_HAVE_PARALLEL */
#ifndef NDEBUG /* debugging functions */
-
H5_DLL herr_t H5C_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr,
- void ** entry_ptr_ptr);
-
-H5_DLL herr_t H5C_verify_entry_type(const H5F_t * f, haddr_t addr,
- const H5C_class_t * expected_type,
- hbool_t * in_cache_ptr,
- hbool_t * type_ok_ptr);
-
+ void **entry_ptr_ptr);
+H5_DLL herr_t H5C_verify_entry_type(const H5F_t *f, haddr_t addr,
+ const H5C_class_t *expected_type, hbool_t *in_cache_ptr,
+ hbool_t *type_ok_ptr);
#endif /* NDEBUG */
#endif /* !_H5Cprivate_H */
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index e22eb3a..af5123c 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -722,7 +722,6 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
unsigned f_ndims; /* The number of dimensions of the file's dataspace */
int sm_ndims; /* The number of dimensions of the memory buffer's dataspace (signed) */
H5SL_node_t *curr_node; /* Current node in skip list */
- H5S_sel_type fsel_type; /* Selection type on disk */
char bogus; /* "bogus" buffer to pass to selection iterator */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
@@ -836,13 +835,13 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
fm->use_single = FALSE;
/* Get type of selection on disk & in memory */
- if((fsel_type = H5S_GET_SELECT_TYPE(file_space)) < H5S_SEL_NONE)
+ if((fm->fsel_type = H5S_GET_SELECT_TYPE(file_space)) < H5S_SEL_NONE)
HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to get type of selection")
if((fm->msel_type = H5S_GET_SELECT_TYPE(mem_space)) < H5S_SEL_NONE)
HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to get type of selection")
/* If the selection is NONE or POINTS, set the flag to FALSE */
- if(fsel_type == H5S_SEL_POINTS || fsel_type == H5S_SEL_NONE)
+ if(fm->fsel_type == H5S_SEL_POINTS || fm->fsel_type == H5S_SEL_NONE)
sel_hyper_flag = FALSE;
else
sel_hyper_flag = TRUE;
@@ -2014,7 +2013,8 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
/* Determine if we will access all the data in the chunk */
if(dst_accessed_bytes != ctg_store.contig.dset_size ||
- (chunk_info->chunk_points * type_info->src_type_size) != ctg_store.contig.dset_size)
+ (chunk_info->chunk_points * type_info->src_type_size) != ctg_store.contig.dset_size ||
+ fm->fsel_type == H5S_SEL_POINTS)
entire_chunk = FALSE;
/* Set chunk's [scaled] coordinates */
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 2d5a54d..315fe53 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -337,6 +337,7 @@ typedef struct H5D_chunk_map_t {
H5S_sel_iter_t mem_iter; /* Iterator for elements in memory selection */
unsigned m_ndims; /* Number of dimensions for memory dataspace */
H5S_sel_type msel_type; /* Selection type in memory */
+ H5S_sel_type fsel_type; /* Selection type in file */
H5SL_t *sel_chunks; /* Skip list containing information for each chunk selected */
diff --git a/src/H5EAcache.c b/src/H5EAcache.c
index b9acc49..70686fb 100644
--- a/src/H5EAcache.c
+++ b/src/H5EAcache.c
@@ -227,7 +227,7 @@ H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata))
H5E_THROW(H5E_CANTINIT, "can't wrap buffer")
/* Compute the 'base' size of the extensible array header on disk */
- size = H5EA_HEADER_SIZE(hdr);
+ size = H5EA_HEADER_SIZE_HDR(hdr);
/* Get a pointer to a buffer that's large enough for serialized header */
if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size)))
@@ -1789,7 +1789,7 @@ H5EA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata))
H5E_THROW(H5E_CANTINIT, "can't wrap buffer")
/* Compute the size of the extensible array data block page on disk */
- size = H5EA_DBLK_PAGE_SIZE(dblk_page);
+ size = H5EA_DBLK_PAGE_SIZE(udata->hdr);
/* Get a pointer to a buffer that's large enough for serialized info */
if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size)))
diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c
index 3c2da7c..37fd68b 100644
--- a/src/H5EAdblkpage.c
+++ b/src/H5EAdblkpage.c
@@ -169,7 +169,7 @@ HDfprintf(stderr, "%s: Called, addr = %a\n", FUNC, addr);
/* Set info about data block page on disk */
dblk_page->addr = addr;
- dblk_page->size = H5EA_DBLK_PAGE_SIZE(dblk_page);
+ dblk_page->size = H5EA_DBLK_PAGE_SIZE(hdr);
#ifdef QAK
HDfprintf(stderr, "%s: dblk_page->size = %Zu\n", FUNC, dblk_page->size);
#endif /* QAK */
diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c
index 136cf1e..76ea6d8 100644
--- a/src/H5EAhdr.c
+++ b/src/H5EAhdr.c
@@ -230,7 +230,7 @@ HDfprintf(stderr, "%s: hdr->sblk_info[%Zu] = {%Zu, %Zu, %Hu, %Hu}\n", FUNC, u, h
} /* end for */
/* Set size of header on disk (locally and in statistics) */
- hdr->stats.computed.hdr_size = hdr->size = H5EA_HEADER_SIZE(hdr);
+ hdr->stats.computed.hdr_size = hdr->size = H5EA_HEADER_SIZE_HDR(hdr);
/* Create the callback context, if there's one */
if(hdr->cparam.cls->crt_context) {
diff --git a/src/H5EApkg.h b/src/H5EApkg.h
index d89a35e..5382eac 100644
--- a/src/H5EApkg.h
+++ b/src/H5EApkg.h
@@ -66,7 +66,7 @@
)
/* Size of the extensible array header on disk */
-#define H5EA_HEADER_SIZE(h) ( \
+#define H5EA_HEADER_SIZE(sizeof_addr, sizeof_size) ( \
/* General metadata fields */ \
H5EA_METADATA_PREFIX_SIZE(TRUE) \
\
@@ -79,15 +79,25 @@
+ 1 /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */ \
\
/* Extensible Array statistics fields */ \
- + (h)->sizeof_size /* Number of super blocks created */ \
- + (h)->sizeof_size /* Size of super blocks created */ \
- + (h)->sizeof_size /* Number of data blocks created */ \
- + (h)->sizeof_size /* Size of data blocks created */ \
- + (h)->sizeof_size /* Max. index set */ \
- + (h)->sizeof_size /* Number of elements 'realized' */ \
+ + (sizeof_size) /* Number of super blocks created */ \
+ + (sizeof_size) /* Size of super blocks created */ \
+ + (sizeof_size) /* Number of data blocks created */ \
+ + (sizeof_size) /* Size of data blocks created */ \
+ + (sizeof_size) /* Max. index set */ \
+ + (sizeof_size) /* Number of elements 'realized' */ \
\
/* Extensible Array Header specific fields */ \
- + (h)->sizeof_addr /* File address of index block */ \
+ + (sizeof_addr) /* File address of index block */ \
+ )
+
+/* Size of the extensible array header on disk (via file pointer) */
+#define H5EA_HEADER_SIZE_FILE(f) ( \
+ H5EA_HEADER_SIZE(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) \
+ )
+
+/* Size of the extensible array header on disk (via extensible array header) */
+#define H5EA_HEADER_SIZE_HDR(h) ( \
+ H5EA_HEADER_SIZE((h)->sizeof_addr, (h)->sizeof_size) \
)
/* Size of the extensible array index block on disk */
@@ -139,8 +149,8 @@
)
/* Size of the extensible array data block page on disk */
-#define H5EA_DBLK_PAGE_SIZE(p) ( \
- + ((p)->hdr->dblk_page_nelmts * (size_t)(p)->hdr->cparam.raw_elmt_size) /* Elements in data block page */ \
+#define H5EA_DBLK_PAGE_SIZE(h) ( \
+ + ((h)->dblk_page_nelmts * (size_t)(h)->cparam.raw_elmt_size) /* Elements in data block page */ \
+ H5EA_SIZEOF_CHKSUM /* Checksum for each page */ \
)
diff --git a/src/H5Eint.c b/src/H5Eint.c
index 2092566..07d1e46 100644
--- a/src/H5Eint.c
+++ b/src/H5Eint.c
@@ -272,10 +272,12 @@ H5E_walk1_cb(int n, H5E_error1_t *err_desc, void *client_data)
/* try show the process or thread id in multiple processes cases*/
#ifdef H5_HAVE_PARALLEL
{
- int mpi_rank, mpi_initialized;
+ int mpi_rank, mpi_initialized, mpi_finalized;
MPI_Initialized(&mpi_initialized);
- if(mpi_initialized) {
+ MPI_Finalized(&mpi_finalized);
+
+ if(mpi_initialized && !mpi_finalized) {
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
fprintf(stream, "MPI-process %d", mpi_rank);
} /* end if */
@@ -402,10 +404,12 @@ H5E_walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data)
/* try show the process or thread id in multiple processes cases*/
#ifdef H5_HAVE_PARALLEL
{
- int mpi_rank, mpi_initialized;
+ int mpi_rank, mpi_initialized, mpi_finalized;
MPI_Initialized(&mpi_initialized);
- if(mpi_initialized) {
+ MPI_Finalized(&mpi_finalized);
+
+ if(mpi_initialized && !mpi_finalized) {
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
fprintf(stream, "MPI-process %d", mpi_rank);
} /* end if */
diff --git a/src/H5F.c b/src/H5F.c
index 256b81e..d213c32 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -1483,3 +1483,4 @@ H5Fclear_elink_file_cache(hid_t file_id)
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fclear_elink_file_cache() */
+
diff --git a/src/H5FAcache.c b/src/H5FAcache.c
index a26aee6..9a1fc57 100644
--- a/src/H5FAcache.c
+++ b/src/H5FAcache.c
@@ -189,7 +189,7 @@ H5FA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata))
H5E_THROW(H5E_CANTINIT, "can't wrap buffer")
/* Compute the 'base' size of the fixed array header on disk */
- size = H5FA_HEADER_SIZE(hdr);
+ size = H5FA_HEADER_SIZE_HDR(hdr);
/* Get a pointer to a buffer that's large enough for serialized header */
if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size)))
@@ -883,7 +883,7 @@ H5FA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata))
H5E_THROW(H5E_CANTINIT, "can't wrap buffer")
/* Compute the size of the fixed array data block page on disk */
- size = H5FA_DBLK_PAGE_SIZE(dblk_page, udata->nelmts);
+ size = H5FA_DBLK_PAGE_SIZE(udata->hdr, udata->nelmts);
/* Get a pointer to a buffer that's large enough for serialized info */
if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size)))
diff --git a/src/H5FAdblkpage.c b/src/H5FAdblkpage.c
index b5ef82c..1f6b706 100644
--- a/src/H5FAdblkpage.c
+++ b/src/H5FAdblkpage.c
@@ -167,7 +167,7 @@ HDfprintf(stderr, "%s: Called, addr = %a\n", FUNC, addr);
/* Set info about data block page on disk */
dblk_page->addr = addr;
- dblk_page->size = H5FA_DBLK_PAGE_SIZE(dblk_page, nelmts);
+ dblk_page->size = H5FA_DBLK_PAGE_SIZE(hdr, nelmts);
#ifdef H5FA_DEBUG
HDfprintf(stderr, "%s: dblk_page->size = %Zu\n", FUNC, dblk_page->size);
#endif /* H5FA_DEBUG */
diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c
index 5970ff0..23c20bc 100644
--- a/src/H5FAhdr.c
+++ b/src/H5FAhdr.c
@@ -148,7 +148,7 @@ H5FA__hdr_init(H5FA_hdr_t *hdr, void *ctx_udata))
HDassert(hdr);
/* Set size of header on disk (locally and in statistics) */
- hdr->stats.hdr_size = hdr->size = H5FA_HEADER_SIZE(hdr);
+ hdr->stats.hdr_size = hdr->size = H5FA_HEADER_SIZE_HDR(hdr);
/* Set number of elements for Fixed Array in statistics */
hdr->stats.nelmts = hdr->cparam.nelmts;
diff --git a/src/H5FApkg.h b/src/H5FApkg.h
index 7101f0b..e7993a6 100644
--- a/src/H5FApkg.h
+++ b/src/H5FApkg.h
@@ -70,7 +70,7 @@
)
/* Size of the Fixed Array header on disk */
-#define H5FA_HEADER_SIZE(h) ( \
+#define H5FA_HEADER_SIZE(sizeof_addr, sizeof_size) ( \
/* General metadata fields */ \
H5FA_METADATA_PREFIX_SIZE(TRUE) \
\
@@ -79,10 +79,20 @@
+ 1 /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */ \
\
/* Fixed Array statistics fields */ \
- + (h)->sizeof_size /* # of elements in the fixed array */ \
+ + (sizeof_size) /* # of elements in the fixed array */ \
\
/* Fixed Array Header specific fields */ \
- + (h)->sizeof_addr /* File address of Fixed Array data block */ \
+ + (sizeof_addr) /* File address of Fixed Array data block */ \
+ )
+
+/* Size of the fixed array header on disk (via file pointer) */
+#define H5FA_HEADER_SIZE_FILE(f) ( \
+ H5FA_HEADER_SIZE(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) \
+ )
+
+/* Size of the fixed array header on disk (via fixed array header) */
+#define H5FA_HEADER_SIZE_HDR(h) ( \
+ H5FA_HEADER_SIZE((h)->sizeof_addr, (h)->sizeof_size) \
)
/* Size of the Fixed Array data block prefix on disk */
@@ -108,9 +118,9 @@
)
/* Size of the Fixed Array data block page on disk */
-#define H5FA_DBLK_PAGE_SIZE(d, nelmts) ( \
+#define H5FA_DBLK_PAGE_SIZE(h, nelmts) ( \
/* Fixed Array Data Block Page */ \
- + (nelmts * (size_t)(d)->hdr->cparam.raw_elmt_size) /* Elements in data block page */ \
+ + (nelmts * (size_t)(h)->cparam.raw_elmt_size) /* Elements in data block page */ \
+ H5FA_SIZEOF_CHKSUM /* Checksum for each page */ \
)
diff --git a/src/H5FS.c b/src/H5FS.c
index 90bbe39..42ea070 100644
--- a/src/H5FS.c
+++ b/src/H5FS.c
@@ -605,7 +605,7 @@ H5FS__new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for free space free list")
/* Set immutable free list parameters */
- fspace->nclasses = nclasses;
+ H5_CHECKED_ASSIGN(fspace->nclasses, unsigned, nclasses, size_t);
if(nclasses > 0) {
if(NULL == (fspace->sect_cls = H5FL_SEQ_MALLOC(H5FS_section_class_t, nclasses)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for free space section class array")
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 0979672..fd22977 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -881,14 +881,6 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush)
/* Push error, but keep going*/
HDONE_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "can't close property list")
- /* Only truncate the file on an orderly close, with write-access */
- if(f->closing && (H5F_ACC_RDWR & H5F_INTENT(f))) {
- /* Truncate the file to the current allocated size */
- if(H5FD_truncate(f->shared->lf, dxpl_id, (unsigned)TRUE) < 0)
- /* Push error, but keep going*/
- HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed")
- } /* end if */
-
/* Close the file */
if(H5FD_close(f->shared->lf) < 0)
/* Push error, but keep going*/
@@ -1206,6 +1198,15 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, hbool_t closing)
/* Push error, but keep going*/
HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache")
+ /* Truncate the file to the current allocated size */
+ if(H5FD_truncate(f->shared->lf, dxpl_id, closing) < 0)
+ HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed")
+
+ /* Flush the entire metadata cache again since the EOA could have changed in the truncate call. */
+ if(H5AC_flush(f, dxpl_id) < 0)
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache")
+
/* Set up I/O info for operation */
fio_info.f = f;
if(NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(dxpl_id)))
@@ -2116,3 +2117,66 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5F_get_file_image() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5F__set_base_addr
+ *
+ * Purpose: Quick and dirty routine to set the file's 'base_addr' value
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * July 19, 2013
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5F__set_base_addr(const H5F_t *f, haddr_t addr)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ HDassert(f);
+ HDassert(f->shared);
+
+ /* Dispatch to driver */
+ if(H5FD_set_base_addr(f->shared->lf, addr) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_base_addr request failed")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5F__set_base_addr() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5F__set_eoa
+ *
+ * Purpose: Quick and dirty routine to set the file's 'eoa' value
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * July 19, 2013
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5F__set_eoa(const H5F_t *f, H5F_mem_t type, haddr_t addr)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ HDassert(f);
+ HDassert(f->shared);
+
+ /* Dispatch to driver */
+ if(H5FD_set_eoa(f->shared->lf, type, addr) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_eoa request failed")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5F__set_eoa() */
+
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index b109cdf..f32690b8 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -90,34 +90,34 @@
+ 1 /* reserved */ \
+ 4 /* group leaf k, group internal k */ \
+ 4) /* consistency flags */
-#define H5F_SUPERBLOCK_VARLEN_SIZE_V0(f) \
+#define H5F_SUPERBLOCK_VARLEN_SIZE_V0(sizeof_addr, sizeof_size) \
( H5F_SUPERBLOCK_VARLEN_SIZE_COMMON /* Common variable-length info */ \
- + H5F_SIZEOF_ADDR(f) /* base address */ \
- + H5F_SIZEOF_ADDR(f) /* <unused> */ \
- + H5F_SIZEOF_ADDR(f) /* EOF address */ \
- + H5F_SIZEOF_ADDR(f) /* driver block address */ \
- + H5G_SIZEOF_ENTRY(f)) /* root group ptr */
-#define H5F_SUPERBLOCK_VARLEN_SIZE_V1(f) \
+ + (sizeof_addr) /* base address */ \
+ + (sizeof_addr) /* <unused> */ \
+ + (sizeof_addr) /* EOF address */ \
+ + (sizeof_addr) /* driver block address */ \
+ + H5G_SIZEOF_ENTRY(sizeof_addr, sizeof_size)) /* root group ptr */
+#define H5F_SUPERBLOCK_VARLEN_SIZE_V1(sizeof_addr, sizeof_size) \
( H5F_SUPERBLOCK_VARLEN_SIZE_COMMON /* Common variable-length info */ \
+ 2 /* indexed B-tree internal k */ \
+ 2 /* reserved */ \
- + H5F_SIZEOF_ADDR(f) /* base address */ \
- + H5F_SIZEOF_ADDR(f) /* <unused> */ \
- + H5F_SIZEOF_ADDR(f) /* EOF address */ \
- + H5F_SIZEOF_ADDR(f) /* driver block address */ \
- + H5G_SIZEOF_ENTRY(f)) /* root group ptr */
-#define H5F_SUPERBLOCK_VARLEN_SIZE_V2(f) \
+ + (sizeof_addr) /* base address */ \
+ + (sizeof_addr) /* <unused> */ \
+ + (sizeof_addr) /* EOF address */ \
+ + (sizeof_addr) /* driver block address */ \
+ + H5G_SIZEOF_ENTRY(sizeof_addr, sizeof_size)) /* root group ptr */
+#define H5F_SUPERBLOCK_VARLEN_SIZE_V2(sizeof_addr) \
( 2 /* size of address, size of lengths */ \
+ 1 /* consistency flags */ \
- + H5F_SIZEOF_ADDR(f) /* base address */ \
- + H5F_SIZEOF_ADDR(f) /* superblock extension address */ \
- + H5F_SIZEOF_ADDR(f) /* EOF address */ \
- + H5F_SIZEOF_ADDR(f) /* root group object header address */ \
+ + (sizeof_addr) /* base address */ \
+ + (sizeof_addr) /* superblock extension address */ \
+ + (sizeof_addr) /* EOF address */ \
+ + (sizeof_addr) /* root group object header address */ \
+ H5F_SIZEOF_CHKSUM) /* superblock checksum (keep this last) */
#define H5F_SUPERBLOCK_VARLEN_SIZE(v, f) ( \
- (v == 0 ? H5F_SUPERBLOCK_VARLEN_SIZE_V0(f) : 0) \
- + (v == 1 ? H5F_SUPERBLOCK_VARLEN_SIZE_V1(f) : 0) \
- + (v == 2 ? H5F_SUPERBLOCK_VARLEN_SIZE_V2(f) : 0))
+ (v == 0 ? H5F_SUPERBLOCK_VARLEN_SIZE_V0(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) : 0) \
+ + (v == 1 ? H5F_SUPERBLOCK_VARLEN_SIZE_V1(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) : 0) \
+ + (v == 2 ? H5F_SUPERBLOCK_VARLEN_SIZE_V2(H5F_SIZEOF_ADDR(f)) : 0))
/* Total size of superblock, depends on superblock version */
#define H5F_SUPERBLOCK_SIZE(v, f) ( H5F_SUPERBLOCK_FIXED_SIZE \
@@ -373,6 +373,10 @@ H5_DLL herr_t H5F_efc_release(H5F_efc_t *efc);
H5_DLL herr_t H5F_efc_destroy(H5F_efc_t *efc);
H5_DLL herr_t H5F_efc_try_close(H5F_t *f);
+/* Functions that get/retrieve values from VFD layer */
+H5_DLL herr_t H5F__set_eoa(const H5F_t *f, H5F_mem_t type, haddr_t addr);
+H5_DLL herr_t H5F__set_base_addr(const H5F_t *f, haddr_t addr);
+
/* Testing functions */
#ifdef H5F_TESTING
H5_DLL herr_t H5F_get_sohm_mesg_count_test(hid_t fid, unsigned type_id,
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index f52bfb2..2aed15b 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -395,13 +395,13 @@
*/
#if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T)
# define H5F_OVERFLOW_SIZET2OFFT(X) \
- ((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(off_t)-1)))
+ ((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(HDoff_t)-1)))
#else
# define H5F_OVERFLOW_SIZET2OFFT(X) 0
#endif
#if (H5_SIZEOF_HSIZE_T >= H5_SIZEOF_OFF_T)
# define H5F_OVERFLOW_HSIZET2OFFT(X) \
- ((hsize_t)(X)>=(hsize_t)((hsize_t)1<<(8*sizeof(off_t)-1)))
+ ((hsize_t)(X)>=(hsize_t)((hsize_t)1<<(8*sizeof(HDoff_t)-1)))
#else
# define H5F_OVERFLOW_HSIZET2OFFT(X) 0
#endif
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 6db631e..166247a 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -279,7 +279,7 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id)
/* Check for userblock present */
if(H5F_addr_gt(super_addr, 0)) {
/* Set the base address for the file in the VFD now */
- if(H5FD_set_base_addr(f->shared->lf, super_addr) < 0)
+ if(H5F__set_base_addr(f, super_addr) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "failed to set base address for file driver")
} /* end if */
@@ -418,13 +418,13 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id)
sblock->status_flags = 0;
/* Reserve space for the userblock */
- if(H5FD_set_eoa(f->shared->lf, H5FD_MEM_SUPER, userblock_size) < 0)
+ if(H5F__set_eoa(f, H5FD_MEM_SUPER, userblock_size) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to set EOA value for userblock")
/* Set the base address for the file in the VFD now, after allocating
* space for userblock.
*/
- if(H5FD_set_base_addr(f->shared->lf, sblock->base_addr) < 0)
+ if(H5F__set_base_addr(f, sblock->base_addr) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "failed to set base address for file driver")
/* Save a local copy of the superblock version number */
@@ -455,7 +455,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id)
superblock_size += driver_size;
/* Reserve space in the file for the superblock, instead of allocating it */
- if(H5FD_set_eoa(f->shared->lf, H5FD_MEM_SUPER, superblock_size) < 0)
+ if(H5F__set_eoa(f, H5FD_MEM_SUPER, superblock_size) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to set EOA value for superblock")
/* Insert superblock into cache, pinned */
diff --git a/src/H5Gent.c b/src/H5Gent.c
index 2cef9f7..3f243de 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -173,7 +173,7 @@ H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent)
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "unknown symbol table entry cache type")
} /* end switch */
- *pp = p_ret + H5G_SIZEOF_ENTRY(f);
+ *pp = p_ret + H5G_SIZEOF_ENTRY_FILE(f);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -240,7 +240,7 @@ done:
herr_t
H5G_ent_encode(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent)
{
- uint8_t *p_ret = *pp + H5G_SIZEOF_ENTRY(f);
+ uint8_t *p_ret = *pp + H5G_SIZEOF_ENTRY_FILE(f);
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h
index b194adb..7346b41 100644
--- a/src/H5Gpkg.h
+++ b/src/H5Gpkg.h
@@ -55,7 +55,7 @@
+ 2 /* Number of symbols */ \
\
/* Entries */ \
- + ((2 * H5F_SYM_LEAF_K(f)) * H5G_SIZEOF_ENTRY(f)) \
+ + ((2 * H5F_SYM_LEAF_K(f)) * H5G_SIZEOF_ENTRY_FILE(f)) \
)
diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h
index 1fa92d8..da2747d 100644
--- a/src/H5Gprivate.h
+++ b/src/H5Gprivate.h
@@ -47,12 +47,14 @@
* The disk size for a symbol table entry...
*/
#define H5G_SIZEOF_SCRATCH 16
-#define H5G_SIZEOF_ENTRY(F) \
- (H5F_SIZEOF_SIZE(F) + /*offset of name into heap */ \
- H5F_SIZEOF_ADDR(F) + /*address of object header */ \
+#define H5G_SIZEOF_ENTRY(sizeof_addr, sizeof_size) \
+ ((sizeof_size) + /*offset of name into heap */ \
+ (sizeof_addr) + /*address of object header */ \
4 + /*entry type */ \
4 + /*reserved */ \
H5G_SIZEOF_SCRATCH) /*scratch pad space */
+#define H5G_SIZEOF_ENTRY_FILE(F) \
+ H5G_SIZEOF_ENTRY(H5F_SIZEOF_ADDR(F), H5F_SIZEOF_SIZE(F))
/* ========= Group Creation properties ============ */
diff --git a/src/H5HFcache.c b/src/H5HFcache.c
index 9f8dfd9..07e5b36 100644
--- a/src/H5HFcache.c
+++ b/src/H5HFcache.c
@@ -262,6 +262,10 @@ H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5HF__dtable_encode() */
+/**************************************************/
+/* metadata cache callback definitions for header */
+/**************************************************/
+
/*-------------------------------------------------------------------------
* Function: H5HF_cache_hdr_load
@@ -379,8 +383,8 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
/* Compute the size of the extra filter information */
filter_info_size = (size_t)(hdr->sizeof_size /* Size of size for filtered root direct block */
- + (unsigned)4 /* Size of filter mask for filtered root direct block */
- + hdr->filter_len); /* Size of encoded I/O filter info */
+ + (unsigned)4 /* Size of filter mask for filtered root direct block */
+ + hdr->filter_len); /* Size of encoded I/O filter info */
/* Compute the heap header's size */
hdr->heap_size = size + filter_info_size;
@@ -724,6 +728,10 @@ H5HF_cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5HF_hdr_t *hdr, size_t
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5HF_cache_hdr_size() */
+/***********************************************************/
+/* metadata cache callback definitions for indirect blocks */
+/***********************************************************/
+
/*-------------------------------------------------------------------------
* Function: H5HF_cache_iblock_load
@@ -1366,6 +1374,10 @@ H5HF_cache_iblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5HF_indirect_t *ibl
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5HF_cache_iblock_size() */
+/*********************************************************/
+/* metadata cache callback definitions for direct blocks */
+/*********************************************************/
+
/*-------------------------------------------------------------------------
* Function: H5HF_cache_dblock_load
diff --git a/src/H5HGcache.c b/src/H5HGcache.c
index f1b5fc6..aac73ed 100644
--- a/src/H5HGcache.c
+++ b/src/H5HGcache.c
@@ -129,10 +129,10 @@ H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)
/* Read the initial 4k page */
if(NULL == (heap = H5FL_CALLOC(H5HG_heap_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
heap->shared = H5F_SHARED(f);
if(NULL == (heap->chunk = H5FL_BLK_MALLOC(gheap_chunk, (size_t)H5HG_MINSIZE)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
if(H5F_block_read(f, H5FD_MEM_GHEAP, addr, (size_t)H5HG_MINSIZE, dxpl_id, heap->chunk) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read global heap collection")
p = heap->chunk;
@@ -260,7 +260,7 @@ H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)
done:
if(!ret_value && heap)
if(H5HG_free(heap) < 0)
- HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy global heap collection")
+ HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy global heap collection")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5HG_load() */
@@ -367,11 +367,11 @@ done:
static herr_t
H5HG_clear(H5F_t *f, H5HG_heap_t *heap, hbool_t destroy)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
- /* Check arguments */
+ /* Sanity checks */
HDassert(heap);
/* Mark heap as clean */
diff --git a/src/H5MF.c b/src/H5MF.c
index eecd724..0c98654 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -565,7 +565,7 @@ HDfprintf(stderr, "%s: size = %Hu\n", FUNC, size);
HDassert(size > 0);
/* Retrieve the 'eoa' for the file */
- if(HADDR_UNDEF == (eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT)))
+ if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, HADDR_UNDEF, "driver get_eoa request failed")
/* Compute value to return */
@@ -598,7 +598,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr,
+H5MF_xfree(const H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr,
hsize_t size)
{
H5F_io_info_t fio_info; /* I/O info for operation */
@@ -862,7 +862,7 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si
HDassert(f->shared->lf);
/* Retrieve the 'eoa' for the file */
- if(HADDR_UNDEF == (eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT)))
+ if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
/* Retrieve metadata aggregator info, if available */
diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c
index d6fc5ce..3a664ef 100644
--- a/src/H5MFdbg.c
+++ b/src/H5MFdbg.c
@@ -238,7 +238,7 @@ HDfprintf(stderr, "%s: Dumping file free space sections\n", FUNC);
HDassert(stream);
/* Retrieve the 'eoa' for the file */
- if(HADDR_UNDEF == (eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT)))
+ if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
#ifdef H5MF_ALLOC_DEBUG
HDfprintf(stderr, "%s: for type = H5FD_MEM_DEFAULT, eoa = %a\n", FUNC, eoa);
@@ -265,7 +265,7 @@ HDfprintf(stderr, "%s: sda_addr = %a, sda_size = %Hu, end of sda = %a\n", FUNC,
if(H5FD_MEM_DEFAULT == f->shared->fs_type_map[type] ||
type == f->shared->fs_type_map[type]) {
/* Retrieve the 'eoa' for this file memory type */
- if(HADDR_UNDEF == (eoa = H5FD_get_eoa(f->shared->lf, type)))
+ if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, type)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3),
"eoa:",
diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h
index ad5e385..024cc91 100644
--- a/src/H5MFprivate.h
+++ b/src/H5MFprivate.h
@@ -67,7 +67,7 @@ H5_DLL herr_t H5MF_close(H5F_t *f, hid_t dxpl_id);
/* File space allocation routines */
H5_DLL haddr_t H5MF_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
H5_DLL haddr_t H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
-H5_DLL herr_t H5MF_xfree(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
+H5_DLL herr_t H5MF_xfree(const H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
hsize_t size);
H5_DLL herr_t H5MF_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type,
haddr_t addr, hsize_t size, hsize_t extra_requested);
diff --git a/src/H5MFsection.c b/src/H5MFsection.c
index bc147ed..20b9984 100644
--- a/src/H5MFsection.c
+++ b/src/H5MFsection.c
@@ -310,7 +310,7 @@ H5MF_sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
HDassert(udata->f);
/* Retrieve the end of the file's address space */
- if(HADDR_UNDEF == (eoa = H5FD_get_eoa(udata->f->shared->lf, udata->alloc_type)))
+ if(HADDR_UNDEF == (eoa = H5F_get_eoa(udata->f, udata->alloc_type)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
/* Compute address of end of section to check */
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index 46cad79..b271581 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -35,6 +35,7 @@
#include "H5Spublic.h" /* Dataspace functions */
/* Private headers needed by this file */
+#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata cache */
#include "H5Fprivate.h" /* File access */
#include "H5SLprivate.h" /* Skip lists */
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index f19f1ba..d31dd94 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -2938,8 +2938,8 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size)
H5_ENCODE_DOUBLE(*pp, config->empty_reserve);
- /* int */
- INT32ENCODE(*pp, (int32_t)config->dirty_bytes_threshold);
+ /* unsigned */
+ UINT32ENCODE(*pp, (uint32_t)config->dirty_bytes_threshold);
/* int */
INT32ENCODE(*pp, (int32_t)config->metadata_write_strategy);
@@ -3090,8 +3090,8 @@ H5P__facc_cache_config_dec(const void **_pp, void *_value)
H5_DECODE_DOUBLE(*pp, config->empty_reserve);
- /* int */
- INT32DECODE(*pp, config->dirty_bytes_threshold);
+ /* unsigned */
+ UINT32DECODE(*pp, config->dirty_bytes_threshold);
/* int */
INT32DECODE(*pp, config->metadata_write_strategy);
diff --git a/src/H5SMcache.c b/src/H5SMcache.c
index 98b5213..eaeb889 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -130,13 +130,13 @@ static H5SM_master_table_t *
H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void H5_ATTR_UNUSED *udata)
{
H5SM_master_table_t *table = NULL;
- H5WB_t *wb = NULL; /* Wrapped buffer for table data */
+ H5WB_t *wb = NULL; /* Wrapped buffer for table data */
uint8_t tbl_buf[H5SM_TBL_BUF_SIZE]; /* Buffer for table */
- uint8_t *buf; /* Reading buffer */
- const uint8_t *p; /* Pointer into input buffer */
- uint32_t stored_chksum; /* Stored metadata checksum value */
- uint32_t computed_chksum; /* Computed metadata checksum value */
- size_t x; /* Counter variable for index headers */
+ uint8_t *buf; /* Reading buffer */
+ const uint8_t *p; /* Pointer into input buffer */
+ uint32_t stored_chksum; /* Stored metadata checksum value */
+ uint32_t computed_chksum; /* Computed metadata checksum value */
+ size_t u; /* Counter variable for index headers */
H5SM_master_table_t *ret_value;
FUNC_ENTER_NOAPI_NOINIT
@@ -187,37 +187,37 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void H5_ATTR_UNUSED *udat
HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "memory allocation failed for SOHM indexes")
/* Read in the index headers */
- for(x = 0; x < table->num_indexes; ++x) {
+ for(u = 0; u < table->num_indexes; ++u) {
/* Verify correct version of index list */
if(H5SM_LIST_VERSION != *p++)
HGOTO_ERROR(H5E_SOHM, H5E_VERSION, NULL, "bad shared message list version number")
/* Type of the index (list or B-tree) */
- table->indexes[x].index_type= (H5SM_index_type_t)*p++;
+ table->indexes[u].index_type= (H5SM_index_type_t)*p++;
/* Type of messages in the index */
- UINT16DECODE(p, table->indexes[x].mesg_types);
+ UINT16DECODE(p, table->indexes[u].mesg_types);
/* Minimum size of message to share */
- UINT32DECODE(p, table->indexes[x].min_mesg_size);
+ UINT32DECODE(p, table->indexes[u].min_mesg_size);
/* List cutoff; fewer than this number and index becomes a list */
- UINT16DECODE(p, table->indexes[x].list_max);
+ UINT16DECODE(p, table->indexes[u].list_max);
/* B-tree cutoff; more than this number and index becomes a B-tree */
- UINT16DECODE(p, table->indexes[x].btree_min);
+ UINT16DECODE(p, table->indexes[u].btree_min);
/* Number of messages shared */
- UINT16DECODE(p, table->indexes[x].num_messages);
+ UINT16DECODE(p, table->indexes[u].num_messages);
/* Address of the actual index */
- H5F_addr_decode(f, &p, &(table->indexes[x].index_addr));
+ H5F_addr_decode(f, &p, &(table->indexes[u].index_addr));
/* Address of the index's heap */
- H5F_addr_decode(f, &p, &(table->indexes[x].heap_addr));
+ H5F_addr_decode(f, &p, &(table->indexes[u].heap_addr));
/* Compute the size of a list index for this SOHM index */
- table->indexes[x].list_size = H5SM_LIST_SIZE(f, table->indexes[x].list_max);
+ table->indexes[u].list_size = H5SM_LIST_SIZE(f, table->indexes[u].list_max);
} /* end for */
/* Read in checksum */
@@ -279,7 +279,7 @@ H5SM_table_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma
uint8_t *buf; /* Temporary buffer */
uint8_t *p; /* Pointer into raw data buffer */
uint32_t computed_chksum; /* Computed metadata checksum value */
- size_t x; /* Counter variable */
+ size_t u; /* Counter variable */
/* Verify that we're writing version 0 of the table; this is the only
* version defined so far.
@@ -302,33 +302,33 @@ H5SM_table_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma
p += H5_SIZEOF_MAGIC;
/* Encode each index header */
- for(x = 0; x < table->num_indexes; ++x) {
- /* Version for this list. */
+ for(u = 0; u < table->num_indexes; ++u) {
+ /* Version for this list */
*p++ = H5SM_LIST_VERSION;
/* Is message index a list or a B-tree? */
- *p++ = table->indexes[x].index_type;
+ *p++ = table->indexes[u].index_type;
/* Type of messages in the index */
- UINT16ENCODE(p, table->indexes[x].mesg_types);
+ UINT16ENCODE(p, table->indexes[u].mesg_types);
/* Minimum size of message to share */
- UINT32ENCODE(p, table->indexes[x].min_mesg_size);
+ UINT32ENCODE(p, table->indexes[u].min_mesg_size);
/* List cutoff; fewer than this number and index becomes a list */
- UINT16ENCODE(p, table->indexes[x].list_max);
+ UINT16ENCODE(p, table->indexes[u].list_max);
/* B-tree cutoff; more than this number and index becomes a B-tree */
- UINT16ENCODE(p, table->indexes[x].btree_min);
+ UINT16ENCODE(p, table->indexes[u].btree_min);
/* Number of messages shared */
- UINT16ENCODE(p, table->indexes[x].num_messages);
+ UINT16ENCODE(p, table->indexes[u].num_messages);
/* Address of the actual index */
- H5F_addr_encode(f, &p, table->indexes[x].index_addr);
+ H5F_addr_encode(f, &p, table->indexes[u].index_addr);
/* Address of the index's heap */
- H5F_addr_encode(f, &p, table->indexes[x].heap_addr);
+ H5F_addr_encode(f, &p, table->indexes[u].heap_addr);
} /* end for */
/* Compute checksum on buffer */
@@ -477,7 +477,7 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
uint8_t *p; /* Pointer into input buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
- size_t x; /* Counter variable for messages in list */
+ size_t u; /* Counter variable for messages in list */
H5SM_list_t *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -517,8 +517,8 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
/* Read messages into the list array */
ctx.sizeof_addr = H5F_SIZEOF_ADDR(udata->f);
- for(x = 0; x < udata->header->num_messages; x++) {
- if(H5SM_message_decode(p, &(list->messages[x]), &ctx) < 0)
+ for(u = 0; u < udata->header->num_messages; u++) {
+ if(H5SM_message_decode(p, &(list->messages[u]), &ctx) < 0)
HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, NULL, "can't decode shared message")
p += H5SM_SOHM_ENTRY_SIZE(udata->f);
} /* end for */
@@ -537,8 +537,8 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, NULL, "incorrect metadata checksum for shared message list")
/* Initialize the rest of the array */
- for(x = udata->header->num_messages; x < udata->header->list_max; x++)
- list->messages[x].location = H5SM_NO_LOC;
+ for(u = udata->header->num_messages; u < udata->header->list_max; u++)
+ list->messages[u].location = H5SM_NO_LOC;
/* Set return value */
ret_value = list;
@@ -590,7 +590,7 @@ H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_lis
uint8_t *p; /* Pointer into raw data buffer */
uint32_t computed_chksum; /* Computed metadata checksum value */
size_t mesgs_written; /* Number of messages written to list */
- size_t x; /* Local index variable */
+ size_t u; /* Local index variable */
/* Wrap the local buffer for serialized list index info */
if(NULL == (wb = H5WB_wrap(lst_buf, sizeof(lst_buf))))
@@ -610,9 +610,9 @@ H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_lis
/* Write messages from the messages array to disk */
mesgs_written = 0;
ctx.sizeof_addr = H5F_SIZEOF_ADDR(f);
- for(x = 0; x < list->header->list_max && mesgs_written < list->header->num_messages; x++) {
- if(list->messages[x].location != H5SM_NO_LOC) {
- if(H5SM_message_encode(p, &(list->messages[x]), &ctx) < 0)
+ for(u = 0; u < list->header->list_max && mesgs_written < list->header->num_messages; u++) {
+ if(list->messages[u].location != H5SM_NO_LOC) {
+ if(H5SM_message_encode(p, &(list->messages[u]), &ctx) < 0)
HGOTO_ERROR(H5E_SOHM, H5E_CANTFLUSH, FAIL, "unable to write shared message to disk")
p += H5SM_SOHM_ENTRY_SIZE(f);
diff --git a/src/H5public.h b/src/H5public.h
index bf6c6de..e625367 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -94,10 +94,10 @@ extern "C" {
/* Version numbers */
#define H5_VERS_MAJOR 1 /* For major interface/format changes */
#define H5_VERS_MINOR 9 /* For minor interface/format changes */
-#define H5_VERS_RELEASE 221 /* For tweaks, bug-fixes, or development */
+#define H5_VERS_RELEASE 222 /* For tweaks, bug-fixes, or development */
#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */
/* Empty string for real releases. */
-#define H5_VERS_INFO "HDF5 library version: 1.9.221" /* Full version string */
+#define H5_VERS_INFO "HDF5 library version: 1.9.222" /* Full version string */
#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \
H5_VERS_RELEASE)
diff --git a/src/Makefile.in b/src/Makefile.in
index 2e058a4..ce97214 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -724,7 +724,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
# After making changes, run bin/reconfigure to update other configure related
# files like Makefile.in.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 211
+LT_VERS_REVISION = 212
LT_VERS_AGE = 0
# Our main target, the HDF5 library
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index 92e4574..c7803f6 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -204,7 +204,7 @@ endif (HDF5_TEST_VFD)
add_test (
NAME H5TEST-clear-testhdf5-objects
COMMAND ${CMAKE_COMMAND}
- -E remove
+ -E remove
coord.h5
dtypes10.h5
sys_file1
@@ -259,7 +259,7 @@ else (HDF5_ENABLE_USING_MEMCHECKER)
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
endif (HDF5_ENABLE_USING_MEMCHECKER)
-
+
##############################################################################
##############################################################################
### T H E T E S T S M A C R O S ###
@@ -270,7 +270,7 @@ endif (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5TEST-clear-objects
COMMAND ${CMAKE_COMMAND}
- -E remove
+ -E remove
dt_arith1.h5
dt_arith2.h5
dtransform.h5
@@ -335,9 +335,16 @@ add_test (
)
foreach (test ${H5_TESTS})
- add_test (NAME H5TEST-${test} COMMAND $<TARGET_FILE:${test}>)
+ if (${test} STREQUAL "big" AND CYGWIN)
+ add_test (
+ NAME H5TEST-${test}
+ COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}"
+ )
+ else (${test} STREQUAL "big" AND CYGWIN)
+ add_test (NAME H5TEST-${test} COMMAND $<TARGET_FILE:${test}>)
+ endif (${test} STREQUAL "big" AND CYGWIN)
set_tests_properties (H5TEST-${test} PROPERTIES
- DEPENDS H5TEST-clear-objects
+ DEPENDS H5TEST-clear-objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
@@ -358,7 +365,7 @@ set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800)
add_test (
NAME H5TEST-clear-cache-objects
COMMAND ${CMAKE_COMMAND}
- -E remove
+ -E remove
cache_test.h5
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
@@ -374,14 +381,14 @@ set_tests_properties (H5TEST-cache PROPERTIES
add_test (
NAME H5TEST-clear-cache_api-objects
COMMAND ${CMAKE_COMMAND}
- -E remove
+ -E remove
cache_api_test.h5
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
add_test (NAME H5TEST-cache_api COMMAND $<TARGET_FILE:cache_api>)
set_tests_properties (H5TEST-cache_api PROPERTIES
- DEPENDS H5TEST-clear-cache_api-objects
+ DEPENDS H5TEST-clear-cache_api-objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
@@ -390,7 +397,7 @@ set_tests_properties (H5TEST-cache_api PROPERTIES
add_test (
NAME H5TEST-clear-cache_tagging-objects
COMMAND ${CMAKE_COMMAND}
- -E remove
+ -E remove
tagging_test.h5
tagging_ext_test.h5
WORKING_DIRECTORY
@@ -407,7 +414,7 @@ set_tests_properties (H5TEST-cache_tagging PROPERTIES
add_test (
NAME H5TEST-clear-ttsafe-objects
COMMAND ${CMAKE_COMMAND}
- -E remove
+ -E remove
ttsafe_error.h5
ttsafe_dcreate.h5
ttsafe_cancel.h5
@@ -427,7 +434,7 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS)
add_test (
NAME H5TEST-clear-err_compat-objects
COMMAND ${CMAKE_COMMAND}
- -E remove
+ -E remove
err_compat.txt
err_compat.txt.err
WORKING_DIRECTORY
@@ -454,7 +461,7 @@ endif (HDF5_ENABLE_DEPRECATED_SYMBOLS)
add_test (
NAME H5TEST-clear-error_test-objects
COMMAND ${CMAKE_COMMAND}
- -E remove
+ -E remove
error_test.txt
error_test.txt.err
WORKING_DIRECTORY
@@ -470,7 +477,7 @@ add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
-set_tests_properties (H5TEST-error_test PROPERTIES
+set_tests_properties (H5TEST-error_test PROPERTIES
DEPENDS H5TEST-clear-error_test-objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
@@ -482,7 +489,7 @@ add_test (
COMMAND ${CMAKE_COMMAND}
-E remove
links_env.txt
- links_env.txt.err
+ links_env.txt.err
extlinks_env0.h5
extlinks_env1.h5
tmp/extlinks_env1.h5
@@ -610,7 +617,7 @@ if (HDF5_TEST_VFD)
if (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split")
if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug)
add_test (
- NAME VFD-${vfdname}-${vfdtest}
+ NAME VFD-${vfdname}-${vfdtest}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>"
-D "TEST_ARGS:STRING="
@@ -632,7 +639,7 @@ if (HDF5_TEST_VFD)
endif(NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug)
else (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split")
add_test (
- NAME VFD-${vfdname}-${vfdtest}
+ NAME VFD-${vfdname}-${vfdtest}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>"
-D "TEST_ARGS:STRING="
@@ -649,7 +656,7 @@ if (HDF5_TEST_VFD)
endif (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split")
else (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2")
add_test (
- NAME VFD-${vfdname}-${vfdtest}
+ NAME VFD-${vfdname}-${vfdtest}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>"
-D "TEST_ARGS:STRING="
@@ -672,7 +679,7 @@ if (HDF5_TEST_VFD)
CHECK_VFD_TEST (${test} ${vfdname} ${resultcode})
else (WIN32)
add_test (
- NAME VFD-${vfdname}-${test}
+ NAME VFD-${vfdname}-${test}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:${test}>"
-D "TEST_ARGS:STRING="
@@ -693,7 +700,7 @@ if (HDF5_TEST_VFD)
set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10)
if (HDF5_TEST_FHEAP_VFD)
add_test (
- NAME VFD-${vfdname}-fheap
+ NAME VFD-${vfdname}-fheap
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:fheap>"
-D "TEST_ARGS:STRING="
@@ -710,7 +717,7 @@ if (HDF5_TEST_VFD)
)
endif (HDF5_TEST_FHEAP_VFD)
ENDMACRO (ADD_VFD_TEST)
-
+
# Run test with different Virtual File Driver
foreach (vfd ${VFD_LIST})
ADD_VFD_TEST (${vfd} 0)
diff --git a/test/cache.c b/test/cache.c
index 8d6076a..85fbadb 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -235,7 +235,6 @@ static unsigned check_notify_cb(void);
static unsigned
smoke_check_1(void)
{
- const char * fcn_name = "smoke_check_1";
hbool_t show_progress = FALSE;
int dirty_unprotects = FALSE;
int dirty_destroys = FALSE;
@@ -256,22 +255,22 @@ smoke_check_1(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
reset_entries();
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(4 * 1024 * 1024),
(size_t)(2 * 1024 * 1024));
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- row_major_scan_forward(/* file_ptr */ file_ptr,
+ row_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -287,9 +286,9 @@ smoke_check_1(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- row_major_scan_backward(/* file_ptr */ file_ptr,
+ row_major_scan_backward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -305,9 +304,9 @@ smoke_check_1(void)
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- row_major_scan_forward(/* file_ptr */ file_ptr,
+ row_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -323,7 +322,7 @@ smoke_check_1(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -334,9 +333,9 @@ smoke_check_1(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- col_major_scan_forward(/* file_ptr */ file_ptr,
+ col_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -347,7 +346,7 @@ smoke_check_1(void)
if ( show_progress ) /* 8 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -358,9 +357,9 @@ smoke_check_1(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- col_major_scan_backward(/* file_ptr */ file_ptr,
+ col_major_scan_backward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -371,13 +370,13 @@ smoke_check_1(void)
if ( show_progress ) /* 10 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -387,7 +386,7 @@ smoke_check_1(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -420,7 +419,6 @@ smoke_check_1(void)
static unsigned
smoke_check_2(void)
{
- const char * fcn_name = "smoke_check_2";
hbool_t show_progress = FALSE;
int dirty_unprotects = TRUE;
int dirty_destroys = TRUE;
@@ -441,22 +439,22 @@ smoke_check_2(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
reset_entries();
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(4 * 1024 * 1024),
(size_t)(2 * 1024 * 1024));
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- row_major_scan_forward(/* file_ptr */ file_ptr,
+ row_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -472,9 +470,9 @@ smoke_check_2(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- row_major_scan_backward(/* file_ptr */ file_ptr,
+ row_major_scan_backward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -490,9 +488,9 @@ smoke_check_2(void)
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- row_major_scan_forward(/* file_ptr */ file_ptr,
+ row_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -508,7 +506,7 @@ smoke_check_2(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -519,9 +517,9 @@ smoke_check_2(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- col_major_scan_forward(/* file_ptr */ file_ptr,
+ col_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -532,7 +530,7 @@ smoke_check_2(void)
if ( show_progress ) /* 8 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -543,9 +541,9 @@ smoke_check_2(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- col_major_scan_backward(/* file_ptr */ file_ptr,
+ col_major_scan_backward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -556,13 +554,13 @@ smoke_check_2(void)
if ( show_progress ) /* 10 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -572,7 +570,7 @@ smoke_check_2(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -604,7 +602,6 @@ smoke_check_2(void)
static unsigned
smoke_check_3(void)
{
- const char * fcn_name = "smoke_check_3";
hbool_t show_progress = FALSE;
int dirty_unprotects = FALSE;
int dirty_destroys = FALSE;
@@ -625,22 +622,22 @@ smoke_check_3(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
reset_entries();
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(2 * 1024),
(size_t)(1 * 1024));
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- row_major_scan_forward(/* file_ptr */ file_ptr,
+ row_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -656,7 +653,7 @@ smoke_check_3(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
row_major_scan_backward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -674,7 +671,7 @@ smoke_check_3(void)
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -692,7 +689,7 @@ smoke_check_3(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -703,7 +700,7 @@ smoke_check_3(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -716,7 +713,7 @@ smoke_check_3(void)
if ( show_progress ) /* 8 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -727,7 +724,7 @@ smoke_check_3(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -740,13 +737,13 @@ smoke_check_3(void)
if ( show_progress ) /* 10 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -756,7 +753,7 @@ smoke_check_3(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -789,7 +786,6 @@ smoke_check_3(void)
static unsigned
smoke_check_4(void)
{
- const char * fcn_name = "smoke_check_4";
hbool_t show_progress = FALSE;
int dirty_unprotects = TRUE;
int dirty_destroys = TRUE;
@@ -810,22 +806,22 @@ smoke_check_4(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
reset_entries();
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(2 * 1024),
(size_t)(1 * 1024));
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- row_major_scan_forward(/* file_ptr */ file_ptr,
+ row_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -841,9 +837,9 @@ smoke_check_4(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- row_major_scan_backward(/* file_ptr */ file_ptr,
+ row_major_scan_backward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -859,9 +855,9 @@ smoke_check_4(void)
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- row_major_scan_forward(/* file_ptr */ file_ptr,
+ row_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -877,7 +873,7 @@ smoke_check_4(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -888,9 +884,9 @@ smoke_check_4(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- col_major_scan_forward(/* file_ptr */ file_ptr,
+ col_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -901,7 +897,7 @@ smoke_check_4(void)
if ( show_progress ) /* 8 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -912,9 +908,9 @@ smoke_check_4(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
- col_major_scan_backward(/* file_ptr */ file_ptr,
+ col_major_scan_backward(/* file_ptr */ file_ptr,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -925,13 +921,13 @@ smoke_check_4(void)
if ( show_progress ) /* 10 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -941,7 +937,7 @@ smoke_check_4(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -974,7 +970,6 @@ smoke_check_4(void)
static unsigned
smoke_check_5(void)
{
- const char * fcn_name = "smoke_check_5";
herr_t result;
hbool_t show_progress = FALSE;
int dirty_unprotects = FALSE;
@@ -1052,13 +1047,13 @@ smoke_check_5(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
reset_entries();
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(2 * 1024),
(size_t)(1 * 1024));
@@ -1077,7 +1072,7 @@ smoke_check_5(void)
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1089,7 +1084,7 @@ smoke_check_5(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_row_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1101,7 +1096,7 @@ smoke_check_5(void)
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1113,7 +1108,7 @@ smoke_check_5(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -1124,7 +1119,7 @@ smoke_check_5(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1137,7 +1132,7 @@ smoke_check_5(void)
if ( show_progress ) /* 8 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -1148,7 +1143,7 @@ smoke_check_5(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_col_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1161,13 +1156,13 @@ smoke_check_5(void)
if ( show_progress ) /* 10 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -1177,7 +1172,7 @@ smoke_check_5(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -1210,7 +1205,6 @@ smoke_check_5(void)
static unsigned
smoke_check_6(void)
{
- const char * fcn_name = "smoke_check_6";
herr_t result;
hbool_t show_progress = FALSE;
int dirty_unprotects = FALSE;
@@ -1285,13 +1279,13 @@ smoke_check_6(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
reset_entries();
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(2 * 1024),
(size_t)(1 * 1024));
@@ -1310,7 +1304,7 @@ smoke_check_6(void)
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1322,7 +1316,7 @@ smoke_check_6(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_row_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1334,7 +1328,7 @@ smoke_check_6(void)
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1346,7 +1340,7 @@ smoke_check_6(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -1357,7 +1351,7 @@ smoke_check_6(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1370,7 +1364,7 @@ smoke_check_6(void)
if ( show_progress ) /* 8 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -1381,7 +1375,7 @@ smoke_check_6(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_col_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1394,13 +1388,13 @@ smoke_check_6(void)
if ( show_progress ) /* 10 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -1410,7 +1404,7 @@ smoke_check_6(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -1443,7 +1437,6 @@ smoke_check_6(void)
static unsigned
smoke_check_7(void)
{
- const char * fcn_name = "smoke_check_7";
herr_t result;
hbool_t show_progress = FALSE;
int dirty_unprotects = FALSE;
@@ -1519,13 +1512,13 @@ smoke_check_7(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
reset_entries();
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(2 * 1024),
(size_t)(1 * 1024));
@@ -1544,7 +1537,7 @@ smoke_check_7(void)
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1556,7 +1549,7 @@ smoke_check_7(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_row_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1568,7 +1561,7 @@ smoke_check_7(void)
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1580,7 +1573,7 @@ smoke_check_7(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -1591,7 +1584,7 @@ smoke_check_7(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1604,7 +1597,7 @@ smoke_check_7(void)
if ( show_progress ) /* 8 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -1615,7 +1608,7 @@ smoke_check_7(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_col_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1628,13 +1621,13 @@ smoke_check_7(void)
if ( show_progress ) /* 10 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -1644,7 +1637,7 @@ smoke_check_7(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -1677,7 +1670,6 @@ smoke_check_7(void)
static unsigned
smoke_check_8(void)
{
- const char * fcn_name = "smoke_check_8";
herr_t result;
hbool_t show_progress = FALSE;
int dirty_unprotects = FALSE;
@@ -1753,13 +1745,13 @@ smoke_check_8(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
reset_entries();
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024));
cache_ptr = file_ptr->shared->cache;
@@ -1777,7 +1769,7 @@ smoke_check_8(void)
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1789,7 +1781,7 @@ smoke_check_8(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_row_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1801,7 +1793,7 @@ smoke_check_8(void)
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1813,7 +1805,7 @@ smoke_check_8(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -1824,7 +1816,7 @@ smoke_check_8(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1837,7 +1829,7 @@ smoke_check_8(void)
if ( show_progress ) /* 8 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -1848,7 +1840,7 @@ smoke_check_8(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
hl_col_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1861,13 +1853,13 @@ smoke_check_8(void)
if ( show_progress ) /* 10 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -1877,7 +1869,7 @@ smoke_check_8(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -1911,7 +1903,6 @@ smoke_check_8(void)
static unsigned
smoke_check_9(void)
{
- const char * fcn_name = "smoke_check_9";
herr_t result;
hbool_t show_progress = FALSE;
int dirty_unprotects = FALSE;
@@ -1935,13 +1926,13 @@ smoke_check_9(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
reset_entries();
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(4 * 1024 * 1024),
(size_t)(2 * 1024 * 1024));
@@ -1951,7 +1942,7 @@ smoke_check_9(void)
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -1966,7 +1957,7 @@ smoke_check_9(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -1986,7 +1977,7 @@ smoke_check_9(void)
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2001,7 +1992,7 @@ smoke_check_9(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
row_major_scan_backward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -2019,7 +2010,7 @@ smoke_check_9(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2034,7 +2025,7 @@ smoke_check_9(void)
if ( show_progress ) /* 8 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled \n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -2052,7 +2043,7 @@ smoke_check_9(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2067,7 +2058,7 @@ smoke_check_9(void)
if ( show_progress ) /* 10 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -2078,7 +2069,7 @@ smoke_check_9(void)
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2093,7 +2084,7 @@ smoke_check_9(void)
if ( show_progress ) /* 12 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -2106,7 +2097,7 @@ smoke_check_9(void)
if ( show_progress ) /* 13 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -2117,7 +2108,7 @@ smoke_check_9(void)
if ( show_progress ) /* 14 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2132,7 +2123,7 @@ smoke_check_9(void)
if ( show_progress ) /* 15 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -2145,7 +2136,7 @@ smoke_check_9(void)
if ( show_progress ) /* 16 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2161,13 +2152,13 @@ smoke_check_9(void)
if ( show_progress ) /* 17 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if ( show_progress ) /* 18 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -2177,7 +2168,7 @@ smoke_check_9(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -2211,7 +2202,6 @@ smoke_check_9(void)
static unsigned
smoke_check_10(void)
{
- const char * fcn_name = "smoke_check_10";
herr_t result;
hbool_t show_progress = FALSE;
int dirty_unprotects = TRUE;
@@ -2235,13 +2225,13 @@ smoke_check_10(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
reset_entries();
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(4 * 1024 * 1024),
(size_t)(2 * 1024 * 1024));
@@ -2249,7 +2239,7 @@ smoke_check_10(void)
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -2267,7 +2257,7 @@ smoke_check_10(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2282,7 +2272,7 @@ smoke_check_10(void)
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
row_major_scan_backward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -2300,7 +2290,7 @@ smoke_check_10(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2315,7 +2305,7 @@ smoke_check_10(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -2333,7 +2323,7 @@ smoke_check_10(void)
if ( show_progress ) /* 8 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2348,7 +2338,7 @@ smoke_check_10(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -2359,7 +2349,7 @@ smoke_check_10(void)
if ( show_progress ) /* 10 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2374,7 +2364,7 @@ smoke_check_10(void)
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -2387,7 +2377,7 @@ smoke_check_10(void)
if ( show_progress ) /* 12 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2402,7 +2392,7 @@ smoke_check_10(void)
if ( show_progress ) /* 13 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -2413,7 +2403,7 @@ smoke_check_10(void)
if ( show_progress ) /* 14 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2428,7 +2418,7 @@ smoke_check_10(void)
if ( show_progress ) /* 15 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -2441,7 +2431,7 @@ smoke_check_10(void)
if ( show_progress ) /* 16 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2456,13 +2446,13 @@ smoke_check_10(void)
if ( show_progress ) /* 17 */
HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if ( show_progress ) /* 18 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -2472,7 +2462,7 @@ smoke_check_10(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -2498,14 +2488,12 @@ smoke_check_10(void)
*
*-------------------------------------------------------------------------
*/
-
static unsigned
write_permitted_check(void)
{
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
- const char * fcn_name = "write_permitted_check";
hbool_t show_progress = FALSE;
hbool_t display_stats = FALSE;
int32_t lag = 10;
@@ -2522,20 +2510,20 @@ write_permitted_check(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
reset_entries();
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(1 * 1024 * 1024),
(size_t)(0));
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -2553,7 +2541,7 @@ write_permitted_check(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
write_permitted = FALSE;
@@ -2573,7 +2561,7 @@ write_permitted_check(void)
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
write_permitted = TRUE;
@@ -2593,7 +2581,7 @@ write_permitted_check(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -2604,7 +2592,7 @@ write_permitted_check(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
/* lag */ lag,
@@ -2617,7 +2605,7 @@ write_permitted_check(void)
if ( show_progress ) /* 8 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
write_permitted = FALSE;
@@ -2634,13 +2622,13 @@ write_permitted_check(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if ( show_progress ) /* 10 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -2650,7 +2638,7 @@ write_permitted_check(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
@@ -2690,7 +2678,6 @@ write_permitted_check(void)
static unsigned
check_insert_entry(void)
{
- const char * fcn_name = "check_insert_entry";
int entry_type = PICO_ENTRY_TYPE;
int i;
herr_t result;
@@ -2956,7 +2943,7 @@ check_insert_entry(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -2983,7 +2970,6 @@ check_insert_entry(void)
static unsigned
check_flush_cache(void)
{
- const char * fcn_name = "check_flush_cache";
H5F_t * file_ptr = NULL;
TESTING("H5C_flush_cache() functionality");
@@ -3041,7 +3027,7 @@ check_flush_cache(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -3068,7 +3054,6 @@ check_flush_cache(void)
static void
check_flush_cache__empty_cache(H5F_t * file_ptr)
{
- /* const char * fcn_name = "check_flush_cache__empty_cache"; */
H5C_t * cache_ptr = file_ptr->shared->cache;
herr_t result;
@@ -3163,7 +3148,6 @@ check_flush_cache__empty_cache(H5F_t * file_ptr)
static void
check_flush_cache__multi_entry(H5F_t * file_ptr)
{
- /* const char * fcn_name = "check_flush_cache__multi_entry"; */
H5C_t *cache_ptr = file_ptr->shared->cache;
if ( cache_ptr == NULL ) {
@@ -4830,7 +4814,6 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr,
int spec_size,
struct flush_cache_test_spec spec[])
{
- /* const char * fcn_name = "check_flush_cache__multi_entry_test"; */
H5C_t * cache_ptr = file_ptr->shared->cache;
static char msg[128];
herr_t result;
@@ -5055,7 +5038,6 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr,
int spec_size,
struct pe_flush_cache_test_spec spec[])
{
- /* const char * fcn_name = "check_flush_cache__pe_multi_entry_test"; */
H5C_t *cache_ptr = file_ptr->shared->cache;
static char msg[128];
herr_t result;
@@ -5295,7 +5277,6 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr,
static void
check_flush_cache__flush_ops(H5F_t * file_ptr)
{
- /* const char * fcn_name = "check_flush_cache__flush_ops"; */
H5C_t *cache_ptr = file_ptr->shared->cache;
if ( cache_ptr == NULL ) {
@@ -9611,7 +9592,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
static void
check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
{
- /* const char * fcn_name = "check_flush_cache__flush_op_eviction_test"; */
H5C_t * cache_ptr = file_ptr->shared->cache;
int i;
int num_variable_entries = 8;
@@ -12346,12 +12326,11 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr,
hbool_t expected_flushed,
hbool_t expected_destroyed)
{
- /* const char * fcn_name = "check_flush_cache__single_entry_test"; */
H5C_t * cache_ptr = file_ptr->shared->cache;
static char msg[128];
herr_t result;
test_entry_t * base_addr;
- test_entry_t * entry_ptr;
+ test_entry_t * entry_ptr = NULL;
if ( cache_ptr == NULL ) {
@@ -12534,13 +12513,12 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr,
hbool_t expected_flushed,
hbool_t expected_destroyed)
{
- /* const char *fcn_name = "check_flush_cache__pinned_single_entry_test"; */
H5C_t * cache_ptr = file_ptr->shared->cache;
static char msg[128];
hbool_t expected_loaded = TRUE;
herr_t result;
test_entry_t * base_addr;
- test_entry_t * entry_ptr;
+ test_entry_t * entry_ptr = NULL;
if ( cache_ptr == NULL ) {
@@ -12726,7 +12704,6 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr,
static unsigned
check_get_entry_status(void)
{
- const char * fcn_name = "check_get_entry_status";
static char msg[128];
herr_t result;
hbool_t in_cache;
@@ -12929,7 +12906,7 @@ check_get_entry_status(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -12956,7 +12933,6 @@ check_get_entry_status(void)
static unsigned
check_expunge_entry(void)
{
- const char * fcn_name = "check_expunge_entry";
static char msg[128];
herr_t result;
hbool_t in_cache;
@@ -13206,8 +13182,8 @@ check_expunge_entry(void)
*/
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected,
- &is_pinned, NULL, NULL);
+ &in_cache, &is_dirty, &is_protected,
+ &is_pinned, NULL, NULL);
if ( result < 0 ) {
@@ -13244,7 +13220,7 @@ check_expunge_entry(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -13272,7 +13248,6 @@ check_expunge_entry(void)
static unsigned
check_multiple_read_protect(void)
{
- const char * fcn_name = "check_multiple_read_protect()";
H5F_t * file_ptr = NULL;
#if H5C_COLLECT_CACHE_STATS
H5C_t * cache_ptr = NULL;
@@ -13669,7 +13644,7 @@ check_multiple_read_protect(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -13697,7 +13672,6 @@ check_multiple_read_protect(void)
static unsigned
check_move_entry(void)
{
- const char * fcn_name = "check_move_entry";
int i;
H5F_t * file_ptr = NULL;
struct move_entry_test_spec test_specs[4] =
@@ -13782,7 +13756,7 @@ check_move_entry(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -13814,7 +13788,6 @@ check_move_entry__run_test(H5F_t * file_ptr,
int test_num,
struct move_entry_test_spec * spec_ptr)
{
- /* const char * fcn_name = "check_move_entry__run_test"; */
H5C_t * cache_ptr = file_ptr->shared->cache;
static char msg[128];
unsigned int flags = H5C__NO_FLAGS_SET;
@@ -13950,7 +13923,6 @@ check_move_entry__run_test(H5F_t * file_ptr,
static unsigned
check_pin_protected_entry(void)
{
- const char * fcn_name = "check_pin_protected_entry";
static char msg[128];
herr_t result;
H5F_t * file_ptr = NULL;
@@ -14025,7 +13997,7 @@ check_pin_protected_entry(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -14050,7 +14022,6 @@ check_pin_protected_entry(void)
static unsigned
check_resize_entry(void)
{
- const char * fcn_name = "check_resize_entry";
static char msg[128];
herr_t result;
hbool_t in_cache;
@@ -14062,7 +14033,7 @@ check_resize_entry(void)
H5F_t * file_ptr = NULL;
H5C_t * cache_ptr = NULL;
test_entry_t * base_addr;
- test_entry_t * entry_ptr;
+ test_entry_t * entry_ptr = NULL;
TESTING("entry resize functionality");
@@ -15034,7 +15005,7 @@ check_resize_entry(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -15062,7 +15033,6 @@ check_resize_entry(void)
static unsigned
check_evictions_enabled(void)
{
- const char * fcn_name = "check_evictions_enabled";
static char msg[128];
herr_t result;
hbool_t show_progress = FALSE;
@@ -15116,7 +15086,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* create the cache */
if ( pass ) {
@@ -15141,7 +15111,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* verify that it is empty */
if ( pass ) {
@@ -15161,7 +15131,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* verify that H5C_get_evictions_enabled() returns the expected value */
if ( pass ) {
@@ -15178,7 +15148,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15193,7 +15163,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* verify that the cache is full */
if ( pass ) {
@@ -15214,7 +15184,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15226,7 +15196,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* verify that an entry has been evicted */
if ( pass ) {
@@ -15246,7 +15216,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 8 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15283,7 +15253,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15294,7 +15264,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 10 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* verify that another entry has been evicted */
if ( pass ) {
@@ -15314,7 +15284,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15350,7 +15320,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 12 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* disable evictions */
if ( pass ) {
@@ -15367,7 +15337,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 13 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* verify that evictions are disabled */
if ( pass ) {
@@ -15387,7 +15357,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 14 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15399,7 +15369,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 15 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* verify that no entry has been evicted */
if ( pass ) {
@@ -15419,7 +15389,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 16 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15430,7 +15400,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 17 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* verify that no entry has been evicted */
if ( pass ) {
@@ -15450,7 +15420,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 18 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* re-enable evictions */
if ( pass ) {
@@ -15467,7 +15437,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 19 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15479,7 +15449,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 20 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* verify that no entries have been evicted */
if ( pass ) {
@@ -15499,7 +15469,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 21 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15511,7 +15481,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 22 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* verify that the entries have been evicted to bring the
* cache back down to its normal size.
@@ -15534,7 +15504,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 23 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15570,7 +15540,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 24 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15606,7 +15576,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 25 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* disable evictions again */
if ( pass ) {
@@ -15623,7 +15593,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 26 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15637,7 +15607,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 27 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* verify that the cache has grown */
if ( pass ) {
@@ -15657,7 +15627,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 28 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* re-enable evictions again */
if ( pass ) {
@@ -15674,7 +15644,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 29 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15685,7 +15655,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 30 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* verify that the cache has returned to its maximum size */
if ( pass ) {
@@ -15705,7 +15675,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 31 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15741,7 +15711,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 32 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* disable evictions one last time before we shut down */
if ( pass ) {
@@ -15758,7 +15728,7 @@ check_evictions_enabled(void)
if ( show_progress ) /* 33 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -15767,14 +15737,14 @@ check_evictions_enabled(void)
if ( show_progress ) /* 34 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) { PASSED(); } else { H5_FAILED(); }
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -15801,7 +15771,6 @@ check_evictions_enabled(void)
static unsigned
check_flush_protected_err(void)
{
- const char * fcn_name = "check_flush_protected_err";
H5F_t * file_ptr = NULL;
TESTING("flush cache with protected entry error");
@@ -15850,7 +15819,7 @@ check_flush_protected_err(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -15881,7 +15850,6 @@ extern H5C_t * saved_cache;
static unsigned
check_destroy_pinned_err(void)
{
- const char * fcn_name = "check_destroy_pinned_err()";
H5F_t * file_ptr = NULL;
TESTING("destroy cache with permanently pinned entry error");
@@ -15942,7 +15910,7 @@ check_destroy_pinned_err(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -15969,7 +15937,6 @@ check_destroy_pinned_err(void)
static unsigned
check_destroy_protected_err(void)
{
- const char * fcn_name = "check_destroy_protected_err";
H5F_t * file_ptr = NULL;
TESTING("destroy cache with protected entry error");
@@ -16028,7 +15995,7 @@ check_destroy_protected_err(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -16055,7 +16022,6 @@ check_destroy_protected_err(void)
static unsigned
check_duplicate_insert_err(void)
{
- const char * fcn_name = "check_duplicate_insert_err";
herr_t result = -1;
H5F_t * file_ptr = NULL;
test_entry_t * base_addr;
@@ -16106,7 +16072,7 @@ check_duplicate_insert_err(void)
if ( ! pass ) {
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -16133,7 +16099,6 @@ check_duplicate_insert_err(void)
static unsigned
check_move_err(void)
{
- const char * fcn_name = "check_move_err()";
herr_t result;
H5F_t * file_ptr = NULL;
H5C_t * cache_ptr = NULL;
@@ -16201,7 +16166,7 @@ check_move_err(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -16230,7 +16195,6 @@ check_move_err(void)
static unsigned
check_double_pin_err(void)
{
- const char * fcn_name = "check_double_pin_err()";
herr_t result;
H5F_t * file_ptr = NULL;
test_entry_t * entry_ptr;
@@ -16289,7 +16253,7 @@ check_double_pin_err(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -16318,7 +16282,6 @@ check_double_pin_err(void)
static unsigned
check_double_unpin_err(void)
{
- const char * fcn_name = "check_double_unpin_err()";
herr_t result;
H5F_t * file_ptr = NULL;
test_entry_t * entry_ptr;
@@ -16388,7 +16351,7 @@ check_double_unpin_err(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -16417,7 +16380,6 @@ check_double_unpin_err(void)
static unsigned
check_pin_entry_errs(void)
{
- const char * fcn_name = "check_pin_entry_errs()";
herr_t result;
H5F_t * file_ptr = NULL;
test_entry_t * entry_ptr;
@@ -16499,7 +16461,7 @@ check_pin_entry_errs(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -16524,7 +16486,6 @@ check_pin_entry_errs(void)
static unsigned
check_double_protect_err(void)
{
- const char * fcn_name = "check_double_protect_err()";
H5F_t * file_ptr = NULL;
test_entry_t * entry_ptr;
H5C_cache_entry_t * cache_entry_ptr;
@@ -16577,7 +16538,7 @@ check_double_protect_err(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -16602,7 +16563,6 @@ check_double_protect_err(void)
static unsigned
check_double_unprotect_err(void)
{
- const char * fcn_name = "check_double_unprotect_err()";
herr_t result;
H5F_t * file_ptr = NULL;
test_entry_t * entry_ptr;
@@ -16654,7 +16614,7 @@ check_double_unprotect_err(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -16682,7 +16642,6 @@ check_double_unprotect_err(void)
static unsigned
check_mark_entry_dirty_errs(void)
{
- const char * fcn_name = "check_mark_entry_dirty_errs()";
herr_t result;
H5F_t * file_ptr = NULL;
test_entry_t * entry_ptr;
@@ -16734,7 +16693,7 @@ check_mark_entry_dirty_errs(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -16763,7 +16722,6 @@ check_mark_entry_dirty_errs(void)
static unsigned
check_expunge_entry_errs(void)
{
- const char * fcn_name = "check_expunge_entry_errs()";
herr_t result;
H5F_t * file_ptr = NULL;
test_entry_t * entry_ptr;
@@ -16858,7 +16816,7 @@ check_expunge_entry_errs(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -16883,7 +16841,6 @@ check_expunge_entry_errs(void)
static unsigned
check_resize_entry_errs(void)
{
- const char * fcn_name = "check_resize_entry_errs()";
herr_t result;
H5F_t * file_ptr = NULL;
test_entry_t * entry_ptr;
@@ -16960,7 +16917,7 @@ check_resize_entry_errs(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -16985,7 +16942,6 @@ check_resize_entry_errs(void)
static unsigned
check_unprotect_ro_dirty_err(void)
{
- const char * fcn_name = "check_unprotect_ro_dirty_err()";
herr_t result;
H5F_t * file_ptr = NULL;
test_entry_t * entry_ptr;
@@ -17086,7 +17042,7 @@ check_unprotect_ro_dirty_err(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -17115,7 +17071,6 @@ check_unprotect_ro_dirty_err(void)
static unsigned
check_protect_ro_rw_err(void)
{
- const char * fcn_name = "check_protect_ro_rw_err()";
H5F_t * file_ptr = NULL;
test_entry_t * entry_ptr;
void * thing_ptr = NULL;
@@ -17169,7 +17124,7 @@ check_protect_ro_rw_err(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -17198,7 +17153,6 @@ check_protect_ro_rw_err(void)
static unsigned
check_check_evictions_enabled_err(void)
{
- const char * fcn_name = "check_evictions_enabled_err()";
herr_t result;
hbool_t evictions_enabled;
H5F_t * file_ptr = NULL;
@@ -17308,7 +17262,7 @@ check_check_evictions_enabled_err(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -17357,7 +17311,6 @@ static void test_rpt_fcn(H5_ATTR_UNUSED H5C_t * cache_ptr,
static unsigned
check_auto_cache_resize(void)
{
- const char * fcn_name = "check_auto_cache_resize()";
hbool_t show_progress = FALSE;
herr_t result;
int32_t i;
@@ -21534,7 +21487,7 @@ check_auto_cache_resize(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -21565,7 +21518,6 @@ check_auto_cache_resize(void)
static unsigned
check_auto_cache_resize_disable(void)
{
- const char * fcn_name = "check_auto_cache_resize_disable()";
hbool_t show_progress = FALSE;
herr_t result;
int32_t i;
@@ -24264,7 +24216,7 @@ check_auto_cache_resize_disable(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -24291,7 +24243,6 @@ check_auto_cache_resize_disable(void)
static unsigned
check_auto_cache_resize_epoch_markers(void)
{
- const char * fcn_name = "check_auto_cache_resize_epoch_markers()";
hbool_t show_progress = FALSE;
herr_t result;
int32_t i;
@@ -24969,7 +24920,7 @@ check_auto_cache_resize_epoch_markers(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -25001,7 +24952,6 @@ check_auto_cache_resize_epoch_markers(void)
static unsigned
check_auto_cache_resize_input_errs(void)
{
- const char * fcn_name = "check_auto_cache_resize_input_errs()";
herr_t result;
H5F_t * file_ptr = NULL;
H5C_t * cache_ptr = NULL;
@@ -27377,7 +27327,7 @@ check_auto_cache_resize_input_errs(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -27409,7 +27359,6 @@ check_auto_cache_resize_input_errs(void)
static unsigned
check_auto_cache_resize_aux_fcns(void)
{
- const char * fcn_name = "check_auto_cache_resize_aux_fcns()";
herr_t result;
int32_t i;
H5F_t * file_ptr = NULL;
@@ -27529,7 +27478,7 @@ check_auto_cache_resize_aux_fcns(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate failed.\n";
- } else if ( hit_rate > FP_EPSILON ) { /* i.e. hit_rate != 0.0 */
+ } else if ( !H5_DBL_ABS_EQUAL(hit_rate, (double)0.0f) ) { /* i.e. hit_rate != 0.0 */
pass = FALSE;
failure_mssg =
@@ -27562,7 +27511,7 @@ check_auto_cache_resize_aux_fcns(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate failed.\n";
- } else if ( hit_rate > FP_EPSILON ) { /* i.e. hit_rate != 0.0 */
+ } else if ( !H5_DBL_ABS_EQUAL(hit_rate, (double)0.0f) ) { /* i.e. hit_rate != 0.0 */
pass = FALSE;
failure_mssg =
@@ -27607,7 +27556,7 @@ check_auto_cache_resize_aux_fcns(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate failed.\n";
- } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5f, FP_EPSILON) ) { /* i.e. hit_rate != 0.5 */
+ } else if ( ! H5_DBL_ABS_EQUAL(hit_rate, (double)0.5f) ) { /* i.e. hit_rate != 0.5 */
pass = FALSE;
failure_mssg =
@@ -27690,7 +27639,7 @@ check_auto_cache_resize_aux_fcns(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate failed.\n";
- } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5F, FP_EPSILON) ) { /* i.e. hit_rate != 0.5 */
+ } else if ( ! H5_DBL_ABS_EQUAL(hit_rate, (double)0.5F) ) { /* i.e. hit_rate != 0.5 */
pass = FALSE;
failure_mssg =
@@ -27916,7 +27865,7 @@ check_auto_cache_resize_aux_fcns(void)
if ( ! pass ) {
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
}
return (unsigned)!pass;
@@ -27955,7 +27904,6 @@ check_auto_cache_resize_aux_fcns(void)
static unsigned
check_metadata_blizzard_absence(hbool_t fill_via_insertion)
{
- const char * fcn_name = "check_metadata_blizzard_absence";
int entry_type = HUGE_ENTRY_TYPE;
size_t entry_size = HUGE_ENTRY_SIZE; /* 16 KB */
H5F_t * file_ptr = NULL;
@@ -28142,7 +28090,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
if ( show_progress) /* 0 */
HDfprintf(stdout, "\n%s: check point %d -- pass %d\n",
- fcn_name, checkpoint++, pass);
+ FUNC, checkpoint++, pass);
if ( pass ) {
@@ -28166,7 +28114,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
if ( show_progress) /* 1 */
HDfprintf(stdout, "%s: check point %d -- pass %d\n",
- fcn_name, checkpoint++, pass);
+ FUNC, checkpoint++, pass);
/* ========================================================================
* ========================================================================
@@ -28230,7 +28178,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
if ( show_progress) /* 2 */
HDfprintf(stdout, "%s: check point %d -- pass %d\n",
- fcn_name, checkpoint++, pass);
+ FUNC, checkpoint++, pass);
/* ========================================================================
* ========================================================================
@@ -28300,7 +28248,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
if ( show_progress) /* 3 */
HDfprintf(stdout, "%s: check point %d -- pass %d\n",
- fcn_name, checkpoint++, pass);
+ FUNC, checkpoint++, pass);
if ( pass ) {
@@ -28354,7 +28302,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
if ( show_progress) /* 4 */
HDfprintf(stdout, "%s: check point %d -- pass %d\n",
- fcn_name, checkpoint++, pass);
+ FUNC, checkpoint++, pass);
if ( pass ) {
@@ -28407,7 +28355,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
if ( show_progress) /* 5 */
HDfprintf(stdout, "%s: check point %d -- pass %d\n",
- fcn_name, checkpoint++, pass);
+ FUNC, checkpoint++, pass);
/* ========================================================================
* ========================================================================
@@ -28482,7 +28430,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
if ( show_progress) /* 6 */
HDfprintf(stdout, "%s: check point %d -- pass %d\n",
- fcn_name, checkpoint++, pass);
+ FUNC, checkpoint++, pass);
if ( pass ) {
@@ -28554,7 +28502,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
if ( show_progress) /* 7 */
HDfprintf(stdout, "%s: check point %d -- pass %d\n",
- fcn_name, checkpoint++, pass);
+ FUNC, checkpoint++, pass);
/* ========================================================================
* ========================================================================
@@ -28614,7 +28562,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
if ( show_progress) /* 8 */
HDfprintf(stdout, "%s: check point %d -- pass %d\n",
- fcn_name, checkpoint++, pass);
+ FUNC, checkpoint++, pass);
if ( pass ) {
@@ -28663,7 +28611,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
if ( show_progress) /* 9 */
HDfprintf(stdout, "%s: check point %d -- pass %d\n",
- fcn_name, checkpoint++, pass);
+ FUNC, checkpoint++, pass);
if ( pass ) {
@@ -28714,7 +28662,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
if ( show_progress) /* 10 */
HDfprintf(stdout, "%s: check point %d -- pass %d\n",
- fcn_name, checkpoint++, pass);
+ FUNC, checkpoint++, pass);
if ( pass ) {
@@ -28762,7 +28710,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
if ( show_progress) /* 11 */
HDfprintf(stdout, "%s: check point %d -- pass %d\n",
- fcn_name, checkpoint++, pass);
+ FUNC, checkpoint++, pass);
if ( pass ) {
@@ -28773,7 +28721,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
if ( show_progress) /* 12 */
HDfprintf(stdout, "%s: check point %d -- pass %d\n",
- fcn_name, checkpoint++, pass);
+ FUNC, checkpoint++, pass);
if ( pass ) { PASSED(); } else { H5_FAILED(); }
diff --git a/test/cache_api.c b/test/cache_api.c
index f3ec4b7..2df1741 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -70,7 +70,6 @@ static unsigned check_file_mdc_api_errs(void);
static unsigned
check_fapl_mdc_api_calls(void)
{
- const char * fcn_name = "check_fapl_mdc_api_calls()";
char filename[512];
herr_t result;
hid_t fapl_id = -1;
@@ -487,7 +486,7 @@ check_fapl_mdc_api_calls(void)
if ( ! pass )
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
return !pass;
@@ -521,7 +520,6 @@ check_fapl_mdc_api_calls(void)
static unsigned
check_file_mdc_api_calls(void)
{
- const char * fcn_name = "check_file_mdc_api_calls()";
char filename[512];
hid_t file_id = -1;
size_t max_size;
@@ -775,7 +773,7 @@ check_file_mdc_api_calls(void)
pass = FALSE;
failure_mssg = "H5Fget_mdc_hit_rate() failed 1.\n";
- } else if ( hit_rate != 0.0f ) {
+ } else if ( !H5_DBL_ABS_EQUAL(hit_rate, (double)0.0f) ) {
pass = FALSE;
failure_mssg =
@@ -839,7 +837,7 @@ check_file_mdc_api_calls(void)
if ( ! pass )
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
return !pass;
@@ -872,7 +870,6 @@ check_file_mdc_api_calls(void)
static unsigned
mdc_api_call_smoke_check(int express_test)
{
- const char * fcn_name = "mdc_api_call_smoke_check()";
char filename[512];
hbool_t valid_chunk;
hbool_t dump_hit_rate = FALSE;
@@ -884,7 +881,7 @@ mdc_api_call_smoke_check(int express_test)
hid_t filespace_ids[NUM_DSETS];
hid_t memspace_id = -1;
hid_t dataset_ids[NUM_DSETS];
- hid_t properties;
+ hid_t properties = -1;
char dset_name[64];
int i, j, k, l, m, n;
herr_t status;
@@ -1187,8 +1184,8 @@ mdc_api_call_smoke_check(int express_test)
}
/* select on disk hyperslab */
- offset[0] = i; /*offset of hyperslab in file*/
- offset[1] = j;
+ offset[0] = (hsize_t)i; /*offset of hyperslab in file*/
+ offset[1] = (hsize_t)j;
a_size[0] = CHUNK_SIZE; /*size of hyperslab*/
a_size[1] = CHUNK_SIZE;
status = H5Sselect_hyperslab(filespace_ids[m], H5S_SELECT_SET,
@@ -1258,8 +1255,8 @@ mdc_api_call_smoke_check(int express_test)
j = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE;
/* select on disk hyperslab */
- offset[0] = i; /*offset of hyperslab in file*/
- offset[1] = j;
+ offset[0] = (hsize_t)i; /*offset of hyperslab in file*/
+ offset[1] = (hsize_t)j;
a_size[0] = CHUNK_SIZE; /*size of hyperslab*/
a_size[1] = CHUNK_SIZE;
status = H5Sselect_hyperslab(filespace_ids[m], H5S_SELECT_SET,
@@ -1383,8 +1380,8 @@ mdc_api_call_smoke_check(int express_test)
j = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE;
/* select on disk hyperslab */
- offset[0] = i; /*offset of hyperslab in file*/
- offset[1] = j;
+ offset[0] = (hsize_t)i; /*offset of hyperslab in file*/
+ offset[1] = (hsize_t)j;
a_size[0] = CHUNK_SIZE; /*size of hyperslab*/
a_size[1] = CHUNK_SIZE;
status = H5Sselect_hyperslab(filespace_ids[m], H5S_SELECT_SET,
@@ -1516,7 +1513,7 @@ mdc_api_call_smoke_check(int express_test)
if ( ! pass )
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
return !pass;
@@ -1526,6 +1523,8 @@ mdc_api_call_smoke_check(int express_test)
/* The following array of invalid external MDC cache configurations is
* used to test error rejection in the MDC related API calls.
+ *
+ * Note: It is assumed that boolean parameters are only set to TRUE/FALSE.
*/
#define NUM_INVALID_CONFIGS 42
@@ -1568,112 +1567,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 1 -- bad rpt_fcn_enabled */
- /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ (hbool_t)-1,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25f,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.9f,
- /* double increment = */ 2.0f,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
- /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999f,
- /* double decrement = */ 0.9f,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1f,
- /* int dirty_bytes_threshold = */ (256 * 1024),
- /* int metadata_write_strategy = */
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY
- },
- {
- /* 2 -- bad open_trace_file */
- /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ (hbool_t)-1,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25f,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.9f,
- /* double increment = */ 2.0f,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
- /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999f,
- /* double decrement = */ 0.9f,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1f,
- /* int dirty_bytes_threshold = */ (256 * 1024),
- /* int metadata_write_strategy = */
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY
- },
- {
- /* 3 -- bad close_trace_file */
- /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ (hbool_t)-1,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25f,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.9f,
- /* double increment = */ 2.0f,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
- /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999f,
- /* double decrement = */ 0.9f,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1f,
- /* int dirty_bytes_threshold = */ (256 * 1024),
- /* int metadata_write_strategy = */
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY
- },
- {
- /* 4 -- open_trace_file == TRUE and empty trace_file_name */
+ /* 1 -- open_trace_file == TRUE and empty trace_file_name */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ TRUE,
@@ -1708,7 +1602,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 5 -- bad set_initial_size */
+ /* 2 -- bad set_initial_size */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -1743,7 +1637,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 6 -- max_size too big */
+ /* 3 -- max_size too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -1778,7 +1672,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 7 -- min_size too small */
+ /* 4 -- min_size too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -1813,7 +1707,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 8 -- min_size > max_size */
+ /* 5 -- min_size > max_size */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -1848,7 +1742,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 9 -- initial size out of range (too big) */
+ /* 6 -- initial size out of range (too big) */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -1883,7 +1777,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 10 -- initial_size out of range (too small) */
+ /* 7 -- initial_size out of range (too small) */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -1918,7 +1812,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 11 -- min_clean_fraction too big */
+ /* 8 -- min_clean_fraction too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -1953,7 +1847,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 12 -- min_clean_fraction too small */
+ /* 9 -- min_clean_fraction too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -1988,7 +1882,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 13 -- epoch_length too small */
+ /* 10 -- epoch_length too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2023,7 +1917,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 14 -- epoch_length too big */
+ /* 11 -- epoch_length too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2058,7 +1952,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 15 -- invalid incr_mode */
+ /* 12 -- invalid incr_mode */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2093,7 +1987,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 16 -- lower_hr_threshold too small */
+ /* 13 -- lower_hr_threshold too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2128,7 +2022,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 17 -- lower_hr_threshold too big */
+ /* 14 -- lower_hr_threshold too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2163,7 +2057,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 18 -- increment too small */
+ /* 15 -- increment too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2198,42 +2092,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 19 -- bad apply_max_increment */
- /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25f,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.9f,
- /* double increment = */ 2.0f,
- /* hbool_t apply_max_increment = */ (hbool_t)-1,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
- /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999f,
- /* double decrement = */ 0.9f,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1f,
- /* int dirty_bytes_threshold = */ (256 * 1024),
- /* int metadata_write_strategy = */
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY
- },
- {
- /* 20 -- invalid flash_incr_mode */
+ /* 16 -- invalid flash_incr_mode */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2268,7 +2127,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 21 -- flash_multiple too small */
+ /* 17 -- flash_multiple too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2303,7 +2162,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 22 -- flash_multiple too big */
+ /* 18 -- flash_multiple too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2338,7 +2197,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 23 -- flash_threshold too small */
+ /* 19 -- flash_threshold too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2373,7 +2232,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 24 -- flash_threshold too big */
+ /* 20 -- flash_threshold too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2408,7 +2267,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 25 -- bad decr_mode */
+ /* 21 -- bad decr_mode */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2443,7 +2302,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 26 -- upper_hr_threshold too big */
+ /* 22 -- upper_hr_threshold too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2478,7 +2337,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 27 -- decrement too small */
+ /* 23 -- decrement too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2513,7 +2372,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 28 -- decrement too big */
+ /* 24 -- decrement too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2548,7 +2407,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 29 -- epochs_before_eviction too small */
+ /* 25 -- epochs_before_eviction too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2583,7 +2442,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 30 -- epochs_before_eviction too big */
+ /* 26 -- epochs_before_eviction too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2618,7 +2477,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 31 -- invalid apply_empty_reserve */
+ /* 27 -- invalid apply_empty_reserve */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2653,7 +2512,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 32 -- empty_reserve too small */
+ /* 28 -- empty_reserve too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2688,7 +2547,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 33 -- empty_reserve too big */
+ /* 29 -- empty_reserve too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2723,7 +2582,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 34 -- upper_hr_threshold too small */
+ /* 30 -- upper_hr_threshold too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2758,7 +2617,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 35 -- upper_hr_threshold too big */
+ /* 31 -- upper_hr_threshold too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2793,7 +2652,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 36 -- upper_hr_threshold <= lower_hr_threshold */
+ /* 32 -- upper_hr_threshold <= lower_hr_threshold */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2828,7 +2687,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 37 -- dirty_bytes_threshold too small */
+ /* 33 -- dirty_bytes_threshold too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2863,7 +2722,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 38 -- dirty_bytes_threshold too big */
+ /* 34 -- dirty_bytes_threshold too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2898,7 +2757,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 39 -- attempt to disable evictions when auto incr enabled */
+ /* 35 -- attempt to disable evictions when auto incr enabled */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2933,7 +2792,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 40 -- attempt to disable evictions when auto decr enabled */
+ /* 36 -- attempt to disable evictions when auto decr enabled */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2968,7 +2827,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
H5AC__DEFAULT_METADATA_WRITE_STRATEGY
},
{
- /* 41 -- unknown metadata write strategy */
+ /* 37 -- unknown metadata write strategy */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -3023,7 +2882,6 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
static unsigned
check_fapl_mdc_api_errs(void)
{
- const char * fcn_name = "check_fapl_mdc_api_errs()";
static char msg[128];
int i;
herr_t result;
@@ -3170,7 +3028,7 @@ check_fapl_mdc_api_errs(void)
if ( ! pass )
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
return !pass;
@@ -3196,7 +3054,6 @@ check_fapl_mdc_api_errs(void)
static unsigned
check_file_mdc_api_errs(void)
{
- const char * fcn_name = "check_file_mdc_api_errs()";
char filename[512];
static char msg[128];
hbool_t show_progress = FALSE;
@@ -3224,7 +3081,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
- HDfprintf(stdout, "%s: calling h5_fixname().\n", fcn_name);
+ HDfprintf(stdout, "%s: calling h5_fixname().\n", FUNC);
}
if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
@@ -3239,7 +3096,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
- HDfprintf(stdout, "%s: calling H5Fcreate().\n", fcn_name);
+ HDfprintf(stdout, "%s: calling H5Fcreate().\n", FUNC);
}
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -3261,7 +3118,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
- HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", fcn_name);
+ HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", FUNC);
}
H5E_BEGIN_TRY {
@@ -3279,7 +3136,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
- HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", fcn_name);
+ HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", FUNC);
}
H5E_BEGIN_TRY {
@@ -3298,7 +3155,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
- HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", fcn_name);
+ HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", FUNC);
}
H5E_BEGIN_TRY {
@@ -3320,7 +3177,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
- HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", fcn_name);
+ HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", FUNC);
}
H5E_BEGIN_TRY {
@@ -3338,7 +3195,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
- HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", fcn_name);
+ HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", FUNC);
}
H5E_BEGIN_TRY {
@@ -3359,7 +3216,7 @@ check_file_mdc_api_errs(void)
HDfprintf(stdout,
"%s: testing H5Fset_mdc_config() with invalid config %d.\n",
- fcn_name, i);
+ FUNC, i);
}
H5E_BEGIN_TRY {
@@ -3388,7 +3245,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 1.\n",
- fcn_name);
+ FUNC);
}
H5E_BEGIN_TRY {
@@ -3407,7 +3264,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 2.\n",
- fcn_name);
+ FUNC);
}
H5E_BEGIN_TRY {
@@ -3428,7 +3285,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: testing H5Freset_mdc_hit_rate_stats().\n",
- fcn_name);
+ FUNC);
}
H5E_BEGIN_TRY {
@@ -3449,7 +3306,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
- HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", fcn_name);
+ HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", FUNC);
}
H5E_BEGIN_TRY {
@@ -3468,7 +3325,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
- HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", fcn_name);
+ HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", FUNC);
}
if ( ( H5Fget_mdc_size(file_id, &max_size, NULL, NULL, NULL) < 0 ) ||
@@ -3490,7 +3347,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
- HDfprintf(stdout, "%s: cleaning up from tests.\n", fcn_name);
+ HDfprintf(stdout, "%s: cleaning up from tests.\n", FUNC);
}
if ( H5Fclose(file_id) < 0 ) {
@@ -3509,7 +3366,7 @@ check_file_mdc_api_errs(void)
if ( ! pass )
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
- fcn_name, failure_mssg);
+ FUNC, failure_mssg);
return !pass;
diff --git a/test/cache_common.c b/test/cache_common.c
index 80be3de..565660a 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -19,7 +19,6 @@
* This file contains common code for tests of the cache
* implemented in H5C.c
*/
-#include "H5private.h" /* Put this first, so H5open() isn't invoked in public macros */
#include "h5test.h"
#include "H5Cprivate.h"
#include "H5Iprivate.h"
@@ -476,18 +475,14 @@ addr_to_type_and_index(haddr_t addr,
*
*-------------------------------------------------------------------------
*/
-
-herr_t
-check_write_permitted(const H5F_t H5_ATTR_UNUSED *f,
- hid_t H5_ATTR_UNUSED dxpl_id,
- hbool_t *write_permitted_ptr)
+static herr_t
+check_write_permitted(const H5F_t H5_ATTR_UNUSED *f, hbool_t *write_permitted_ptr)
{
+ HDassert(write_permitted_ptr);
- HDassert( write_permitted_ptr );
*write_permitted_ptr = write_permitted;
return(SUCCEED);
-
} /* check_write_permitted() */
@@ -799,7 +794,6 @@ notify_dest(H5F_t * f, void * thing)
*
*-------------------------------------------------------------------------
*/
-
herr_t
flush(H5F_t *f,
hid_t H5_ATTR_UNUSED dxpl_id,
@@ -871,7 +865,6 @@ flush(H5F_t *f,
}
return(SUCCEED);
-
} /* flush() */
herr_t
@@ -962,7 +955,6 @@ notify_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr,
return(flush(f, dxpl_id, dest, addr, thing, flags_ptr));
}
-
/*-------------------------------------------------------------------------
* Function: load & friends
@@ -1108,7 +1100,6 @@ notify_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)
*
*-------------------------------------------------------------------------
*/
-
herr_t
size(H5F_t H5_ATTR_UNUSED * f,
void * thing,
@@ -1134,7 +1125,6 @@ size(H5F_t H5_ATTR_UNUSED * f,
*size_ptr = entry_ptr->size;
return(SUCCEED);
-
} /* size() */
herr_t
@@ -2401,7 +2391,6 @@ H5F_t *
setup_cache(size_t max_cache_size,
size_t min_clean_size)
{
- const char * fcn_name = "setup_cache()";
char filename[512];
hbool_t show_progress = FALSE;
hbool_t verbose = TRUE;
@@ -2415,7 +2404,7 @@ setup_cache(size_t max_cache_size,
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
saved_fid = -1;
@@ -2432,7 +2421,7 @@ setup_cache(size_t max_cache_size,
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( ( pass ) && ( try_core_file_driver ) ) {
@@ -2454,7 +2443,7 @@ setup_cache(size_t max_cache_size,
core_file_driver_failed = TRUE;
if ( verbose ) {
- HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", fcn_name);
+ HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", FUNC);
}
} else {
@@ -2465,7 +2454,7 @@ setup_cache(size_t max_cache_size,
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
/* if we either aren't using the core file driver, or a create
* with the core file driver failed, try again with a regular file.
@@ -2483,14 +2472,14 @@ setup_cache(size_t max_cache_size,
failure_mssg = "H5Fcreate() failed.";
if ( verbose ) {
- HDfprintf(stdout, "%s: H5Fcreate() failed.\n", fcn_name);
+ HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC);
}
}
}
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2504,7 +2493,7 @@ setup_cache(size_t max_cache_size,
failure_mssg = "H5Fflush() failed.";
if ( verbose ) {
- HDfprintf(stdout, "%s: H5Fflush() failed.\n", fcn_name);
+ HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
}
} else {
@@ -2517,7 +2506,7 @@ setup_cache(size_t max_cache_size,
failure_mssg = "Can't get file_ptr.";
if ( verbose ) {
- HDfprintf(stdout, "%s: H5Fflush() failed.\n", fcn_name);
+ HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
}
}
}
@@ -2525,7 +2514,7 @@ setup_cache(size_t max_cache_size,
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2577,7 +2566,7 @@ setup_cache(size_t max_cache_size,
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2587,7 +2576,7 @@ setup_cache(size_t max_cache_size,
failure_mssg = "H5C_create() failed.";
if ( verbose ) {
- HDfprintf(stdout, "%s: H5C_create() failed.\n", fcn_name);
+ HDfprintf(stdout, "%s: H5C_create() failed.\n", FUNC);
}
} else if ( cache_ptr->magic != H5C__H5C_T_MAGIC ) {
@@ -2596,14 +2585,14 @@ setup_cache(size_t max_cache_size,
failure_mssg = "Bad cache_ptr magic.";
if ( verbose ) {
- HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", fcn_name);
+ HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", FUNC);
}
}
}
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) { /* allocate space for test entries */
@@ -2616,7 +2605,7 @@ setup_cache(size_t max_cache_size,
failure_mssg = "H5MF_alloc() failed.";
if ( verbose ) {
- HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", fcn_name);
+ HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", FUNC);
}
} else if ( actual_base_addr > BASE_ADDR ) {
@@ -2630,7 +2619,7 @@ setup_cache(size_t max_cache_size,
if ( verbose ) {
HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n",
- fcn_name);
+ FUNC);
}
}
@@ -2639,7 +2628,7 @@ setup_cache(size_t max_cache_size,
if ( show_progress ) /* 8 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
if ( pass ) {
@@ -2652,7 +2641,7 @@ setup_cache(size_t max_cache_size,
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- fcn_name, mile_stone++, (int)pass);
+ FUNC, mile_stone++, (int)pass);
return(ret_val);
} /* setup_cache() */
@@ -2772,7 +2761,6 @@ expunge_entry(H5F_t * file_ptr,
int32_t type,
int32_t idx)
{
- /* const char * fcn_name = "expunge_entry()"; */
herr_t result;
test_entry_t * base_addr;
test_entry_t * entry_ptr;
@@ -2835,7 +2823,6 @@ flush_cache(H5F_t * file_ptr,
hbool_t dump_stats,
hbool_t dump_detailed_stats)
{
- const char * fcn_name = "flush_cache()";
hbool_t verbose = FALSE;
verify_unprotected();
@@ -2871,7 +2858,7 @@ flush_cache(H5F_t * file_ptr,
if(verbose) {
HDfprintf(stdout,
"%s: unexpected il/is/cis/dis = %lld/%lld/%lld/%lld.\n",
- fcn_name,
+ FUNC,
(long long)(cache_ptr->index_len),
(long long)(cache_ptr->index_size),
(long long)(cache_ptr->clean_index_size),
@@ -3589,13 +3576,12 @@ row_major_scan_forward(H5F_t * file_ptr,
int dirty_destroys,
int dirty_unprotects)
{
- const char * fcn_name = "row_major_scan_forward";
- H5C_t * cache_ptr;
+ H5C_t * cache_ptr = NULL;
int32_t type = 0;
int32_t idx;
if ( verbose )
- HDfprintf(stdout, "%s(): entering.\n", fcn_name);
+ HDfprintf(stdout, "%s(): entering.\n", FUNC);
if ( pass ) {
@@ -3881,8 +3867,7 @@ hl_row_major_scan_forward(H5F_t * file_ptr,
hbool_t display_detailed_stats,
hbool_t do_inserts)
{
- const char * fcn_name = "hl_row_major_scan_forward";
- H5C_t * cache_ptr;
+ H5C_t * cache_ptr = NULL;
int32_t type = 0;
int32_t idx;
int32_t i;
@@ -3890,7 +3875,7 @@ hl_row_major_scan_forward(H5F_t * file_ptr,
int32_t local_max_index;
if ( verbose )
- HDfprintf(stdout, "%s(): entering.\n", fcn_name);
+ HDfprintf(stdout, "%s(): entering.\n", FUNC);
if ( pass ) {
@@ -3993,13 +3978,12 @@ row_major_scan_backward(H5F_t * file_ptr,
int dirty_destroys,
int dirty_unprotects)
{
- const char * fcn_name = "row_major_scan_backward";
- H5C_t * cache_ptr;
+ H5C_t * cache_ptr = NULL;
int32_t type = NUMBER_OF_ENTRY_TYPES - 1;
int32_t idx;
if ( verbose )
- HDfprintf(stdout, "%s(): Entering.\n", fcn_name);
+ HDfprintf(stdout, "%s(): Entering.\n", FUNC);
if ( pass ) {
@@ -4279,8 +4263,7 @@ hl_row_major_scan_backward(H5F_t * file_ptr,
hbool_t display_detailed_stats,
hbool_t do_inserts)
{
- const char * fcn_name = "hl_row_major_scan_backward";
- H5C_t * cache_ptr;
+ H5C_t * cache_ptr = NULL;
int32_t type = NUMBER_OF_ENTRY_TYPES - 1;
int32_t idx;
int32_t i;
@@ -4288,7 +4271,7 @@ hl_row_major_scan_backward(H5F_t * file_ptr,
int32_t local_max_index;
if ( verbose )
- HDfprintf(stdout, "%s(): entering.\n", fcn_name);
+ HDfprintf(stdout, "%s(): entering.\n", FUNC);
if ( pass ) {
@@ -4386,13 +4369,12 @@ col_major_scan_forward(H5F_t * file_ptr,
hbool_t do_inserts,
int dirty_unprotects)
{
- const char * fcn_name = "col_major_scan_forward()";
- H5C_t * cache_ptr;
+ H5C_t * cache_ptr = NULL;
int32_t type = 0;
int32_t idx;
if ( verbose )
- HDfprintf(stdout, "%s: entering.\n", fcn_name);
+ HDfprintf(stdout, "%s: entering.\n", FUNC);
if ( pass ) {
@@ -4487,8 +4469,7 @@ hl_col_major_scan_forward(H5F_t * file_ptr,
hbool_t do_inserts,
int dirty_unprotects)
{
- const char * fcn_name = "hl_col_major_scan_forward()";
- H5C_t * cache_ptr;
+ H5C_t * cache_ptr = NULL;
int32_t type = 0;
int32_t idx;
int32_t lag = 200;
@@ -4496,7 +4477,7 @@ hl_col_major_scan_forward(H5F_t * file_ptr,
int32_t local_max_index;
if ( verbose )
- HDfprintf(stdout, "%s: entering.\n", fcn_name);
+ HDfprintf(stdout, "%s: entering.\n", FUNC);
if ( pass ) {
@@ -4604,14 +4585,13 @@ col_major_scan_backward(H5F_t * file_ptr,
hbool_t do_inserts,
int dirty_unprotects)
{
- const char * fcn_name = "col_major_scan_backward()";
- H5C_t * cache_ptr;
+ H5C_t * cache_ptr = NULL;
int mile_stone = 1;
int32_t type;
int32_t idx;
if ( verbose )
- HDfprintf(stdout, "%s: entering.\n", fcn_name);
+ HDfprintf(stdout, "%s: entering.\n", FUNC);
if ( pass ) {
@@ -4630,7 +4610,7 @@ col_major_scan_backward(H5F_t * file_ptr,
idx = MAX_ENTRIES + lag;
if ( verbose ) /* 1 */
- HDfprintf(stdout, "%s: point %d.\n", fcn_name, mile_stone++);
+ HDfprintf(stdout, "%s: point %d.\n", FUNC, mile_stone++);
while ( ( pass ) && ( (idx + lag) >= 0 ) )
@@ -4678,7 +4658,7 @@ col_major_scan_backward(H5F_t * file_ptr,
}
if ( verbose ) /* 2 */
- HDfprintf(stdout, "%s: point %d.\n", fcn_name, mile_stone++);
+ HDfprintf(stdout, "%s: point %d.\n", FUNC, mile_stone++);
if ( ( pass ) && ( display_stats ) ) {
@@ -4686,7 +4666,7 @@ col_major_scan_backward(H5F_t * file_ptr,
}
if ( verbose )
- HDfprintf(stdout, "%s: exiting.\n", fcn_name);
+ HDfprintf(stdout, "%s: exiting.\n", FUNC);
return;
@@ -4718,16 +4698,15 @@ hl_col_major_scan_backward(H5F_t * file_ptr,
hbool_t do_inserts,
int dirty_unprotects)
{
- const char * fcn_name = "hl_col_major_scan_backward()";
- H5C_t * cache_ptr;
+ H5C_t * cache_ptr = NULL;
int32_t type = 0;
- int32_t idx;
+ int32_t idx = -1;
int32_t lag = 50;
int32_t i;
- int32_t local_max_index;
+ int32_t local_max_index = -1;
if ( verbose )
- HDfprintf(stdout, "%s: entering.\n", fcn_name);
+ HDfprintf(stdout, "%s: entering.\n", FUNC);
if ( pass ) {
@@ -5111,7 +5090,7 @@ check_and_validate_cache_hit_rate(hid_t file_id,
pass = FALSE;
failure_mssg = "H5Fget_mdc_hit_rate() failed.";
- } else if ( ! DBL_REL_EQUAL(hit_rate, expected_hit_rate, 0.00001F) ) {
+ } else if ( ! H5_DBL_ABS_EQUAL(hit_rate, expected_hit_rate) ) {
pass = FALSE;
failure_mssg = "unexpected hit rate.";
@@ -5304,7 +5283,7 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a,
return(FALSE);
else if(compare_init && (a->initial_size != b->initial_size))
return(FALSE);
- else if(HDfabs(a->min_clean_fraction - b->min_clean_fraction) > FP_EPSILON)
+ else if(!H5_DBL_ABS_EQUAL(a->min_clean_fraction, b->min_clean_fraction))
return(FALSE);
else if(a->max_size != b->max_size)
return(FALSE);
@@ -5314,9 +5293,9 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a,
return(FALSE);
else if(a->incr_mode != b->incr_mode)
return(FALSE);
- else if(HDfabs(a->lower_hr_threshold - b->lower_hr_threshold) > FP_EPSILON)
+ else if(!H5_DBL_ABS_EQUAL(a->lower_hr_threshold, b->lower_hr_threshold))
return(FALSE);
- else if(HDfabs(a->increment - b->increment) > FP_EPSILON)
+ else if(!H5_DBL_ABS_EQUAL(a->increment, b->increment))
return(FALSE);
else if(a->apply_max_increment != b->apply_max_increment)
return(FALSE);
@@ -5324,15 +5303,15 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a,
return(FALSE);
else if(a->flash_incr_mode != b->flash_incr_mode)
return(FALSE);
- else if(HDfabs(a->flash_multiple - b->flash_multiple) > FP_EPSILON)
+ else if(!H5_DBL_ABS_EQUAL(a->flash_multiple, b->flash_multiple))
return(FALSE);
- else if(HDfabs(a->flash_threshold - b->flash_threshold) > FP_EPSILON)
+ else if(!H5_DBL_ABS_EQUAL(a->flash_threshold, b->flash_threshold))
return(FALSE);
else if(a->decr_mode != b->decr_mode)
return(FALSE);
- else if(HDfabs(a->upper_hr_threshold - b->upper_hr_threshold) > FP_EPSILON)
+ else if(!H5_DBL_ABS_EQUAL(a->upper_hr_threshold, b->upper_hr_threshold))
return(FALSE);
- else if(HDfabs(a->decrement - b->decrement) > FP_EPSILON)
+ else if(!H5_DBL_ABS_EQUAL(a->decrement, b->decrement))
return(FALSE);
else if(a->apply_max_decrement != b->apply_max_decrement)
return(FALSE);
@@ -5342,7 +5321,7 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a,
return(FALSE);
else if(a->apply_empty_reserve != b->apply_empty_reserve)
return(FALSE);
- else if(HDfabs(a->empty_reserve - b->empty_reserve) > FP_EPSILON)
+ else if(!H5_DBL_ABS_EQUAL(a->empty_reserve, b->empty_reserve))
return(FALSE);
return(TRUE);
}
diff --git a/test/cache_common.h b/test/cache_common.h
index a309fa4..48b95d8 100644
--- a/test/cache_common.h
+++ b/test/cache_common.h
@@ -425,26 +425,26 @@ if ( ( (cache_ptr) == NULL ) || \
( (a).set_initial_size == (b).set_initial_size ) ) && \
( ( ! cmp_init_size ) || \
( (a).initial_size == (b).initial_size ) ) && \
- ( DBL_REL_EQUAL((a).min_clean_fraction, (b).min_clean_fraction, 0.00001 ) ) && \
+ ( H5_DBL_ABS_EQUAL((a).min_clean_fraction, (b).min_clean_fraction) ) && \
( (a).max_size == (b).max_size ) && \
( (a).min_size == (b).min_size ) && \
( (a).epoch_length == (b).epoch_length ) && \
( (a).incr_mode == (b).incr_mode ) && \
- ( DBL_REL_EQUAL((a).lower_hr_threshold, (b).lower_hr_threshold, 0.00001 ) ) && \
- ( DBL_REL_EQUAL((a).increment, (b).increment, 0.00001 ) ) && \
+ ( H5_DBL_ABS_EQUAL((a).lower_hr_threshold, (b).lower_hr_threshold) ) && \
+ ( H5_DBL_ABS_EQUAL((a).increment, (b).increment) ) && \
( (a).apply_max_increment == (b).apply_max_increment ) && \
( (a).max_increment == (b).max_increment ) && \
( (a).flash_incr_mode == (b).flash_incr_mode ) && \
- ( DBL_REL_EQUAL((a).flash_multiple, (b).flash_multiple, 0.00001 ) ) && \
- ( DBL_REL_EQUAL((a).flash_threshold, (b).flash_threshold, 0.00001 ) ) && \
+ ( H5_DBL_ABS_EQUAL((a).flash_multiple, (b).flash_multiple) ) && \
+ ( H5_DBL_ABS_EQUAL((a).flash_threshold, (b).flash_threshold) ) && \
( (a).decr_mode == (b).decr_mode ) && \
- ( DBL_REL_EQUAL((a).upper_hr_threshold, (b).upper_hr_threshold, 0.00001 ) ) && \
- ( DBL_REL_EQUAL((a).decrement, (b).decrement, 0.00001 ) ) && \
+ ( H5_DBL_ABS_EQUAL((a).upper_hr_threshold, (b).upper_hr_threshold) ) && \
+ ( H5_DBL_ABS_EQUAL((a).decrement, (b).decrement) ) && \
( (a).apply_max_decrement == (b).apply_max_decrement ) && \
( (a).max_decrement == (b).max_decrement ) && \
( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \
( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \
- ( DBL_REL_EQUAL((a).empty_reserve, (b).empty_reserve, 0.00001 ) ) && \
+ ( H5_DBL_ABS_EQUAL((a).empty_reserve, (b).empty_reserve) ) && \
( (a).dirty_bytes_threshold == (b).dirty_bytes_threshold ) && \
( (a).metadata_write_strategy == (b).metadata_write_strategy ) )
@@ -482,9 +482,6 @@ if ( ( (cache_ptr) == NULL ) || \
(i).empty_reserve = (e).empty_reserve; \
}
-/* Epsilon for floating-point comparisons */
-#define FP_EPSILON 0.000001f
-
/* misc type definitions */
@@ -532,13 +529,6 @@ extern const haddr_t base_addrs[NUMBER_OF_ENTRY_TYPES];
extern const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES];
extern const char * entry_type_names[NUMBER_OF_ENTRY_TYPES];
-
-/* call back function declarations: */
-
-herr_t check_write_permitted(const H5F_t * f,
- hid_t dxpl_id,
- hbool_t * write_permitted_ptr);
-
/* callback table extern */
extern const H5C_class_t types[NUMBER_OF_ENTRY_TYPES];
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index d81b7fc..5c591f8 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -1285,16 +1285,16 @@ compare_data(void *src_data, void *dst_data, hbool_t src_subset)
s_ptr->c[3] != d_ptr->c[3] ||
s_ptr->d != d_ptr->d ||
s_ptr->e != d_ptr->e ||
- !FLT_ABS_EQUAL(s_ptr->f, d_ptr->f) ||
- !FLT_ABS_EQUAL(s_ptr->g, d_ptr->g) ||
- !FLT_ABS_EQUAL(s_ptr->h[0], d_ptr->h[0]) ||
- !FLT_ABS_EQUAL(s_ptr->h[1], d_ptr->h[1]) ||
- !FLT_ABS_EQUAL(s_ptr->i, d_ptr->i) ||
- !FLT_ABS_EQUAL(s_ptr->j, d_ptr->j) ||
- !DBL_ABS_EQUAL(s_ptr->k, d_ptr->k) ||
- !DBL_ABS_EQUAL(s_ptr->l, d_ptr->l) ||
- !DBL_ABS_EQUAL(s_ptr->m, d_ptr->m) ||
- !DBL_ABS_EQUAL(s_ptr->n, d_ptr->n) ) {
+ !H5_FLT_ABS_EQUAL(s_ptr->f, d_ptr->f) ||
+ !H5_FLT_ABS_EQUAL(s_ptr->g, d_ptr->g) ||
+ !H5_FLT_ABS_EQUAL(s_ptr->h[0], d_ptr->h[0]) ||
+ !H5_FLT_ABS_EQUAL(s_ptr->h[1], d_ptr->h[1]) ||
+ !H5_FLT_ABS_EQUAL(s_ptr->i, d_ptr->i) ||
+ !H5_FLT_ABS_EQUAL(s_ptr->j, d_ptr->j) ||
+ !H5_DBL_ABS_EQUAL(s_ptr->k, d_ptr->k) ||
+ !H5_DBL_ABS_EQUAL(s_ptr->l, d_ptr->l) ||
+ !H5_DBL_ABS_EQUAL(s_ptr->m, d_ptr->m) ||
+ !H5_DBL_ABS_EQUAL(s_ptr->n, d_ptr->n) ) {
H5_FAILED();
printf(" i=%d\n", i);
diff --git a/test/cross_read.c b/test/cross_read.c
index 35dd2ce..b2fae89 100644
--- a/test/cross_read.c
+++ b/test/cross_read.c
@@ -126,7 +126,7 @@ static int check_data(const char *dsetname, hid_t fid, hbool_t floating_number)
/* Check results */
for (j=0; j<(NX+1); j++) {
for (i=0; i<NY; i++) {
- if (!DBL_REL_EQUAL(data_out[j][i], data_in[j][i], 0.001F)) {
+ if (!H5_DBL_REL_EQUAL(data_out[j][i], data_in[j][i], 0.001F)) {
if (!nerrors++) {
H5_FAILED();
printf("element [%d][%d] is %g but should have been %g\n",
diff --git a/test/dsets.c b/test/dsets.c
index 8055d27..e6b2ee4 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -5819,7 +5819,7 @@ test_set_local(hid_t fapl)
for(j=0; j<dims[1]; j++) {
/* If the difference between two values is greater than 0.001%, they're
* considered not equal. */
- if(!DBL_REL_EQUAL(points_dbl[i][j],check_dbl[i][j],0.00001F)) {
+ if(!H5_DBL_REL_EQUAL(points_dbl[i][j],check_dbl[i][j],0.00001F)) {
H5_FAILED();
printf(" Line %d: Read different values than written.\n",__LINE__);
printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
@@ -7127,7 +7127,7 @@ test_chunk_cache(hid_t fapl)
*/
if (H5Pget_cache(fapl_def, NULL, &nslots_1, &nbytes_1, &w0_1) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl1, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
- if ((nslots_1 != nslots_4) || (nbytes_1 != nbytes_4) || !DBL_ABS_EQUAL(w0_1, w0_4))
+ if ((nslots_1 != nslots_4) || (nbytes_1 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_1, w0_4))
FAIL_PUTS_ERROR(" Cache values from default dapl do not match those from fapl.")
/* Set a lapl property on dapl1 (to verify inheritance) */
@@ -7168,7 +7168,7 @@ test_chunk_cache(hid_t fapl)
/* Retrieve dapl from dataset, verfiy cache values are the same as on fapl_local */
if ((dapl2 = H5Dget_access_plist(dsid)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
- if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !DBL_ABS_EQUAL(w0_2, w0_4))
+ if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_2, w0_4))
FAIL_PUTS_ERROR(" Cache values from retrieved dapl do not match those from fapl.")
if (H5Pclose(dapl2) < 0) FAIL_STACK_ERROR
@@ -7190,7 +7190,7 @@ test_chunk_cache(hid_t fapl)
*/
if ((dapl2 = H5Dget_access_plist(dsid)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
- if ((nslots_3 != nslots_4) || (nbytes_2 != nbytes_4) || !DBL_ABS_EQUAL(w0_3, w0_4))
+ if ((nslots_3 != nslots_4) || (nbytes_2 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_3, w0_4))
FAIL_PUTS_ERROR(" Cache values from retrieved dapl do not match those from dapl1.")
if (H5Pclose(dapl2) < 0) FAIL_STACK_ERROR
@@ -7201,7 +7201,7 @@ test_chunk_cache(hid_t fapl)
/* Retrieve dapl from dataset, verfiy cache values are the same on fapl_local */
if ((dapl2 = H5Dget_access_plist(dsid)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
- if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !DBL_ABS_EQUAL(w0_2, w0_4))
+ if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_2, w0_4))
FAIL_PUTS_ERROR(" Cache values from retrieved dapl do not match those from fapl.")
if (H5Pclose(dapl2) < 0) FAIL_STACK_ERROR
@@ -7211,7 +7211,7 @@ test_chunk_cache(hid_t fapl)
FAIL_STACK_ERROR
if ((dapl2 = H5Dget_access_plist(dsid)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
- if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !DBL_ABS_EQUAL(w0_2, w0_4))
+ if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_2, w0_4))
FAIL_PUTS_ERROR(" Cache values from retrieved dapl do not match those from fapl.")
/* Don't close dapl2, we will use it in the next section */
@@ -7231,7 +7231,7 @@ test_chunk_cache(hid_t fapl)
if (H5Pclose(dapl2) < 0) FAIL_STACK_ERROR /* Close dapl2, to avoid id leak */
if ((dapl2 = H5Dget_access_plist(dsid)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
- if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !DBL_ABS_EQUAL(w0_2, w0_4))
+ if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_2, w0_4))
FAIL_PUTS_ERROR(" Cache values from retrieved dapl do not match those from dapl2.")
/* Test H5D_CHUNK_CACHE_NSLOTS_DEFAULT and H5D_CHUNK_CACHE_W0_DEFAULT */
@@ -7244,7 +7244,7 @@ test_chunk_cache(hid_t fapl)
if (H5Pclose(dapl2) < 0) FAIL_STACK_ERROR /* Close dapl2, to avoid id leak */
if ((dapl2 = H5Dget_access_plist(dsid)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
- if ((nslots_3 != nslots_4) || (nbytes_2 != nbytes_4) || !DBL_ABS_EQUAL(w0_3, w0_4))
+ if ((nslots_3 != nslots_4) || (nbytes_2 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_3, w0_4))
FAIL_PUTS_ERROR(" Cache values from retrieved dapl do not match those expected.")
if (H5Pclose(dapl2) < 0) FAIL_STACK_ERROR
@@ -7254,14 +7254,14 @@ test_chunk_cache(hid_t fapl)
if ((dsid = H5Oopen(fid, "dset", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if ((dapl2 = H5Dget_access_plist(dsid)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
- if ((nslots_3 != nslots_4) || (nbytes_3 != nbytes_4) || !DBL_ABS_EQUAL(w0_3, w0_4))
+ if ((nslots_3 != nslots_4) || (nbytes_3 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_3, w0_4))
FAIL_PUTS_ERROR(" Cache values from retrieved dapl do not match those from fapl.")
if (H5Pclose(dapl2) < 0) FAIL_STACK_ERROR
/* Verify functionality of H5Pcopy with a dapl */
if ((dapl2 = H5Pcopy(dapl1)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
- if ((nslots_3 != nslots_4) || (nbytes_1 != nbytes_4) || !DBL_ABS_EQUAL(w0_3, w0_4))
+ if ((nslots_3 != nslots_4) || (nbytes_1 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_3, w0_4))
FAIL_PUTS_ERROR(" Cache values from dapl2 do not match those from dapl1.")
/* Close */
diff --git a/test/h5test.c b/test/h5test.c
index d73c120..fefacda 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -700,21 +700,24 @@ h5_show_hostname(void)
{
char hostname[80];
#ifdef H5_HAVE_WIN32_API
- WSADATA wsaData;
- int err;
+ WSADATA wsaData;
+ int err;
#endif
/* try show the process or thread id in multiple processes cases*/
#ifdef H5_HAVE_PARALLEL
{
- int mpi_rank, mpi_initialized;
-
- MPI_Initialized(&mpi_initialized);
- if (mpi_initialized){
- MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
- printf("MPI-process %d.", mpi_rank);
- }else
- printf("thread 0.");
+ int mpi_rank, mpi_initialized, mpi_finalized;
+
+ MPI_Initialized(&mpi_initialized);
+ MPI_Finalized(&mpi_finalized);
+
+ if(mpi_initialized && !mpi_finalized) {
+ MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
+ printf("MPI-process %d.", mpi_rank);
+ }
+ else
+ printf("thread 0.");
}
#elif defined(H5_HAVE_THREADSAFE)
printf("thread %lu.", HDpthread_self_ulong());
@@ -723,31 +726,31 @@ h5_show_hostname(void)
#endif
#ifdef H5_HAVE_WIN32_API
- err = WSAStartup( MAKEWORD(2,2), &wsaData );
- if ( err != 0 ) {
- /* could not find a usable WinSock DLL */
- return;
- }
-
-/* Confirm that the WinSock DLL supports 2.2.*/
-/* Note that if the DLL supports versions greater */
-/* than 2.2 in addition to 2.2, it will still return */
-/* 2.2 in wVersion since that is the version we */
-/* requested. */
-
- if ( LOBYTE( wsaData.wVersion ) != 2 ||
- HIBYTE( wsaData.wVersion ) != 2 ) {
- /* could not find a usable WinSock DLL */
- WSACleanup( );
- return;
- }
+ err = WSAStartup( MAKEWORD(2,2), &wsaData );
+ if ( err != 0 ) {
+ /* could not find a usable WinSock DLL */
+ return;
+ }
+
+ /* Confirm that the WinSock DLL supports 2.2.*/
+ /* Note that if the DLL supports versions greater */
+ /* than 2.2 in addition to 2.2, it will still return */
+ /* 2.2 in wVersion since that is the version we */
+ /* requested. */
+
+ if ( LOBYTE( wsaData.wVersion ) != 2 ||
+ HIBYTE( wsaData.wVersion ) != 2 ) {
+ /* could not find a usable WinSock DLL */
+ WSACleanup( );
+ return;
+ }
#endif
#ifdef H5_HAVE_GETHOSTNAME
if (gethostname(hostname, (size_t)80) < 0)
- printf(" gethostname failed\n");
+ printf(" gethostname failed\n");
else
- printf(" hostname=%s\n", hostname);
+ printf(" hostname=%s\n", hostname);
#else
printf(" gethostname not supported\n");
#endif
@@ -1099,61 +1102,62 @@ int h5_szip_can_encode(void )
char *
getenv_all(MPI_Comm comm, int root, const char* name)
{
- int mpi_size, mpi_rank, mpi_initialized;
+ int mpi_size, mpi_rank, mpi_initialized, mpi_finalized;
int len;
static char* env = NULL;
assert(name);
MPI_Initialized(&mpi_initialized);
- if(!mpi_initialized) {
- /* use original getenv */
- if(env)
- HDfree(env);
- env = HDgetenv(name);
- } /* end if */
- else {
- MPI_Comm_rank(comm, &mpi_rank);
- MPI_Comm_size(comm, &mpi_size);
- assert(root < mpi_size);
-
- /* The root task does the getenv call
- * and sends the result to the other tasks */
- if(mpi_rank == root) {
- env = HDgetenv(name);
- if(env) {
- len = (int)HDstrlen(env);
- MPI_Bcast(&len, 1, MPI_INT, root, comm);
- MPI_Bcast(env, len, MPI_CHAR, root, comm);
- }
- else {
- /* len -1 indicates that the variable was not in the environment */
- len = -1;
- MPI_Bcast(&len, 1, MPI_INT, root, comm);
- }
- }
- else {
- MPI_Bcast(&len, 1, MPI_INT, root, comm);
- if(len >= 0) {
- if(env == NULL)
- env = (char*) HDmalloc((size_t)len+1);
- else if(HDstrlen(env) < (size_t)len)
- env = (char*) HDrealloc(env, (size_t)len+1);
-
- MPI_Bcast(env, len, MPI_CHAR, root, comm);
- env[len] = '\0';
- }
- else {
- if(env)
- HDfree(env);
- env = NULL;
- }
- }
- }
-
+ MPI_Finalized(&mpi_finalized);
+
+ if(mpi_initialized && !mpi_finalized) {
+ MPI_Comm_rank(comm, &mpi_rank);
+ MPI_Comm_size(comm, &mpi_size);
+ assert(root < mpi_size);
+
+ /* The root task does the getenv call
+ * and sends the result to the other tasks */
+ if(mpi_rank == root) {
+ env = HDgetenv(name);
+ if(env) {
+ len = (int)HDstrlen(env);
+ MPI_Bcast(&len, 1, MPI_INT, root, comm);
+ MPI_Bcast(env, len, MPI_CHAR, root, comm);
+ }
+ else {
+ /* len -1 indicates that the variable was not in the environment */
+ len = -1;
+ MPI_Bcast(&len, 1, MPI_INT, root, comm);
+ }
+ }
+ else {
+ MPI_Bcast(&len, 1, MPI_INT, root, comm);
+ if(len >= 0) {
+ if(env == NULL)
+ env = (char*) HDmalloc((size_t)len+1);
+ else if(HDstrlen(env) < (size_t)len)
+ env = (char*) HDrealloc(env, (size_t)len+1);
+
+ MPI_Bcast(env, len, MPI_CHAR, root, comm);
+ env[len] = '\0';
+ }
+ else {
+ if(env)
+ HDfree(env);
+ env = NULL;
+ }
+ }
#ifndef NDEBUG
- MPI_Barrier(comm);
+ MPI_Barrier(comm);
#endif
+ }
+ else {
+ /* use original getenv */
+ if(env)
+ HDfree(env);
+ env = HDgetenv(name);
+ } /* end if */
return env;
}
diff --git a/test/h5test.h b/test/h5test.h
index ce224d8..fa0c11b 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -118,24 +118,6 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
#define ALARM_ON TestAlarmOn()
#define ALARM_OFF HDalarm(0)
-/*
- * The methods to compare the equality of floating-point values:
- * 1. XXX_ABS_EQUAL - check if the difference is smaller than the
- * Epsilon value. The Epsilon values, FLT_EPSILON, DBL_EPSILON,
- * and LDBL_EPSILON, are defined by compiler in float.h.
- * 2. XXX_REL_EQUAL - check if the relative difference is smaller than a
- * predefined value M. See if two values are relatively equal.
- * It's the test's responsibility not to pass in the value 0, which
- * may cause the equation to fail.
- */
-#define FLT_ABS_EQUAL(X,Y) ((float)fabs(X-Y)<FLT_EPSILON)
-#define DBL_ABS_EQUAL(X,Y) (fabs(X-Y)<DBL_EPSILON)
-#define LDBL_ABS_EQUAL(X,Y) (fabsl(X-Y)<LDBL_EPSILON)
-
-#define FLT_REL_EQUAL(X,Y,M) (fabsf((Y-X)/X<M)
-#define DBL_REL_EQUAL(X,Y,M) (fabs((Y-X)/X)<M)
-#define LDBL_REL_EQUAL(X,Y,M) (fabsl((Y-X)/X)<M)
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/test/hyperslab.c b/test/hyperslab.c
index 9bc085c..2cf47b1 100644
--- a/test/hyperslab.c
+++ b/test/hyperslab.c
@@ -644,7 +644,7 @@ test_multifill(size_t nx)
for(i = 0; i < nx; i++) {
if(dst[i].left != 3333333)
sprintf(s, "bad dst[%lu].left", (unsigned long)i);
- else if(!DBL_ABS_EQUAL(dst[i].mid, fill.mid))
+ else if(!H5_DBL_ABS_EQUAL(dst[i].mid, fill.mid))
/* Check if two DOUBLE values are equal. If their difference
* is smaller than the EPSILON value for double, they are
* considered equal. See the definition in h5test.h.
diff --git a/test/tarray.c b/test/tarray.c
index 0923625..9c79f41 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -685,7 +685,7 @@ test_array_compound_atomic(void)
TestErrPrintf("Array data information doesn't match!, wdata[%d][%d].i=%d, rdata[%d][%d].i=%d\n", (int)i, (int)j, (int)wdata[i][j].i, (int)i, (int)j, (int)rdata[i][j].i);
continue;
} /* end if */
- if(!FLT_ABS_EQUAL(wdata[i][j].f, rdata[i][j].f)) {
+ if(!H5_FLT_ABS_EQUAL(wdata[i][j].f, rdata[i][j].f)) {
TestErrPrintf("Array data information doesn't match!, wdata[%d][%d].f=%f, rdata[%d][%d].f=%f\n", (int)i, (int)j, (double)wdata[i][j].f, (int)i, (int)j, (double)rdata[i][j].f);
continue;
} /* end if */
@@ -928,7 +928,7 @@ test_array_compound_array(void)
continue;
} /* end if */
for(k=0; k<ARRAY1_DIM1; k++)
- if(!FLT_ABS_EQUAL(wdata[i][j].f[k],rdata[i][j].f[k])) {
+ if(!H5_FLT_ABS_EQUAL(wdata[i][j].f[k],rdata[i][j].f[k])) {
TestErrPrintf("Array data information doesn't match!, wdata[%d][%d].f[%d]=%f, rdata[%d][%d].f[%d]=%f\n",(int)i,(int)j,(int)k,(double)wdata[i][j].f[k],(int)i,(int)j,(int)k,(double)rdata[i][j].f[k]);
continue;
} /* end if */
@@ -1618,11 +1618,11 @@ test_array_bkg(void)
TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]);
continue;
}
- if(!FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) {
+ if(!H5_FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) {
TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].b[j],(int)i,(int)j,(double)cfr[i].b[j]);
continue;
}
- if(!DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) {
+ if(!H5_DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) {
TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].c[j],(int)i,(int)j,(double)cfr[i].c[j]);
continue;
}
@@ -1685,7 +1685,7 @@ test_array_bkg(void)
for (i=0; i< LENGTH; i++)
for (j = 0; j < ALEN; j++)
- if(!FLT_ABS_EQUAL(fld[i].b[j],fldr[i].b[j])) {
+ if(!H5_FLT_ABS_EQUAL(fld[i].b[j],fldr[i].b[j])) {
TestErrPrintf("Field data doesn't match, fld[%d].b[%d]=%f, fldr[%d].b[%d]=%f\n",(int)i,(int)j,(double)fld[i].b[j],(int)i,(int)j,(double)fldr[i].b[j]);
continue;
}
@@ -1711,11 +1711,11 @@ test_array_bkg(void)
TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]);
continue;
}
- if(!FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) {
+ if(!H5_FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) {
TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].b[j],(int)i,(int)j,(double)cfr[i].b[j]);
continue;
}
- if(!DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) {
+ if(!H5_DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) {
TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].c[j],(int)i,(int)j,(double)cfr[i].c[j]);
continue;
}
@@ -1760,11 +1760,11 @@ test_array_bkg(void)
TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]);
continue;
}
- if(!FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) {
+ if(!H5_FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) {
TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].b[j],(int)i,(int)j,(double)cfr[i].b[j]);
continue;
}
- if(!DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) {
+ if(!H5_DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) {
TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].c[j],(int)i,(int)j,(double)cfr[i].c[j]);
continue;
}
diff --git a/test/tattr.c b/test/tattr.c
index 9429f31..137c7c9 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -522,7 +522,7 @@ test_attr_flush(hid_t fapl)
ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
- if(!DBL_ABS_EQUAL(rdata,0.0F))
+ if(!H5_DBL_ABS_EQUAL(rdata,0.0F))
TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,(double)0.0F);
ret=H5Fflush(fil, H5F_SCOPE_GLOBAL);
@@ -531,7 +531,7 @@ test_attr_flush(hid_t fapl)
ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
- if(!DBL_ABS_EQUAL(rdata,0.0F))
+ if(!H5_DBL_ABS_EQUAL(rdata,0.0F))
TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,(double)0.0F);
ret=H5Awrite(att, H5T_NATIVE_DOUBLE, &wdata);
@@ -540,7 +540,7 @@ test_attr_flush(hid_t fapl)
ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
- if(!DBL_ABS_EQUAL(rdata,wdata))
+ if(!H5_DBL_ABS_EQUAL(rdata,wdata))
TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,wdata);
ret=H5Sclose(spc);
@@ -1014,7 +1014,7 @@ test_attr_scalar_read(hid_t fapl)
CHECK(ret, FAIL, "H5Aread");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!FLT_ABS_EQUAL(rdata, attr_data5))
+ if(!H5_FLT_ABS_EQUAL(rdata, attr_data5))
printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__);
@@ -1355,7 +1355,7 @@ test_attr_mult_read(hid_t fapl)
for(i = 0; i < ATTR3_DIM1; i++)
for(j = 0; j < ATTR3_DIM2; j++)
for(k = 0; k < ATTR3_DIM3; k++)
- if(!DBL_ABS_EQUAL(attr_data3[i][j][k], read_data3[i][j][k]))
+ if(!H5_DBL_ABS_EQUAL(attr_data3[i][j][k], read_data3[i][j][k]))
TestErrPrintf("%d: attribute data different: attr_data3[%d][%d][%d]=%f, read_data3[%d][%d][%d]=%f\n", __LINE__, i, j, k, attr_data3[i][j][k], i, j, k, read_data3[i][j][k]);
/* Verify Name */
diff --git a/test/tgenprop.c b/test/tgenprop.c
index bf4f3fa..10cae6d 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -681,7 +681,7 @@ test_genprop_basic_list(void)
ret = H5Pget(lid1, PROP2_NAME,&prop2_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
+ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
@@ -773,7 +773,7 @@ test_genprop_basic_list_prop(void)
ret = H5Pget(lid1, PROP2_NAME,&prop2_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
+ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
@@ -786,7 +786,7 @@ test_genprop_basic_list_prop(void)
ret = H5Pget(lid1, PROP4_NAME,&prop4_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
+ if(!H5_FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
@@ -823,7 +823,7 @@ test_genprop_basic_list_prop(void)
ret = H5Pget(lid1, PROP4_NAME,&prop4_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
+ if(!H5_FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
@@ -1237,7 +1237,7 @@ test_genprop_list_callback(void)
ret = H5Pget(lid1, PROP2_NAME,&prop2_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
+ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
@@ -1252,7 +1252,7 @@ test_genprop_list_callback(void)
ret = H5Pget(lid1, PROP4_NAME,&prop4_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
+ if(!H5_FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
diff --git a/test/th5s.c b/test/th5s.c
index 7c1c46e..1560ef4 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -1683,7 +1683,7 @@ test_h5s_chunk(void)
for(i=0; i<50000; i++) {
for(j=0; j<3; j++) {
/* Check if the two values are within 0.001% range. */
- if(!DBL_REL_EQUAL(chunk_data_dbl[i][j], chunk_data_flt[i][j], 0.00001F))
+ if(!H5_DBL_REL_EQUAL(chunk_data_dbl[i][j], chunk_data_flt[i][j], 0.00001F))
TestErrPrintf("%u: chunk_data_dbl[%d][%d]=%e, chunk_data_flt[%d][%d]=%e\n", (unsigned)__LINE__, i, j, chunk_data_dbl[i][j], i, j, (double)chunk_data_flt[i][j]);
} /* end for */
} /* end for */
diff --git a/test/tmisc.c b/test/tmisc.c
index 45c5b4d..388ced1 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -2486,7 +2486,7 @@ test_misc14(void)
/* Check data from first dataset */
ret = H5Dread(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
- if(!DBL_ABS_EQUAL(rdata, data1))
+ if(!H5_DBL_ABS_EQUAL(rdata, data1))
TestErrPrintf("Error on line %d: data1!=rdata\n",__LINE__);
/* Unlink second dataset */
@@ -2500,7 +2500,7 @@ test_misc14(void)
/* Verify the data from dataset #1 */
ret = H5Dread(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
- if(!DBL_ABS_EQUAL(rdata,data1))
+ if(!H5_DBL_ABS_EQUAL(rdata,data1))
TestErrPrintf("Error on line %d: data1!=rdata\n",__LINE__);
/* Close first dataset */
@@ -2534,7 +2534,7 @@ test_misc14(void)
/* Check data from second dataset */
ret = H5Dread(Dataset2, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
- if(!DBL_ABS_EQUAL(rdata,data2))
+ if(!H5_DBL_ABS_EQUAL(rdata,data2))
TestErrPrintf("Error on line %d: data2!=rdata\n",__LINE__);
/* Unlink first dataset */
@@ -2548,7 +2548,7 @@ test_misc14(void)
/* Verify the data from dataset #2 */
ret = H5Dread(Dataset2, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
- if(!DBL_ABS_EQUAL(rdata,data2))
+ if(!H5_DBL_ABS_EQUAL(rdata,data2))
TestErrPrintf("Error on line %d: data2!=rdata\n",__LINE__);
/* Close second dataset */
@@ -2589,13 +2589,13 @@ test_misc14(void)
/* Check data from first dataset */
ret = H5Dread(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
- if(!DBL_ABS_EQUAL(rdata,data1))
+ if(!H5_DBL_ABS_EQUAL(rdata,data1))
TestErrPrintf("Error on line %d: data1!=rdata\n",__LINE__);
/* Check data from third dataset */
ret = H5Dread(Dataset3, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
- if(!DBL_ABS_EQUAL(rdata,data3))
+ if(!H5_DBL_ABS_EQUAL(rdata,data3))
TestErrPrintf("Error on line %d: data3!=rdata\n",__LINE__);
/* Unlink second dataset */
@@ -2609,13 +2609,13 @@ test_misc14(void)
/* Verify the data from dataset #1 */
ret = H5Dread(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
- if(!DBL_ABS_EQUAL(rdata,data1))
+ if(!H5_DBL_ABS_EQUAL(rdata,data1))
TestErrPrintf("Error on line %d: data1!=rdata\n",__LINE__);
/* Verify the data from dataset #3 */
ret = H5Dread(Dataset3, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
- if(!DBL_ABS_EQUAL(rdata,data3))
+ if(!H5_DBL_ABS_EQUAL(rdata,data3))
TestErrPrintf("Error on line %d: data3!=rdata\n",__LINE__);
/* Close first dataset */
diff --git a/test/tvltypes.c b/test/tvltypes.c
index 19e8252..d1a4235 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -798,7 +798,7 @@ test_vltypes_vlen_compound(void)
TestErrPrintf("VL data values don't match!, wdata[%d].p[%d].i=%d, rdata[%d].p[%d].i=%d\n",(int)i,(int)j, (int)((s1 *)wdata[i].p)[j].i, (int)i,(int)j, (int)((s1 *)rdata[i].p)[j].i);
continue;
} /* end if */
- if(!FLT_ABS_EQUAL(((s1 *)wdata[i].p)[j].f,((s1 *)rdata[i].p)[j].f)) {
+ if(!H5_FLT_ABS_EQUAL(((s1 *)wdata[i].p)[j].f,((s1 *)rdata[i].p)[j].f)) {
TestErrPrintf("VL data values don't match!, wdata[%d].p[%d].f=%f, rdata[%d].p[%d].f=%f\n",(int)i,(int)j, (double)((s1 *)wdata[i].p)[j].f, (int)i,(int)j, (double)((s1 *)rdata[i].p)[j].f);
continue;
} /* end if */
@@ -943,7 +943,7 @@ rewrite_vltypes_vlen_compound(void)
TestErrPrintf("VL data values don't match!, wdata[%d].p[%d].i=%d, rdata[%d].p[%d].i=%d\n",(int)i,(int)j, (int)((s1 *)wdata[i].p)[j].i, (int)i,(int)j, (int)((s1 *)rdata[i].p)[j].i);
continue;
} /* end if */
- if(!FLT_ABS_EQUAL(((s1 *)wdata[i].p)[j].f,((s1 *)rdata[i].p)[j].f)) {
+ if(!H5_FLT_ABS_EQUAL(((s1 *)wdata[i].p)[j].f,((s1 *)rdata[i].p)[j].f)) {
TestErrPrintf("VL data values don't match!, wdata[%d].p[%d].f=%f, rdata[%d].p[%d].f=%f\n",(int)i,(int)j, (double)((s1 *)wdata[i].p)[j].f, (int)i,(int)j, (double)((s1 *)rdata[i].p)[j].f);
continue;
} /* end if */
@@ -1092,7 +1092,7 @@ test_vltypes_compound_vlen_vlen(void)
TestErrPrintf("Integer components don't match!, wdata[%d].i=%d, rdata[%d].i=%d\n",(int)i,(int)wdata[i].i,(int)i,(int)rdata[i].i);
continue;
} /* end if */
- if(!FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
+ if(!H5_FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
TestErrPrintf("Float components don't match!, wdata[%d].f=%f, rdata[%d].f=%f\n",(int)i,(double)wdata[i].f,(int)i,(double)rdata[i].f);
continue;
} /* end if */
@@ -1546,7 +1546,7 @@ test_vltypes_compound_vlen_atomic(void)
TestErrPrintf("Integer components don't match!, wdata[%d].i=%d, rdata[%d].i=%d\n",(int)i,(int)wdata[i].i,(int)i,(int)rdata[i].i);
continue;
} /* end if */
- if(!FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
+ if(!H5_FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
TestErrPrintf("Float components don't match!, wdata[%d].f=%f, rdata[%d].f=%f\n",(int)i,(double)wdata[i].f,(int)i,(double)rdata[i].f);
continue;
} /* end if */
@@ -1595,7 +1595,7 @@ test_vltypes_compound_vlen_atomic(void)
/* Check data read in */
for(i = 0; i < SPACE1_DIM1; i++)
- if(rdata[i].i != 0 || !FLT_ABS_EQUAL(rdata[i].f, 0.0F) || rdata[i].v.len != 0 || rdata[i].v.p != NULL)
+ if(rdata[i].i != 0 || !H5_FLT_ABS_EQUAL(rdata[i].f, 0.0F) || rdata[i].v.len != 0 || rdata[i].v.p != NULL)
TestErrPrintf("VL doesn't match!, rdata[%d].i=%d, rdata[%d].f=%f, rdata[%d].v.len=%u, rdata[%d].v.p=%p\n",(int)i,rdata[i].i,(int)i,(double)rdata[i].f,(int)i,(unsigned)rdata[i].v.len,(int)i,rdata[i].v.p);
/* Write dataset to disk */
@@ -1612,7 +1612,7 @@ test_vltypes_compound_vlen_atomic(void)
TestErrPrintf("Integer components don't match!, wdata[%d].i=%d, rdata[%d].i=%d\n",(int)i,(int)wdata[i].i,(int)i,(int)rdata[i].i);
continue;
} /* end if */
- if(!FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
+ if(!H5_FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
TestErrPrintf("Float components don't match!, wdata[%d].f=%f, rdata[%d].f=%f\n",(int)i,(double)wdata[i].f,(int)i,(double)rdata[i].f);
continue;
} /* end if */
@@ -1764,7 +1764,7 @@ rewrite_vltypes_compound_vlen_atomic(void)
TestErrPrintf("Integer components don't match!, wdata[%d].i=%d, rdata[%d].i=%d\n",(int)i,(int)wdata[i].i,(int)i,(int)rdata[i].i);
continue;
} /* end if */
- if(!FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
+ if(!H5_FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
TestErrPrintf("Float components don't match!, wdata[%d].f=%f, rdata[%d].f=%f\n",(int)i,(double)wdata[i].f,(int)i,(double)rdata[i].f);
continue;
} /* end if */
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt
index 70e0246..b02c8e2 100644
--- a/testpar/CMakeLists.txt
+++ b/testpar/CMakeLists.txt
@@ -48,6 +48,7 @@ set (H5P_TESTS
t_pflush2
t_pshutdown
t_prestart
+ t_init_term
t_shapesame
)
diff --git a/testpar/Makefile.am b/testpar/Makefile.am
index 1eae439..4fe0ba8 100644
--- a/testpar/Makefile.am
+++ b/testpar/Makefile.am
@@ -25,7 +25,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test
# Test programs. These are our main targets.
#
-TEST_PROG_PARA=t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_pshutdown t_prestart t_shapesame
+TEST_PROG_PARA=t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_pshutdown t_prestart t_init_term t_shapesame
check_PROGRAMS = $(TEST_PROG_PARA)
@@ -40,7 +40,8 @@ LDADD = $(LIBH5TEST) $(LIBHDF5)
# MPItest.h5 is from t_mpi
# Para*.h5 are from testphdf
# shutdown.h5 is from t_pshutdown
+# after_mpi_fin.h5 is from t_init_term
# go is used for debugging. See testphdf5.c.
-CHECK_CLEANFILES+=MPItest.h5 Para*.h5 CacheTestDummy.h5 shutdown.h5 go
+CHECK_CLEANFILES+=MPItest.h5 Para*.h5 CacheTestDummy.h5 shutdown.h5 after_mpi_fin.h5 go
include $(top_srcdir)/config/conclude.am
diff --git a/testpar/Makefile.in b/testpar/Makefile.in
index 7787a65..dc339cd 100644
--- a/testpar/Makefile.in
+++ b/testpar/Makefile.in
@@ -113,7 +113,7 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__EXEEXT_1 = t_mpi$(EXEEXT) testphdf5$(EXEEXT) t_cache$(EXEEXT) \
t_pflush1$(EXEEXT) t_pflush2$(EXEEXT) t_pshutdown$(EXEEXT) \
- t_prestart$(EXEEXT) t_shapesame$(EXEEXT)
+ t_prestart$(EXEEXT) t_init_term$(EXEEXT) t_shapesame$(EXEEXT)
t_cache_SOURCES = t_cache.c
t_cache_OBJECTS = t_cache.$(OBJEXT)
t_cache_LDADD = $(LDADD)
@@ -122,6 +122,10 @@ AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
+t_init_term_SOURCES = t_init_term.c
+t_init_term_OBJECTS = t_init_term.$(OBJEXT)
+t_init_term_LDADD = $(LDADD)
+t_init_term_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5)
t_mpi_SOURCES = t_mpi.c
t_mpi_OBJECTS = t_mpi.$(OBJEXT)
t_mpi_LDADD = $(LDADD)
@@ -188,10 +192,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-SOURCES = t_cache.c t_mpi.c t_pflush1.c t_pflush2.c t_prestart.c \
- t_pshutdown.c t_shapesame.c $(testphdf5_SOURCES)
-DIST_SOURCES = t_cache.c t_mpi.c t_pflush1.c t_pflush2.c t_prestart.c \
- t_pshutdown.c t_shapesame.c $(testphdf5_SOURCES)
+SOURCES = t_cache.c t_init_term.c t_mpi.c t_pflush1.c t_pflush2.c \
+ t_prestart.c t_pshutdown.c t_shapesame.c $(testphdf5_SOURCES)
+DIST_SOURCES = t_cache.c t_init_term.c t_mpi.c t_pflush1.c t_pflush2.c \
+ t_prestart.c t_pshutdown.c t_shapesame.c $(testphdf5_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -687,13 +691,14 @@ TRACE = perl $(top_srcdir)/bin/trace
# MPItest.h5 is from t_mpi
# Para*.h5 are from testphdf
# shutdown.h5 is from t_pshutdown
+# after_mpi_fin.h5 is from t_init_term
# go is used for debugging. See testphdf5.c.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 MPItest.h5 \
- Para*.h5 CacheTestDummy.h5 shutdown.h5 go
+ Para*.h5 CacheTestDummy.h5 shutdown.h5 after_mpi_fin.h5 go
# Test programs. These are our main targets.
#
-TEST_PROG_PARA = t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_pshutdown t_prestart t_shapesame
+TEST_PROG_PARA = t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_pshutdown t_prestart t_init_term t_shapesame
testphdf5_SOURCES = testphdf5.c t_dset.c t_file.c t_file_image.c t_mdset.c \
t_ph5basic.c t_coll_chunk.c t_span_tree.c t_chunk_alloc.c t_filter_read.c \
t_prop.c
@@ -770,6 +775,10 @@ t_cache$(EXEEXT): $(t_cache_OBJECTS) $(t_cache_DEPENDENCIES) $(EXTRA_t_cache_DEP
@rm -f t_cache$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(t_cache_OBJECTS) $(t_cache_LDADD) $(LIBS)
+t_init_term$(EXEEXT): $(t_init_term_OBJECTS) $(t_init_term_DEPENDENCIES) $(EXTRA_t_init_term_DEPENDENCIES)
+ @rm -f t_init_term$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(t_init_term_OBJECTS) $(t_init_term_LDADD) $(LIBS)
+
t_mpi$(EXEEXT): $(t_mpi_OBJECTS) $(t_mpi_DEPENDENCIES) $(EXTRA_t_mpi_DEPENDENCIES)
@rm -f t_mpi$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(t_mpi_OBJECTS) $(t_mpi_LDADD) $(LIBS)
@@ -811,6 +820,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_file.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_file_image.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_filter_read.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_init_term.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_mdset.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_mpi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_pflush1.Po@am__quote@
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 74381d3..701a780 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -31,6 +31,7 @@
#include "H5Iprivate.h"
+#define BASE_ADDR (haddr_t)512
int nerrors = 0;
@@ -556,7 +557,6 @@ reset_stats(void)
static hbool_t
set_up_file_communicator(void)
{
- const char * fcn_name = "set_up_file_communicator()";
hbool_t success = TRUE;
int mpi_result;
int num_excluded_ranks;
@@ -575,7 +575,7 @@ set_up_file_communicator(void)
if ( verbose ) {
fprintf(stdout,
"%d:%s: MPI_Comm_group() failed with error %d.\n",
- world_mpi_rank, fcn_name, mpi_result);
+ world_mpi_rank, FUNC, mpi_result);
}
}
}
@@ -594,7 +594,7 @@ set_up_file_communicator(void)
if ( verbose ) {
fprintf(stdout,
"%d:%s: MPI_Group_excl() failed with error %d.\n",
- world_mpi_rank, fcn_name, mpi_result);
+ world_mpi_rank, FUNC, mpi_result);
}
}
}
@@ -611,7 +611,7 @@ set_up_file_communicator(void)
if ( verbose ) {
fprintf(stdout,
"%d:%s: MPI_Comm_create() failed with error %d.\n",
- world_mpi_rank, fcn_name, mpi_result);
+ world_mpi_rank, FUNC, mpi_result);
}
} else {
@@ -625,7 +625,7 @@ set_up_file_communicator(void)
if ( verbose ) {
fprintf(stdout,
"%d:%s: file_mpi_comm == MPI_COMM_NULL.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
} else {
@@ -639,7 +639,7 @@ set_up_file_communicator(void)
if ( verbose ) {
fprintf(stdout,
"%d:%s: file_mpi_comm != MPI_COMM_NULL.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -657,7 +657,7 @@ set_up_file_communicator(void)
if ( verbose ) {
fprintf(stdout,
"%d:%s: MPI_Comm_size() failed with error %d.\n",
- world_mpi_rank, fcn_name, mpi_result);
+ world_mpi_rank, FUNC, mpi_result);
}
}
}
@@ -673,7 +673,7 @@ set_up_file_communicator(void)
if ( verbose ) {
fprintf(stdout,
"%d:%s: MPI_Comm_rank() failed with error %d.\n",
- world_mpi_rank, fcn_name, mpi_result);
+ world_mpi_rank, FUNC, mpi_result);
}
}
}
@@ -704,7 +704,6 @@ set_up_file_communicator(void)
static int
addr_to_datum_index(haddr_t base_addr)
{
- /* const char * fcn_name = "addr_to_datum_index()"; */
int top = NUM_DATA_ENTRIES - 1;
int bottom = 0;
int middle = (NUM_DATA_ENTRIES - 1) / 2;
@@ -752,7 +751,6 @@ addr_to_datum_index(haddr_t base_addr)
static void
init_data(void)
{
- /* const char * fcn_name = "init_data()"; */
/* The set of address offsets is chosen so as to avoid allowing the
* base addresses to fall in a pattern of that will annoy the hash
* table, and to give a good range of entry sizes.
@@ -767,7 +765,7 @@ init_data(void)
1974, 3194, 5168, 8362, 13539};
int i;
int j = 0;
- haddr_t addr = 512;
+ haddr_t addr = BASE_ADDR;
/* this must hold so moves don't change entry size. */
HDassert( (NUM_DATA_ENTRIES / 2) % 20 == 0 );
@@ -830,7 +828,6 @@ init_data(void)
static int
do_express_test(void)
{
- const char * fcn_name = "do_express_test()";
int express_test;
int max_express_test;
int result;
@@ -850,7 +847,7 @@ do_express_test(void)
max_express_test = -1;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: MPI_Allreduce() failed.\n",
- world_mpi_rank, fcn_name );
+ world_mpi_rank, FUNC );
}
}
@@ -879,7 +876,6 @@ do_express_test(void)
static void
do_sync(void)
{
- const char * fcn_name = "do_sync()";
struct mssg_t mssg;
@@ -901,7 +897,7 @@ do_sync(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -913,7 +909,7 @@ do_sync(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else if ( ( mssg.req != SYNC_ACK_CODE ) ||
( mssg.src != world_server_mpi_rank ) ||
@@ -923,7 +919,7 @@ do_sync(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad data in sync ack.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -951,7 +947,6 @@ do_sync(void)
static int
get_max_nerrors(void)
{
- const char * fcn_name = "get_max_nerrors()";
int max_nerrors;
int result;
@@ -968,7 +963,7 @@ get_max_nerrors(void)
max_nerrors = -1;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: MPI_Allreduce() failed.\n",
- world_mpi_rank, fcn_name );
+ world_mpi_rank, FUNC );
}
}
@@ -1007,7 +1002,6 @@ static hbool_t
recv_mssg(struct mssg_t *mssg_ptr,
int mssg_tag_offset)
{
- const char * fcn_name = "recv_mssg()";
hbool_t success = TRUE;
int mssg_tag = CACHE_TEST_TAG;
int result;
@@ -1021,7 +1015,7 @@ recv_mssg(struct mssg_t *mssg_ptr,
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: bad param(s) on entry.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
@@ -1039,7 +1033,7 @@ recv_mssg(struct mssg_t *mssg_ptr,
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: MPI_Recv() failed.\n",
- world_mpi_rank, fcn_name );
+ world_mpi_rank, FUNC );
}
} else if ( mssg_ptr->magic != MSSG_MAGIC ) {
@@ -1047,7 +1041,7 @@ recv_mssg(struct mssg_t *mssg_ptr,
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: invalid magic.\n", world_mpi_rank,
- fcn_name);
+ FUNC);
}
} else if ( mssg_ptr->src != status.MPI_SOURCE ) {
@@ -1056,7 +1050,7 @@ recv_mssg(struct mssg_t *mssg_ptr,
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: mssg_ptr->src != status.MPI_SOURCE.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -1091,7 +1085,6 @@ static hbool_t
send_mssg(struct mssg_t *mssg_ptr,
hbool_t add_req_to_tag)
{
- const char * fcn_name = "send_mssg()";
hbool_t success = TRUE;
int mssg_tag = CACHE_TEST_TAG;
int result;
@@ -1110,7 +1103,7 @@ send_mssg(struct mssg_t *mssg_ptr,
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Invalid mssg on entry.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -1132,7 +1125,7 @@ send_mssg(struct mssg_t *mssg_ptr,
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: MPI_Send() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -1159,7 +1152,6 @@ send_mssg(struct mssg_t *mssg_ptr,
static hbool_t
setup_derived_types(void)
{
- const char * fcn_name = "setup_derived_types()";
hbool_t success = TRUE;
int i;
int result;
@@ -1185,7 +1177,7 @@ setup_derived_types(void)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: MPI_Address() call failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
@@ -1207,7 +1199,7 @@ setup_derived_types(void)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: MPI_Type_struct() call failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -1222,7 +1214,7 @@ setup_derived_types(void)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: MPI_Type_commit() call failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -1249,7 +1241,6 @@ setup_derived_types(void)
static hbool_t
takedown_derived_types(void)
{
- const char * fcn_name = "takedown_derived_types()";
hbool_t success = TRUE;
int result;
@@ -1261,7 +1252,7 @@ takedown_derived_types(void)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: MPI_Type_free() call failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -1291,7 +1282,6 @@ takedown_derived_types(void)
static hbool_t
reset_server_counters(void)
{
- const char * fcn_name = "reset_server_counters()";
hbool_t success = TRUE;
int i;
long actual_total_reads = 0;
@@ -1318,7 +1308,7 @@ reset_server_counters(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: actual/total reads mismatch (%ld/%ld).\n",
- world_mpi_rank, fcn_name,
+ world_mpi_rank, FUNC,
actual_total_reads, total_reads);
}
}
@@ -1329,7 +1319,7 @@ reset_server_counters(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: actual/total writes mismatch (%ld/%ld).\n",
- world_mpi_rank, fcn_name,
+ world_mpi_rank, FUNC,
actual_total_writes, total_writes);
}
}
@@ -1368,7 +1358,6 @@ reset_server_counters(void)
static hbool_t
server_main(void)
{
- const char * fcn_name = "server_main()";
hbool_t done = FALSE;
hbool_t success = TRUE;
int done_count = 0;
@@ -1380,7 +1369,7 @@ server_main(void)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: This isn't the server process?!?!?\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -1400,7 +1389,7 @@ server_main(void)
case WRITE_REQ_ACK_CODE:
success = FALSE;
if(verbose)
- HDfprintf(stdout, "%s: Received write ack?!?.\n", fcn_name);
+ HDfprintf(stdout, "%s: Received write ack?!?.\n", FUNC);
break;
case READ_REQ_CODE:
@@ -1410,7 +1399,7 @@ server_main(void)
case READ_REQ_REPLY_CODE:
success = FALSE;
if(verbose)
- HDfprintf(stdout, "%s: Received read req reply?!?.\n", fcn_name);
+ HDfprintf(stdout, "%s: Received read req reply?!?.\n", FUNC);
break;
case SYNC_REQ_CODE:
@@ -1420,7 +1409,7 @@ server_main(void)
case SYNC_ACK_CODE:
success = FALSE;
if(verbose)
- HDfprintf(stdout, "%s: Received sync ack?!?.\n", fcn_name);
+ HDfprintf(stdout, "%s: Received sync ack?!?.\n", FUNC);
break;
case REQ_TTL_WRITES_CODE:
@@ -1430,7 +1419,7 @@ server_main(void)
case REQ_TTL_WRITES_RPLY_CODE:
success = FALSE;
if(verbose)
- HDfprintf(stdout, "%s: Received total writes reply?!?.\n", fcn_name);
+ HDfprintf(stdout, "%s: Received total writes reply?!?.\n", FUNC);
break;
case REQ_TTL_READS_CODE:
@@ -1440,7 +1429,7 @@ server_main(void)
case REQ_TTL_READS_RPLY_CODE:
success = FALSE;
if(verbose)
- HDfprintf(stdout, "%s: Received total reads reply?!?.\n", fcn_name);
+ HDfprintf(stdout, "%s: Received total reads reply?!?.\n", FUNC);
break;
case REQ_ENTRY_WRITES_CODE:
@@ -1450,7 +1439,7 @@ server_main(void)
case REQ_ENTRY_WRITES_RPLY_CODE:
success = FALSE;
if(verbose)
- HDfprintf(stdout, "%s: Received entry writes reply?!?.\n", fcn_name);
+ HDfprintf(stdout, "%s: Received entry writes reply?!?.\n", FUNC);
break;
case REQ_ENTRY_READS_CODE:
@@ -1460,7 +1449,7 @@ server_main(void)
case REQ_ENTRY_READS_RPLY_CODE:
success = FALSE;
if(verbose)
- HDfprintf(stdout, "%s: Received entry reads reply?!?.\n", fcn_name);
+ HDfprintf(stdout, "%s: Received entry reads reply?!?.\n", FUNC);
break;
case REQ_RW_COUNT_RESET_CODE:
@@ -1470,7 +1459,7 @@ server_main(void)
case REQ_RW_COUNT_RESET_RPLY_CODE:
success = FALSE;
if(verbose)
- HDfprintf(stdout, "%s: Received RW count reset reply?!?.\n", fcn_name);
+ HDfprintf(stdout, "%s: Received RW count reset reply?!?.\n", FUNC);
break;
case DONE_REQ_CODE:
@@ -1483,7 +1472,7 @@ server_main(void)
nerrors++;
success = FALSE;
if(verbose)
- HDfprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, fcn_name);
+ HDfprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, FUNC);
break;
}
}
@@ -1515,7 +1504,6 @@ server_main(void)
static hbool_t
serve_read_request(struct mssg_t * mssg_ptr)
{
- const char * fcn_name = "serve_read_request()";
hbool_t report_mssg = FALSE;
hbool_t success = TRUE;
int target_index;
@@ -1530,7 +1518,7 @@ serve_read_request(struct mssg_t * mssg_ptr)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -1545,7 +1533,7 @@ serve_read_request(struct mssg_t * mssg_ptr)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: addr lookup failed for %a.\n",
- world_mpi_rank, fcn_name, target_addr);
+ world_mpi_rank, FUNC, target_addr);
}
} else if ( data[target_index].len != mssg_ptr->len ) {
@@ -1554,7 +1542,7 @@ serve_read_request(struct mssg_t * mssg_ptr)
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: data[i].len = %Zu != mssg->len = %d.\n",
- world_mpi_rank, fcn_name,
+ world_mpi_rank, FUNC,
data[target_index].len, mssg_ptr->len);
}
} else if ( ! (data[target_index].valid) ) {
@@ -1564,7 +1552,7 @@ serve_read_request(struct mssg_t * mssg_ptr)
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: proc %d read invalid entry. idx/base_addr = %d/%a.\n",
- world_mpi_rank, fcn_name,
+ world_mpi_rank, FUNC,
mssg_ptr->src,
target_index,
data[target_index].base_addr);
@@ -1643,7 +1631,6 @@ serve_read_request(struct mssg_t * mssg_ptr)
static hbool_t
serve_sync_request(struct mssg_t * mssg_ptr)
{
- const char * fcn_name = "serve_sync_request()";
hbool_t report_mssg = FALSE;
hbool_t success = TRUE;
struct mssg_t reply;
@@ -1656,7 +1643,7 @@ serve_sync_request(struct mssg_t * mssg_ptr)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -1718,7 +1705,6 @@ serve_sync_request(struct mssg_t * mssg_ptr)
static hbool_t
serve_write_request(struct mssg_t * mssg_ptr)
{
- const char * fcn_name = "serve_write_request()";
hbool_t report_mssg = FALSE;
hbool_t success = TRUE;
int target_index;
@@ -1736,7 +1722,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -1751,7 +1737,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: addr lookup failed for %a.\n",
- world_mpi_rank, fcn_name, target_addr);
+ world_mpi_rank, FUNC, target_addr);
}
} else if ( data[target_index].len != mssg_ptr->len ) {
@@ -1760,7 +1746,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: data[i].len = %Zu != mssg->len = %d.\n",
- world_mpi_rank, fcn_name,
+ world_mpi_rank, FUNC,
data[target_index].len, mssg_ptr->len);
}
}
@@ -1777,7 +1763,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: new ver = %d <= old ver = %d.\n",
- world_mpi_rank, fcn_name,
+ world_mpi_rank, FUNC,
new_ver_num, data[target_index].ver);
}
}
@@ -1861,7 +1847,6 @@ serve_write_request(struct mssg_t * mssg_ptr)
static hbool_t
serve_total_writes_request(struct mssg_t * mssg_ptr)
{
- const char * fcn_name = "serve_total_writes_request()";
hbool_t report_mssg = FALSE;
hbool_t success = TRUE;
struct mssg_t reply;
@@ -1874,7 +1859,7 @@ serve_total_writes_request(struct mssg_t * mssg_ptr)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -1941,7 +1926,6 @@ serve_total_writes_request(struct mssg_t * mssg_ptr)
static hbool_t
serve_total_reads_request(struct mssg_t * mssg_ptr)
{
- const char * fcn_name = "serve_total_reads_request()";
hbool_t report_mssg = FALSE;
hbool_t success = TRUE;
struct mssg_t reply;
@@ -1954,7 +1938,7 @@ serve_total_reads_request(struct mssg_t * mssg_ptr)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -2021,7 +2005,6 @@ serve_total_reads_request(struct mssg_t * mssg_ptr)
static hbool_t
serve_entry_writes_request(struct mssg_t * mssg_ptr)
{
- const char * fcn_name = "serve_entry_writes_request()";
hbool_t report_mssg = FALSE;
hbool_t success = TRUE;
int target_index;
@@ -2036,7 +2019,7 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -2051,7 +2034,7 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: addr lookup failed for %a.\n",
- world_mpi_rank, fcn_name, target_addr);
+ world_mpi_rank, FUNC, target_addr);
}
} else {
@@ -2119,7 +2102,6 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr)
static hbool_t
serve_entry_reads_request(struct mssg_t * mssg_ptr)
{
- const char * fcn_name = "serve_entry_reads_request()";
hbool_t report_mssg = FALSE;
hbool_t success = TRUE;
int target_index;
@@ -2134,7 +2116,7 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -2149,7 +2131,7 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: addr lookup failed for %a.\n",
- world_mpi_rank, fcn_name, target_addr);
+ world_mpi_rank, FUNC, target_addr);
}
} else {
@@ -2216,7 +2198,6 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr)
static hbool_t
serve_rw_count_reset_request(struct mssg_t * mssg_ptr)
{
- const char * fcn_name = "serve_rw_count_reset_request()";
hbool_t report_mssg = FALSE;
hbool_t success = TRUE;
struct mssg_t reply;
@@ -2229,7 +2210,7 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -2416,7 +2397,6 @@ flush_datum(H5F_t *f,
haddr_t H5_ATTR_UNUSED addr,
void *thing)
{
- const char * fcn_name = "flush_datum()";
hbool_t was_dirty = FALSE;
herr_t ret_value = SUCCEED;
int idx;
@@ -2463,7 +2443,7 @@ flush_datum(H5F_t *f,
ret_value = FAIL;
HDfprintf(stdout,
"%d:%s: Flushed dirty entry from non-zero file process.",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
if ( ret_value == SUCCEED ) {
@@ -2489,7 +2469,7 @@ flush_datum(H5F_t *f,
ret_value = FAIL;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
else
@@ -2511,7 +2491,7 @@ flush_datum(H5F_t *f,
ret_value = FAIL;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else if ( ( mssg.req != WRITE_REQ_ACK_CODE ) ||
( mssg.src != world_server_mpi_rank ) ||
@@ -2525,7 +2505,7 @@ flush_datum(H5F_t *f,
ret_value = FAIL;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad data in write req ack.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -2574,7 +2554,6 @@ load_datum(H5F_t H5_ATTR_UNUSED *f,
haddr_t addr,
void H5_ATTR_UNUSED *udata)
{
- const char * fcn_name = "load_datum()";
hbool_t success = TRUE;
int idx;
struct datum * entry_ptr = NULL;
@@ -2609,7 +2588,7 @@ load_datum(H5F_t H5_ATTR_UNUSED *f,
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -2621,7 +2600,7 @@ load_datum(H5F_t H5_ATTR_UNUSED *f,
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -2640,42 +2619,42 @@ load_datum(H5F_t H5_ATTR_UNUSED *f,
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad data in read req reply.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
#if 0 /* This has been useful debugging code -- keep it for now. */
if ( mssg.req != READ_REQ_REPLY_CODE ) {
HDfprintf(stdout,
"%d:%s: mssg.req != READ_REQ_REPLY_CODE.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
HDfprintf(stdout, "%d:%s: mssg.req = %d.\n",
- world_mpi_rank, fcn_name, (int)(mssg.req));
+ world_mpi_rank, FUNC, (int)(mssg.req));
}
if ( mssg.src != world_server_mpi_rank ) {
HDfprintf(stdout,
"%d:%s: mssg.src != world_server_mpi_rank.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
if ( mssg.dest != world_mpi_rank ) {
HDfprintf(stdout,
"%d:%s: mssg.dest != world_mpi_rank.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
if ( mssg.base_addr != entry_ptr->base_addr ) {
HDfprintf(stdout,
"%d:%s: mssg.base_addr != entry_ptr->base_addr.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n",
- world_mpi_rank, fcn_name, mssg.base_addr);
+ world_mpi_rank, FUNC, mssg.base_addr);
HDfprintf(stdout,
"%d:%s: entry_ptr->base_addr = %a.\n",
- world_mpi_rank, fcn_name,
+ world_mpi_rank, FUNC,
entry_ptr->base_addr);
}
@@ -2683,22 +2662,22 @@ load_datum(H5F_t H5_ATTR_UNUSED *f,
HDfprintf(stdout,
"%d:%s: mssg.len != entry_ptr->len.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
HDfprintf(stdout, "%d:%s: mssg.len = %a.\n",
- world_mpi_rank, fcn_name, mssg.len);
+ world_mpi_rank, FUNC, mssg.len);
}
if ( mssg.ver < entry_ptr->ver ) {
HDfprintf(stdout,
"%d:%s: mssg.ver < entry_ptr->ver.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
if ( mssg.magic != MSSG_MAGIC ) {
HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
#endif /* JRM */
@@ -2799,7 +2778,6 @@ static void
expunge_entry(H5F_t * file_ptr,
int32_t idx)
{
- const char * fcn_name = "expunge_entry()";
hbool_t in_cache;
herr_t result;
struct datum * entry_ptr;
@@ -2824,7 +2802,7 @@ expunge_entry(H5F_t * file_ptr,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Error in H5AC_expunge_entry().\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -2839,14 +2817,14 @@ expunge_entry(H5F_t * file_ptr,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Error in H5C_get_entry_status().\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else if ( in_cache ) {
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Expunged entry still in cache?!?\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -2883,7 +2861,6 @@ insert_entry(H5C_t * cache_ptr,
int32_t idx,
unsigned int flags)
{
- const char * fcn_name = "insert_entry()";
hbool_t insert_pinned;
herr_t result;
struct datum * entry_ptr;
@@ -2915,7 +2892,7 @@ insert_entry(H5C_t * cache_ptr,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Error in H5AC_insert_entry().\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -2938,7 +2915,7 @@ insert_entry(H5C_t * cache_ptr,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n",
- world_mpi_rank, fcn_name, idx,
+ world_mpi_rank, FUNC, idx,
(int)(data[idx].header.is_dirty));
}
}
@@ -2987,7 +2964,6 @@ local_pin_and_unpin_random_entries(H5F_t * file_ptr,
int min_count,
int max_count)
{
- /* const char * fcn_name = "local_pin_and_unpin_random_entries()"; */
if ( nerrors == 0 ) {
@@ -3056,7 +3032,6 @@ local_pin_random_entry(H5F_t * file_ptr,
int min_idx,
int max_idx)
{
- /* const char * fcn_name = "local_pin_random_entry()"; */
int idx;
if ( nerrors == 0 ) {
@@ -3100,7 +3075,6 @@ static void
local_unpin_all_entries(H5F_t * file_ptr,
hbool_t via_unprotect)
{
- /* const char * fcn_name = "local_unpin_all_entries()"; */
if ( nerrors == 0 ) {
@@ -3143,7 +3117,6 @@ local_unpin_next_pinned_entry(H5F_t * file_ptr,
int start_idx,
hbool_t via_unprotect)
{
- /* const char * fcn_name = "local_unpin_next_pinned_entry()"; */
int i = 0;
int idx = -1;
@@ -3203,7 +3176,6 @@ lock_and_unlock_random_entries(H5F_t * file_ptr,
int min_count,
int max_count)
{
- /* const char * fcn_name = "lock_and_unlock_random_entries()"; */
int count;
int i;
@@ -3248,7 +3220,6 @@ lock_and_unlock_random_entry(H5F_t * file_ptr,
int min_idx,
int max_idx)
{
- /* const char * fcn_name = "lock_and_unlock_random_entry()"; */
int idx;
if ( nerrors == 0 ) {
@@ -3296,7 +3267,6 @@ static void
lock_entry(H5F_t * file_ptr,
int32_t idx)
{
- const char * fcn_name = "lock_entry()";
struct datum * entry_ptr;
H5C_cache_entry_t * cache_entry_ptr;
@@ -3322,7 +3292,7 @@ lock_entry(H5F_t * file_ptr,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: error in H5AC_protect().\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
@@ -3354,7 +3324,6 @@ lock_entry(H5F_t * file_ptr,
static void
mark_entry_dirty(int32_t idx)
{
- const char * fcn_name = "mark_entry_dirty()";
herr_t result;
struct datum * entry_ptr;
@@ -3379,7 +3348,7 @@ mark_entry_dirty(int32_t idx)
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: error in H5AC_mark_entry_dirty().\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
else if ( ! ( entry_ptr->locked ) )
@@ -3412,7 +3381,6 @@ pin_entry(H5F_t * file_ptr,
hbool_t global,
hbool_t dirty)
{
- /* const char * fcn_name = "pin_entry()"; */
unsigned int flags = H5AC__PIN_ENTRY_FLAG;
struct datum * entry_ptr;
@@ -3479,7 +3447,6 @@ static void
pin_protected_entry(int32_t idx,
hbool_t global)
{
- const char * fcn_name = "pin_protected_entry()";
herr_t result;
struct datum * entry_ptr;
@@ -3505,7 +3472,7 @@ pin_protected_entry(int32_t idx,
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: Error in H5AC_pin_protected entry().\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -3553,7 +3520,6 @@ move_entry(H5F_t * file_ptr,
int32_t old_idx,
int32_t new_idx)
{
- const char * fcn_name = "move_entry()";
herr_t result;
int tmp;
size_t tmp_len;
@@ -3616,7 +3582,7 @@ move_entry(H5F_t * file_ptr,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: H5AC_move_entry() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
@@ -3643,7 +3609,7 @@ move_entry(H5F_t * file_ptr,
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: data[%d].header.is_dirty = %d.\n",
- world_mpi_rank, fcn_name, new_idx,
+ world_mpi_rank, FUNC, new_idx,
(int)(data[new_idx].header.is_dirty));
}
}
@@ -3674,7 +3640,6 @@ move_entry(H5F_t * file_ptr,
static hbool_t
reset_server_counts(void)
{
- const char * fcn_name = "reset_server_counts()";
hbool_t success = TRUE; /* will set to FALSE if appropriate. */
struct mssg_t mssg;
@@ -3697,7 +3662,7 @@ reset_server_counts(void)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -3710,7 +3675,7 @@ reset_server_counts(void)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else if ( ( mssg.req != REQ_RW_COUNT_RESET_RPLY_CODE ) ||
( mssg.src != world_server_mpi_rank ) ||
@@ -3726,7 +3691,7 @@ reset_server_counts(void)
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: Bad data in req r/w counter reset reply.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -3755,7 +3720,6 @@ static void
resize_entry(int32_t idx,
size_t new_size)
{
- const char * fcn_name = "resize_entry()";
herr_t result;
struct datum * entry_ptr;
@@ -3782,7 +3746,7 @@ resize_entry(int32_t idx,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: H5AC_resize_entry() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
@@ -3830,7 +3794,6 @@ setup_cache_for_test(hid_t * fid_ptr,
H5C_t ** cache_ptr_ptr,
int metadata_write_strategy)
{
- const char * fcn_name = "setup_cache_for_test()";
hbool_t success = FALSE; /* will set to TRUE if appropriate. */
hbool_t enable_rpt_fcn = FALSE;
hid_t fid = -1;
@@ -3849,13 +3812,13 @@ setup_cache_for_test(hid_t * fid_ptr,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: H5Fcreate() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
file_ptr = (H5F_t *)H5VL_object_verify(fid, H5I_FILE);
@@ -3865,7 +3828,7 @@ setup_cache_for_test(hid_t * fid_ptr,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Can't get file_ptr.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
cache_ptr = file_ptr->shared->cache;
@@ -3875,13 +3838,13 @@ setup_cache_for_test(hid_t * fid_ptr,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Can't get cache_ptr.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else if ( cache_ptr->magic != H5C__H5C_T_MAGIC ) {
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad cache_ptr magic.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
cache_ptr->ignore_tags = TRUE;
@@ -3901,7 +3864,7 @@ setup_cache_for_test(hid_t * fid_ptr,
HDfprintf(stdout,
"%d:%s: H5AC_get_cache_auto_resize_config(1) failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
} else {
@@ -3913,12 +3876,12 @@ setup_cache_for_test(hid_t * fid_ptr,
HDfprintf(stdout,
"%d:%s: H5AC_set_cache_auto_resize_config() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
} else if ( enable_rpt_fcn ) {
HDfprintf(stdout, "%d:%s: rpt_fcn enabled.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -3935,7 +3898,7 @@ setup_cache_for_test(hid_t * fid_ptr,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr == NULL.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else if ( ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic !=
H5AC__H5AC_AUX_T_MAGIC ) {
@@ -3944,7 +3907,7 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: cache_ptr->aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else if( ((H5AC_aux_t *)(cache_ptr->aux_ptr))->metadata_write_strategy
!= metadata_write_strategy ) {
@@ -3953,7 +3916,7 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: bad cache_ptr->aux_ptr->metadata_write_strategy\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -3971,7 +3934,7 @@ setup_cache_for_test(hid_t * fid_ptr,
HDfprintf(stdout,
"%d:%s: H5AC_get_cache_auto_resize_config(2) failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
} else if ( test_config.metadata_write_strategy !=
metadata_write_strategy ) {
@@ -3982,7 +3945,7 @@ setup_cache_for_test(hid_t * fid_ptr,
HDfprintf(stdout,
"%d:%s: unexpected metadata_write_strategy.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -3998,7 +3961,7 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: H5C_set_write_done_callback failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4013,7 +3976,7 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: H5AC_set_sync_point_done_callback failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4054,7 +4017,6 @@ static void
verify_writes(int num_writes,
haddr_t * written_entries_tbl)
{
- const char * fcn_name = "verify_writes()";
const hbool_t report = FALSE;
hbool_t proceed = TRUE;
int i = 0;
@@ -4075,7 +4037,7 @@ verify_writes(int num_writes,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: barrier 1 failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4102,7 +4064,7 @@ verify_writes(int num_writes,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: barrier 2 failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4118,12 +4080,12 @@ verify_writes(int num_writes,
if ( proceed ) {
HDfprintf(stdout, "%d:%s: verified %d writes.\n",
- world_mpi_rank, fcn_name, num_writes);
+ world_mpi_rank, FUNC, num_writes);
} else {
HDfprintf(stdout, "%d:%s: FAILED to verify %d writes.\n",
- world_mpi_rank, fcn_name, num_writes);
+ world_mpi_rank, FUNC, num_writes);
}
}
@@ -4142,7 +4104,7 @@ verify_writes(int num_writes,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: barrier 3 failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4174,7 +4136,6 @@ verify_writes(int num_writes,
static void
setup_rand(void)
{
- const char * fcn_name = "setup_rand()";
hbool_t use_predefined_seeds = FALSE;
int num_predefined_seeds = 3;
unsigned predefined_seeds[3] = {33402, 33505, 33422};
@@ -4189,7 +4150,7 @@ setup_rand(void)
seed = predefined_seeds[world_mpi_rank];
HDfprintf(stdout, "%d:%s: predefined_seed = %d.\n",
- world_mpi_rank, fcn_name, seed);
+ world_mpi_rank, FUNC, seed);
fflush(stdout);
HDsrand(seed);
@@ -4200,13 +4161,13 @@ setup_rand(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: gettimeofday() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
seed = (unsigned)tv.tv_usec;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: seed = %d.\n",
- world_mpi_rank, fcn_name, seed);
+ world_mpi_rank, FUNC, seed);
fflush(stdout);
}
HDsrand(seed);
@@ -4237,7 +4198,6 @@ setup_rand(void)
static hbool_t
take_down_cache(hid_t fid)
{
- const char * fcn_name = "take_down_cache()";
hbool_t success = FALSE; /* will set to TRUE if appropriate. */
/* close the file and delete it */
@@ -4246,7 +4206,7 @@ take_down_cache(hid_t fid)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: H5Fclose() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else if ( world_mpi_rank == world_server_mpi_rank ) {
@@ -4256,7 +4216,7 @@ take_down_cache(hid_t fid)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: HDremove() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
@@ -4296,7 +4256,6 @@ static hbool_t
verify_entry_reads(haddr_t addr,
int expected_entry_reads)
{
- const char * fcn_name = "verify_entry_reads()";
hbool_t success = TRUE;
int reported_entry_reads;
struct mssg_t mssg;
@@ -4320,7 +4279,7 @@ verify_entry_reads(haddr_t addr,
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4333,7 +4292,7 @@ verify_entry_reads(haddr_t addr,
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4352,7 +4311,7 @@ verify_entry_reads(haddr_t addr,
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad data in req entry reads reply.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
@@ -4369,7 +4328,7 @@ verify_entry_reads(haddr_t addr,
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: rep/exp entry 0x%llx reads mismatch (%ld/%ld).\n",
- world_mpi_rank, fcn_name, (long long)addr,
+ world_mpi_rank, FUNC, (long long)addr,
reported_entry_reads, expected_entry_reads);
}
}
@@ -4404,7 +4363,6 @@ static hbool_t
verify_entry_writes(haddr_t addr,
int expected_entry_writes)
{
- const char * fcn_name = "verify_entry_writes()";
hbool_t success = TRUE;
int reported_entry_writes;
struct mssg_t mssg;
@@ -4428,7 +4386,7 @@ verify_entry_writes(haddr_t addr,
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4441,7 +4399,7 @@ verify_entry_writes(haddr_t addr,
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4460,7 +4418,7 @@ verify_entry_writes(haddr_t addr,
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad data in req entry writes reply.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
@@ -4477,7 +4435,7 @@ verify_entry_writes(haddr_t addr,
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: rep/exp entry 0x%llx writes mismatch (%ld/%ld).\n",
- world_mpi_rank, fcn_name, (long long)addr,
+ world_mpi_rank, FUNC, (long long)addr,
reported_entry_writes, expected_entry_writes);
}
}
@@ -4510,7 +4468,6 @@ verify_entry_writes(haddr_t addr,
static hbool_t
verify_total_reads(int expected_total_reads)
{
- const char * fcn_name = "verify_total_reads()";
hbool_t success = TRUE; /* will set to FALSE if appropriate. */
long reported_total_reads;
struct mssg_t mssg;
@@ -4534,7 +4491,7 @@ verify_total_reads(int expected_total_reads)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4547,7 +4504,7 @@ verify_total_reads(int expected_total_reads)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else if ( ( mssg.req != REQ_TTL_READS_RPLY_CODE ) ||
( mssg.src != world_server_mpi_rank ) ||
@@ -4561,7 +4518,7 @@ verify_total_reads(int expected_total_reads)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad data in req total reads reply.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
@@ -4578,7 +4535,7 @@ verify_total_reads(int expected_total_reads)
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: reported/expected total reads mismatch (%ld/%ld).\n",
- world_mpi_rank, fcn_name,
+ world_mpi_rank, FUNC,
reported_total_reads, expected_total_reads);
}
@@ -4612,7 +4569,6 @@ verify_total_reads(int expected_total_reads)
static hbool_t
verify_total_writes(int expected_total_writes)
{
- const char * fcn_name = "verify_total_writes()";
hbool_t success = TRUE; /* will set to FALSE if appropriate. */
long reported_total_writes;
struct mssg_t mssg;
@@ -4636,7 +4592,7 @@ verify_total_writes(int expected_total_writes)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4649,7 +4605,7 @@ verify_total_writes(int expected_total_writes)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else if ( ( mssg.req != REQ_TTL_WRITES_RPLY_CODE ) ||
( mssg.src != world_server_mpi_rank ) ||
@@ -4663,7 +4619,7 @@ verify_total_writes(int expected_total_writes)
success = FALSE;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad data in req total reads reply.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
@@ -4680,7 +4636,7 @@ verify_total_writes(int expected_total_writes)
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: reported/expected total writes mismatch (%ld/%ld).\n",
- world_mpi_rank, fcn_name,
+ world_mpi_rank, FUNC,
reported_total_writes, expected_total_writes);
}
}
@@ -4709,12 +4665,11 @@ verify_total_writes(int expected_total_writes)
* Updated for the new local_len field in datum.
*
*****************************************************************************/
-void
+static void
unlock_entry(H5F_t * file_ptr,
int32_t idx,
unsigned int flags)
{
- const char * fcn_name = "unlock_entry()";
herr_t dirtied;
herr_t result;
struct datum * entry_ptr;
@@ -4749,7 +4704,7 @@ unlock_entry(H5F_t * file_ptr,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: error in H5C_unprotect().\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
} else {
@@ -4802,7 +4757,6 @@ unpin_entry(H5F_t * file_ptr,
hbool_t dirty,
hbool_t via_unprotect)
{
- const char * fcn_name = "unpin_entry()";
herr_t result;
unsigned int flags = H5AC__UNPIN_ENTRY_FLAG;
struct datum * entry_ptr;
@@ -4847,7 +4801,7 @@ unpin_entry(H5F_t * file_ptr,
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: error in H5AC_unpin_entry().\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4891,7 +4845,6 @@ unpin_entry(H5F_t * file_ptr,
static hbool_t
server_smoke_check(void)
{
- const char * fcn_name = "server_smoke_check()";
hbool_t success = TRUE;
int max_nerrors;
struct mssg_t mssg;
@@ -4913,7 +4866,7 @@ server_smoke_check(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: server_main() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4935,7 +4888,7 @@ server_smoke_check(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed on write.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -4951,7 +4904,7 @@ server_smoke_check(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4971,7 +4924,7 @@ server_smoke_check(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad data in write req ack.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -4987,7 +4940,7 @@ server_smoke_check(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: barrier 1 failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -5020,7 +4973,7 @@ server_smoke_check(void)
if ( verbose ) {
HDfprintf(stdout, "%d:%s: barrier 2 failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -5044,7 +4997,7 @@ server_smoke_check(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed on write.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -5059,7 +5012,7 @@ server_smoke_check(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -5079,7 +5032,7 @@ server_smoke_check(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad data in read req reply.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -5091,7 +5044,7 @@ server_smoke_check(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: barrier 3 failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -5123,7 +5076,7 @@ server_smoke_check(void)
if ( verbose ) {
HDfprintf(stdout, "%d:%s: barrier 4 failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -5140,7 +5093,7 @@ server_smoke_check(void)
if ( verbose ) {
HDfprintf(stdout, "%d:%s: barrier 5 failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -5172,7 +5125,7 @@ server_smoke_check(void)
if ( verbose ) {
HDfprintf(stdout, "%d:%s: barrier 6 failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -5196,7 +5149,7 @@ server_smoke_check(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -5240,7 +5193,6 @@ server_smoke_check(void)
static hbool_t
smoke_check_1(int metadata_write_strategy)
{
- const char * fcn_name = "smoke_check_1()";
hbool_t success = TRUE;
int i;
int max_nerrors;
@@ -5282,7 +5234,7 @@ smoke_check_1(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: server_main() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -5296,7 +5248,7 @@ smoke_check_1(int metadata_write_strategy)
cache_ptr = NULL;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -5334,7 +5286,7 @@ smoke_check_1(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -5369,7 +5321,7 @@ smoke_check_1(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -5416,7 +5368,6 @@ smoke_check_1(int metadata_write_strategy)
static hbool_t
smoke_check_2(int metadata_write_strategy)
{
- const char * fcn_name = "smoke_check_2()";
hbool_t success = TRUE;
int i;
int max_nerrors;
@@ -5458,7 +5409,7 @@ smoke_check_2(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: server_main() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -5472,7 +5423,7 @@ smoke_check_2(int metadata_write_strategy)
cache_ptr = NULL;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -5557,7 +5508,7 @@ smoke_check_2(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -5592,7 +5543,7 @@ smoke_check_2(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -5642,7 +5593,6 @@ smoke_check_2(int metadata_write_strategy)
static hbool_t
smoke_check_3(int metadata_write_strategy)
{
- const char * fcn_name = "smoke_check_3()";
hbool_t success = TRUE;
int i;
int max_nerrors;
@@ -5688,7 +5638,7 @@ smoke_check_3(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: server_main() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -5702,7 +5652,7 @@ smoke_check_3(int metadata_write_strategy)
cache_ptr = NULL;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -5767,7 +5717,7 @@ smoke_check_3(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -5881,7 +5831,7 @@ smoke_check_3(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -5917,7 +5867,7 @@ smoke_check_3(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -5967,7 +5917,6 @@ smoke_check_3(int metadata_write_strategy)
static hbool_t
smoke_check_4(int metadata_write_strategy)
{
- const char * fcn_name = "smoke_check_4()";
hbool_t success = TRUE;
int i;
int max_nerrors;
@@ -6013,7 +5962,7 @@ smoke_check_4(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: server_main() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -6027,7 +5976,7 @@ smoke_check_4(int metadata_write_strategy)
cache_ptr = NULL;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -6103,7 +6052,7 @@ smoke_check_4(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -6199,7 +6148,7 @@ smoke_check_4(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -6235,7 +6184,7 @@ smoke_check_4(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -6280,7 +6229,6 @@ smoke_check_4(int metadata_write_strategy)
static hbool_t
smoke_check_5(int metadata_write_strategy)
{
- const char * fcn_name = "smoke_check_5()";
hbool_t success = TRUE;
int i;
int max_nerrors;
@@ -6323,7 +6271,7 @@ smoke_check_5(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: server_main() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -6338,7 +6286,7 @@ smoke_check_5(int metadata_write_strategy)
cache_ptr = NULL;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -6352,7 +6300,7 @@ smoke_check_5(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -6410,7 +6358,7 @@ smoke_check_5(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -6445,7 +6393,7 @@ smoke_check_5(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -6519,7 +6467,6 @@ trace_file_check(int metadata_write_strategy)
#ifdef H5_METADATA_TRACE_FILE
- const char * fcn_name = "trace_file_check()";
const char *((* expected_output)[]) = NULL;
const char * expected_output_0[] =
{
@@ -6642,7 +6589,7 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: server_main() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -6657,7 +6604,7 @@ trace_file_check(int metadata_write_strategy)
cache_ptr = NULL;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -6671,7 +6618,7 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
HDfprintf(stdout,
"%d:%s: H5AC_get_cache_auto_resize_config() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
} else {
@@ -6684,7 +6631,7 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
HDfprintf(stdout,
"%d:%s: H5AC_set_cache_auto_resize_config() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -6720,7 +6667,7 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -6734,7 +6681,7 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
HDfprintf(stdout,
"%d:%s: H5AC_get_cache_auto_resize_config() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
} else {
@@ -6748,7 +6695,7 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
HDfprintf(stdout,
"%d:%s: H5AC_set_cache_auto_resize_config() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -6760,7 +6707,7 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -6795,7 +6742,7 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -6810,7 +6757,7 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: HDfopen failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
@@ -6847,12 +6794,12 @@ trace_file_check(int metadata_write_strategy)
if ( verbose ) {
HDfprintf(stdout,
"%d:%s: Unexpected data in trace file line %d.\n",
- world_mpi_rank, fcn_name, i);
+ world_mpi_rank, FUNC, i);
HDfprintf(stdout, "%d:%s: expected = \"%s\" %d\n",
- world_mpi_rank, fcn_name, (*expected_output)[i],
+ world_mpi_rank, FUNC, (*expected_output)[i],
expected_line_len);
HDfprintf(stdout, "%d:%s: actual = \"%s\" %d\n",
- world_mpi_rank, fcn_name, buffer,
+ world_mpi_rank, FUNC, buffer,
actual_line_len);
}
} else {
@@ -6919,7 +6866,6 @@ trace_file_check(int metadata_write_strategy)
int
main(int argc, char **argv)
{
- const char * fcn_name = "main()";
int express_test;
unsigned u;
int mpi_size;
@@ -6998,7 +6944,7 @@ main(int argc, char **argv)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: H5Pcreate() failed 1.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -7007,7 +6953,7 @@ main(int argc, char **argv)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 1.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -7020,7 +6966,7 @@ main(int argc, char **argv)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: h5_fixname() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
break;
}
@@ -7031,7 +6977,7 @@ main(int argc, char **argv)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: H5Pclose() failed.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -7043,7 +6989,7 @@ main(int argc, char **argv)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: H5Pcreate() failed 2.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
@@ -7052,7 +6998,7 @@ main(int argc, char **argv)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 2.\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, FUNC);
}
}
}
diff --git a/testpar/t_init_term.c b/testpar/t_init_term.c
new file mode 100644
index 0000000..824f773
--- /dev/null
+++ b/testpar/t_init_term.c
@@ -0,0 +1,76 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Mohamad Chaarawi
+ * June 2015
+ *
+ * Purpose: This test checks for the correct initialization and
+ * termination of the HDF5 library with MPI init and finalize.
+ */
+
+#include "testphdf5.h"
+
+int nerrors = 0; /* errors count */
+
+const char *FILENAME[] = {
+ "after_mpi_fin",
+ NULL
+};
+
+int
+main (int argc, char **argv)
+{
+ int mpi_size, mpi_rank;
+ MPI_Comm comm = MPI_COMM_WORLD;
+
+ /* Initialize and finalize MPI */
+ MPI_Init(&argc, &argv);
+ MPI_Comm_size(comm, &mpi_size);
+ MPI_Comm_rank(comm, &mpi_rank);
+
+ if(MAINPROCESS)
+ TESTING("Usage of Serial HDF5 after MPI_Finalize() is called");
+
+ MPI_Finalize();
+
+ nerrors += GetTestNumErrs();
+
+ /* test if we can initialize the library with MPI being finalized
+ and create a file serially */
+ H5open();
+
+ if(mpi_rank == 0) {
+ char filename[1024];
+ hid_t file_id;
+
+ h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof filename);
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((file_id >= 0), "H5Fcreate succeeded");
+ H5Fclose(file_id);
+ file_id = -1;
+ }
+
+ H5close();
+
+ if(MAINPROCESS) {
+ if(0 == nerrors)
+ PASSED()
+ else
+ H5_FAILED()
+ }
+
+ return (nerrors!=0);
+}
diff --git a/tools/h5dump/CMakeTestsPBITS.cmake b/tools/h5dump/CMakeTestsPBITS.cmake
index 421e020..e76fa0e 100644
--- a/tools/h5dump/CMakeTestsPBITS.cmake
+++ b/tools/h5dump/CMakeTestsPBITS.cmake
@@ -4,65 +4,65 @@
### T E S T I N G ###
##############################################################################
##############################################################################
-
+
# --------------------------------------------------------------------
# Packed Bits
# --------------------------------------------------------------------
#-- Copy all the HDF5 files from the test directory into the source directory
set (HDF5_REFERENCE_PBITS
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tnofilename-with-packed-bits.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsArray.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCompound.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIncomplete.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLengthExceeded.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCharLengthExceeded.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIntLengthExceeded.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLongLengthExceeded.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLengthPositive.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsMax.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsMaxExceeded.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOffsetExceeded.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCharOffsetExceeded.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIntOffsetExceeded.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLongOffsetExceeded.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOffsetNegative.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOverlapped.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedWhole.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedWhole.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedIntWhole.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedIntWhole.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongWhole.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongWhole.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole1.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole1.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole63.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole63.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned4.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned4.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt8.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt8.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong16.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong16.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong32.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong32.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned2.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned2.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt4.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt4.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong8.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong8.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong16.ddl
- ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong16.ddl
+ tnofilename-with-packed-bits.ddl
+ tpbitsArray.ddl
+ tpbitsCompound.ddl
+ tpbitsIncomplete.ddl
+ tpbitsLengthExceeded.ddl
+ tpbitsCharLengthExceeded.ddl
+ tpbitsIntLengthExceeded.ddl
+ tpbitsLongLengthExceeded.ddl
+ tpbitsLengthPositive.ddl
+ tpbitsMax.ddl
+ tpbitsMaxExceeded.ddl
+ tpbitsOffsetExceeded.ddl
+ tpbitsCharOffsetExceeded.ddl
+ tpbitsIntOffsetExceeded.ddl
+ tpbitsLongOffsetExceeded.ddl
+ tpbitsOffsetNegative.ddl
+ tpbitsOverlapped.ddl
+ tpbitsSigned.ddl
+ tpbitsUnsigned.ddl
+ tpbitsSignedInt.ddl
+ tpbitsUnsignedInt.ddl
+ tpbitsSignedLong.ddl
+ tpbitsUnsignedLong.ddl
+ tpbitsSignedLongLong.ddl
+ tpbitsUnsignedLongLong.ddl
+ tpbitsSignedWhole.ddl
+ tpbitsUnsignedWhole.ddl
+ tpbitsSignedIntWhole.ddl
+ tpbitsUnsignedIntWhole.ddl
+ tpbitsSignedLongWhole.ddl
+ tpbitsUnsignedLongWhole.ddl
+ tpbitsSignedLongLongWhole.ddl
+ tpbitsUnsignedLongLongWhole.ddl
+ tpbitsSignedLongLongWhole1.ddl
+ tpbitsUnsignedLongLongWhole1.ddl
+ tpbitsSignedLongLongWhole63.ddl
+ tpbitsUnsignedLongLongWhole63.ddl
+ tpbitsSigned4.ddl
+ tpbitsUnsigned4.ddl
+ tpbitsSignedInt8.ddl
+ tpbitsUnsignedInt8.ddl
+ tpbitsSignedLong16.ddl
+ tpbitsUnsignedLong16.ddl
+ tpbitsSignedLongLong32.ddl
+ tpbitsUnsignedLongLong32.ddl
+ tpbitsSigned2.ddl
+ tpbitsUnsigned2.ddl
+ tpbitsSignedInt4.ddl
+ tpbitsUnsignedInt4.ddl
+ tpbitsSignedLong8.ddl
+ tpbitsUnsignedLong8.ddl
+ tpbitsSignedLongLong16.ddl
+ tpbitsUnsignedLongLong16.ddl
)
set (HDF5_REFERENCE_TEST_PBITS
${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.h5
@@ -70,19 +70,19 @@
${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5
)
set (HDF5_ERROR_REFERENCE_PBITS
- ${PROJECT_SOURCE_DIR}/errfiles/tnofilename-with-packed-bits.err
- ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharLengthExceeded.err
- ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharOffsetExceeded.err
- ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIncomplete.err
- ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIntLengthExceeded.err
- ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIntOffsetExceeded.err
- ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLengthExceeded.err
- ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLengthPositive.err
- ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLongLengthExceeded.err
- ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLongOffsetExceeded.err
- ${PROJECT_SOURCE_DIR}/errfiles/tpbitsMaxExceeded.err
- ${PROJECT_SOURCE_DIR}/errfiles/tpbitsOffsetExceeded.err
- ${PROJECT_SOURCE_DIR}/errfiles/tpbitsOffsetNegative.err
+ tnofilename-with-packed-bits.err
+ tpbitsCharLengthExceeded.err
+ tpbitsCharOffsetExceeded.err
+ tpbitsIncomplete.err
+ tpbitsIntLengthExceeded.err
+ tpbitsIntOffsetExceeded.err
+ tpbitsLengthExceeded.err
+ tpbitsLengthPositive.err
+ tpbitsLongLengthExceeded.err
+ tpbitsLongOffsetExceeded.err
+ tpbitsMaxExceeded.err
+ tpbitsOffsetExceeded.err
+ tpbitsOffsetNegative.err
)
foreach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS})
@@ -96,7 +96,7 @@
ARGS -E copy_if_different ${pbits_h5_file} ${dest}
)
endforeach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS})
-
+
foreach (ddl_pbits ${HDF5_REFERENCE_PBITS})
GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME)
@@ -106,7 +106,7 @@
TARGET h5dump
POST_BUILD
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${ddl_pbits} ${ddldest}
+ ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/pbits/${ddl_pbits} ${ddldest}
)
endforeach (ddl_pbits ${HDF5_REFERENCE_PBITS})
@@ -118,10 +118,10 @@
TARGET h5dump
POST_BUILD
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${ddl_pbits} ${ddldest}
+ ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/errfiles/${ddl_pbits} ${ddldest}
)
endforeach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS})
-
+
##############################################################################
##############################################################################
### T H E T E S T S M A C R O S ###
@@ -163,7 +163,7 @@
##############################################################################
##############################################################################
-### T H E T E S T S HDF5_ENABLE_USING_MEMCHECKER ###
+### T H E T E S T S ###
##############################################################################
##############################################################################
@@ -172,7 +172,7 @@
add_test (
NAME H5DUMP_PACKED_BITS-clearall-objects
COMMAND ${CMAKE_COMMAND}
- -E remove
+ -E remove
tnofilename-with-packed-bits.out
tnofilename-with-packed-bits.out.err
tpbitsArray.out
diff --git a/tools/h5dump/testh5dumppbits.sh.in b/tools/h5dump/testh5dumppbits.sh.in
index 6556ff5..4211c63 100644
--- a/tools/h5dump/testh5dumppbits.sh.in
+++ b/tools/h5dump/testh5dumppbits.sh.in
@@ -28,10 +28,10 @@ EXIT_FAILURE=1
DUMPER=h5dump # The tool name
DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary
-H5DIFF=../h5diff/h5diff # The h5diff tool name
+H5DIFF=../h5diff/h5diff # The h5diff tool name
H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary
-H5IMPORT=../h5import/h5import # The h5import tool name
+H5IMPORT=../h5import/h5import # The h5import tool name
H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary
RM='rm -rf'
@@ -81,59 +81,59 @@ $SRC_H5DUMP_TESTFILES/tcompound.h5
"
LIST_OTHER_TEST_FILES="
-$SRC_H5DUMP_TESTFILES/tnofilename-with-packed-bits.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsArray.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsCompound.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsIncomplete.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsLengthExceeded.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsCharLengthExceeded.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsIntLengthExceeded.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsLongLengthExceeded.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsLengthPositive.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsMax.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsMaxExceeded.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsOffsetExceeded.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsCharOffsetExceeded.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsIntOffsetExceeded.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsLongOffsetExceeded.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsOffsetNegative.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsOverlapped.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSigned.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsigned.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedInt.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedLong.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedWhole.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedWhole.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedIntWhole.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedIntWhole.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedLongWhole.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongWhole.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole1.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole1.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole63.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole63.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSigned4.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsigned4.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedInt8.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt8.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedLong16.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong16.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong32.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong32.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSigned2.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsigned2.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedInt4.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt4.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedLong8.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong8.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong16.ddl
-$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong16.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tnofilename-with-packed-bits.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsArray.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsCompound.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsIncomplete.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsLengthExceeded.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsCharLengthExceeded.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsIntLengthExceeded.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsLongLengthExceeded.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsLengthPositive.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsMax.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsMaxExceeded.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsOffsetExceeded.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsCharOffsetExceeded.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsIntOffsetExceeded.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsLongOffsetExceeded.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsOffsetNegative.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsOverlapped.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSigned.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsigned.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedInt.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedInt.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLong.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLong.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLongLong.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLongLong.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedWhole.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedWhole.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedIntWhole.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedIntWhole.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLongWhole.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLongWhole.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLongLongWhole.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLongLongWhole.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLongLongWhole1.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLongLongWhole1.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLongLongWhole63.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLongLongWhole63.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSigned4.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsigned4.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedInt8.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedInt8.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLong16.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLong16.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLongLong32.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLongLong32.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSigned2.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsigned2.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedInt4.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedInt4.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLong8.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLong8.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLongLong16.ddl
+$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLongLong16.ddl
"
LIST_ERROR_TEST_FILES="
@@ -173,10 +173,10 @@ COPY_TESTFILES_TO_TESTDIR()
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $CP -f $tstfile $TESTDIR
+ $CP -f $tstfile $TESTDIR
if [ $? -ne 0 ]; then
echo "Error: FAILED to copy $tstfile ."
-
+
# Comment out this to CREATE expected file
exit $EXIT_FAILURE
fi
@@ -303,7 +303,7 @@ TOOLTEST2() {
nerrors="`expr $nerrors + 1`"
test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
fi
-
+
# Clean up output file
if test -z "$HDF5_NOCLEANUP"; then
rm -f $actual $actualdata $actual_err
@@ -434,7 +434,7 @@ SKIP() {
TESTING $DUMPER $@
echo " -SKIP-"
}
-
+
# Print a line-line message left justified in a field of 70 characters
#
PRINT_H5DIFF() {
@@ -445,7 +445,7 @@ PRINT_H5DIFF() {
# Call the h5diff tool
#
-DIFFTEST()
+DIFFTEST()
{
PRINT_H5DIFF $@
(
@@ -459,7 +459,7 @@ DIFFTEST()
else
echo " PASSED"
fi
-
+
}
# Print a line-line message left justified in a field of 70 characters
@@ -472,7 +472,7 @@ PRINT_H5IMPORT() {
# Call the h5import tool
#
-IMPORTTEST()
+IMPORTTEST()
{
# remove the output hdf5 file if it exists
hdf5_file="$TESTDIR/$5"
@@ -483,7 +483,7 @@ IMPORTTEST()
PRINT_H5IMPORT $@
(
cd $TESTDIR
- $RUNSERIAL $H5IMPORT_BIN "$@"
+ $RUNSERIAL $H5IMPORT_BIN "$@"
)
RET=$?
if [ $RET != 0 ] ; then
@@ -492,7 +492,7 @@ IMPORTTEST()
else
echo " PASSED"
fi
-
+
}
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 10d150f..c820aff 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -54,9 +54,6 @@ unsigned long long packed_data_mask; /* mask in which packed bits to display */
/* module-scoped variables */
static int h5tools_init_g; /* if h5tools lib has been initialized */
-#ifdef H5_HAVE_PARALLEL
-static int h5tools_mpi_init_g; /* if MPI_Init() has been called */
-#endif /* H5_HAVE_PARALLEL */
/* Names of VFDs */
static const char *drivernames[]={
@@ -516,11 +513,14 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum)
}
#ifdef H5_HAVE_PARALLEL
else if(!HDstrcmp(driver, drivernames[MPIO_IDX])) {
+ int mpi_initialized, mpi_finalized;
+
/* MPI-I/O Driver */
- /* check if MPI has been initialized. */
- if(!h5tools_mpi_init_g)
- MPI_Initialized(&h5tools_mpi_init_g);
- if(h5tools_mpi_init_g) {
+ /* check if MPI is available. */
+ MPI_Initialized(&mpi_initialized);
+ MPI_Finalized(&mpi_finalized);
+
+ if(mpi_initialized && !mpi_finalized) {
if(H5Pset_fapl_mpio(new_fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
goto error;
if(drivernum)
diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl
index 64a2880..64a2880 100644
--- a/tools/testfiles/tnofilename-with-packed-bits.ddl
+++ b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl
diff --git a/tools/testfiles/tpbitsArray.ddl b/tools/testfiles/pbits/tpbitsArray.ddl
index 125abb8..125abb8 100644
--- a/tools/testfiles/tpbitsArray.ddl
+++ b/tools/testfiles/pbits/tpbitsArray.ddl
diff --git a/tools/testfiles/tpbitsCharLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl
index b0683a7..b0683a7 100644
--- a/tools/testfiles/tpbitsCharLengthExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl
diff --git a/tools/testfiles/tpbitsCharOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl
index 530fa05..530fa05 100644
--- a/tools/testfiles/tpbitsCharOffsetExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl
diff --git a/tools/testfiles/tpbitsCompound.ddl b/tools/testfiles/pbits/tpbitsCompound.ddl
index c84272a..c84272a 100644
--- a/tools/testfiles/tpbitsCompound.ddl
+++ b/tools/testfiles/pbits/tpbitsCompound.ddl
diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/pbits/tpbitsIncomplete.ddl
index cdb1f91..cdb1f91 100644
--- a/tools/testfiles/tpbitsIncomplete.ddl
+++ b/tools/testfiles/pbits/tpbitsIncomplete.ddl
diff --git a/tools/testfiles/tpbitsIntLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl
index 1c919cd..1c919cd 100644
--- a/tools/testfiles/tpbitsIntLengthExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl
diff --git a/tools/testfiles/tpbitsIntOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl
index f3b2a8c..f3b2a8c 100644
--- a/tools/testfiles/tpbitsIntOffsetExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl
diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl
index 6d2492a..6d2492a 100644
--- a/tools/testfiles/tpbitsLengthExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl
diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/pbits/tpbitsLengthPositive.ddl
index 4f56619..4f56619 100644
--- a/tools/testfiles/tpbitsLengthPositive.ddl
+++ b/tools/testfiles/pbits/tpbitsLengthPositive.ddl
diff --git a/tools/testfiles/tpbitsLongLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl
index 812c300..812c300 100644
--- a/tools/testfiles/tpbitsLongLengthExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl
diff --git a/tools/testfiles/tpbitsLongOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl
index cbea722..cbea722 100644
--- a/tools/testfiles/tpbitsLongOffsetExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl
diff --git a/tools/testfiles/tpbitsMax.ddl b/tools/testfiles/pbits/tpbitsMax.ddl
index e569488..e569488 100644
--- a/tools/testfiles/tpbitsMax.ddl
+++ b/tools/testfiles/pbits/tpbitsMax.ddl
diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl
index 3432433..3432433 100644
--- a/tools/testfiles/tpbitsMaxExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl
diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl
index e51a09e..e51a09e 100644
--- a/tools/testfiles/tpbitsOffsetExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl
diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl
index ba6e46d..ba6e46d 100644
--- a/tools/testfiles/tpbitsOffsetNegative.ddl
+++ b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl
diff --git a/tools/testfiles/tpbitsOverlapped.ddl b/tools/testfiles/pbits/tpbitsOverlapped.ddl
index 9dcc9d2..9dcc9d2 100644
--- a/tools/testfiles/tpbitsOverlapped.ddl
+++ b/tools/testfiles/pbits/tpbitsOverlapped.ddl
diff --git a/tools/testfiles/tpbitsSigned.ddl b/tools/testfiles/pbits/tpbitsSigned.ddl
index b843388..b843388 100644
--- a/tools/testfiles/tpbitsSigned.ddl
+++ b/tools/testfiles/pbits/tpbitsSigned.ddl
diff --git a/tools/testfiles/tpbitsSigned2.ddl b/tools/testfiles/pbits/tpbitsSigned2.ddl
index 932b5fd..932b5fd 100644
--- a/tools/testfiles/tpbitsSigned2.ddl
+++ b/tools/testfiles/pbits/tpbitsSigned2.ddl
diff --git a/tools/testfiles/tpbitsSigned4.ddl b/tools/testfiles/pbits/tpbitsSigned4.ddl
index 9eacd83..9eacd83 100644
--- a/tools/testfiles/tpbitsSigned4.ddl
+++ b/tools/testfiles/pbits/tpbitsSigned4.ddl
diff --git a/tools/testfiles/tpbitsSignedInt.ddl b/tools/testfiles/pbits/tpbitsSignedInt.ddl
index 5c37e77..5c37e77 100644
--- a/tools/testfiles/tpbitsSignedInt.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedInt.ddl
diff --git a/tools/testfiles/tpbitsSignedInt4.ddl b/tools/testfiles/pbits/tpbitsSignedInt4.ddl
index 4e9f0f6..4e9f0f6 100644
--- a/tools/testfiles/tpbitsSignedInt4.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedInt4.ddl
diff --git a/tools/testfiles/tpbitsSignedInt8.ddl b/tools/testfiles/pbits/tpbitsSignedInt8.ddl
index f2d6069..f2d6069 100644
--- a/tools/testfiles/tpbitsSignedInt8.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedInt8.ddl
diff --git a/tools/testfiles/tpbitsSignedIntWhole.ddl b/tools/testfiles/pbits/tpbitsSignedIntWhole.ddl
index 598c446..598c446 100644
--- a/tools/testfiles/tpbitsSignedIntWhole.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedIntWhole.ddl
diff --git a/tools/testfiles/tpbitsSignedLong.ddl b/tools/testfiles/pbits/tpbitsSignedLong.ddl
index b3eba61..b3eba61 100644
--- a/tools/testfiles/tpbitsSignedLong.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedLong.ddl
diff --git a/tools/testfiles/tpbitsSignedLong16.ddl b/tools/testfiles/pbits/tpbitsSignedLong16.ddl
index 83fa889..83fa889 100644
--- a/tools/testfiles/tpbitsSignedLong16.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedLong16.ddl
diff --git a/tools/testfiles/tpbitsSignedLong8.ddl b/tools/testfiles/pbits/tpbitsSignedLong8.ddl
index e99b1d0..e99b1d0 100644
--- a/tools/testfiles/tpbitsSignedLong8.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedLong8.ddl
diff --git a/tools/testfiles/tpbitsSignedLongLong.ddl b/tools/testfiles/pbits/tpbitsSignedLongLong.ddl
index 2be8a55..2be8a55 100644
--- a/tools/testfiles/tpbitsSignedLongLong.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedLongLong.ddl
diff --git a/tools/testfiles/tpbitsSignedLongLong16.ddl b/tools/testfiles/pbits/tpbitsSignedLongLong16.ddl
index 44e336d..44e336d 100644
--- a/tools/testfiles/tpbitsSignedLongLong16.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedLongLong16.ddl
diff --git a/tools/testfiles/tpbitsSignedLongLong32.ddl b/tools/testfiles/pbits/tpbitsSignedLongLong32.ddl
index 6ab4ac4..6ab4ac4 100644
--- a/tools/testfiles/tpbitsSignedLongLong32.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedLongLong32.ddl
diff --git a/tools/testfiles/tpbitsSignedLongLongWhole.ddl b/tools/testfiles/pbits/tpbitsSignedLongLongWhole.ddl
index 134f3be..134f3be 100644
--- a/tools/testfiles/tpbitsSignedLongLongWhole.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedLongLongWhole.ddl
diff --git a/tools/testfiles/tpbitsSignedLongLongWhole1.ddl b/tools/testfiles/pbits/tpbitsSignedLongLongWhole1.ddl
index 7431670..7431670 100644
--- a/tools/testfiles/tpbitsSignedLongLongWhole1.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedLongLongWhole1.ddl
diff --git a/tools/testfiles/tpbitsSignedLongLongWhole63.ddl b/tools/testfiles/pbits/tpbitsSignedLongLongWhole63.ddl
index c7cc65f..c7cc65f 100644
--- a/tools/testfiles/tpbitsSignedLongLongWhole63.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedLongLongWhole63.ddl
diff --git a/tools/testfiles/tpbitsSignedLongWhole.ddl b/tools/testfiles/pbits/tpbitsSignedLongWhole.ddl
index e583f1d..e583f1d 100644
--- a/tools/testfiles/tpbitsSignedLongWhole.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedLongWhole.ddl
diff --git a/tools/testfiles/tpbitsSignedWhole.ddl b/tools/testfiles/pbits/tpbitsSignedWhole.ddl
index f044e23..f044e23 100644
--- a/tools/testfiles/tpbitsSignedWhole.ddl
+++ b/tools/testfiles/pbits/tpbitsSignedWhole.ddl
diff --git a/tools/testfiles/tpbitsUnsigned.ddl b/tools/testfiles/pbits/tpbitsUnsigned.ddl
index 9e7ac50..9e7ac50 100644
--- a/tools/testfiles/tpbitsUnsigned.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsigned.ddl
diff --git a/tools/testfiles/tpbitsUnsigned2.ddl b/tools/testfiles/pbits/tpbitsUnsigned2.ddl
index b7e6f79..b7e6f79 100644
--- a/tools/testfiles/tpbitsUnsigned2.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsigned2.ddl
diff --git a/tools/testfiles/tpbitsUnsigned4.ddl b/tools/testfiles/pbits/tpbitsUnsigned4.ddl
index d25d838..d25d838 100644
--- a/tools/testfiles/tpbitsUnsigned4.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsigned4.ddl
diff --git a/tools/testfiles/tpbitsUnsignedInt.ddl b/tools/testfiles/pbits/tpbitsUnsignedInt.ddl
index 5e0fefe..5e0fefe 100644
--- a/tools/testfiles/tpbitsUnsignedInt.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedInt.ddl
diff --git a/tools/testfiles/tpbitsUnsignedInt4.ddl b/tools/testfiles/pbits/tpbitsUnsignedInt4.ddl
index 0d3e38f..0d3e38f 100644
--- a/tools/testfiles/tpbitsUnsignedInt4.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedInt4.ddl
diff --git a/tools/testfiles/tpbitsUnsignedInt8.ddl b/tools/testfiles/pbits/tpbitsUnsignedInt8.ddl
index 861ed3e..861ed3e 100644
--- a/tools/testfiles/tpbitsUnsignedInt8.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedInt8.ddl
diff --git a/tools/testfiles/tpbitsUnsignedIntWhole.ddl b/tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl
index c054011..c054011 100644
--- a/tools/testfiles/tpbitsUnsignedIntWhole.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl
diff --git a/tools/testfiles/tpbitsUnsignedLong.ddl b/tools/testfiles/pbits/tpbitsUnsignedLong.ddl
index 9f8bcb4..9f8bcb4 100644
--- a/tools/testfiles/tpbitsUnsignedLong.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedLong.ddl
diff --git a/tools/testfiles/tpbitsUnsignedLong16.ddl b/tools/testfiles/pbits/tpbitsUnsignedLong16.ddl
index 7a1984f..7a1984f 100644
--- a/tools/testfiles/tpbitsUnsignedLong16.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedLong16.ddl
diff --git a/tools/testfiles/tpbitsUnsignedLong8.ddl b/tools/testfiles/pbits/tpbitsUnsignedLong8.ddl
index 17b896c..17b896c 100644
--- a/tools/testfiles/tpbitsUnsignedLong8.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedLong8.ddl
diff --git a/tools/testfiles/tpbitsUnsignedLongLong.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl
index 1cd9a6c..1cd9a6c 100644
--- a/tools/testfiles/tpbitsUnsignedLongLong.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl
diff --git a/tools/testfiles/tpbitsUnsignedLongLong16.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl
index f8b0189..f8b0189 100644
--- a/tools/testfiles/tpbitsUnsignedLongLong16.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl
diff --git a/tools/testfiles/tpbitsUnsignedLongLong32.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl
index befaf5b..befaf5b 100644
--- a/tools/testfiles/tpbitsUnsignedLongLong32.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl
diff --git a/tools/testfiles/tpbitsUnsignedLongLongWhole.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole.ddl
index 27c8879..27c8879 100644
--- a/tools/testfiles/tpbitsUnsignedLongLongWhole.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole.ddl
diff --git a/tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl
index 0302105..0302105 100644
--- a/tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl
diff --git a/tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl
index 6a9b503..6a9b503 100644
--- a/tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl
diff --git a/tools/testfiles/tpbitsUnsignedLongWhole.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl
index 50ad02f..50ad02f 100644
--- a/tools/testfiles/tpbitsUnsignedLongWhole.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl
diff --git a/tools/testfiles/tpbitsUnsignedWhole.ddl b/tools/testfiles/pbits/tpbitsUnsignedWhole.ddl
index 7c9e736..7c9e736 100644
--- a/tools/testfiles/tpbitsUnsignedWhole.ddl
+++ b/tools/testfiles/pbits/tpbitsUnsignedWhole.ddl