From d92c74b4aa169d33c72ea273dd401ac8586ca56f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 12 Jun 2015 16:33:27 -0500 Subject: [svn-r27196] Move pbbits file to subfolder --- tools/h5dump/CMakeTestsPBITS.cmake | 146 +++++++-------- tools/h5dump/testh5dumppbits.sh.in | 128 +++++++------- .../pbits/tnofilename-with-packed-bits.ddl | 136 ++++++++++++++ tools/testfiles/pbits/tpbitsArray.ddl | 14 ++ tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl | 18 ++ tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl | 18 ++ tools/testfiles/pbits/tpbitsCompound.ddl | 66 +++++++ tools/testfiles/pbits/tpbitsIncomplete.ddl | 136 ++++++++++++++ tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl | 18 ++ tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl | 18 ++ tools/testfiles/pbits/tpbitsLengthExceeded.ddl | 136 ++++++++++++++ tools/testfiles/pbits/tpbitsLengthPositive.ddl | 136 ++++++++++++++ tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl | 26 +++ tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl | 26 +++ tools/testfiles/pbits/tpbitsMax.ddl | 94 ++++++++++ tools/testfiles/pbits/tpbitsMaxExceeded.ddl | 136 ++++++++++++++ tools/testfiles/pbits/tpbitsOffsetExceeded.ddl | 136 ++++++++++++++ tools/testfiles/pbits/tpbitsOffsetNegative.ddl | 136 ++++++++++++++ tools/testfiles/pbits/tpbitsOverlapped.ddl | 50 ++++++ tools/testfiles/pbits/tpbitsSigned.ddl | 28 +++ tools/testfiles/pbits/tpbitsSigned2.ddl | 50 ++++++ tools/testfiles/pbits/tpbitsSigned4.ddl | 28 +++ tools/testfiles/pbits/tpbitsSignedInt.ddl | 28 +++ tools/testfiles/pbits/tpbitsSignedInt4.ddl | 50 ++++++ tools/testfiles/pbits/tpbitsSignedInt8.ddl | 34 ++++ tools/testfiles/pbits/tpbitsSignedIntWhole.ddl | 25 +++ tools/testfiles/pbits/tpbitsSignedLong.ddl | 44 +++++ tools/testfiles/pbits/tpbitsSignedLong16.ddl | 67 +++++++ tools/testfiles/pbits/tpbitsSignedLong8.ddl | 96 ++++++++++ tools/testfiles/pbits/tpbitsSignedLongLong.ddl | 68 +++++++ tools/testfiles/pbits/tpbitsSignedLongLong16.ddl | 196 +++++++++++++++++++++ tools/testfiles/pbits/tpbitsSignedLongLong32.ddl | 175 ++++++++++++++++++ .../testfiles/pbits/tpbitsSignedLongLongWhole.ddl | 121 +++++++++++++ .../testfiles/pbits/tpbitsSignedLongLongWhole1.ddl | 175 ++++++++++++++++++ .../pbits/tpbitsSignedLongLongWhole63.ddl | 172 ++++++++++++++++++ tools/testfiles/pbits/tpbitsSignedLongWhole.ddl | 46 +++++ tools/testfiles/pbits/tpbitsSignedWhole.ddl | 17 ++ tools/testfiles/pbits/tpbitsUnsigned.ddl | 28 +++ tools/testfiles/pbits/tpbitsUnsigned2.ddl | 50 ++++++ tools/testfiles/pbits/tpbitsUnsigned4.ddl | 28 +++ tools/testfiles/pbits/tpbitsUnsignedInt.ddl | 28 +++ tools/testfiles/pbits/tpbitsUnsignedInt4.ddl | 50 ++++++ tools/testfiles/pbits/tpbitsUnsignedInt8.ddl | 34 ++++ tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl | 25 +++ tools/testfiles/pbits/tpbitsUnsignedLong.ddl | 44 +++++ tools/testfiles/pbits/tpbitsUnsignedLong16.ddl | 67 +++++++ tools/testfiles/pbits/tpbitsUnsignedLong8.ddl | 96 ++++++++++ tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl | 68 +++++++ tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl | 196 +++++++++++++++++++++ tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl | 175 ++++++++++++++++++ .../pbits/tpbitsUnsignedLongLongWhole.ddl | 176 ++++++++++++++++++ .../pbits/tpbitsUnsignedLongLongWhole1.ddl | 175 ++++++++++++++++++ .../pbits/tpbitsUnsignedLongLongWhole63.ddl | 172 ++++++++++++++++++ tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl | 59 +++++++ tools/testfiles/pbits/tpbitsUnsignedWhole.ddl | 17 ++ tools/testfiles/tnofilename-with-packed-bits.ddl | 136 -------------- tools/testfiles/tpbitsArray.ddl | 14 -- tools/testfiles/tpbitsCharLengthExceeded.ddl | 18 -- tools/testfiles/tpbitsCharOffsetExceeded.ddl | 18 -- tools/testfiles/tpbitsCompound.ddl | 66 ------- tools/testfiles/tpbitsIncomplete.ddl | 136 -------------- tools/testfiles/tpbitsIntLengthExceeded.ddl | 18 -- tools/testfiles/tpbitsIntOffsetExceeded.ddl | 18 -- tools/testfiles/tpbitsLengthExceeded.ddl | 136 -------------- tools/testfiles/tpbitsLengthPositive.ddl | 136 -------------- tools/testfiles/tpbitsLongLengthExceeded.ddl | 26 --- tools/testfiles/tpbitsLongOffsetExceeded.ddl | 26 --- tools/testfiles/tpbitsMax.ddl | 94 ---------- tools/testfiles/tpbitsMaxExceeded.ddl | 136 -------------- tools/testfiles/tpbitsOffsetExceeded.ddl | 136 -------------- tools/testfiles/tpbitsOffsetNegative.ddl | 136 -------------- tools/testfiles/tpbitsOverlapped.ddl | 50 ------ tools/testfiles/tpbitsSigned.ddl | 28 --- tools/testfiles/tpbitsSigned2.ddl | 50 ------ tools/testfiles/tpbitsSigned4.ddl | 28 --- tools/testfiles/tpbitsSignedInt.ddl | 28 --- tools/testfiles/tpbitsSignedInt4.ddl | 50 ------ tools/testfiles/tpbitsSignedInt8.ddl | 34 ---- tools/testfiles/tpbitsSignedIntWhole.ddl | 25 --- tools/testfiles/tpbitsSignedLong.ddl | 44 ----- tools/testfiles/tpbitsSignedLong16.ddl | 67 ------- tools/testfiles/tpbitsSignedLong8.ddl | 96 ---------- tools/testfiles/tpbitsSignedLongLong.ddl | 68 ------- tools/testfiles/tpbitsSignedLongLong16.ddl | 196 --------------------- tools/testfiles/tpbitsSignedLongLong32.ddl | 175 ------------------ tools/testfiles/tpbitsSignedLongLongWhole.ddl | 121 ------------- tools/testfiles/tpbitsSignedLongLongWhole1.ddl | 175 ------------------ tools/testfiles/tpbitsSignedLongLongWhole63.ddl | 172 ------------------ tools/testfiles/tpbitsSignedLongWhole.ddl | 46 ----- tools/testfiles/tpbitsSignedWhole.ddl | 17 -- tools/testfiles/tpbitsUnsigned.ddl | 28 --- tools/testfiles/tpbitsUnsigned2.ddl | 50 ------ tools/testfiles/tpbitsUnsigned4.ddl | 28 --- tools/testfiles/tpbitsUnsignedInt.ddl | 28 --- tools/testfiles/tpbitsUnsignedInt4.ddl | 50 ------ tools/testfiles/tpbitsUnsignedInt8.ddl | 34 ---- tools/testfiles/tpbitsUnsignedIntWhole.ddl | 25 --- tools/testfiles/tpbitsUnsignedLong.ddl | 44 ----- tools/testfiles/tpbitsUnsignedLong16.ddl | 67 ------- tools/testfiles/tpbitsUnsignedLong8.ddl | 96 ---------- tools/testfiles/tpbitsUnsignedLongLong.ddl | 68 ------- tools/testfiles/tpbitsUnsignedLongLong16.ddl | 196 --------------------- tools/testfiles/tpbitsUnsignedLongLong32.ddl | 175 ------------------ tools/testfiles/tpbitsUnsignedLongLongWhole.ddl | 176 ------------------ tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl | 175 ------------------ tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl | 172 ------------------ tools/testfiles/tpbitsUnsignedLongWhole.ddl | 59 ------- tools/testfiles/tpbitsUnsignedWhole.ddl | 17 -- 108 files changed, 4345 insertions(+), 4345 deletions(-) create mode 100644 tools/testfiles/pbits/tnofilename-with-packed-bits.ddl create mode 100644 tools/testfiles/pbits/tpbitsArray.ddl create mode 100644 tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsCompound.ddl create mode 100644 tools/testfiles/pbits/tpbitsIncomplete.ddl create mode 100644 tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsLengthExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsLengthPositive.ddl create mode 100644 tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsMax.ddl create mode 100644 tools/testfiles/pbits/tpbitsMaxExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsOffsetExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsOffsetNegative.ddl create mode 100644 tools/testfiles/pbits/tpbitsOverlapped.ddl create mode 100644 tools/testfiles/pbits/tpbitsSigned.ddl create mode 100644 tools/testfiles/pbits/tpbitsSigned2.ddl create mode 100644 tools/testfiles/pbits/tpbitsSigned4.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedInt.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedInt4.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedInt8.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedIntWhole.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLong.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLong16.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLong8.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLongLong.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLongLong16.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLongLong32.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLongLongWhole.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLongLongWhole1.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLongLongWhole63.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLongWhole.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedWhole.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsigned.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsigned2.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsigned4.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedInt.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedInt4.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedInt8.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLong.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLong16.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLong8.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLongLongWhole.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedWhole.ddl delete mode 100644 tools/testfiles/tnofilename-with-packed-bits.ddl delete mode 100644 tools/testfiles/tpbitsArray.ddl delete mode 100644 tools/testfiles/tpbitsCharLengthExceeded.ddl delete mode 100644 tools/testfiles/tpbitsCharOffsetExceeded.ddl delete mode 100644 tools/testfiles/tpbitsCompound.ddl delete mode 100644 tools/testfiles/tpbitsIncomplete.ddl delete mode 100644 tools/testfiles/tpbitsIntLengthExceeded.ddl delete mode 100644 tools/testfiles/tpbitsIntOffsetExceeded.ddl delete mode 100644 tools/testfiles/tpbitsLengthExceeded.ddl delete mode 100644 tools/testfiles/tpbitsLengthPositive.ddl delete mode 100644 tools/testfiles/tpbitsLongLengthExceeded.ddl delete mode 100644 tools/testfiles/tpbitsLongOffsetExceeded.ddl delete mode 100644 tools/testfiles/tpbitsMax.ddl delete mode 100644 tools/testfiles/tpbitsMaxExceeded.ddl delete mode 100644 tools/testfiles/tpbitsOffsetExceeded.ddl delete mode 100644 tools/testfiles/tpbitsOffsetNegative.ddl delete mode 100644 tools/testfiles/tpbitsOverlapped.ddl delete mode 100644 tools/testfiles/tpbitsSigned.ddl delete mode 100644 tools/testfiles/tpbitsSigned2.ddl delete mode 100644 tools/testfiles/tpbitsSigned4.ddl delete mode 100644 tools/testfiles/tpbitsSignedInt.ddl delete mode 100644 tools/testfiles/tpbitsSignedInt4.ddl delete mode 100644 tools/testfiles/tpbitsSignedInt8.ddl delete mode 100644 tools/testfiles/tpbitsSignedIntWhole.ddl delete mode 100644 tools/testfiles/tpbitsSignedLong.ddl delete mode 100644 tools/testfiles/tpbitsSignedLong16.ddl delete mode 100644 tools/testfiles/tpbitsSignedLong8.ddl delete mode 100644 tools/testfiles/tpbitsSignedLongLong.ddl delete mode 100644 tools/testfiles/tpbitsSignedLongLong16.ddl delete mode 100644 tools/testfiles/tpbitsSignedLongLong32.ddl delete mode 100644 tools/testfiles/tpbitsSignedLongLongWhole.ddl delete mode 100644 tools/testfiles/tpbitsSignedLongLongWhole1.ddl delete mode 100644 tools/testfiles/tpbitsSignedLongLongWhole63.ddl delete mode 100644 tools/testfiles/tpbitsSignedLongWhole.ddl delete mode 100644 tools/testfiles/tpbitsSignedWhole.ddl delete mode 100644 tools/testfiles/tpbitsUnsigned.ddl delete mode 100644 tools/testfiles/tpbitsUnsigned2.ddl delete mode 100644 tools/testfiles/tpbitsUnsigned4.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedInt.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedInt4.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedInt8.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedIntWhole.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLong.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLong16.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLong8.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLongLong.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLongLong16.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLongLong32.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLongLongWhole.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLongWhole.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedWhole.ddl 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/testfiles/pbits/tnofilename-with-packed-bits.ddl b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl new file mode 100644 index 0000000..64a2880 --- /dev/null +++ b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl @@ -0,0 +1,136 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- + -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- + -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -t P, --datatype=P Print the specified named datatype + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + +--------------- Subsetting Options --------------- + Subsetting is available by using the following options with a dataset + option. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + (Alternate compact form of subsetting is described in the Reference Manual) + +--------------- Option Argument Conventions --------------- + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + See examples below for family, split, and multi driver special file name usage. + + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + +--------------- Examples --------------- + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 + + h5dump -d /foo -f split splitfile + + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + +h5dump error: missing file name diff --git a/tools/testfiles/pbits/tpbitsArray.ddl b/tools/testfiles/pbits/tpbitsArray.ddl new file mode 100644 index 0000000..125abb8 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsArray.ddl @@ -0,0 +1,14 @@ +HDF5 "tarray1.h5" { +DATASET "/Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } + PACKED_BITS OFFSET=0 LENGTH=1 + DATA { + (0): [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ] + } + PACKED_BITS OFFSET=1 LENGTH=1 + DATA { + (0): [ 0, 0, 1, 1 ], [ 1, 1, 0, 0 ], [ 0, 0, 1, 1 ], [ 1, 1, 0, 0 ] + } +} +} diff --git a/tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl new file mode 100644 index 0000000..b0683a7 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl @@ -0,0 +1,18 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=2 LENGTH=7 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(9) too large. Max is 8 diff --git a/tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl new file mode 100644 index 0000000..530fa05 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl @@ -0,0 +1,18 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=8 LENGTH=1 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(9) too large. Max is 8 diff --git a/tools/testfiles/pbits/tpbitsCompound.ddl b/tools/testfiles/pbits/tpbitsCompound.ddl new file mode 100644 index 0000000..c84272a --- /dev/null +++ b/tools/testfiles/pbits/tpbitsCompound.ddl @@ -0,0 +1,66 @@ +HDF5 "tcompound.h5" { +DATASET "/dset1" { + DATATYPE H5T_COMPOUND { + H5T_STD_I32BE "a_name"; + H5T_IEEE_F32BE "b_name"; + H5T_IEEE_F64BE "c_name"; + } + DATASPACE SIMPLE { ( 5 ) / ( 5 ) } + PACKED_BITS OFFSET=0 LENGTH=1 + DATA { + (0): { + 0, + 0, + 1 + }, + (1): { + 1, + 1, + 0.5 + }, + (2): { + 0, + 4, + 0.333333 + }, + (3): { + 1, + 9, + 0.25 + }, + (4): { + 0, + 16, + 0.2 + } + } + PACKED_BITS OFFSET=1 LENGTH=1 + DATA { + (0): { + 0, + 0, + 1 + }, + (1): { + 0, + 1, + 0.5 + }, + (2): { + 1, + 4, + 0.333333 + }, + (3): { + 1, + 9, + 0.25 + }, + (4): { + 0, + 16, + 0.2 + } + } +} +} diff --git a/tools/testfiles/pbits/tpbitsIncomplete.ddl b/tools/testfiles/pbits/tpbitsIncomplete.ddl new file mode 100644 index 0000000..cdb1f91 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsIncomplete.ddl @@ -0,0 +1,136 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- + -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- + -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -t P, --datatype=P Print the specified named datatype + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + +--------------- Subsetting Options --------------- + Subsetting is available by using the following options with a dataset + option. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + (Alternate compact form of subsetting is described in the Reference Manual) + +--------------- Option Argument Conventions --------------- + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + See examples below for family, split, and multi driver special file name usage. + + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + +--------------- Examples --------------- + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 + + h5dump -d /foo -f split splitfile + + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + +h5dump error: Bad mask list(0,2,2,1,0,2,2,) diff --git a/tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl new file mode 100644 index 0000000..1c919cd --- /dev/null +++ b/tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl @@ -0,0 +1,18 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=10 LENGTH=7 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(17) too large. Max is 16 diff --git a/tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl new file mode 100644 index 0000000..f3b2a8c --- /dev/null +++ b/tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl @@ -0,0 +1,18 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=16 LENGTH=1 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(17) too large. Max is 16 diff --git a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl new file mode 100644 index 0000000..6d2492a --- /dev/null +++ b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl @@ -0,0 +1,136 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- + -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- + -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -t P, --datatype=P Print the specified named datatype + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + +--------------- Subsetting Options --------------- + Subsetting is available by using the following options with a dataset + option. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + (Alternate compact form of subsetting is described in the Reference Manual) + +--------------- Option Argument Conventions --------------- + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + See examples below for family, split, and multi driver special file name usage. + + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + +--------------- Examples --------------- + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 + + h5dump -d /foo -f split splitfile + + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + +h5dump error: Packed Bit offset+length value(65) too large. Max is 64 diff --git a/tools/testfiles/pbits/tpbitsLengthPositive.ddl b/tools/testfiles/pbits/tpbitsLengthPositive.ddl new file mode 100644 index 0000000..4f56619 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsLengthPositive.ddl @@ -0,0 +1,136 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- + -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- + -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -t P, --datatype=P Print the specified named datatype + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + +--------------- Subsetting Options --------------- + Subsetting is available by using the following options with a dataset + option. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + (Alternate compact form of subsetting is described in the Reference Manual) + +--------------- Option Argument Conventions --------------- + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + See examples below for family, split, and multi driver special file name usage. + + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + +--------------- Examples --------------- + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 + + h5dump -d /foo -f split splitfile + + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + +h5dump error: Packed Bit length value(0) must be positive. diff --git a/tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl new file mode 100644 index 0000000..812c300 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl @@ -0,0 +1,26 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=26 LENGTH=7 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(33) too large. Max is 32 diff --git a/tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl new file mode 100644 index 0000000..cbea722 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl @@ -0,0 +1,26 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=32 LENGTH=1 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(33) too large. Max is 32 diff --git a/tools/testfiles/pbits/tpbitsMax.ddl b/tools/testfiles/pbits/tpbitsMax.ddl new file mode 100644 index 0000000..e569488 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsMax.ddl @@ -0,0 +1,94 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=1 + DATA { + (0,0): 1, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=1 LENGTH=1 + DATA { + (0,0): 1, 1, 0, 0, 0, 0, 0, 0, + (1,0): 1, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 0, 0, 0, 0, 0, + (1,0): 1, 1, 0, 0, 0, 0, 0, 0, + (2,0): 1, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=3 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 0, 0, 0, 0, + (1,0): 1, 1, 1, 0, 0, 0, 0, 0, + (2,0): 1, 1, 0, 0, 0, 0, 0, 0, + (3,0): 1, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 1, 0, 0, 0, + (1,0): 1, 1, 1, 1, 0, 0, 0, 0, + (2,0): 1, 1, 1, 0, 0, 0, 0, 0, + (3,0): 1, 1, 0, 0, 0, 0, 0, 0, + (4,0): 1, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=5 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 1, 1, 0, 0, + (1,0): 1, 1, 1, 1, 1, 0, 0, 0, + (2,0): 1, 1, 1, 1, 0, 0, 0, 0, + (3,0): 1, 1, 1, 0, 0, 0, 0, 0, + (4,0): 1, 1, 0, 0, 0, 0, 0, 0, + (5,0): 1, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=6 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 1, 1, 1, 0, + (1,0): 1, 1, 1, 1, 1, 1, 0, 0, + (2,0): 1, 1, 1, 1, 1, 0, 0, 0, + (3,0): 1, 1, 1, 1, 0, 0, 0, 0, + (4,0): 1, 1, 1, 0, 0, 0, 0, 0, + (5,0): 1, 1, 0, 0, 0, 0, 0, 0, + (6,0): 1, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=7 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 1, 1, 1, 1, + (1,0): 1, 1, 1, 1, 1, 1, 1, 0, + (2,0): 1, 1, 1, 1, 1, 1, 0, 0, + (3,0): 1, 1, 1, 1, 1, 0, 0, 0, + (4,0): 1, 1, 1, 1, 0, 0, 0, 0, + (5,0): 1, 1, 1, 0, 0, 0, 0, 0, + (6,0): 1, 1, 0, 0, 0, 0, 0, 0, + (7,0): 1, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl new file mode 100644 index 0000000..3432433 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl @@ -0,0 +1,136 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- + -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- + -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -t P, --datatype=P Print the specified named datatype + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + +--------------- Subsetting Options --------------- + Subsetting is available by using the following options with a dataset + option. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + (Alternate compact form of subsetting is described in the Reference Manual) + +--------------- Option Argument Conventions --------------- + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + See examples below for family, split, and multi driver special file name usage. + + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + +--------------- Examples --------------- + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 + + h5dump -d /foo -f split splitfile + + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + +h5dump error: Too many masks requested (max. 8). Mask list(0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1) diff --git a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl new file mode 100644 index 0000000..e51a09e --- /dev/null +++ b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl @@ -0,0 +1,136 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- + -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- + -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -t P, --datatype=P Print the specified named datatype + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + +--------------- Subsetting Options --------------- + Subsetting is available by using the following options with a dataset + option. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + (Alternate compact form of subsetting is described in the Reference Manual) + +--------------- Option Argument Conventions --------------- + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + See examples below for family, split, and multi driver special file name usage. + + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + +--------------- Examples --------------- + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 + + h5dump -d /foo -f split splitfile + + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + +h5dump error: Packed Bit offset value(64) must be between 0 and 63 diff --git a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl new file mode 100644 index 0000000..ba6e46d --- /dev/null +++ b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl @@ -0,0 +1,136 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- + -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- + -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -t P, --datatype=P Print the specified named datatype + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + +--------------- Subsetting Options --------------- + Subsetting is available by using the following options with a dataset + option. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + (Alternate compact form of subsetting is described in the Reference Manual) + +--------------- Option Argument Conventions --------------- + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + See examples below for family, split, and multi driver special file name usage. + + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + +--------------- Examples --------------- + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 + + h5dump -d /foo -f split splitfile + + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + +h5dump error: Bad mask list(-1,1) diff --git a/tools/testfiles/pbits/tpbitsOverlapped.ddl b/tools/testfiles/pbits/tpbitsOverlapped.ddl new file mode 100644 index 0000000..9dcc9d2 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsOverlapped.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=1 + DATA { + (0,0): 1, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=1 LENGTH=1 + DATA { + (0,0): 1, 1, 0, 0, 0, 0, 0, 0, + (1,0): 1, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 0, 0, 0, 0, 0, + (1,0): 1, 1, 0, 0, 0, 0, 0, 0, + (2,0): 1, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=0 LENGTH=3 + DATA { + (0,0): 7, 6, 4, 0, 0, 0, 0, 0, + (1,0): 6, 4, 0, 0, 0, 0, 0, 0, + (2,0): 4, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSigned.ddl b/tools/testfiles/pbits/tpbitsSigned.ddl new file mode 100644 index 0000000..b843388 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSigned.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSigned2.ddl b/tools/testfiles/pbits/tpbitsSigned2.ddl new file mode 100644 index 0000000..932b5fd --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSigned2.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 2, 0, 0, 0, 0, + (1,0): 3, 3, 2, 0, 0, 0, 0, 0, + (2,0): 3, 2, 0, 0, 0, 0, 0, 0, + (3,0): 2, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 3, 3, 2, 0, 0, + (1,0): 3, 3, 3, 3, 2, 0, 0, 0, + (2,0): 3, 3, 3, 2, 0, 0, 0, 0, + (3,0): 3, 3, 2, 0, 0, 0, 0, 0, + (4,0): 3, 2, 0, 0, 0, 0, 0, 0, + (5,0): 2, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=6 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 3, 3, 3, 3, 2, + (1,0): 3, 3, 3, 3, 3, 3, 2, 0, + (2,0): 3, 3, 3, 3, 3, 2, 0, 0, + (3,0): 3, 3, 3, 3, 2, 0, 0, 0, + (4,0): 3, 3, 3, 2, 0, 0, 0, 0, + (5,0): 3, 3, 2, 0, 0, 0, 0, 0, + (6,0): 3, 2, 0, 0, 0, 0, 0, 0, + (7,0): 2, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSigned4.ddl b/tools/testfiles/pbits/tpbitsSigned4.ddl new file mode 100644 index 0000000..9eacd83 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSigned4.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=4 + DATA { + (0,0): 15, 14, 12, 8, 0, 0, 0, 0, + (1,0): 14, 12, 8, 0, 0, 0, 0, 0, + (2,0): 12, 8, 0, 0, 0, 0, 0, 0, + (3,0): 8, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 14, 12, 8, + (1,0): 15, 15, 15, 15, 14, 12, 8, 0, + (2,0): 15, 15, 15, 14, 12, 8, 0, 0, + (3,0): 15, 15, 14, 12, 8, 0, 0, 0, + (4,0): 15, 14, 12, 8, 0, 0, 0, 0, + (5,0): 14, 12, 8, 0, 0, 0, 0, 0, + (6,0): 12, 8, 0, 0, 0, 0, 0, 0, + (7,0): 8, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedInt.ddl b/tools/testfiles/pbits/tpbitsSignedInt.ddl new file mode 100644 index 0000000..5c37e77 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedInt.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=10 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedInt4.ddl b/tools/testfiles/pbits/tpbitsSignedInt4.ddl new file mode 100644 index 0000000..4e9f0f6 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedInt4.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=4 + DATA { + (0,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, + (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, + (2,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, + (3,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, + (4,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=12 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, + (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, + (2,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, + (3,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, + (4,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, + (5,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, + (6,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, + (7,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedInt8.ddl b/tools/testfiles/pbits/tpbitsSignedInt8.ddl new file mode 100644 index 0000000..f2d6069 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedInt8.ddl @@ -0,0 +1,34 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (0,13): 224, 192, 128, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (1,13): 192, 128, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (2,13): 128, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, + (3,14): 0, 0, + (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (4,14): 0, 0, + (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (5,15): 0, + (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedIntWhole.ddl b/tools/testfiles/pbits/tpbitsSignedIntWhole.ddl new file mode 100644 index 0000000..598c446 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedIntWhole.ddl @@ -0,0 +1,25 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, + (0,12): -4096, -8192, -16384, -32768, + (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (1,12): -8192, -16384, -32768, 0, + (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (2,11): -8192, -16384, -32768, 0, 0, + (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (3,11): -16384, -32768, 0, 0, 0, + (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (4,10): -16384, -32768, 0, 0, 0, 0, + (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, + (5,10): -32768, 0, 0, 0, 0, 0, + (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (6,10): 0, 0, 0, 0, 0, 0, + (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, 0, 0, + (7,11): 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLong.ddl b/tools/testfiles/pbits/tpbitsSignedLong.ddl new file mode 100644 index 0000000..b3eba61 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLong.ddl @@ -0,0 +1,44 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=26 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,17): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,17): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,17): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,17): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,17): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLong16.ddl b/tools/testfiles/pbits/tpbitsSignedLong16.ddl new file mode 100644 index 0000000..83fa889 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLong16.ddl @@ -0,0 +1,67 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,25): 0, 0, 0, 0, 0, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,26): 0, 0, 0, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,27): 0, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,29): 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,30): 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (0,27): 63488, 61440, 57344, 49152, 32768, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (1,27): 61440, 57344, 49152, 32768, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (2,27): 57344, 49152, 32768, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (3,27): 49152, 32768, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (4,27): 32768, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (5,28): 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (6,29): 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,31): 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLong8.ddl b/tools/testfiles/pbits/tpbitsSignedLong8.ddl new file mode 100644 index 0000000..e99b1d0 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLong8.ddl @@ -0,0 +1,96 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,17): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,19): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,21): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (0,13): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (1,13): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (2,13): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, + (3,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (4,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (5,15): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, + (6,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, + (7,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (0,13): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (0,28): 0, 0, 0, 0, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (1,13): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, + (1,28): 0, 0, 0, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (2,13): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, + (2,29): 0, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (3,13): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,30): 0, 0, + (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (4,13): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,30): 0, 0, + (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, + (5,13): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,31): 0, + (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, + (6,13): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, + (7,13): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=24 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (0,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, + (0,26): 252, 248, 240, 224, 192, 128, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (1,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, + (1,26): 248, 240, 224, 192, 128, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (2,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, + (2,26): 240, 224, 192, 128, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (3,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (3,26): 224, 192, 128, 0, 0, 0, + (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (4,13): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (4,26): 192, 128, 0, 0, 0, 0, + (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (5,13): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (5,26): 128, 0, 0, 0, 0, 0, + (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (6,13): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, + (6,26): 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (7,13): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (7,27): 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLongLong.ddl b/tools/testfiles/pbits/tpbitsSignedLongLong.ddl new file mode 100644 index 0000000..2be8a55 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLongLong.ddl @@ -0,0 +1,68 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=58 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,49): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,49): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,49): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,49): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,49): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,49): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLongLong16.ddl b/tools/testfiles/pbits/tpbitsSignedLongLong16.ddl new file mode 100644 index 0000000..44e336d --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLongLong16.ddl @@ -0,0 +1,196 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,25): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,26): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,30): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,52): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (0,27): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,42): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (1,27): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (2,27): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (3,27): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (4,27): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (5,28): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (6,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,31): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,53): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=32 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (0,36): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (0,45): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,63): 0, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,27): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (1,36): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (1,45): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,27): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (2,36): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (2,45): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,27): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (3,36): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,27): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (4,36): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (4,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,27): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (5,36): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (5,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,27): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (6,36): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (6,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (7,27): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (7,36): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=48 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,45): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (0,54): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (0,63): 32768, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,45): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (1,54): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,45): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (2,54): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,45): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (3,54): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,45): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (4,54): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (5,45): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (5,54): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (6,45): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (6,54): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,36): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (7,45): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (7,54): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLongLong32.ddl b/tools/testfiles/pbits/tpbitsSignedLongLong32.ddl new file mode 100644 index 0000000..6ab4ac4 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLongLong32.ddl @@ -0,0 +1,175 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (0,30): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (1,30): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (2,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, + (3,35): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,57): 0, 0, 0, 0, 0, 0, 0, + (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,38): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,60): 0, 0, 0, 0, + (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,41): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,63): 0, + (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (6,25): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (7,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=32 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,30): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, + (0,35): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (0,40): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (0,45): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (0,50): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (0,55): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (0,60): 4026531840, 3758096384, 3221225472, 2147483648, + (1,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,30): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, + (1,35): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (1,40): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (1,45): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (1,50): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (1,55): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (1,60): 3758096384, 3221225472, 2147483648, 0, + (2,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,30): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (2,35): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (2,40): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (2,45): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (2,50): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (2,55): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (2,60): 3221225472, 2147483648, 0, 0, + (3,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,30): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (3,35): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (3,40): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (3,45): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (3,50): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (3,55): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (3,60): 2147483648, 0, 0, 0, + (4,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967294, + (4,30): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (4,35): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (4,40): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (4,45): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (4,50): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (4,55): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (4,62): 0, 0, + (5,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,25): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, + (5,30): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (5,35): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (5,40): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (5,45): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (5,50): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (5,55): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, + (6,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,25): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, + (6,30): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (6,35): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (6,40): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (6,45): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (6,50): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (6,55): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, + (7,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,25): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (7,30): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (7,35): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (7,40): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (7,45): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (7,50): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (7,55): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLongLongWhole.ddl b/tools/testfiles/pbits/tpbitsSignedLongLongWhole.ddl new file mode 100644 index 0000000..134f3be --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLongLongWhole.ddl @@ -0,0 +1,121 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=64 + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, + (0,12): -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (0,20): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (0,26): -67108864, -134217728, -268435456, -536870912, -1073741824, + (0,31): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, + (0,36): -68719476736, -137438953472, -274877906944, -549755813888, + (0,40): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (0,44): -17592186044416, -35184372088832, -70368744177664, + (0,47): -140737488355328, -281474976710656, -562949953421312, + (0,50): -1125899906842624, -2251799813685248, -4503599627370496, + (0,53): -9007199254740992, -18014398509481984, -36028797018963968, + (0,56): -72057594037927936, -144115188075855872, -288230376151711744, + (0,59): -576460752303423488, -1152921504606846976, -2305843009213693952, + (0,62): -4611686018427387904, -9223372036854775808, + (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (1,12): -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (1,19): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (1,25): -67108864, -134217728, -268435456, -536870912, -1073741824, + (1,30): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, + (1,35): -68719476736, -137438953472, -274877906944, -549755813888, + (1,39): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (1,43): -17592186044416, -35184372088832, -70368744177664, + (1,46): -140737488355328, -281474976710656, -562949953421312, + (1,49): -1125899906842624, -2251799813685248, -4503599627370496, + (1,52): -9007199254740992, -18014398509481984, -36028797018963968, + (1,55): -72057594037927936, -144115188075855872, -288230376151711744, + (1,58): -576460752303423488, -1152921504606846976, -2305843009213693952, + (1,61): -4611686018427387904, -9223372036854775808, 0, + (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (2,11): -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (2,18): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (2,24): -67108864, -134217728, -268435456, -536870912, -1073741824, + (2,29): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, + (2,34): -68719476736, -137438953472, -274877906944, -549755813888, + (2,38): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (2,42): -17592186044416, -35184372088832, -70368744177664, + (2,45): -140737488355328, -281474976710656, -562949953421312, + (2,48): -1125899906842624, -2251799813685248, -4503599627370496, + (2,51): -9007199254740992, -18014398509481984, -36028797018963968, + (2,54): -72057594037927936, -144115188075855872, -288230376151711744, + (2,57): -576460752303423488, -1152921504606846976, -2305843009213693952, + (2,60): -4611686018427387904, -9223372036854775808, 0, 0, + (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (3,11): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, + (3,18): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, + (3,24): -134217728, -268435456, -536870912, -1073741824, -2147483648, + (3,29): -4294967296, -8589934592, -17179869184, -34359738368, + (3,33): -68719476736, -137438953472, -274877906944, -549755813888, + (3,37): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (3,41): -17592186044416, -35184372088832, -70368744177664, + (3,44): -140737488355328, -281474976710656, -562949953421312, + (3,47): -1125899906842624, -2251799813685248, -4503599627370496, + (3,50): -9007199254740992, -18014398509481984, -36028797018963968, + (3,53): -72057594037927936, -144115188075855872, -288230376151711744, + (3,56): -576460752303423488, -1152921504606846976, -2305843009213693952, + (3,59): -4611686018427387904, -9223372036854775808, 0, 0, 0, + (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (4,10): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, + (4,17): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, + (4,23): -134217728, -268435456, -536870912, -1073741824, -2147483648, + (4,28): -4294967296, -8589934592, -17179869184, -34359738368, + (4,32): -68719476736, -137438953472, -274877906944, -549755813888, + (4,36): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (4,40): -17592186044416, -35184372088832, -70368744177664, + (4,43): -140737488355328, -281474976710656, -562949953421312, + (4,46): -1125899906842624, -2251799813685248, -4503599627370496, + (4,49): -9007199254740992, -18014398509481984, -36028797018963968, + (4,52): -72057594037927936, -144115188075855872, -288230376151711744, + (4,55): -576460752303423488, -1152921504606846976, -2305843009213693952, + (4,58): -4611686018427387904, -9223372036854775808, 0, 0, 0, 0, + (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, + (5,10): -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, + (5,17): -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, + (5,23): -268435456, -536870912, -1073741824, -2147483648, -4294967296, + (5,28): -8589934592, -17179869184, -34359738368, -68719476736, + (5,32): -137438953472, -274877906944, -549755813888, -1099511627776, + (5,36): -2199023255552, -4398046511104, -8796093022208, -17592186044416, + (5,40): -35184372088832, -70368744177664, -140737488355328, + (5,43): -281474976710656, -562949953421312, -1125899906842624, + (5,46): -2251799813685248, -4503599627370496, -9007199254740992, + (5,49): -18014398509481984, -36028797018963968, -72057594037927936, + (5,52): -144115188075855872, -288230376151711744, -576460752303423488, + (5,55): -1152921504606846976, -2305843009213693952, -4611686018427387904, + (5,58): -9223372036854775808, 0, 0, 0, 0, 0, + (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (6,10): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, + (6,17): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, + (6,23): -536870912, -1073741824, -2147483648, -4294967296, -8589934592, + (6,28): -17179869184, -34359738368, -68719476736, -137438953472, + (6,32): -274877906944, -549755813888, -1099511627776, -2199023255552, + (6,36): -4398046511104, -8796093022208, -17592186044416, -35184372088832, + (6,40): -70368744177664, -140737488355328, -281474976710656, + (6,43): -562949953421312, -1125899906842624, -2251799813685248, + (6,46): -4503599627370496, -9007199254740992, -18014398509481984, + (6,49): -36028797018963968, -72057594037927936, -144115188075855872, + (6,52): -288230376151711744, -576460752303423488, -1152921504606846976, + (6,55): -2305843009213693952, -4611686018427387904, -9223372036854775808, + (6,58): 0, 0, 0, 0, 0, 0, + (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (7,9): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, + (7,16): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, + (7,22): -536870912, -1073741824, -2147483648, -4294967296, -8589934592, + (7,27): -17179869184, -34359738368, -68719476736, -137438953472, + (7,31): -274877906944, -549755813888, -1099511627776, -2199023255552, + (7,35): -4398046511104, -8796093022208, -17592186044416, -35184372088832, + (7,39): -70368744177664, -140737488355328, -281474976710656, + (7,42): -562949953421312, -1125899906842624, -2251799813685248, + (7,45): -4503599627370496, -9007199254740992, -18014398509481984, + (7,48): -36028797018963968, -72057594037927936, -144115188075855872, + (7,51): -288230376151711744, -576460752303423488, -1152921504606846976, + (7,54): -2305843009213693952, -4611686018427387904, -9223372036854775808, + (7,57): 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLongLongWhole1.ddl b/tools/testfiles/pbits/tpbitsSignedLongLongWhole1.ddl new file mode 100644 index 0000000..7431670 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLongLongWhole1.ddl @@ -0,0 +1,175 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=1 LENGTH=63 + DATA { + (0,0): 9223372036854775807, 9223372036854775807, 9223372036854775806, + (0,3): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (0,6): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (0,9): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (0,12): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (0,15): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (0,18): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (0,21): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (0,24): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (0,27): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (0,30): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (0,33): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (0,36): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (0,39): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (0,42): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (0,45): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (0,48): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (0,51): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (0,54): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (0,57): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (0,60): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (0,63): 4611686018427387904, + (1,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, + (1,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (1,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (1,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (1,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (1,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (1,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (1,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (1,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (1,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (1,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (1,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (1,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (1,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (1,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (1,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (1,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (1,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (1,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (1,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (1,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (2,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, + (2,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (2,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (2,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (2,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (2,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (2,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (2,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (2,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (2,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (2,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (2,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (2,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (2,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (2,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (2,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (2,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (2,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (2,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (2,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (2,60): 6917529027641081856, 4611686018427387904, 0, 0, + (3,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (3,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (3,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (3,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (3,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (3,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (3,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (3,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (3,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (3,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (3,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (3,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (3,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (3,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (3,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (3,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (3,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (3,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (3,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (3,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (3,60): 4611686018427387904, 0, 0, 0, + (4,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (4,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (4,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (4,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (4,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (4,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (4,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (4,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (4,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (4,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (4,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (4,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (4,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (4,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (4,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (4,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (4,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (4,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (4,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (4,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (4,61): 0, 0, 0, + (5,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (5,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (5,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (5,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (5,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (5,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (5,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (5,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (5,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (5,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (5,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (5,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (5,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (5,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (5,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (5,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (5,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (5,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (5,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (5,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, + (6,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (6,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (6,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (6,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (6,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (6,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (6,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (6,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (6,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (6,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (6,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (6,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (6,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (6,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (6,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (6,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (6,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (6,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (6,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (6,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, + (7,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (7,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (7,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (7,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (7,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (7,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (7,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (7,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (7,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (7,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (7,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (7,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (7,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (7,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (7,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (7,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (7,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (7,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (7,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (7,58): 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLongLongWhole63.ddl b/tools/testfiles/pbits/tpbitsSignedLongLongWhole63.ddl new file mode 100644 index 0000000..c7cc65f --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLongLongWhole63.ddl @@ -0,0 +1,172 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=63 + DATA { + (0,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, + (0,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (0,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (0,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (0,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (0,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (0,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (0,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (0,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (0,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (0,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (0,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (0,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (0,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (0,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (0,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (0,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (0,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (0,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (0,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (0,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (1,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, + (1,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (1,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (1,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (1,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (1,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (1,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (1,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (1,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (1,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (1,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (1,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (1,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (1,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (1,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (1,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (1,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (1,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (1,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (1,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (1,60): 6917529027641081856, 4611686018427387904, 0, 0, + (2,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (2,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (2,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (2,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (2,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (2,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (2,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (2,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (2,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (2,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (2,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (2,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (2,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (2,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (2,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (2,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (2,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (2,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (2,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (2,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (2,60): 4611686018427387904, 0, 0, 0, + (3,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (3,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (3,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (3,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (3,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (3,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (3,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (3,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (3,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (3,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (3,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (3,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (3,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (3,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (3,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (3,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (3,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (3,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (3,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (3,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (3,61): 0, 0, 0, + (4,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (4,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (4,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (4,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (4,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (4,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (4,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (4,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (4,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (4,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (4,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (4,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (4,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (4,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (4,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (4,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (4,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (4,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (4,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (4,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, + (5,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (5,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (5,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (5,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (5,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (5,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (5,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (5,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (5,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (5,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (5,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (5,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (5,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (5,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (5,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (5,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (5,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (5,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (5,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (5,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, + (6,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (6,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (6,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (6,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (6,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (6,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (6,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (6,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (6,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (6,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (6,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (6,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (6,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (6,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (6,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (6,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (6,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (6,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (6,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (6,58): 0, 0, 0, 0, 0, 0, + (7,0): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (7,3): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (7,6): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (7,9): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (7,12): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (7,15): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (7,18): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (7,21): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (7,24): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (7,27): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (7,30): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (7,33): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (7,36): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (7,39): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (7,42): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (7,45): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (7,48): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (7,51): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (7,54): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLongWhole.ddl b/tools/testfiles/pbits/tpbitsSignedLongWhole.ddl new file mode 100644 index 0000000..e583f1d --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLongWhole.ddl @@ -0,0 +1,46 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=32 + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, + (0,12): -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (0,20): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (0,26): -67108864, -134217728, -268435456, -536870912, -1073741824, + (0,31): -2147483648, + (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (1,12): -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (1,19): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (1,25): -67108864, -134217728, -268435456, -536870912, -1073741824, + (1,30): -2147483648, 0, + (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (2,11): -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (2,18): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (2,24): -67108864, -134217728, -268435456, -536870912, -1073741824, + (2,29): -2147483648, 0, 0, + (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (3,11): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, + (3,18): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, + (3,24): -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, + (3,30): 0, 0, + (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (4,10): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, + (4,17): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, + (4,23): -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, + (4,29): 0, 0, 0, + (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, + (5,10): -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, + (5,17): -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, + (5,23): -268435456, -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, + (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (6,10): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, + (6,17): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, + (6,23): -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, 0, + (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (7,9): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, + (7,16): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, + (7,22): -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedWhole.ddl b/tools/testfiles/pbits/tpbitsSignedWhole.ddl new file mode 100644 index 0000000..f044e23 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedWhole.ddl @@ -0,0 +1,17 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, + (1,0): -2, -4, -8, -16, -32, -64, -128, 0, + (2,0): -4, -8, -16, -32, -64, -128, 0, 0, + (3,0): -8, -16, -32, -64, -128, 0, 0, 0, + (4,0): -16, -32, -64, -128, 0, 0, 0, 0, + (5,0): -32, -64, -128, 0, 0, 0, 0, 0, + (6,0): -64, -128, 0, 0, 0, 0, 0, 0, + (7,0): -128, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsigned.ddl b/tools/testfiles/pbits/tpbitsUnsigned.ddl new file mode 100644 index 0000000..9e7ac50 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsigned.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DU08BITS" { + DATATYPE H5T_STD_U8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsigned2.ddl b/tools/testfiles/pbits/tpbitsUnsigned2.ddl new file mode 100644 index 0000000..b7e6f79 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsigned2.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DU08BITS" { + DATATYPE H5T_STD_U8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 2, 0, 0, 0, 0, + (1,0): 3, 3, 2, 0, 0, 0, 0, 0, + (2,0): 3, 2, 0, 0, 0, 0, 0, 0, + (3,0): 2, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 3, 3, 2, 0, 0, + (1,0): 3, 3, 3, 3, 2, 0, 0, 0, + (2,0): 3, 3, 3, 2, 0, 0, 0, 0, + (3,0): 3, 3, 2, 0, 0, 0, 0, 0, + (4,0): 3, 2, 0, 0, 0, 0, 0, 0, + (5,0): 2, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=6 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 3, 3, 3, 3, 2, + (1,0): 3, 3, 3, 3, 3, 3, 2, 0, + (2,0): 3, 3, 3, 3, 3, 2, 0, 0, + (3,0): 3, 3, 3, 3, 2, 0, 0, 0, + (4,0): 3, 3, 3, 2, 0, 0, 0, 0, + (5,0): 3, 3, 2, 0, 0, 0, 0, 0, + (6,0): 3, 2, 0, 0, 0, 0, 0, 0, + (7,0): 2, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsigned4.ddl b/tools/testfiles/pbits/tpbitsUnsigned4.ddl new file mode 100644 index 0000000..d25d838 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsigned4.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DU08BITS" { + DATATYPE H5T_STD_U8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=4 + DATA { + (0,0): 15, 14, 12, 8, 0, 0, 0, 0, + (1,0): 14, 12, 8, 0, 0, 0, 0, 0, + (2,0): 12, 8, 0, 0, 0, 0, 0, 0, + (3,0): 8, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 14, 12, 8, + (1,0): 15, 15, 15, 15, 14, 12, 8, 0, + (2,0): 15, 15, 15, 14, 12, 8, 0, 0, + (3,0): 15, 15, 14, 12, 8, 0, 0, 0, + (4,0): 15, 14, 12, 8, 0, 0, 0, 0, + (5,0): 14, 12, 8, 0, 0, 0, 0, 0, + (6,0): 12, 8, 0, 0, 0, 0, 0, 0, + (7,0): 8, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedInt.ddl b/tools/testfiles/pbits/tpbitsUnsignedInt.ddl new file mode 100644 index 0000000..5e0fefe --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedInt.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DU16BITS" { + DATATYPE H5T_STD_U16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=10 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedInt4.ddl b/tools/testfiles/pbits/tpbitsUnsignedInt4.ddl new file mode 100644 index 0000000..0d3e38f --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedInt4.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DU16BITS" { + DATATYPE H5T_STD_U16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=4 + DATA { + (0,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, + (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, + (2,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, + (3,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, + (4,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=12 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, + (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, + (2,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, + (3,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, + (4,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, + (5,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, + (6,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, + (7,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedInt8.ddl b/tools/testfiles/pbits/tpbitsUnsignedInt8.ddl new file mode 100644 index 0000000..861ed3e --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedInt8.ddl @@ -0,0 +1,34 @@ +HDF5 "packedbits.h5" { +DATASET "/DU16BITS" { + DATATYPE H5T_STD_U16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (0,13): 224, 192, 128, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (1,13): 192, 128, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (2,13): 128, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, + (3,14): 0, 0, + (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (4,14): 0, 0, + (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (5,15): 0, + (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl b/tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl new file mode 100644 index 0000000..c054011 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl @@ -0,0 +1,25 @@ +HDF5 "packedbits.h5" { +DATASET "/DU16BITS" { + DATATYPE H5T_STD_U16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLong.ddl b/tools/testfiles/pbits/tpbitsUnsignedLong.ddl new file mode 100644 index 0000000..9f8bcb4 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLong.ddl @@ -0,0 +1,44 @@ +HDF5 "packedbits.h5" { +DATASET "/DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=26 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,17): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,17): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,17): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,17): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,17): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLong16.ddl b/tools/testfiles/pbits/tpbitsUnsignedLong16.ddl new file mode 100644 index 0000000..7a1984f --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLong16.ddl @@ -0,0 +1,67 @@ +HDF5 "packedbits.h5" { +DATASET "/DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,25): 0, 0, 0, 0, 0, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,26): 0, 0, 0, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,27): 0, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,29): 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,30): 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (0,27): 63488, 61440, 57344, 49152, 32768, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (1,27): 61440, 57344, 49152, 32768, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (2,27): 57344, 49152, 32768, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (3,27): 49152, 32768, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (4,27): 32768, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (5,28): 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (6,29): 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,31): 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLong8.ddl b/tools/testfiles/pbits/tpbitsUnsignedLong8.ddl new file mode 100644 index 0000000..17b896c --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLong8.ddl @@ -0,0 +1,96 @@ +HDF5 "packedbits.h5" { +DATASET "/DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,17): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,19): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,21): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (0,13): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (1,13): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (2,13): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, + (3,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (4,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (5,15): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, + (6,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, + (7,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (0,13): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (0,28): 0, 0, 0, 0, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (1,13): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, + (1,28): 0, 0, 0, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (2,13): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, + (2,29): 0, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (3,13): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,30): 0, 0, + (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (4,13): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,30): 0, 0, + (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, + (5,13): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,31): 0, + (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, + (6,13): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, + (7,13): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=24 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (0,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, + (0,26): 252, 248, 240, 224, 192, 128, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (1,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, + (1,26): 248, 240, 224, 192, 128, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (2,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, + (2,26): 240, 224, 192, 128, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (3,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (3,26): 224, 192, 128, 0, 0, 0, + (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (4,13): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (4,26): 192, 128, 0, 0, 0, 0, + (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (5,13): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (5,26): 128, 0, 0, 0, 0, 0, + (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (6,13): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, + (6,26): 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (7,13): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (7,27): 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl new file mode 100644 index 0000000..1cd9a6c --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl @@ -0,0 +1,68 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=58 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,49): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,49): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,49): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,49): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,49): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,49): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl new file mode 100644 index 0000000..f8b0189 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl @@ -0,0 +1,196 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,25): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,26): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,30): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,52): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (0,27): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,42): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (1,27): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (2,27): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (3,27): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (4,27): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (5,28): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (6,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,31): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,53): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=32 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (0,36): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (0,45): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,63): 0, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,27): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (1,36): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (1,45): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,27): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (2,36): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (2,45): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,27): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (3,36): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,27): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (4,36): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (4,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,27): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (5,36): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (5,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,27): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (6,36): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (6,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (7,27): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (7,36): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=48 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,45): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (0,54): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (0,63): 32768, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,45): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (1,54): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,45): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (2,54): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,45): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (3,54): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,45): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (4,54): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (5,45): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (5,54): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (6,45): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (6,54): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,36): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (7,45): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (7,54): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl new file mode 100644 index 0000000..befaf5b --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl @@ -0,0 +1,175 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (0,30): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (1,30): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (2,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, + (3,35): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,57): 0, 0, 0, 0, 0, 0, 0, + (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,38): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,60): 0, 0, 0, 0, + (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,41): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,63): 0, + (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (6,25): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (7,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=32 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,30): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, + (0,35): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (0,40): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (0,45): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (0,50): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (0,55): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (0,60): 4026531840, 3758096384, 3221225472, 2147483648, + (1,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,30): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, + (1,35): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (1,40): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (1,45): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (1,50): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (1,55): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (1,60): 3758096384, 3221225472, 2147483648, 0, + (2,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,30): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (2,35): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (2,40): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (2,45): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (2,50): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (2,55): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (2,60): 3221225472, 2147483648, 0, 0, + (3,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,30): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (3,35): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (3,40): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (3,45): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (3,50): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (3,55): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (3,60): 2147483648, 0, 0, 0, + (4,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967294, + (4,30): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (4,35): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (4,40): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (4,45): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (4,50): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (4,55): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (4,62): 0, 0, + (5,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,25): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, + (5,30): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (5,35): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (5,40): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (5,45): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (5,50): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (5,55): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, + (6,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,25): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, + (6,30): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (6,35): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (6,40): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (6,45): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (6,50): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (6,55): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, + (7,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,25): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (7,30): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (7,35): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (7,40): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (7,45): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (7,50): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (7,55): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole.ddl new file mode 100644 index 0000000..27c8879 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole.ddl @@ -0,0 +1,176 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=64 + DATA { + (0,0): 18446744073709551615, 18446744073709551614, 18446744073709551612, + (0,3): 18446744073709551608, 18446744073709551600, 18446744073709551584, + (0,6): 18446744073709551552, 18446744073709551488, 18446744073709551360, + (0,9): 18446744073709551104, 18446744073709550592, 18446744073709549568, + (0,12): 18446744073709547520, 18446744073709543424, 18446744073709535232, + (0,15): 18446744073709518848, 18446744073709486080, 18446744073709420544, + (0,18): 18446744073709289472, 18446744073709027328, 18446744073708503040, + (0,21): 18446744073707454464, 18446744073705357312, 18446744073701163008, + (0,24): 18446744073692774400, 18446744073675997184, 18446744073642442752, + (0,27): 18446744073575333888, 18446744073441116160, 18446744073172680704, + (0,30): 18446744072635809792, 18446744071562067968, 18446744069414584320, + (0,33): 18446744065119617024, 18446744056529682432, 18446744039349813248, + (0,36): 18446744004990074880, 18446743936270598144, 18446743798831644672, + (0,39): 18446743523953737728, 18446742974197923840, 18446741874686296064, + (0,42): 18446739675663040512, 18446735277616529408, 18446726481523507200, + (0,45): 18446708889337462784, 18446673704965373952, 18446603336221196288, + (0,48): 18446462598732840960, 18446181123756130304, 18445618173802708992, + (0,51): 18444492273895866368, 18442240474082181120, 18437736874454810624, + (0,54): 18428729675200069632, 18410715276690587648, 18374686479671623680, + (0,57): 18302628885633695744, 18158513697557839872, 17870283321406128128, + (0,60): 17293822569102704640, 16140901064495857664, 13835058055282163712, + (0,63): 9223372036854775808, + (1,0): 18446744073709551614, 18446744073709551612, 18446744073709551608, + (1,3): 18446744073709551600, 18446744073709551584, 18446744073709551552, + (1,6): 18446744073709551488, 18446744073709551360, 18446744073709551104, + (1,9): 18446744073709550592, 18446744073709549568, 18446744073709547520, + (1,12): 18446744073709543424, 18446744073709535232, 18446744073709518848, + (1,15): 18446744073709486080, 18446744073709420544, 18446744073709289472, + (1,18): 18446744073709027328, 18446744073708503040, 18446744073707454464, + (1,21): 18446744073705357312, 18446744073701163008, 18446744073692774400, + (1,24): 18446744073675997184, 18446744073642442752, 18446744073575333888, + (1,27): 18446744073441116160, 18446744073172680704, 18446744072635809792, + (1,30): 18446744071562067968, 18446744069414584320, 18446744065119617024, + (1,33): 18446744056529682432, 18446744039349813248, 18446744004990074880, + (1,36): 18446743936270598144, 18446743798831644672, 18446743523953737728, + (1,39): 18446742974197923840, 18446741874686296064, 18446739675663040512, + (1,42): 18446735277616529408, 18446726481523507200, 18446708889337462784, + (1,45): 18446673704965373952, 18446603336221196288, 18446462598732840960, + (1,48): 18446181123756130304, 18445618173802708992, 18444492273895866368, + (1,51): 18442240474082181120, 18437736874454810624, 18428729675200069632, + (1,54): 18410715276690587648, 18374686479671623680, 18302628885633695744, + (1,57): 18158513697557839872, 17870283321406128128, 17293822569102704640, + (1,60): 16140901064495857664, 13835058055282163712, 9223372036854775808, + (1,63): 0, + (2,0): 18446744073709551612, 18446744073709551608, 18446744073709551600, + (2,3): 18446744073709551584, 18446744073709551552, 18446744073709551488, + (2,6): 18446744073709551360, 18446744073709551104, 18446744073709550592, + (2,9): 18446744073709549568, 18446744073709547520, 18446744073709543424, + (2,12): 18446744073709535232, 18446744073709518848, 18446744073709486080, + (2,15): 18446744073709420544, 18446744073709289472, 18446744073709027328, + (2,18): 18446744073708503040, 18446744073707454464, 18446744073705357312, + (2,21): 18446744073701163008, 18446744073692774400, 18446744073675997184, + (2,24): 18446744073642442752, 18446744073575333888, 18446744073441116160, + (2,27): 18446744073172680704, 18446744072635809792, 18446744071562067968, + (2,30): 18446744069414584320, 18446744065119617024, 18446744056529682432, + (2,33): 18446744039349813248, 18446744004990074880, 18446743936270598144, + (2,36): 18446743798831644672, 18446743523953737728, 18446742974197923840, + (2,39): 18446741874686296064, 18446739675663040512, 18446735277616529408, + (2,42): 18446726481523507200, 18446708889337462784, 18446673704965373952, + (2,45): 18446603336221196288, 18446462598732840960, 18446181123756130304, + (2,48): 18445618173802708992, 18444492273895866368, 18442240474082181120, + (2,51): 18437736874454810624, 18428729675200069632, 18410715276690587648, + (2,54): 18374686479671623680, 18302628885633695744, 18158513697557839872, + (2,57): 17870283321406128128, 17293822569102704640, 16140901064495857664, + (2,60): 13835058055282163712, 9223372036854775808, 0, 0, + (3,0): 18446744073709551608, 18446744073709551600, 18446744073709551584, + (3,3): 18446744073709551552, 18446744073709551488, 18446744073709551360, + (3,6): 18446744073709551104, 18446744073709550592, 18446744073709549568, + (3,9): 18446744073709547520, 18446744073709543424, 18446744073709535232, + (3,12): 18446744073709518848, 18446744073709486080, 18446744073709420544, + (3,15): 18446744073709289472, 18446744073709027328, 18446744073708503040, + (3,18): 18446744073707454464, 18446744073705357312, 18446744073701163008, + (3,21): 18446744073692774400, 18446744073675997184, 18446744073642442752, + (3,24): 18446744073575333888, 18446744073441116160, 18446744073172680704, + (3,27): 18446744072635809792, 18446744071562067968, 18446744069414584320, + (3,30): 18446744065119617024, 18446744056529682432, 18446744039349813248, + (3,33): 18446744004990074880, 18446743936270598144, 18446743798831644672, + (3,36): 18446743523953737728, 18446742974197923840, 18446741874686296064, + (3,39): 18446739675663040512, 18446735277616529408, 18446726481523507200, + (3,42): 18446708889337462784, 18446673704965373952, 18446603336221196288, + (3,45): 18446462598732840960, 18446181123756130304, 18445618173802708992, + (3,48): 18444492273895866368, 18442240474082181120, 18437736874454810624, + (3,51): 18428729675200069632, 18410715276690587648, 18374686479671623680, + (3,54): 18302628885633695744, 18158513697557839872, 17870283321406128128, + (3,57): 17293822569102704640, 16140901064495857664, 13835058055282163712, + (3,60): 9223372036854775808, 0, 0, 0, + (4,0): 18446744073709551600, 18446744073709551584, 18446744073709551552, + (4,3): 18446744073709551488, 18446744073709551360, 18446744073709551104, + (4,6): 18446744073709550592, 18446744073709549568, 18446744073709547520, + (4,9): 18446744073709543424, 18446744073709535232, 18446744073709518848, + (4,12): 18446744073709486080, 18446744073709420544, 18446744073709289472, + (4,15): 18446744073709027328, 18446744073708503040, 18446744073707454464, + (4,18): 18446744073705357312, 18446744073701163008, 18446744073692774400, + (4,21): 18446744073675997184, 18446744073642442752, 18446744073575333888, + (4,24): 18446744073441116160, 18446744073172680704, 18446744072635809792, + (4,27): 18446744071562067968, 18446744069414584320, 18446744065119617024, + (4,30): 18446744056529682432, 18446744039349813248, 18446744004990074880, + (4,33): 18446743936270598144, 18446743798831644672, 18446743523953737728, + (4,36): 18446742974197923840, 18446741874686296064, 18446739675663040512, + (4,39): 18446735277616529408, 18446726481523507200, 18446708889337462784, + (4,42): 18446673704965373952, 18446603336221196288, 18446462598732840960, + (4,45): 18446181123756130304, 18445618173802708992, 18444492273895866368, + (4,48): 18442240474082181120, 18437736874454810624, 18428729675200069632, + (4,51): 18410715276690587648, 18374686479671623680, 18302628885633695744, + (4,54): 18158513697557839872, 17870283321406128128, 17293822569102704640, + (4,57): 16140901064495857664, 13835058055282163712, 9223372036854775808, + (4,60): 0, 0, 0, 0, + (5,0): 18446744073709551584, 18446744073709551552, 18446744073709551488, + (5,3): 18446744073709551360, 18446744073709551104, 18446744073709550592, + (5,6): 18446744073709549568, 18446744073709547520, 18446744073709543424, + (5,9): 18446744073709535232, 18446744073709518848, 18446744073709486080, + (5,12): 18446744073709420544, 18446744073709289472, 18446744073709027328, + (5,15): 18446744073708503040, 18446744073707454464, 18446744073705357312, + (5,18): 18446744073701163008, 18446744073692774400, 18446744073675997184, + (5,21): 18446744073642442752, 18446744073575333888, 18446744073441116160, + (5,24): 18446744073172680704, 18446744072635809792, 18446744071562067968, + (5,27): 18446744069414584320, 18446744065119617024, 18446744056529682432, + (5,30): 18446744039349813248, 18446744004990074880, 18446743936270598144, + (5,33): 18446743798831644672, 18446743523953737728, 18446742974197923840, + (5,36): 18446741874686296064, 18446739675663040512, 18446735277616529408, + (5,39): 18446726481523507200, 18446708889337462784, 18446673704965373952, + (5,42): 18446603336221196288, 18446462598732840960, 18446181123756130304, + (5,45): 18445618173802708992, 18444492273895866368, 18442240474082181120, + (5,48): 18437736874454810624, 18428729675200069632, 18410715276690587648, + (5,51): 18374686479671623680, 18302628885633695744, 18158513697557839872, + (5,54): 17870283321406128128, 17293822569102704640, 16140901064495857664, + (5,57): 13835058055282163712, 9223372036854775808, 0, 0, 0, 0, 0, + (6,0): 18446744073709551552, 18446744073709551488, 18446744073709551360, + (6,3): 18446744073709551104, 18446744073709550592, 18446744073709549568, + (6,6): 18446744073709547520, 18446744073709543424, 18446744073709535232, + (6,9): 18446744073709518848, 18446744073709486080, 18446744073709420544, + (6,12): 18446744073709289472, 18446744073709027328, 18446744073708503040, + (6,15): 18446744073707454464, 18446744073705357312, 18446744073701163008, + (6,18): 18446744073692774400, 18446744073675997184, 18446744073642442752, + (6,21): 18446744073575333888, 18446744073441116160, 18446744073172680704, + (6,24): 18446744072635809792, 18446744071562067968, 18446744069414584320, + (6,27): 18446744065119617024, 18446744056529682432, 18446744039349813248, + (6,30): 18446744004990074880, 18446743936270598144, 18446743798831644672, + (6,33): 18446743523953737728, 18446742974197923840, 18446741874686296064, + (6,36): 18446739675663040512, 18446735277616529408, 18446726481523507200, + (6,39): 18446708889337462784, 18446673704965373952, 18446603336221196288, + (6,42): 18446462598732840960, 18446181123756130304, 18445618173802708992, + (6,45): 18444492273895866368, 18442240474082181120, 18437736874454810624, + (6,48): 18428729675200069632, 18410715276690587648, 18374686479671623680, + (6,51): 18302628885633695744, 18158513697557839872, 17870283321406128128, + (6,54): 17293822569102704640, 16140901064495857664, 13835058055282163712, + (6,57): 9223372036854775808, 0, 0, 0, 0, 0, 0, + (7,0): 18446744073709551488, 18446744073709551360, 18446744073709551104, + (7,3): 18446744073709550592, 18446744073709549568, 18446744073709547520, + (7,6): 18446744073709543424, 18446744073709535232, 18446744073709518848, + (7,9): 18446744073709486080, 18446744073709420544, 18446744073709289472, + (7,12): 18446744073709027328, 18446744073708503040, 18446744073707454464, + (7,15): 18446744073705357312, 18446744073701163008, 18446744073692774400, + (7,18): 18446744073675997184, 18446744073642442752, 18446744073575333888, + (7,21): 18446744073441116160, 18446744073172680704, 18446744072635809792, + (7,24): 18446744071562067968, 18446744069414584320, 18446744065119617024, + (7,27): 18446744056529682432, 18446744039349813248, 18446744004990074880, + (7,30): 18446743936270598144, 18446743798831644672, 18446743523953737728, + (7,33): 18446742974197923840, 18446741874686296064, 18446739675663040512, + (7,36): 18446735277616529408, 18446726481523507200, 18446708889337462784, + (7,39): 18446673704965373952, 18446603336221196288, 18446462598732840960, + (7,42): 18446181123756130304, 18445618173802708992, 18444492273895866368, + (7,45): 18442240474082181120, 18437736874454810624, 18428729675200069632, + (7,48): 18410715276690587648, 18374686479671623680, 18302628885633695744, + (7,51): 18158513697557839872, 17870283321406128128, 17293822569102704640, + (7,54): 16140901064495857664, 13835058055282163712, 9223372036854775808, + (7,57): 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl new file mode 100644 index 0000000..0302105 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl @@ -0,0 +1,175 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=1 LENGTH=63 + DATA { + (0,0): 9223372036854775807, 9223372036854775807, 9223372036854775806, + (0,3): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (0,6): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (0,9): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (0,12): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (0,15): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (0,18): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (0,21): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (0,24): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (0,27): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (0,30): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (0,33): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (0,36): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (0,39): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (0,42): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (0,45): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (0,48): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (0,51): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (0,54): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (0,57): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (0,60): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (0,63): 4611686018427387904, + (1,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, + (1,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (1,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (1,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (1,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (1,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (1,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (1,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (1,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (1,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (1,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (1,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (1,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (1,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (1,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (1,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (1,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (1,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (1,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (1,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (1,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (2,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, + (2,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (2,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (2,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (2,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (2,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (2,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (2,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (2,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (2,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (2,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (2,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (2,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (2,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (2,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (2,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (2,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (2,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (2,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (2,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (2,60): 6917529027641081856, 4611686018427387904, 0, 0, + (3,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (3,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (3,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (3,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (3,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (3,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (3,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (3,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (3,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (3,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (3,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (3,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (3,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (3,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (3,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (3,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (3,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (3,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (3,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (3,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (3,60): 4611686018427387904, 0, 0, 0, + (4,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (4,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (4,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (4,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (4,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (4,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (4,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (4,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (4,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (4,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (4,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (4,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (4,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (4,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (4,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (4,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (4,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (4,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (4,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (4,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (4,61): 0, 0, 0, + (5,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (5,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (5,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (5,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (5,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (5,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (5,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (5,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (5,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (5,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (5,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (5,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (5,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (5,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (5,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (5,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (5,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (5,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (5,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (5,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, + (6,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (6,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (6,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (6,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (6,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (6,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (6,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (6,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (6,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (6,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (6,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (6,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (6,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (6,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (6,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (6,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (6,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (6,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (6,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (6,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, + (7,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (7,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (7,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (7,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (7,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (7,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (7,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (7,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (7,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (7,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (7,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (7,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (7,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (7,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (7,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (7,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (7,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (7,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (7,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (7,58): 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl new file mode 100644 index 0000000..6a9b503 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl @@ -0,0 +1,172 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=63 + DATA { + (0,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, + (0,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (0,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (0,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (0,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (0,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (0,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (0,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (0,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (0,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (0,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (0,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (0,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (0,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (0,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (0,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (0,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (0,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (0,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (0,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (0,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (1,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, + (1,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (1,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (1,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (1,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (1,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (1,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (1,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (1,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (1,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (1,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (1,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (1,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (1,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (1,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (1,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (1,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (1,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (1,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (1,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (1,60): 6917529027641081856, 4611686018427387904, 0, 0, + (2,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (2,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (2,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (2,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (2,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (2,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (2,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (2,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (2,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (2,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (2,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (2,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (2,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (2,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (2,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (2,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (2,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (2,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (2,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (2,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (2,60): 4611686018427387904, 0, 0, 0, + (3,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (3,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (3,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (3,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (3,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (3,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (3,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (3,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (3,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (3,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (3,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (3,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (3,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (3,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (3,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (3,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (3,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (3,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (3,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (3,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (3,61): 0, 0, 0, + (4,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (4,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (4,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (4,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (4,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (4,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (4,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (4,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (4,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (4,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (4,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (4,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (4,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (4,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (4,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (4,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (4,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (4,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (4,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (4,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, + (5,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (5,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (5,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (5,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (5,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (5,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (5,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (5,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (5,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (5,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (5,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (5,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (5,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (5,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (5,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (5,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (5,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (5,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (5,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (5,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, + (6,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (6,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (6,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (6,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (6,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (6,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (6,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (6,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (6,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (6,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (6,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (6,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (6,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (6,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (6,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (6,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (6,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (6,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (6,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (6,58): 0, 0, 0, 0, 0, 0, + (7,0): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (7,3): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (7,6): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (7,9): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (7,12): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (7,15): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (7,18): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (7,21): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (7,24): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (7,27): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (7,30): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (7,33): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (7,36): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (7,39): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (7,42): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (7,45): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (7,48): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (7,51): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (7,54): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl new file mode 100644 index 0000000..50ad02f --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl @@ -0,0 +1,59 @@ +HDF5 "packedbits.h5" { +DATASET "/DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (0,30): 3221225472, 2147483648, + (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (1,30): 2147483648, 0, + (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, + (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, + (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, + (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (6,25): 2147483648, 0, 0, 0, 0, 0, 0, + (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (7,27): 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedWhole.ddl b/tools/testfiles/pbits/tpbitsUnsignedWhole.ddl new file mode 100644 index 0000000..7c9e736 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedWhole.ddl @@ -0,0 +1,17 @@ +HDF5 "packedbits.h5" { +DATASET "/DU08BITS" { + DATATYPE H5T_STD_U8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl deleted file mode 100644 index 64a2880..0000000 --- a/tools/testfiles/tnofilename-with-packed-bits.ddl +++ /dev/null @@ -1,136 +0,0 @@ -usage: h5dump [OPTIONS] files - OPTIONS - -h, --help Print a usage message and exit - -V, --version Print version number and exit ---------------- File Options --------------- - -n, --contents Print a list of the file contents and exit - Optional value 1 also prints attributes. - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -f D, --filedriver=D Specify which driver to open the file with - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display ---------------- Object Options --------------- - -a P, --attribute=P Print the specified attribute - If an attribute name contains a slash (/), escape the - slash with a preceding backslash (\). - (See example section below.) - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -t P, --datatype=P Print the specified named datatype - -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P - P can be the absolute path or just a relative path. - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. ---------------- Object Property Options --------------- - -i, --object-ids Print the object ids - -p, --properties Print dataset filters, storage layout and fill value - -M L, --packedbits=L Print packed bits as unsigned integers, using mask - format L for an integer dataset specified with - option -d. L is a list of offset,length values, - separated by commas. Offset is the beginning bit in - the data value and length is the number of bits of - the mask. - -R, --region Print dataset pointed by region references ---------------- Formatting Options --------------- - -e, --escape Escape non printing characters - -r, --string Print 1-byte integer datasets as ASCII - -y, --noindex Do not print array indices with the data - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. ---------------- XML Options --------------- - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - ---------------- Subsetting Options --------------- - Subsetting is available by using the following options with a dataset - option. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - (Alternate compact form of subsetting is described in the Reference Manual) - ---------------- Option Argument Conventions --------------- - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - See examples below for family, split, and multi driver special file name usage. - - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - ---------------- Examples --------------- - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - Attribute "high/low" of the group /bar_none in the file quux.h5 - - h5dump -a "/bar_none/high\/low" quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - - 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset - - h5dump -d /dset -M 0,1,4,3 quux.h5 - - 5) Dataset foo in files file1.h5 file2.h5 file3.h5 - - h5dump -d /foo file1.h5 file2.h5 file3.h5 - - 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - - h5dump -d /foo -f split splitfile - - 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 - - h5dump -d /foo -f multi mf - - 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 - - h5dump -d /foo -f family fam%05d.h5 - -h5dump error: missing file name diff --git a/tools/testfiles/tpbitsArray.ddl b/tools/testfiles/tpbitsArray.ddl deleted file mode 100644 index 125abb8..0000000 --- a/tools/testfiles/tpbitsArray.ddl +++ /dev/null @@ -1,14 +0,0 @@ -HDF5 "tarray1.h5" { -DATASET "/Dataset1" { - DATATYPE H5T_ARRAY { [4] H5T_STD_I32LE } - DATASPACE SIMPLE { ( 4 ) / ( 4 ) } - PACKED_BITS OFFSET=0 LENGTH=1 - DATA { - (0): [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ] - } - PACKED_BITS OFFSET=1 LENGTH=1 - DATA { - (0): [ 0, 0, 1, 1 ], [ 1, 1, 0, 0 ], [ 0, 0, 1, 1 ], [ 1, 1, 0, 0 ] - } -} -} diff --git a/tools/testfiles/tpbitsCharLengthExceeded.ddl b/tools/testfiles/tpbitsCharLengthExceeded.ddl deleted file mode 100644 index b0683a7..0000000 --- a/tools/testfiles/tpbitsCharLengthExceeded.ddl +++ /dev/null @@ -1,18 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=2 LENGTH=7 - DATA { - (0,0): 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} -h5dump error: Packed Bit offset+length value(9) too large. Max is 8 diff --git a/tools/testfiles/tpbitsCharOffsetExceeded.ddl b/tools/testfiles/tpbitsCharOffsetExceeded.ddl deleted file mode 100644 index 530fa05..0000000 --- a/tools/testfiles/tpbitsCharOffsetExceeded.ddl +++ /dev/null @@ -1,18 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=8 LENGTH=1 - DATA { - (0,0): 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} -h5dump error: Packed Bit offset+length value(9) too large. Max is 8 diff --git a/tools/testfiles/tpbitsCompound.ddl b/tools/testfiles/tpbitsCompound.ddl deleted file mode 100644 index c84272a..0000000 --- a/tools/testfiles/tpbitsCompound.ddl +++ /dev/null @@ -1,66 +0,0 @@ -HDF5 "tcompound.h5" { -DATASET "/dset1" { - DATATYPE H5T_COMPOUND { - H5T_STD_I32BE "a_name"; - H5T_IEEE_F32BE "b_name"; - H5T_IEEE_F64BE "c_name"; - } - DATASPACE SIMPLE { ( 5 ) / ( 5 ) } - PACKED_BITS OFFSET=0 LENGTH=1 - DATA { - (0): { - 0, - 0, - 1 - }, - (1): { - 1, - 1, - 0.5 - }, - (2): { - 0, - 4, - 0.333333 - }, - (3): { - 1, - 9, - 0.25 - }, - (4): { - 0, - 16, - 0.2 - } - } - PACKED_BITS OFFSET=1 LENGTH=1 - DATA { - (0): { - 0, - 0, - 1 - }, - (1): { - 0, - 1, - 0.5 - }, - (2): { - 1, - 4, - 0.333333 - }, - (3): { - 1, - 9, - 0.25 - }, - (4): { - 0, - 16, - 0.2 - } - } -} -} diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl deleted file mode 100644 index cdb1f91..0000000 --- a/tools/testfiles/tpbitsIncomplete.ddl +++ /dev/null @@ -1,136 +0,0 @@ -usage: h5dump [OPTIONS] files - OPTIONS - -h, --help Print a usage message and exit - -V, --version Print version number and exit ---------------- File Options --------------- - -n, --contents Print a list of the file contents and exit - Optional value 1 also prints attributes. - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -f D, --filedriver=D Specify which driver to open the file with - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display ---------------- Object Options --------------- - -a P, --attribute=P Print the specified attribute - If an attribute name contains a slash (/), escape the - slash with a preceding backslash (\). - (See example section below.) - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -t P, --datatype=P Print the specified named datatype - -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P - P can be the absolute path or just a relative path. - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. ---------------- Object Property Options --------------- - -i, --object-ids Print the object ids - -p, --properties Print dataset filters, storage layout and fill value - -M L, --packedbits=L Print packed bits as unsigned integers, using mask - format L for an integer dataset specified with - option -d. L is a list of offset,length values, - separated by commas. Offset is the beginning bit in - the data value and length is the number of bits of - the mask. - -R, --region Print dataset pointed by region references ---------------- Formatting Options --------------- - -e, --escape Escape non printing characters - -r, --string Print 1-byte integer datasets as ASCII - -y, --noindex Do not print array indices with the data - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. ---------------- XML Options --------------- - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - ---------------- Subsetting Options --------------- - Subsetting is available by using the following options with a dataset - option. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - (Alternate compact form of subsetting is described in the Reference Manual) - ---------------- Option Argument Conventions --------------- - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - See examples below for family, split, and multi driver special file name usage. - - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - ---------------- Examples --------------- - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - Attribute "high/low" of the group /bar_none in the file quux.h5 - - h5dump -a "/bar_none/high\/low" quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - - 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset - - h5dump -d /dset -M 0,1,4,3 quux.h5 - - 5) Dataset foo in files file1.h5 file2.h5 file3.h5 - - h5dump -d /foo file1.h5 file2.h5 file3.h5 - - 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - - h5dump -d /foo -f split splitfile - - 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 - - h5dump -d /foo -f multi mf - - 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 - - h5dump -d /foo -f family fam%05d.h5 - -h5dump error: Bad mask list(0,2,2,1,0,2,2,) diff --git a/tools/testfiles/tpbitsIntLengthExceeded.ddl b/tools/testfiles/tpbitsIntLengthExceeded.ddl deleted file mode 100644 index 1c919cd..0000000 --- a/tools/testfiles/tpbitsIntLengthExceeded.ddl +++ /dev/null @@ -1,18 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS16BITS" { - DATATYPE H5T_STD_I16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=10 LENGTH=7 - DATA { - (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} -h5dump error: Packed Bit offset+length value(17) too large. Max is 16 diff --git a/tools/testfiles/tpbitsIntOffsetExceeded.ddl b/tools/testfiles/tpbitsIntOffsetExceeded.ddl deleted file mode 100644 index f3b2a8c..0000000 --- a/tools/testfiles/tpbitsIntOffsetExceeded.ddl +++ /dev/null @@ -1,18 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS16BITS" { - DATATYPE H5T_STD_I16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=16 LENGTH=1 - DATA { - (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} -h5dump error: Packed Bit offset+length value(17) too large. Max is 16 diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl deleted file mode 100644 index 6d2492a..0000000 --- a/tools/testfiles/tpbitsLengthExceeded.ddl +++ /dev/null @@ -1,136 +0,0 @@ -usage: h5dump [OPTIONS] files - OPTIONS - -h, --help Print a usage message and exit - -V, --version Print version number and exit ---------------- File Options --------------- - -n, --contents Print a list of the file contents and exit - Optional value 1 also prints attributes. - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -f D, --filedriver=D Specify which driver to open the file with - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display ---------------- Object Options --------------- - -a P, --attribute=P Print the specified attribute - If an attribute name contains a slash (/), escape the - slash with a preceding backslash (\). - (See example section below.) - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -t P, --datatype=P Print the specified named datatype - -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P - P can be the absolute path or just a relative path. - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. ---------------- Object Property Options --------------- - -i, --object-ids Print the object ids - -p, --properties Print dataset filters, storage layout and fill value - -M L, --packedbits=L Print packed bits as unsigned integers, using mask - format L for an integer dataset specified with - option -d. L is a list of offset,length values, - separated by commas. Offset is the beginning bit in - the data value and length is the number of bits of - the mask. - -R, --region Print dataset pointed by region references ---------------- Formatting Options --------------- - -e, --escape Escape non printing characters - -r, --string Print 1-byte integer datasets as ASCII - -y, --noindex Do not print array indices with the data - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. ---------------- XML Options --------------- - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - ---------------- Subsetting Options --------------- - Subsetting is available by using the following options with a dataset - option. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - (Alternate compact form of subsetting is described in the Reference Manual) - ---------------- Option Argument Conventions --------------- - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - See examples below for family, split, and multi driver special file name usage. - - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - ---------------- Examples --------------- - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - Attribute "high/low" of the group /bar_none in the file quux.h5 - - h5dump -a "/bar_none/high\/low" quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - - 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset - - h5dump -d /dset -M 0,1,4,3 quux.h5 - - 5) Dataset foo in files file1.h5 file2.h5 file3.h5 - - h5dump -d /foo file1.h5 file2.h5 file3.h5 - - 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - - h5dump -d /foo -f split splitfile - - 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 - - h5dump -d /foo -f multi mf - - 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 - - h5dump -d /foo -f family fam%05d.h5 - -h5dump error: Packed Bit offset+length value(65) too large. Max is 64 diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl deleted file mode 100644 index 4f56619..0000000 --- a/tools/testfiles/tpbitsLengthPositive.ddl +++ /dev/null @@ -1,136 +0,0 @@ -usage: h5dump [OPTIONS] files - OPTIONS - -h, --help Print a usage message and exit - -V, --version Print version number and exit ---------------- File Options --------------- - -n, --contents Print a list of the file contents and exit - Optional value 1 also prints attributes. - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -f D, --filedriver=D Specify which driver to open the file with - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display ---------------- Object Options --------------- - -a P, --attribute=P Print the specified attribute - If an attribute name contains a slash (/), escape the - slash with a preceding backslash (\). - (See example section below.) - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -t P, --datatype=P Print the specified named datatype - -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P - P can be the absolute path or just a relative path. - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. ---------------- Object Property Options --------------- - -i, --object-ids Print the object ids - -p, --properties Print dataset filters, storage layout and fill value - -M L, --packedbits=L Print packed bits as unsigned integers, using mask - format L for an integer dataset specified with - option -d. L is a list of offset,length values, - separated by commas. Offset is the beginning bit in - the data value and length is the number of bits of - the mask. - -R, --region Print dataset pointed by region references ---------------- Formatting Options --------------- - -e, --escape Escape non printing characters - -r, --string Print 1-byte integer datasets as ASCII - -y, --noindex Do not print array indices with the data - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. ---------------- XML Options --------------- - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - ---------------- Subsetting Options --------------- - Subsetting is available by using the following options with a dataset - option. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - (Alternate compact form of subsetting is described in the Reference Manual) - ---------------- Option Argument Conventions --------------- - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - See examples below for family, split, and multi driver special file name usage. - - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - ---------------- Examples --------------- - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - Attribute "high/low" of the group /bar_none in the file quux.h5 - - h5dump -a "/bar_none/high\/low" quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - - 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset - - h5dump -d /dset -M 0,1,4,3 quux.h5 - - 5) Dataset foo in files file1.h5 file2.h5 file3.h5 - - h5dump -d /foo file1.h5 file2.h5 file3.h5 - - 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - - h5dump -d /foo -f split splitfile - - 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 - - h5dump -d /foo -f multi mf - - 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 - - h5dump -d /foo -f family fam%05d.h5 - -h5dump error: Packed Bit length value(0) must be positive. diff --git a/tools/testfiles/tpbitsLongLengthExceeded.ddl b/tools/testfiles/tpbitsLongLengthExceeded.ddl deleted file mode 100644 index 812c300..0000000 --- a/tools/testfiles/tpbitsLongLengthExceeded.ddl +++ /dev/null @@ -1,26 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS32BITS" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=26 LENGTH=7 - DATA { - (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} -h5dump error: Packed Bit offset+length value(33) too large. Max is 32 diff --git a/tools/testfiles/tpbitsLongOffsetExceeded.ddl b/tools/testfiles/tpbitsLongOffsetExceeded.ddl deleted file mode 100644 index cbea722..0000000 --- a/tools/testfiles/tpbitsLongOffsetExceeded.ddl +++ /dev/null @@ -1,26 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS32BITS" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=32 LENGTH=1 - DATA { - (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} -h5dump error: Packed Bit offset+length value(33) too large. Max is 32 diff --git a/tools/testfiles/tpbitsMax.ddl b/tools/testfiles/tpbitsMax.ddl deleted file mode 100644 index e569488..0000000 --- a/tools/testfiles/tpbitsMax.ddl +++ /dev/null @@ -1,94 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=1 - DATA { - (0,0): 1, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=1 LENGTH=1 - DATA { - (0,0): 1, 1, 0, 0, 0, 0, 0, 0, - (1,0): 1, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=2 LENGTH=1 - DATA { - (0,0): 1, 1, 1, 0, 0, 0, 0, 0, - (1,0): 1, 1, 0, 0, 0, 0, 0, 0, - (2,0): 1, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=3 LENGTH=1 - DATA { - (0,0): 1, 1, 1, 1, 0, 0, 0, 0, - (1,0): 1, 1, 1, 0, 0, 0, 0, 0, - (2,0): 1, 1, 0, 0, 0, 0, 0, 0, - (3,0): 1, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=4 LENGTH=1 - DATA { - (0,0): 1, 1, 1, 1, 1, 0, 0, 0, - (1,0): 1, 1, 1, 1, 0, 0, 0, 0, - (2,0): 1, 1, 1, 0, 0, 0, 0, 0, - (3,0): 1, 1, 0, 0, 0, 0, 0, 0, - (4,0): 1, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=5 LENGTH=1 - DATA { - (0,0): 1, 1, 1, 1, 1, 1, 0, 0, - (1,0): 1, 1, 1, 1, 1, 0, 0, 0, - (2,0): 1, 1, 1, 1, 0, 0, 0, 0, - (3,0): 1, 1, 1, 0, 0, 0, 0, 0, - (4,0): 1, 1, 0, 0, 0, 0, 0, 0, - (5,0): 1, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=6 LENGTH=1 - DATA { - (0,0): 1, 1, 1, 1, 1, 1, 1, 0, - (1,0): 1, 1, 1, 1, 1, 1, 0, 0, - (2,0): 1, 1, 1, 1, 1, 0, 0, 0, - (3,0): 1, 1, 1, 1, 0, 0, 0, 0, - (4,0): 1, 1, 1, 0, 0, 0, 0, 0, - (5,0): 1, 1, 0, 0, 0, 0, 0, 0, - (6,0): 1, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=7 LENGTH=1 - DATA { - (0,0): 1, 1, 1, 1, 1, 1, 1, 1, - (1,0): 1, 1, 1, 1, 1, 1, 1, 0, - (2,0): 1, 1, 1, 1, 1, 1, 0, 0, - (3,0): 1, 1, 1, 1, 1, 0, 0, 0, - (4,0): 1, 1, 1, 1, 0, 0, 0, 0, - (5,0): 1, 1, 1, 0, 0, 0, 0, 0, - (6,0): 1, 1, 0, 0, 0, 0, 0, 0, - (7,0): 1, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl deleted file mode 100644 index 3432433..0000000 --- a/tools/testfiles/tpbitsMaxExceeded.ddl +++ /dev/null @@ -1,136 +0,0 @@ -usage: h5dump [OPTIONS] files - OPTIONS - -h, --help Print a usage message and exit - -V, --version Print version number and exit ---------------- File Options --------------- - -n, --contents Print a list of the file contents and exit - Optional value 1 also prints attributes. - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -f D, --filedriver=D Specify which driver to open the file with - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display ---------------- Object Options --------------- - -a P, --attribute=P Print the specified attribute - If an attribute name contains a slash (/), escape the - slash with a preceding backslash (\). - (See example section below.) - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -t P, --datatype=P Print the specified named datatype - -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P - P can be the absolute path or just a relative path. - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. ---------------- Object Property Options --------------- - -i, --object-ids Print the object ids - -p, --properties Print dataset filters, storage layout and fill value - -M L, --packedbits=L Print packed bits as unsigned integers, using mask - format L for an integer dataset specified with - option -d. L is a list of offset,length values, - separated by commas. Offset is the beginning bit in - the data value and length is the number of bits of - the mask. - -R, --region Print dataset pointed by region references ---------------- Formatting Options --------------- - -e, --escape Escape non printing characters - -r, --string Print 1-byte integer datasets as ASCII - -y, --noindex Do not print array indices with the data - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. ---------------- XML Options --------------- - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - ---------------- Subsetting Options --------------- - Subsetting is available by using the following options with a dataset - option. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - (Alternate compact form of subsetting is described in the Reference Manual) - ---------------- Option Argument Conventions --------------- - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - See examples below for family, split, and multi driver special file name usage. - - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - ---------------- Examples --------------- - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - Attribute "high/low" of the group /bar_none in the file quux.h5 - - h5dump -a "/bar_none/high\/low" quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - - 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset - - h5dump -d /dset -M 0,1,4,3 quux.h5 - - 5) Dataset foo in files file1.h5 file2.h5 file3.h5 - - h5dump -d /foo file1.h5 file2.h5 file3.h5 - - 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - - h5dump -d /foo -f split splitfile - - 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 - - h5dump -d /foo -f multi mf - - 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 - - h5dump -d /foo -f family fam%05d.h5 - -h5dump error: Too many masks requested (max. 8). Mask list(0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1) diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl deleted file mode 100644 index e51a09e..0000000 --- a/tools/testfiles/tpbitsOffsetExceeded.ddl +++ /dev/null @@ -1,136 +0,0 @@ -usage: h5dump [OPTIONS] files - OPTIONS - -h, --help Print a usage message and exit - -V, --version Print version number and exit ---------------- File Options --------------- - -n, --contents Print a list of the file contents and exit - Optional value 1 also prints attributes. - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -f D, --filedriver=D Specify which driver to open the file with - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display ---------------- Object Options --------------- - -a P, --attribute=P Print the specified attribute - If an attribute name contains a slash (/), escape the - slash with a preceding backslash (\). - (See example section below.) - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -t P, --datatype=P Print the specified named datatype - -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P - P can be the absolute path or just a relative path. - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. ---------------- Object Property Options --------------- - -i, --object-ids Print the object ids - -p, --properties Print dataset filters, storage layout and fill value - -M L, --packedbits=L Print packed bits as unsigned integers, using mask - format L for an integer dataset specified with - option -d. L is a list of offset,length values, - separated by commas. Offset is the beginning bit in - the data value and length is the number of bits of - the mask. - -R, --region Print dataset pointed by region references ---------------- Formatting Options --------------- - -e, --escape Escape non printing characters - -r, --string Print 1-byte integer datasets as ASCII - -y, --noindex Do not print array indices with the data - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. ---------------- XML Options --------------- - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - ---------------- Subsetting Options --------------- - Subsetting is available by using the following options with a dataset - option. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - (Alternate compact form of subsetting is described in the Reference Manual) - ---------------- Option Argument Conventions --------------- - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - See examples below for family, split, and multi driver special file name usage. - - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - ---------------- Examples --------------- - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - Attribute "high/low" of the group /bar_none in the file quux.h5 - - h5dump -a "/bar_none/high\/low" quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - - 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset - - h5dump -d /dset -M 0,1,4,3 quux.h5 - - 5) Dataset foo in files file1.h5 file2.h5 file3.h5 - - h5dump -d /foo file1.h5 file2.h5 file3.h5 - - 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - - h5dump -d /foo -f split splitfile - - 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 - - h5dump -d /foo -f multi mf - - 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 - - h5dump -d /foo -f family fam%05d.h5 - -h5dump error: Packed Bit offset value(64) must be between 0 and 63 diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl deleted file mode 100644 index ba6e46d..0000000 --- a/tools/testfiles/tpbitsOffsetNegative.ddl +++ /dev/null @@ -1,136 +0,0 @@ -usage: h5dump [OPTIONS] files - OPTIONS - -h, --help Print a usage message and exit - -V, --version Print version number and exit ---------------- File Options --------------- - -n, --contents Print a list of the file contents and exit - Optional value 1 also prints attributes. - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -f D, --filedriver=D Specify which driver to open the file with - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display ---------------- Object Options --------------- - -a P, --attribute=P Print the specified attribute - If an attribute name contains a slash (/), escape the - slash with a preceding backslash (\). - (See example section below.) - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -t P, --datatype=P Print the specified named datatype - -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P - P can be the absolute path or just a relative path. - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. ---------------- Object Property Options --------------- - -i, --object-ids Print the object ids - -p, --properties Print dataset filters, storage layout and fill value - -M L, --packedbits=L Print packed bits as unsigned integers, using mask - format L for an integer dataset specified with - option -d. L is a list of offset,length values, - separated by commas. Offset is the beginning bit in - the data value and length is the number of bits of - the mask. - -R, --region Print dataset pointed by region references ---------------- Formatting Options --------------- - -e, --escape Escape non printing characters - -r, --string Print 1-byte integer datasets as ASCII - -y, --noindex Do not print array indices with the data - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. ---------------- XML Options --------------- - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - ---------------- Subsetting Options --------------- - Subsetting is available by using the following options with a dataset - option. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - (Alternate compact form of subsetting is described in the Reference Manual) - ---------------- Option Argument Conventions --------------- - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - See examples below for family, split, and multi driver special file name usage. - - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - ---------------- Examples --------------- - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - Attribute "high/low" of the group /bar_none in the file quux.h5 - - h5dump -a "/bar_none/high\/low" quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - - 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset - - h5dump -d /dset -M 0,1,4,3 quux.h5 - - 5) Dataset foo in files file1.h5 file2.h5 file3.h5 - - h5dump -d /foo file1.h5 file2.h5 file3.h5 - - 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - - h5dump -d /foo -f split splitfile - - 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 - - h5dump -d /foo -f multi mf - - 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 - - h5dump -d /foo -f family fam%05d.h5 - -h5dump error: Bad mask list(-1,1) diff --git a/tools/testfiles/tpbitsOverlapped.ddl b/tools/testfiles/tpbitsOverlapped.ddl deleted file mode 100644 index 9dcc9d2..0000000 --- a/tools/testfiles/tpbitsOverlapped.ddl +++ /dev/null @@ -1,50 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=1 - DATA { - (0,0): 1, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=1 LENGTH=1 - DATA { - (0,0): 1, 1, 0, 0, 0, 0, 0, 0, - (1,0): 1, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=2 LENGTH=1 - DATA { - (0,0): 1, 1, 1, 0, 0, 0, 0, 0, - (1,0): 1, 1, 0, 0, 0, 0, 0, 0, - (2,0): 1, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=0 LENGTH=3 - DATA { - (0,0): 7, 6, 4, 0, 0, 0, 0, 0, - (1,0): 6, 4, 0, 0, 0, 0, 0, 0, - (2,0): 4, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSigned.ddl b/tools/testfiles/tpbitsSigned.ddl deleted file mode 100644 index b843388..0000000 --- a/tools/testfiles/tpbitsSigned.ddl +++ /dev/null @@ -1,28 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=2 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSigned2.ddl b/tools/testfiles/tpbitsSigned2.ddl deleted file mode 100644 index 932b5fd..0000000 --- a/tools/testfiles/tpbitsSigned2.ddl +++ /dev/null @@ -1,50 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=2 LENGTH=2 - DATA { - (0,0): 3, 3, 3, 2, 0, 0, 0, 0, - (1,0): 3, 3, 2, 0, 0, 0, 0, 0, - (2,0): 3, 2, 0, 0, 0, 0, 0, 0, - (3,0): 2, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=4 LENGTH=2 - DATA { - (0,0): 3, 3, 3, 3, 3, 2, 0, 0, - (1,0): 3, 3, 3, 3, 2, 0, 0, 0, - (2,0): 3, 3, 3, 2, 0, 0, 0, 0, - (3,0): 3, 3, 2, 0, 0, 0, 0, 0, - (4,0): 3, 2, 0, 0, 0, 0, 0, 0, - (5,0): 2, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=6 LENGTH=2 - DATA { - (0,0): 3, 3, 3, 3, 3, 3, 3, 2, - (1,0): 3, 3, 3, 3, 3, 3, 2, 0, - (2,0): 3, 3, 3, 3, 3, 2, 0, 0, - (3,0): 3, 3, 3, 3, 2, 0, 0, 0, - (4,0): 3, 3, 3, 2, 0, 0, 0, 0, - (5,0): 3, 3, 2, 0, 0, 0, 0, 0, - (6,0): 3, 2, 0, 0, 0, 0, 0, 0, - (7,0): 2, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSigned4.ddl b/tools/testfiles/tpbitsSigned4.ddl deleted file mode 100644 index 9eacd83..0000000 --- a/tools/testfiles/tpbitsSigned4.ddl +++ /dev/null @@ -1,28 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=4 - DATA { - (0,0): 15, 14, 12, 8, 0, 0, 0, 0, - (1,0): 14, 12, 8, 0, 0, 0, 0, 0, - (2,0): 12, 8, 0, 0, 0, 0, 0, 0, - (3,0): 8, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=4 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 14, 12, 8, - (1,0): 15, 15, 15, 15, 14, 12, 8, 0, - (2,0): 15, 15, 15, 14, 12, 8, 0, 0, - (3,0): 15, 15, 14, 12, 8, 0, 0, 0, - (4,0): 15, 14, 12, 8, 0, 0, 0, 0, - (5,0): 14, 12, 8, 0, 0, 0, 0, 0, - (6,0): 12, 8, 0, 0, 0, 0, 0, 0, - (7,0): 8, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedInt.ddl b/tools/testfiles/tpbitsSignedInt.ddl deleted file mode 100644 index 5c37e77..0000000 --- a/tools/testfiles/tpbitsSignedInt.ddl +++ /dev/null @@ -1,28 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS16BITS" { - DATATYPE H5T_STD_I16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=10 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedInt4.ddl b/tools/testfiles/tpbitsSignedInt4.ddl deleted file mode 100644 index 4e9f0f6..0000000 --- a/tools/testfiles/tpbitsSignedInt4.ddl +++ /dev/null @@ -1,50 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS16BITS" { - DATATYPE H5T_STD_I16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=4 - DATA { - (0,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=4 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=8 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, - (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, - (2,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, - (3,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, - (4,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=12 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, - (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, - (2,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, - (3,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, - (4,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, - (5,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, - (6,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, - (7,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedInt8.ddl b/tools/testfiles/tpbitsSignedInt8.ddl deleted file mode 100644 index f2d6069..0000000 --- a/tools/testfiles/tpbitsSignedInt8.ddl +++ /dev/null @@ -1,34 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS16BITS" { - DATATYPE H5T_STD_I16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=8 - DATA { - (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=8 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, - (0,13): 224, 192, 128, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, - (1,13): 192, 128, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, - (2,13): 128, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, - (3,14): 0, 0, - (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, - (4,14): 0, 0, - (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, - (5,15): 0, - (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedIntWhole.ddl b/tools/testfiles/tpbitsSignedIntWhole.ddl deleted file mode 100644 index 598c446..0000000 --- a/tools/testfiles/tpbitsSignedIntWhole.ddl +++ /dev/null @@ -1,25 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS16BITS" { - DATATYPE H5T_STD_I16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=16 - DATA { - (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, - (0,12): -4096, -8192, -16384, -32768, - (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, - (1,12): -8192, -16384, -32768, 0, - (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, - (2,11): -8192, -16384, -32768, 0, 0, - (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, - (3,11): -16384, -32768, 0, 0, 0, - (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, - (4,10): -16384, -32768, 0, 0, 0, 0, - (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, - (5,10): -32768, 0, 0, 0, 0, 0, - (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, - (6,10): 0, 0, 0, 0, 0, 0, - (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, 0, 0, - (7,11): 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLong.ddl b/tools/testfiles/tpbitsSignedLong.ddl deleted file mode 100644 index b3eba61..0000000 --- a/tools/testfiles/tpbitsSignedLong.ddl +++ /dev/null @@ -1,44 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS32BITS" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=26 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,17): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,17): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,17): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,17): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,17): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLong16.ddl b/tools/testfiles/tpbitsSignedLong16.ddl deleted file mode 100644 index 83fa889..0000000 --- a/tools/testfiles/tpbitsSignedLong16.ddl +++ /dev/null @@ -1,67 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS32BITS" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=16 - DATA { - (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, - (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,25): 0, 0, 0, 0, 0, 0, 0, - (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,26): 0, 0, 0, 0, 0, 0, - (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,27): 0, 0, 0, 0, 0, - (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,29): 0, 0, 0, - (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,30): 0, 0, - (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=16 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (0,27): 63488, 61440, 57344, 49152, 32768, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, - (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (1,27): 61440, 57344, 49152, 32768, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (2,27): 57344, 49152, 32768, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, - (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (3,27): 49152, 32768, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (4,27): 32768, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (5,28): 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (6,29): 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (7,31): 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLong8.ddl b/tools/testfiles/tpbitsSignedLong8.ddl deleted file mode 100644 index e99b1d0..0000000 --- a/tools/testfiles/tpbitsSignedLong8.ddl +++ /dev/null @@ -1,96 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS32BITS" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=8 - DATA { - (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,17): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,19): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,21): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=8 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, - (0,13): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, - (1,13): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, - (2,13): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, - (3,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, - (4,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, - (5,15): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, - (6,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, - (7,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=16 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (0,13): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, - (0,28): 0, 0, 0, 0, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (1,13): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, - (1,28): 0, 0, 0, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (2,13): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, - (2,29): 0, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (3,13): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,30): 0, 0, - (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (4,13): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,30): 0, 0, - (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, - (5,13): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,31): 0, - (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, - (6,13): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, - (7,13): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=24 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (0,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, - (0,26): 252, 248, 240, 224, 192, 128, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (1,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, - (1,26): 248, 240, 224, 192, 128, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (2,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, - (2,26): 240, 224, 192, 128, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (3,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, - (3,26): 224, 192, 128, 0, 0, 0, - (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (4,13): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, - (4,26): 192, 128, 0, 0, 0, 0, - (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (5,13): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, - (5,26): 128, 0, 0, 0, 0, 0, - (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (6,13): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, - (6,26): 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (7,13): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, - (7,27): 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLongLong.ddl b/tools/testfiles/tpbitsSignedLongLong.ddl deleted file mode 100644 index 2be8a55..0000000 --- a/tools/testfiles/tpbitsSignedLongLong.ddl +++ /dev/null @@ -1,68 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS64BITS" { - DATATYPE H5T_STD_I64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=58 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,49): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,49): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,49): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,49): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,49): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,49): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLongLong16.ddl b/tools/testfiles/tpbitsSignedLongLong16.ddl deleted file mode 100644 index 44e336d..0000000 --- a/tools/testfiles/tpbitsSignedLongLong16.ddl +++ /dev/null @@ -1,196 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS64BITS" { - DATATYPE H5T_STD_I64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=16 - DATA { - (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, - (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,25): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,26): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,30): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,52): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=16 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (0,27): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,42): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, - (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (1,27): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (2,27): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, - (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (3,27): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (4,27): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (5,28): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (6,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (7,31): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,53): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=32 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (0,36): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (0,45): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,63): 0, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,27): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, - (1,36): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (1,45): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,27): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (2,36): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (2,45): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,27): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (3,36): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,27): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (4,36): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (4,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,27): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (5,36): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (5,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,27): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (6,36): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, - (6,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (7,27): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (7,36): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=48 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,45): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (0,54): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (0,63): 32768, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,45): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (1,54): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,45): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (2,54): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,45): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (3,54): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,45): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (4,54): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (5,45): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (5,54): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, - (6,45): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (6,54): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,36): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (7,45): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (7,54): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLongLong32.ddl b/tools/testfiles/tpbitsSignedLongLong32.ddl deleted file mode 100644 index 6ab4ac4..0000000 --- a/tools/testfiles/tpbitsSignedLongLong32.ddl +++ /dev/null @@ -1,175 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS64BITS" { - DATATYPE H5T_STD_I64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=32 - DATA { - (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, - (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (0,30): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, - (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (1,30): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, - (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (2,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, - (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, - (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, - (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, - (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, - (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, - (3,35): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,57): 0, 0, 0, 0, 0, 0, 0, - (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, - (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, - (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, - (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, - (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, - (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,38): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,60): 0, 0, 0, 0, - (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,41): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,63): 0, - (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (6,25): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (7,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=32 LENGTH=32 - DATA { - (0,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,30): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, - (0,35): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, - (0,40): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, - (0,45): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, - (0,50): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, - (0,55): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, - (0,60): 4026531840, 3758096384, 3221225472, 2147483648, - (1,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,30): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, - (1,35): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, - (1,40): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, - (1,45): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, - (1,50): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, - (1,55): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, - (1,60): 3758096384, 3221225472, 2147483648, 0, - (2,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,30): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, - (2,35): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (2,40): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (2,45): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (2,50): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (2,55): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (2,60): 3221225472, 2147483648, 0, 0, - (3,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,30): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, - (3,35): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (3,40): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (3,45): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (3,50): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (3,55): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (3,60): 2147483648, 0, 0, 0, - (4,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967294, - (4,30): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, - (4,35): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (4,40): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (4,45): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (4,50): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (4,55): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (4,62): 0, 0, - (5,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,25): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, - (5,30): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, - (5,35): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, - (5,40): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, - (5,45): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, - (5,50): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, - (5,55): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, - (6,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,25): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, - (6,30): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, - (6,35): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, - (6,40): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, - (6,45): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, - (6,50): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, - (6,55): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, - (7,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,25): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, - (7,30): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (7,35): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (7,40): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (7,45): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (7,50): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (7,55): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLongLongWhole.ddl b/tools/testfiles/tpbitsSignedLongLongWhole.ddl deleted file mode 100644 index 134f3be..0000000 --- a/tools/testfiles/tpbitsSignedLongLongWhole.ddl +++ /dev/null @@ -1,121 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS64BITS" { - DATATYPE H5T_STD_I64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=64 - DATA { - (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, - (0,12): -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, - (0,20): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, - (0,26): -67108864, -134217728, -268435456, -536870912, -1073741824, - (0,31): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, - (0,36): -68719476736, -137438953472, -274877906944, -549755813888, - (0,40): -1099511627776, -2199023255552, -4398046511104, -8796093022208, - (0,44): -17592186044416, -35184372088832, -70368744177664, - (0,47): -140737488355328, -281474976710656, -562949953421312, - (0,50): -1125899906842624, -2251799813685248, -4503599627370496, - (0,53): -9007199254740992, -18014398509481984, -36028797018963968, - (0,56): -72057594037927936, -144115188075855872, -288230376151711744, - (0,59): -576460752303423488, -1152921504606846976, -2305843009213693952, - (0,62): -4611686018427387904, -9223372036854775808, - (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, - (1,12): -8192, -16384, -32768, -65536, -131072, -262144, -524288, - (1,19): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, - (1,25): -67108864, -134217728, -268435456, -536870912, -1073741824, - (1,30): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, - (1,35): -68719476736, -137438953472, -274877906944, -549755813888, - (1,39): -1099511627776, -2199023255552, -4398046511104, -8796093022208, - (1,43): -17592186044416, -35184372088832, -70368744177664, - (1,46): -140737488355328, -281474976710656, -562949953421312, - (1,49): -1125899906842624, -2251799813685248, -4503599627370496, - (1,52): -9007199254740992, -18014398509481984, -36028797018963968, - (1,55): -72057594037927936, -144115188075855872, -288230376151711744, - (1,58): -576460752303423488, -1152921504606846976, -2305843009213693952, - (1,61): -4611686018427387904, -9223372036854775808, 0, - (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, - (2,11): -8192, -16384, -32768, -65536, -131072, -262144, -524288, - (2,18): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, - (2,24): -67108864, -134217728, -268435456, -536870912, -1073741824, - (2,29): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, - (2,34): -68719476736, -137438953472, -274877906944, -549755813888, - (2,38): -1099511627776, -2199023255552, -4398046511104, -8796093022208, - (2,42): -17592186044416, -35184372088832, -70368744177664, - (2,45): -140737488355328, -281474976710656, -562949953421312, - (2,48): -1125899906842624, -2251799813685248, -4503599627370496, - (2,51): -9007199254740992, -18014398509481984, -36028797018963968, - (2,54): -72057594037927936, -144115188075855872, -288230376151711744, - (2,57): -576460752303423488, -1152921504606846976, -2305843009213693952, - (2,60): -4611686018427387904, -9223372036854775808, 0, 0, - (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, - (3,11): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, - (3,18): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, - (3,24): -134217728, -268435456, -536870912, -1073741824, -2147483648, - (3,29): -4294967296, -8589934592, -17179869184, -34359738368, - (3,33): -68719476736, -137438953472, -274877906944, -549755813888, - (3,37): -1099511627776, -2199023255552, -4398046511104, -8796093022208, - (3,41): -17592186044416, -35184372088832, -70368744177664, - (3,44): -140737488355328, -281474976710656, -562949953421312, - (3,47): -1125899906842624, -2251799813685248, -4503599627370496, - (3,50): -9007199254740992, -18014398509481984, -36028797018963968, - (3,53): -72057594037927936, -144115188075855872, -288230376151711744, - (3,56): -576460752303423488, -1152921504606846976, -2305843009213693952, - (3,59): -4611686018427387904, -9223372036854775808, 0, 0, 0, - (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, - (4,10): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, - (4,17): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, - (4,23): -134217728, -268435456, -536870912, -1073741824, -2147483648, - (4,28): -4294967296, -8589934592, -17179869184, -34359738368, - (4,32): -68719476736, -137438953472, -274877906944, -549755813888, - (4,36): -1099511627776, -2199023255552, -4398046511104, -8796093022208, - (4,40): -17592186044416, -35184372088832, -70368744177664, - (4,43): -140737488355328, -281474976710656, -562949953421312, - (4,46): -1125899906842624, -2251799813685248, -4503599627370496, - (4,49): -9007199254740992, -18014398509481984, -36028797018963968, - (4,52): -72057594037927936, -144115188075855872, -288230376151711744, - (4,55): -576460752303423488, -1152921504606846976, -2305843009213693952, - (4,58): -4611686018427387904, -9223372036854775808, 0, 0, 0, 0, - (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, - (5,10): -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, - (5,17): -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, - (5,23): -268435456, -536870912, -1073741824, -2147483648, -4294967296, - (5,28): -8589934592, -17179869184, -34359738368, -68719476736, - (5,32): -137438953472, -274877906944, -549755813888, -1099511627776, - (5,36): -2199023255552, -4398046511104, -8796093022208, -17592186044416, - (5,40): -35184372088832, -70368744177664, -140737488355328, - (5,43): -281474976710656, -562949953421312, -1125899906842624, - (5,46): -2251799813685248, -4503599627370496, -9007199254740992, - (5,49): -18014398509481984, -36028797018963968, -72057594037927936, - (5,52): -144115188075855872, -288230376151711744, -576460752303423488, - (5,55): -1152921504606846976, -2305843009213693952, -4611686018427387904, - (5,58): -9223372036854775808, 0, 0, 0, 0, 0, - (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, - (6,10): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, - (6,17): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, - (6,23): -536870912, -1073741824, -2147483648, -4294967296, -8589934592, - (6,28): -17179869184, -34359738368, -68719476736, -137438953472, - (6,32): -274877906944, -549755813888, -1099511627776, -2199023255552, - (6,36): -4398046511104, -8796093022208, -17592186044416, -35184372088832, - (6,40): -70368744177664, -140737488355328, -281474976710656, - (6,43): -562949953421312, -1125899906842624, -2251799813685248, - (6,46): -4503599627370496, -9007199254740992, -18014398509481984, - (6,49): -36028797018963968, -72057594037927936, -144115188075855872, - (6,52): -288230376151711744, -576460752303423488, -1152921504606846976, - (6,55): -2305843009213693952, -4611686018427387904, -9223372036854775808, - (6,58): 0, 0, 0, 0, 0, 0, - (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, - (7,9): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, - (7,16): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, - (7,22): -536870912, -1073741824, -2147483648, -4294967296, -8589934592, - (7,27): -17179869184, -34359738368, -68719476736, -137438953472, - (7,31): -274877906944, -549755813888, -1099511627776, -2199023255552, - (7,35): -4398046511104, -8796093022208, -17592186044416, -35184372088832, - (7,39): -70368744177664, -140737488355328, -281474976710656, - (7,42): -562949953421312, -1125899906842624, -2251799813685248, - (7,45): -4503599627370496, -9007199254740992, -18014398509481984, - (7,48): -36028797018963968, -72057594037927936, -144115188075855872, - (7,51): -288230376151711744, -576460752303423488, -1152921504606846976, - (7,54): -2305843009213693952, -4611686018427387904, -9223372036854775808, - (7,57): 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLongLongWhole1.ddl b/tools/testfiles/tpbitsSignedLongLongWhole1.ddl deleted file mode 100644 index 7431670..0000000 --- a/tools/testfiles/tpbitsSignedLongLongWhole1.ddl +++ /dev/null @@ -1,175 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS64BITS" { - DATATYPE H5T_STD_I64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=1 LENGTH=63 - DATA { - (0,0): 9223372036854775807, 9223372036854775807, 9223372036854775806, - (0,3): 9223372036854775804, 9223372036854775800, 9223372036854775792, - (0,6): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (0,9): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (0,12): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (0,15): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (0,18): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (0,21): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (0,24): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (0,27): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (0,30): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (0,33): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (0,36): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (0,39): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (0,42): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (0,45): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (0,48): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (0,51): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (0,54): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (0,57): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (0,60): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (0,63): 4611686018427387904, - (1,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, - (1,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (1,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (1,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (1,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (1,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (1,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (1,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (1,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (1,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (1,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (1,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (1,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (1,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (1,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (1,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (1,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (1,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (1,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (1,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (1,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (2,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, - (2,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (2,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (2,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (2,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (2,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (2,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (2,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (2,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (2,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (2,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (2,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (2,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (2,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (2,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (2,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (2,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (2,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (2,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (2,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (2,60): 6917529027641081856, 4611686018427387904, 0, 0, - (3,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, - (3,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (3,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (3,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (3,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (3,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (3,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (3,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (3,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (3,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (3,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (3,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (3,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (3,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (3,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (3,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (3,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (3,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (3,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (3,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (3,60): 4611686018427387904, 0, 0, 0, - (4,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (4,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (4,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (4,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (4,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (4,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (4,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (4,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (4,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (4,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (4,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (4,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (4,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (4,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (4,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (4,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (4,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (4,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (4,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (4,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (4,61): 0, 0, 0, - (5,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (5,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (5,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (5,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (5,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (5,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (5,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (5,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (5,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (5,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (5,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (5,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (5,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (5,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (5,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (5,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (5,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (5,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (5,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (5,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, - (6,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (6,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (6,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (6,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (6,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (6,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (6,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (6,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (6,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (6,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (6,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (6,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (6,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (6,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (6,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (6,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (6,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (6,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (6,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (6,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, - (7,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (7,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (7,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (7,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (7,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (7,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (7,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (7,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (7,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (7,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (7,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (7,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (7,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (7,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (7,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (7,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (7,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (7,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (7,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (7,58): 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLongLongWhole63.ddl b/tools/testfiles/tpbitsSignedLongLongWhole63.ddl deleted file mode 100644 index c7cc65f..0000000 --- a/tools/testfiles/tpbitsSignedLongLongWhole63.ddl +++ /dev/null @@ -1,172 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS64BITS" { - DATATYPE H5T_STD_I64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=63 - DATA { - (0,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, - (0,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (0,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (0,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (0,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (0,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (0,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (0,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (0,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (0,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (0,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (0,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (0,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (0,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (0,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (0,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (0,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (0,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (0,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (0,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (0,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (1,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, - (1,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (1,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (1,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (1,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (1,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (1,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (1,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (1,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (1,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (1,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (1,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (1,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (1,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (1,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (1,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (1,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (1,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (1,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (1,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (1,60): 6917529027641081856, 4611686018427387904, 0, 0, - (2,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, - (2,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (2,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (2,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (2,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (2,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (2,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (2,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (2,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (2,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (2,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (2,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (2,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (2,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (2,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (2,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (2,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (2,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (2,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (2,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (2,60): 4611686018427387904, 0, 0, 0, - (3,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (3,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (3,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (3,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (3,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (3,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (3,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (3,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (3,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (3,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (3,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (3,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (3,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (3,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (3,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (3,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (3,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (3,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (3,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (3,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (3,61): 0, 0, 0, - (4,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (4,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (4,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (4,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (4,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (4,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (4,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (4,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (4,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (4,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (4,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (4,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (4,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (4,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (4,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (4,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (4,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (4,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (4,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (4,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, - (5,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (5,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (5,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (5,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (5,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (5,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (5,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (5,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (5,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (5,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (5,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (5,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (5,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (5,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (5,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (5,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (5,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (5,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (5,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (5,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, - (6,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (6,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (6,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (6,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (6,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (6,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (6,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (6,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (6,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (6,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (6,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (6,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (6,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (6,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (6,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (6,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (6,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (6,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (6,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (6,58): 0, 0, 0, 0, 0, 0, - (7,0): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (7,3): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (7,6): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (7,9): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (7,12): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (7,15): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (7,18): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (7,21): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (7,24): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (7,27): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (7,30): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (7,33): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (7,36): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (7,39): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (7,42): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (7,45): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (7,48): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (7,51): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (7,54): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLongWhole.ddl b/tools/testfiles/tpbitsSignedLongWhole.ddl deleted file mode 100644 index e583f1d..0000000 --- a/tools/testfiles/tpbitsSignedLongWhole.ddl +++ /dev/null @@ -1,46 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS32BITS" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=32 - DATA { - (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, - (0,12): -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, - (0,20): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, - (0,26): -67108864, -134217728, -268435456, -536870912, -1073741824, - (0,31): -2147483648, - (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, - (1,12): -8192, -16384, -32768, -65536, -131072, -262144, -524288, - (1,19): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, - (1,25): -67108864, -134217728, -268435456, -536870912, -1073741824, - (1,30): -2147483648, 0, - (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, - (2,11): -8192, -16384, -32768, -65536, -131072, -262144, -524288, - (2,18): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, - (2,24): -67108864, -134217728, -268435456, -536870912, -1073741824, - (2,29): -2147483648, 0, 0, - (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, - (3,11): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, - (3,18): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, - (3,24): -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, - (3,30): 0, 0, - (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, - (4,10): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, - (4,17): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, - (4,23): -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, - (4,29): 0, 0, 0, - (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, - (5,10): -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, - (5,17): -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, - (5,23): -268435456, -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, - (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, - (6,10): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, - (6,17): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, - (6,23): -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, 0, - (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, - (7,9): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, - (7,16): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, - (7,22): -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedWhole.ddl b/tools/testfiles/tpbitsSignedWhole.ddl deleted file mode 100644 index f044e23..0000000 --- a/tools/testfiles/tpbitsSignedWhole.ddl +++ /dev/null @@ -1,17 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=8 - DATA { - (0,0): -1, -2, -4, -8, -16, -32, -64, -128, - (1,0): -2, -4, -8, -16, -32, -64, -128, 0, - (2,0): -4, -8, -16, -32, -64, -128, 0, 0, - (3,0): -8, -16, -32, -64, -128, 0, 0, 0, - (4,0): -16, -32, -64, -128, 0, 0, 0, 0, - (5,0): -32, -64, -128, 0, 0, 0, 0, 0, - (6,0): -64, -128, 0, 0, 0, 0, 0, 0, - (7,0): -128, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsigned.ddl b/tools/testfiles/tpbitsUnsigned.ddl deleted file mode 100644 index 9e7ac50..0000000 --- a/tools/testfiles/tpbitsUnsigned.ddl +++ /dev/null @@ -1,28 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU08BITS" { - DATATYPE H5T_STD_U8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=2 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsigned2.ddl b/tools/testfiles/tpbitsUnsigned2.ddl deleted file mode 100644 index b7e6f79..0000000 --- a/tools/testfiles/tpbitsUnsigned2.ddl +++ /dev/null @@ -1,50 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU08BITS" { - DATATYPE H5T_STD_U8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=2 LENGTH=2 - DATA { - (0,0): 3, 3, 3, 2, 0, 0, 0, 0, - (1,0): 3, 3, 2, 0, 0, 0, 0, 0, - (2,0): 3, 2, 0, 0, 0, 0, 0, 0, - (3,0): 2, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=4 LENGTH=2 - DATA { - (0,0): 3, 3, 3, 3, 3, 2, 0, 0, - (1,0): 3, 3, 3, 3, 2, 0, 0, 0, - (2,0): 3, 3, 3, 2, 0, 0, 0, 0, - (3,0): 3, 3, 2, 0, 0, 0, 0, 0, - (4,0): 3, 2, 0, 0, 0, 0, 0, 0, - (5,0): 2, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=6 LENGTH=2 - DATA { - (0,0): 3, 3, 3, 3, 3, 3, 3, 2, - (1,0): 3, 3, 3, 3, 3, 3, 2, 0, - (2,0): 3, 3, 3, 3, 3, 2, 0, 0, - (3,0): 3, 3, 3, 3, 2, 0, 0, 0, - (4,0): 3, 3, 3, 2, 0, 0, 0, 0, - (5,0): 3, 3, 2, 0, 0, 0, 0, 0, - (6,0): 3, 2, 0, 0, 0, 0, 0, 0, - (7,0): 2, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsigned4.ddl b/tools/testfiles/tpbitsUnsigned4.ddl deleted file mode 100644 index d25d838..0000000 --- a/tools/testfiles/tpbitsUnsigned4.ddl +++ /dev/null @@ -1,28 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU08BITS" { - DATATYPE H5T_STD_U8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=4 - DATA { - (0,0): 15, 14, 12, 8, 0, 0, 0, 0, - (1,0): 14, 12, 8, 0, 0, 0, 0, 0, - (2,0): 12, 8, 0, 0, 0, 0, 0, 0, - (3,0): 8, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=4 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 14, 12, 8, - (1,0): 15, 15, 15, 15, 14, 12, 8, 0, - (2,0): 15, 15, 15, 14, 12, 8, 0, 0, - (3,0): 15, 15, 14, 12, 8, 0, 0, 0, - (4,0): 15, 14, 12, 8, 0, 0, 0, 0, - (5,0): 14, 12, 8, 0, 0, 0, 0, 0, - (6,0): 12, 8, 0, 0, 0, 0, 0, 0, - (7,0): 8, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedInt.ddl b/tools/testfiles/tpbitsUnsignedInt.ddl deleted file mode 100644 index 5e0fefe..0000000 --- a/tools/testfiles/tpbitsUnsignedInt.ddl +++ /dev/null @@ -1,28 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU16BITS" { - DATATYPE H5T_STD_U16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=10 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedInt4.ddl b/tools/testfiles/tpbitsUnsignedInt4.ddl deleted file mode 100644 index 0d3e38f..0000000 --- a/tools/testfiles/tpbitsUnsignedInt4.ddl +++ /dev/null @@ -1,50 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU16BITS" { - DATATYPE H5T_STD_U16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=4 - DATA { - (0,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=4 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=8 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, - (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, - (2,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, - (3,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, - (4,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=12 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, - (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, - (2,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, - (3,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, - (4,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, - (5,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, - (6,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, - (7,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedInt8.ddl b/tools/testfiles/tpbitsUnsignedInt8.ddl deleted file mode 100644 index 861ed3e..0000000 --- a/tools/testfiles/tpbitsUnsignedInt8.ddl +++ /dev/null @@ -1,34 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU16BITS" { - DATATYPE H5T_STD_U16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=8 - DATA { - (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=8 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, - (0,13): 224, 192, 128, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, - (1,13): 192, 128, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, - (2,13): 128, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, - (3,14): 0, 0, - (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, - (4,14): 0, 0, - (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, - (5,15): 0, - (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedIntWhole.ddl b/tools/testfiles/tpbitsUnsignedIntWhole.ddl deleted file mode 100644 index c054011..0000000 --- a/tools/testfiles/tpbitsUnsignedIntWhole.ddl +++ /dev/null @@ -1,25 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU16BITS" { - DATATYPE H5T_STD_U16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=16 - DATA { - (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, - (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, - (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, - (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, - (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (4,9): 57344, 49152, 32768, 0, 0, 0, 0, - (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (5,9): 49152, 32768, 0, 0, 0, 0, 0, - (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (6,9): 32768, 0, 0, 0, 0, 0, 0, - (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (7,10): 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLong.ddl b/tools/testfiles/tpbitsUnsignedLong.ddl deleted file mode 100644 index 9f8bcb4..0000000 --- a/tools/testfiles/tpbitsUnsignedLong.ddl +++ /dev/null @@ -1,44 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU32BITS" { - DATATYPE H5T_STD_U32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=26 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,17): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,17): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,17): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,17): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,17): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLong16.ddl b/tools/testfiles/tpbitsUnsignedLong16.ddl deleted file mode 100644 index 7a1984f..0000000 --- a/tools/testfiles/tpbitsUnsignedLong16.ddl +++ /dev/null @@ -1,67 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU32BITS" { - DATATYPE H5T_STD_U32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=16 - DATA { - (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, - (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,25): 0, 0, 0, 0, 0, 0, 0, - (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,26): 0, 0, 0, 0, 0, 0, - (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,27): 0, 0, 0, 0, 0, - (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,29): 0, 0, 0, - (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,30): 0, 0, - (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=16 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (0,27): 63488, 61440, 57344, 49152, 32768, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, - (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (1,27): 61440, 57344, 49152, 32768, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (2,27): 57344, 49152, 32768, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, - (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (3,27): 49152, 32768, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (4,27): 32768, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (5,28): 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (6,29): 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (7,31): 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLong8.ddl b/tools/testfiles/tpbitsUnsignedLong8.ddl deleted file mode 100644 index 17b896c..0000000 --- a/tools/testfiles/tpbitsUnsignedLong8.ddl +++ /dev/null @@ -1,96 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU32BITS" { - DATATYPE H5T_STD_U32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=8 - DATA { - (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,17): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,19): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,21): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=8 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, - (0,13): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, - (1,13): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, - (2,13): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, - (3,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, - (4,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, - (5,15): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, - (6,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, - (7,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=16 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (0,13): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, - (0,28): 0, 0, 0, 0, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (1,13): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, - (1,28): 0, 0, 0, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (2,13): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, - (2,29): 0, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (3,13): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,30): 0, 0, - (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (4,13): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,30): 0, 0, - (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, - (5,13): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,31): 0, - (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, - (6,13): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, - (7,13): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=24 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (0,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, - (0,26): 252, 248, 240, 224, 192, 128, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (1,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, - (1,26): 248, 240, 224, 192, 128, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (2,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, - (2,26): 240, 224, 192, 128, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (3,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, - (3,26): 224, 192, 128, 0, 0, 0, - (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (4,13): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, - (4,26): 192, 128, 0, 0, 0, 0, - (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (5,13): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, - (5,26): 128, 0, 0, 0, 0, 0, - (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (6,13): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, - (6,26): 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (7,13): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, - (7,27): 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLongLong.ddl b/tools/testfiles/tpbitsUnsignedLongLong.ddl deleted file mode 100644 index 1cd9a6c..0000000 --- a/tools/testfiles/tpbitsUnsignedLongLong.ddl +++ /dev/null @@ -1,68 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU64BITS" { - DATATYPE H5T_STD_U64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=58 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,49): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,49): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,49): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,49): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,49): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,49): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLongLong16.ddl b/tools/testfiles/tpbitsUnsignedLongLong16.ddl deleted file mode 100644 index f8b0189..0000000 --- a/tools/testfiles/tpbitsUnsignedLongLong16.ddl +++ /dev/null @@ -1,196 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU64BITS" { - DATATYPE H5T_STD_U64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=16 - DATA { - (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, - (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,25): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,26): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,30): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,52): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=16 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (0,27): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,42): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, - (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (1,27): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (2,27): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, - (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (3,27): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (4,27): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (5,28): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (6,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (7,31): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,53): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=32 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (0,36): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (0,45): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,63): 0, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,27): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, - (1,36): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (1,45): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,27): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (2,36): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (2,45): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,27): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (3,36): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,27): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (4,36): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (4,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,27): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (5,36): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (5,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,27): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (6,36): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, - (6,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (7,27): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (7,36): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=48 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,45): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (0,54): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (0,63): 32768, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,45): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (1,54): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,45): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (2,54): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,45): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (3,54): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,45): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (4,54): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (5,45): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (5,54): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, - (6,45): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (6,54): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,36): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (7,45): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (7,54): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLongLong32.ddl b/tools/testfiles/tpbitsUnsignedLongLong32.ddl deleted file mode 100644 index befaf5b..0000000 --- a/tools/testfiles/tpbitsUnsignedLongLong32.ddl +++ /dev/null @@ -1,175 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU64BITS" { - DATATYPE H5T_STD_U64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=32 - DATA { - (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, - (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (0,30): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, - (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (1,30): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, - (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (2,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, - (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, - (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, - (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, - (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, - (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, - (3,35): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,57): 0, 0, 0, 0, 0, 0, 0, - (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, - (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, - (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, - (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, - (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, - (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,38): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,60): 0, 0, 0, 0, - (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,41): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,63): 0, - (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (6,25): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (7,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=32 LENGTH=32 - DATA { - (0,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,30): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, - (0,35): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, - (0,40): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, - (0,45): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, - (0,50): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, - (0,55): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, - (0,60): 4026531840, 3758096384, 3221225472, 2147483648, - (1,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,30): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, - (1,35): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, - (1,40): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, - (1,45): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, - (1,50): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, - (1,55): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, - (1,60): 3758096384, 3221225472, 2147483648, 0, - (2,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,30): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, - (2,35): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (2,40): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (2,45): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (2,50): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (2,55): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (2,60): 3221225472, 2147483648, 0, 0, - (3,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,30): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, - (3,35): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (3,40): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (3,45): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (3,50): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (3,55): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (3,60): 2147483648, 0, 0, 0, - (4,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967294, - (4,30): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, - (4,35): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (4,40): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (4,45): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (4,50): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (4,55): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (4,62): 0, 0, - (5,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,25): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, - (5,30): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, - (5,35): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, - (5,40): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, - (5,45): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, - (5,50): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, - (5,55): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, - (6,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,25): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, - (6,30): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, - (6,35): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, - (6,40): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, - (6,45): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, - (6,50): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, - (6,55): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, - (7,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,25): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, - (7,30): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (7,35): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (7,40): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (7,45): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (7,50): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (7,55): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLongLongWhole.ddl b/tools/testfiles/tpbitsUnsignedLongLongWhole.ddl deleted file mode 100644 index 27c8879..0000000 --- a/tools/testfiles/tpbitsUnsignedLongLongWhole.ddl +++ /dev/null @@ -1,176 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU64BITS" { - DATATYPE H5T_STD_U64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=64 - DATA { - (0,0): 18446744073709551615, 18446744073709551614, 18446744073709551612, - (0,3): 18446744073709551608, 18446744073709551600, 18446744073709551584, - (0,6): 18446744073709551552, 18446744073709551488, 18446744073709551360, - (0,9): 18446744073709551104, 18446744073709550592, 18446744073709549568, - (0,12): 18446744073709547520, 18446744073709543424, 18446744073709535232, - (0,15): 18446744073709518848, 18446744073709486080, 18446744073709420544, - (0,18): 18446744073709289472, 18446744073709027328, 18446744073708503040, - (0,21): 18446744073707454464, 18446744073705357312, 18446744073701163008, - (0,24): 18446744073692774400, 18446744073675997184, 18446744073642442752, - (0,27): 18446744073575333888, 18446744073441116160, 18446744073172680704, - (0,30): 18446744072635809792, 18446744071562067968, 18446744069414584320, - (0,33): 18446744065119617024, 18446744056529682432, 18446744039349813248, - (0,36): 18446744004990074880, 18446743936270598144, 18446743798831644672, - (0,39): 18446743523953737728, 18446742974197923840, 18446741874686296064, - (0,42): 18446739675663040512, 18446735277616529408, 18446726481523507200, - (0,45): 18446708889337462784, 18446673704965373952, 18446603336221196288, - (0,48): 18446462598732840960, 18446181123756130304, 18445618173802708992, - (0,51): 18444492273895866368, 18442240474082181120, 18437736874454810624, - (0,54): 18428729675200069632, 18410715276690587648, 18374686479671623680, - (0,57): 18302628885633695744, 18158513697557839872, 17870283321406128128, - (0,60): 17293822569102704640, 16140901064495857664, 13835058055282163712, - (0,63): 9223372036854775808, - (1,0): 18446744073709551614, 18446744073709551612, 18446744073709551608, - (1,3): 18446744073709551600, 18446744073709551584, 18446744073709551552, - (1,6): 18446744073709551488, 18446744073709551360, 18446744073709551104, - (1,9): 18446744073709550592, 18446744073709549568, 18446744073709547520, - (1,12): 18446744073709543424, 18446744073709535232, 18446744073709518848, - (1,15): 18446744073709486080, 18446744073709420544, 18446744073709289472, - (1,18): 18446744073709027328, 18446744073708503040, 18446744073707454464, - (1,21): 18446744073705357312, 18446744073701163008, 18446744073692774400, - (1,24): 18446744073675997184, 18446744073642442752, 18446744073575333888, - (1,27): 18446744073441116160, 18446744073172680704, 18446744072635809792, - (1,30): 18446744071562067968, 18446744069414584320, 18446744065119617024, - (1,33): 18446744056529682432, 18446744039349813248, 18446744004990074880, - (1,36): 18446743936270598144, 18446743798831644672, 18446743523953737728, - (1,39): 18446742974197923840, 18446741874686296064, 18446739675663040512, - (1,42): 18446735277616529408, 18446726481523507200, 18446708889337462784, - (1,45): 18446673704965373952, 18446603336221196288, 18446462598732840960, - (1,48): 18446181123756130304, 18445618173802708992, 18444492273895866368, - (1,51): 18442240474082181120, 18437736874454810624, 18428729675200069632, - (1,54): 18410715276690587648, 18374686479671623680, 18302628885633695744, - (1,57): 18158513697557839872, 17870283321406128128, 17293822569102704640, - (1,60): 16140901064495857664, 13835058055282163712, 9223372036854775808, - (1,63): 0, - (2,0): 18446744073709551612, 18446744073709551608, 18446744073709551600, - (2,3): 18446744073709551584, 18446744073709551552, 18446744073709551488, - (2,6): 18446744073709551360, 18446744073709551104, 18446744073709550592, - (2,9): 18446744073709549568, 18446744073709547520, 18446744073709543424, - (2,12): 18446744073709535232, 18446744073709518848, 18446744073709486080, - (2,15): 18446744073709420544, 18446744073709289472, 18446744073709027328, - (2,18): 18446744073708503040, 18446744073707454464, 18446744073705357312, - (2,21): 18446744073701163008, 18446744073692774400, 18446744073675997184, - (2,24): 18446744073642442752, 18446744073575333888, 18446744073441116160, - (2,27): 18446744073172680704, 18446744072635809792, 18446744071562067968, - (2,30): 18446744069414584320, 18446744065119617024, 18446744056529682432, - (2,33): 18446744039349813248, 18446744004990074880, 18446743936270598144, - (2,36): 18446743798831644672, 18446743523953737728, 18446742974197923840, - (2,39): 18446741874686296064, 18446739675663040512, 18446735277616529408, - (2,42): 18446726481523507200, 18446708889337462784, 18446673704965373952, - (2,45): 18446603336221196288, 18446462598732840960, 18446181123756130304, - (2,48): 18445618173802708992, 18444492273895866368, 18442240474082181120, - (2,51): 18437736874454810624, 18428729675200069632, 18410715276690587648, - (2,54): 18374686479671623680, 18302628885633695744, 18158513697557839872, - (2,57): 17870283321406128128, 17293822569102704640, 16140901064495857664, - (2,60): 13835058055282163712, 9223372036854775808, 0, 0, - (3,0): 18446744073709551608, 18446744073709551600, 18446744073709551584, - (3,3): 18446744073709551552, 18446744073709551488, 18446744073709551360, - (3,6): 18446744073709551104, 18446744073709550592, 18446744073709549568, - (3,9): 18446744073709547520, 18446744073709543424, 18446744073709535232, - (3,12): 18446744073709518848, 18446744073709486080, 18446744073709420544, - (3,15): 18446744073709289472, 18446744073709027328, 18446744073708503040, - (3,18): 18446744073707454464, 18446744073705357312, 18446744073701163008, - (3,21): 18446744073692774400, 18446744073675997184, 18446744073642442752, - (3,24): 18446744073575333888, 18446744073441116160, 18446744073172680704, - (3,27): 18446744072635809792, 18446744071562067968, 18446744069414584320, - (3,30): 18446744065119617024, 18446744056529682432, 18446744039349813248, - (3,33): 18446744004990074880, 18446743936270598144, 18446743798831644672, - (3,36): 18446743523953737728, 18446742974197923840, 18446741874686296064, - (3,39): 18446739675663040512, 18446735277616529408, 18446726481523507200, - (3,42): 18446708889337462784, 18446673704965373952, 18446603336221196288, - (3,45): 18446462598732840960, 18446181123756130304, 18445618173802708992, - (3,48): 18444492273895866368, 18442240474082181120, 18437736874454810624, - (3,51): 18428729675200069632, 18410715276690587648, 18374686479671623680, - (3,54): 18302628885633695744, 18158513697557839872, 17870283321406128128, - (3,57): 17293822569102704640, 16140901064495857664, 13835058055282163712, - (3,60): 9223372036854775808, 0, 0, 0, - (4,0): 18446744073709551600, 18446744073709551584, 18446744073709551552, - (4,3): 18446744073709551488, 18446744073709551360, 18446744073709551104, - (4,6): 18446744073709550592, 18446744073709549568, 18446744073709547520, - (4,9): 18446744073709543424, 18446744073709535232, 18446744073709518848, - (4,12): 18446744073709486080, 18446744073709420544, 18446744073709289472, - (4,15): 18446744073709027328, 18446744073708503040, 18446744073707454464, - (4,18): 18446744073705357312, 18446744073701163008, 18446744073692774400, - (4,21): 18446744073675997184, 18446744073642442752, 18446744073575333888, - (4,24): 18446744073441116160, 18446744073172680704, 18446744072635809792, - (4,27): 18446744071562067968, 18446744069414584320, 18446744065119617024, - (4,30): 18446744056529682432, 18446744039349813248, 18446744004990074880, - (4,33): 18446743936270598144, 18446743798831644672, 18446743523953737728, - (4,36): 18446742974197923840, 18446741874686296064, 18446739675663040512, - (4,39): 18446735277616529408, 18446726481523507200, 18446708889337462784, - (4,42): 18446673704965373952, 18446603336221196288, 18446462598732840960, - (4,45): 18446181123756130304, 18445618173802708992, 18444492273895866368, - (4,48): 18442240474082181120, 18437736874454810624, 18428729675200069632, - (4,51): 18410715276690587648, 18374686479671623680, 18302628885633695744, - (4,54): 18158513697557839872, 17870283321406128128, 17293822569102704640, - (4,57): 16140901064495857664, 13835058055282163712, 9223372036854775808, - (4,60): 0, 0, 0, 0, - (5,0): 18446744073709551584, 18446744073709551552, 18446744073709551488, - (5,3): 18446744073709551360, 18446744073709551104, 18446744073709550592, - (5,6): 18446744073709549568, 18446744073709547520, 18446744073709543424, - (5,9): 18446744073709535232, 18446744073709518848, 18446744073709486080, - (5,12): 18446744073709420544, 18446744073709289472, 18446744073709027328, - (5,15): 18446744073708503040, 18446744073707454464, 18446744073705357312, - (5,18): 18446744073701163008, 18446744073692774400, 18446744073675997184, - (5,21): 18446744073642442752, 18446744073575333888, 18446744073441116160, - (5,24): 18446744073172680704, 18446744072635809792, 18446744071562067968, - (5,27): 18446744069414584320, 18446744065119617024, 18446744056529682432, - (5,30): 18446744039349813248, 18446744004990074880, 18446743936270598144, - (5,33): 18446743798831644672, 18446743523953737728, 18446742974197923840, - (5,36): 18446741874686296064, 18446739675663040512, 18446735277616529408, - (5,39): 18446726481523507200, 18446708889337462784, 18446673704965373952, - (5,42): 18446603336221196288, 18446462598732840960, 18446181123756130304, - (5,45): 18445618173802708992, 18444492273895866368, 18442240474082181120, - (5,48): 18437736874454810624, 18428729675200069632, 18410715276690587648, - (5,51): 18374686479671623680, 18302628885633695744, 18158513697557839872, - (5,54): 17870283321406128128, 17293822569102704640, 16140901064495857664, - (5,57): 13835058055282163712, 9223372036854775808, 0, 0, 0, 0, 0, - (6,0): 18446744073709551552, 18446744073709551488, 18446744073709551360, - (6,3): 18446744073709551104, 18446744073709550592, 18446744073709549568, - (6,6): 18446744073709547520, 18446744073709543424, 18446744073709535232, - (6,9): 18446744073709518848, 18446744073709486080, 18446744073709420544, - (6,12): 18446744073709289472, 18446744073709027328, 18446744073708503040, - (6,15): 18446744073707454464, 18446744073705357312, 18446744073701163008, - (6,18): 18446744073692774400, 18446744073675997184, 18446744073642442752, - (6,21): 18446744073575333888, 18446744073441116160, 18446744073172680704, - (6,24): 18446744072635809792, 18446744071562067968, 18446744069414584320, - (6,27): 18446744065119617024, 18446744056529682432, 18446744039349813248, - (6,30): 18446744004990074880, 18446743936270598144, 18446743798831644672, - (6,33): 18446743523953737728, 18446742974197923840, 18446741874686296064, - (6,36): 18446739675663040512, 18446735277616529408, 18446726481523507200, - (6,39): 18446708889337462784, 18446673704965373952, 18446603336221196288, - (6,42): 18446462598732840960, 18446181123756130304, 18445618173802708992, - (6,45): 18444492273895866368, 18442240474082181120, 18437736874454810624, - (6,48): 18428729675200069632, 18410715276690587648, 18374686479671623680, - (6,51): 18302628885633695744, 18158513697557839872, 17870283321406128128, - (6,54): 17293822569102704640, 16140901064495857664, 13835058055282163712, - (6,57): 9223372036854775808, 0, 0, 0, 0, 0, 0, - (7,0): 18446744073709551488, 18446744073709551360, 18446744073709551104, - (7,3): 18446744073709550592, 18446744073709549568, 18446744073709547520, - (7,6): 18446744073709543424, 18446744073709535232, 18446744073709518848, - (7,9): 18446744073709486080, 18446744073709420544, 18446744073709289472, - (7,12): 18446744073709027328, 18446744073708503040, 18446744073707454464, - (7,15): 18446744073705357312, 18446744073701163008, 18446744073692774400, - (7,18): 18446744073675997184, 18446744073642442752, 18446744073575333888, - (7,21): 18446744073441116160, 18446744073172680704, 18446744072635809792, - (7,24): 18446744071562067968, 18446744069414584320, 18446744065119617024, - (7,27): 18446744056529682432, 18446744039349813248, 18446744004990074880, - (7,30): 18446743936270598144, 18446743798831644672, 18446743523953737728, - (7,33): 18446742974197923840, 18446741874686296064, 18446739675663040512, - (7,36): 18446735277616529408, 18446726481523507200, 18446708889337462784, - (7,39): 18446673704965373952, 18446603336221196288, 18446462598732840960, - (7,42): 18446181123756130304, 18445618173802708992, 18444492273895866368, - (7,45): 18442240474082181120, 18437736874454810624, 18428729675200069632, - (7,48): 18410715276690587648, 18374686479671623680, 18302628885633695744, - (7,51): 18158513697557839872, 17870283321406128128, 17293822569102704640, - (7,54): 16140901064495857664, 13835058055282163712, 9223372036854775808, - (7,57): 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl b/tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl deleted file mode 100644 index 0302105..0000000 --- a/tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl +++ /dev/null @@ -1,175 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU64BITS" { - DATATYPE H5T_STD_U64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=1 LENGTH=63 - DATA { - (0,0): 9223372036854775807, 9223372036854775807, 9223372036854775806, - (0,3): 9223372036854775804, 9223372036854775800, 9223372036854775792, - (0,6): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (0,9): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (0,12): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (0,15): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (0,18): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (0,21): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (0,24): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (0,27): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (0,30): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (0,33): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (0,36): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (0,39): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (0,42): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (0,45): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (0,48): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (0,51): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (0,54): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (0,57): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (0,60): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (0,63): 4611686018427387904, - (1,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, - (1,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (1,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (1,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (1,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (1,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (1,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (1,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (1,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (1,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (1,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (1,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (1,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (1,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (1,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (1,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (1,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (1,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (1,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (1,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (1,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (2,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, - (2,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (2,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (2,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (2,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (2,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (2,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (2,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (2,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (2,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (2,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (2,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (2,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (2,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (2,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (2,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (2,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (2,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (2,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (2,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (2,60): 6917529027641081856, 4611686018427387904, 0, 0, - (3,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, - (3,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (3,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (3,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (3,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (3,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (3,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (3,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (3,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (3,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (3,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (3,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (3,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (3,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (3,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (3,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (3,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (3,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (3,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (3,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (3,60): 4611686018427387904, 0, 0, 0, - (4,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (4,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (4,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (4,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (4,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (4,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (4,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (4,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (4,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (4,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (4,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (4,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (4,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (4,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (4,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (4,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (4,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (4,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (4,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (4,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (4,61): 0, 0, 0, - (5,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (5,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (5,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (5,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (5,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (5,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (5,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (5,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (5,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (5,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (5,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (5,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (5,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (5,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (5,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (5,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (5,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (5,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (5,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (5,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, - (6,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (6,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (6,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (6,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (6,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (6,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (6,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (6,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (6,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (6,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (6,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (6,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (6,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (6,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (6,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (6,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (6,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (6,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (6,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (6,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, - (7,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (7,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (7,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (7,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (7,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (7,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (7,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (7,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (7,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (7,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (7,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (7,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (7,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (7,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (7,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (7,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (7,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (7,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (7,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (7,58): 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl b/tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl deleted file mode 100644 index 6a9b503..0000000 --- a/tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl +++ /dev/null @@ -1,172 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU64BITS" { - DATATYPE H5T_STD_U64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=63 - DATA { - (0,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, - (0,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (0,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (0,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (0,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (0,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (0,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (0,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (0,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (0,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (0,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (0,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (0,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (0,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (0,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (0,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (0,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (0,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (0,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (0,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (0,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (1,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, - (1,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (1,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (1,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (1,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (1,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (1,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (1,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (1,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (1,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (1,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (1,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (1,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (1,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (1,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (1,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (1,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (1,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (1,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (1,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (1,60): 6917529027641081856, 4611686018427387904, 0, 0, - (2,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, - (2,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (2,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (2,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (2,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (2,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (2,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (2,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (2,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (2,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (2,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (2,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (2,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (2,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (2,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (2,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (2,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (2,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (2,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (2,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (2,60): 4611686018427387904, 0, 0, 0, - (3,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (3,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (3,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (3,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (3,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (3,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (3,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (3,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (3,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (3,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (3,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (3,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (3,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (3,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (3,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (3,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (3,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (3,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (3,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (3,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (3,61): 0, 0, 0, - (4,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (4,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (4,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (4,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (4,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (4,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (4,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (4,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (4,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (4,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (4,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (4,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (4,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (4,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (4,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (4,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (4,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (4,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (4,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (4,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, - (5,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (5,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (5,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (5,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (5,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (5,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (5,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (5,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (5,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (5,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (5,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (5,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (5,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (5,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (5,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (5,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (5,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (5,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (5,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (5,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, - (6,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (6,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (6,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (6,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (6,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (6,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (6,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (6,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (6,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (6,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (6,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (6,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (6,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (6,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (6,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (6,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (6,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (6,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (6,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (6,58): 0, 0, 0, 0, 0, 0, - (7,0): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (7,3): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (7,6): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (7,9): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (7,12): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (7,15): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (7,18): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (7,21): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (7,24): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (7,27): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (7,30): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (7,33): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (7,36): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (7,39): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (7,42): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (7,45): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (7,48): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (7,51): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (7,54): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLongWhole.ddl b/tools/testfiles/tpbitsUnsignedLongWhole.ddl deleted file mode 100644 index 50ad02f..0000000 --- a/tools/testfiles/tpbitsUnsignedLongWhole.ddl +++ /dev/null @@ -1,59 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU32BITS" { - DATATYPE H5T_STD_U32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=32 - DATA { - (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, - (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (0,30): 3221225472, 2147483648, - (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, - (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (1,30): 2147483648, 0, - (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, - (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, - (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, - (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, - (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, - (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, - (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, - (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, - (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, - (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, - (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, - (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, - (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, - (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, - (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (6,25): 2147483648, 0, 0, 0, 0, 0, 0, - (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (7,27): 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedWhole.ddl b/tools/testfiles/tpbitsUnsignedWhole.ddl deleted file mode 100644 index 7c9e736..0000000 --- a/tools/testfiles/tpbitsUnsignedWhole.ddl +++ /dev/null @@ -1,17 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU08BITS" { - DATATYPE H5T_STD_U8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=8 - DATA { - (0,0): 255, 254, 252, 248, 240, 224, 192, 128, - (1,0): 254, 252, 248, 240, 224, 192, 128, 0, - (2,0): 252, 248, 240, 224, 192, 128, 0, 0, - (3,0): 248, 240, 224, 192, 128, 0, 0, 0, - (4,0): 240, 224, 192, 128, 0, 0, 0, 0, - (5,0): 224, 192, 128, 0, 0, 0, 0, 0, - (6,0): 192, 128, 0, 0, 0, 0, 0, 0, - (7,0): 128, 0, 0, 0, 0, 0, 0, 0 - } -} -} -- cgit v0.12 From e29904660a01b137e8470a8fe71d2d73a3f76538 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Fri, 12 Jun 2015 17:55:18 -0500 Subject: [svn-r27198] Set "entire_chunk" to false in H5D__chunk_write() for point selection as duplicate points are not checked to determine that it is really an "entire chunk". The bug appears from running the mdset.c test. This is a short-term fix for the problem. --- src/H5Dchunk.c | 8 ++++---- src/H5Dpkg.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) 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 815dae4..1476229 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 */ -- cgit v0.12 From 65e76690fdafd30540acfd37d82ada689e363e6b Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 12 Jun 2015 22:40:33 -0500 Subject: [svn-r27199] Description: Large code cleanups and optimizations, in preparation for the upcoming v3 metadata cache merge. Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.x (jam) w/serial & parallel --- src/H5AC.c | 3043 +++++++++++++++++++-------------------------------- src/H5ACpkg.h | 19 - src/H5ACprivate.h | 21 +- src/H5C.c | 42 +- src/H5Cprivate.h | 10 +- test/cache_api.c | 216 +--- test/cache_common.c | 10 +- test/cache_common.h | 7 - 8 files changed, 1206 insertions(+), 2162 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index c5466be..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 -#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); - - -/* - * Private file-scope function declarations: - */ +hid_t H5AC_ind_dxpl_id = (-1); -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((const H5C_cache_entry_t *) 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((const H5C_cache_entry_t *)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((H5C_cache_entry_t *)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,53 +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 ) 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() */ @@ -1383,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((H5C_cache_entry_t *)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); @@ -1401,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 */ @@ -1449,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((H5C_cache_entry_t *)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 */ @@ -1496,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((H5C_cache_entry_t *)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 */ @@ -1572,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); @@ -1588,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. @@ -1611,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 */ @@ -1637,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 0x%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) @@ -1678,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; @@ -1708,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 ); @@ -1728,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 @@ -1744,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); @@ -1755,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() */ @@ -1780,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 */ /*------------------------------------------------------------------------- @@ -1807,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'; @@ -1883,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() */ @@ -1928,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() */ @@ -1971,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 */ @@ -2000,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() */ @@ -2033,124 +1822,84 @@ 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 ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "Trace file already open.") - } - } - if ( config_ptr->close_trace_file ) { + /* Validate external configuration */ + if(H5AC_validate_config(config_ptr) != SUCCEED) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad cache configuration"); - 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 %zu %d %d\n", "H5AC_set_cache_auto_resize_config", @@ -2185,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() */ @@ -2216,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) { @@ -2247,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 ) ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "Can't disable evictions while auto-resize is enabled.") - } + 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.") - 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) @@ -2309,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() */ @@ -2367,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 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() */ @@ -2483,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; @@ -2492,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 */ @@ -2568,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 */ @@ -2624,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 */ @@ -2664,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 @@ -2688,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 @@ -2799,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. @@ -2983,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 @@ -3058,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: @@ -3100,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 @@ -3137,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. @@ -3271,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; @@ -3323,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. * @@ -3346,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 @@ -3438,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 ) { + 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.") - 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 @@ -3555,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. * @@ -3685,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 */ @@ -3739,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. * @@ -3756,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 @@ -3791,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. * @@ -3892,61 +3240,40 @@ 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; -#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 */ - } - - /* 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.") - } - - /* 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 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 */ + /* 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.") + } /* 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 @@ -4042,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 */ @@ -4089,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 @@ -4209,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. @@ -4258,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) - - 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); + FUNC_ENTER_STATIC - 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") + + /* 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 */ + + /* 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; + +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 */ - /* 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]); + FUNC_ENTER_STATIC - if(haddr_buf_ptr[i] == HADDR_UNDEF) - HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert MPI off to haddr") + /* 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); - i++; - } /* end while */ + /* 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. @@ -4375,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 @@ -4522,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. @@ -4554,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.") @@ -4588,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 @@ -4675,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) @@ -4705,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 @@ -4758,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 @@ -4860,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) @@ -4896,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; @@ -4913,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.") @@ -4926,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 @@ -4972,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...:%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); +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: @@ -5033,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: @@ -5068,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 @@ -5109,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 @@ -5147,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 @@ -5206,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 */ @@ -5244,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); @@ -5279,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) @@ -5322,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 5b8ac86..950bdea 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -297,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 @@ -312,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. * @@ -325,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. @@ -394,16 +381,10 @@ typedef struct H5AC_aux_t 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 e259a24..a4e7c5a 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -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/H5C.c b/src/H5C.c index a5eaa93..d6a89e6 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -2127,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 ) { @@ -2569,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() */ @@ -2600,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 @@ -2617,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() */ @@ -2820,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 ) { @@ -3934,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 ) { @@ -4083,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 ) { @@ -8611,8 +8598,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 ) { diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index c9679f4..301dd19 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -170,14 +170,12 @@ typedef struct H5C_class_t { /* Type defintions of call back 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); + unsigned flags); /* Upper and lower limits on cache size. These limits are picked * out of a hat -- you should be able to change them as necessary. @@ -1142,10 +1140,8 @@ H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, 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 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, diff --git a/test/cache_api.c b/test/cache_api.c index 51dda99..3c0871f 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -1526,6 +1526,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 +1570,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 +1605,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 +1640,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 +1675,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 +1710,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 +1745,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 +1780,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 +1815,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 +1850,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 +1885,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 +1920,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 +1955,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 +1990,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 +2025,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 +2060,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 +2095,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 +2130,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 +2165,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 +2200,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 +2235,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 +2270,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 +2305,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 +2340,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 +2375,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 +2410,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 +2445,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 +2480,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 +2515,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 +2550,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 +2585,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 +2620,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 +2655,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 +2690,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 +2725,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 +2760,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 +2795,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 +2830,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, diff --git a/test/cache_common.c b/test/cache_common.c index 12001b2..4abc0f4 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -475,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() */ diff --git a/test/cache_common.h b/test/cache_common.h index a309fa4..be3195b 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -532,13 +532,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]; -- cgit v0.12 From 83208611cbac1fe77907a635a8877248d5ee47f9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 15 Jun 2015 07:59:14 -0500 Subject: [svn-r27201] Changed location of packed bits testfiles --- MANIFEST | 108 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/MANIFEST b/MANIFEST index bd6928c..6a596ac 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1678,60 +1678,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/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 +./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/packedbits.h5 +./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 # h5dump h5import validation ./tools/testfiles/out3.h5import -- cgit v0.12 From b5a6740703d3dcc6f2c56c9e950507390be99a2c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 15 Jun 2015 08:10:14 -0500 Subject: [svn-r27202] Except one file is used by other tests! --- MANIFEST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index 6a596ac..1cac0e1 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1719,7 +1719,6 @@ ./tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl ./tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl ./tools/testfiles/pbits/tpbitsMax.ddl -./tools/testfiles/pbits/packedbits.h5 ./tools/testfiles/pbits/tpbitsArray.ddl ./tools/testfiles/pbits/tpbitsCompound.ddl ./tools/testfiles/pbits/tpbitsIncomplete.ddl @@ -1732,6 +1731,7 @@ ./tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl ./tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl ./tools/testfiles/pbits/tpbitsOverlapped.ddl +./tools/testfiles/packedbits.h5 # h5dump h5import validation ./tools/testfiles/out3.h5import -- cgit v0.12 From adbb64c6cd100915dfd62235c10d48a3b4162bd9 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 15 Jun 2015 11:07:38 -0500 Subject: [svn-r27204] Description: Clean up compiler warnings before merging in v3 metadata cache changes from branch. Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.x (jam) w/serial & parallel --- hl/test/test_lite.c | 16 +- hl/test/test_packet.c | 4 +- hl/test/test_table.c | 26 +- src/H5C.c | 41 +- src/H5Cpkg.h | 6476 ++++++++++++++++++++++++------------------------- src/H5Cprivate.h | 617 ++--- test/cache.c | 510 ++-- test/cache_api.c | 59 +- test/cache_common.c | 107 +- test/cache_common.h | 19 +- test/cmpd_dset.c | 20 +- test/cross_read.c | 2 +- test/dsets.c | 20 +- test/h5test.h | 18 - test/hyperslab.c | 2 +- test/tarray.c | 18 +- test/tattr.c | 10 +- test/tgenprop.c | 12 +- test/th5s.c | 2 +- test/tmisc.c | 16 +- test/tvltypes.c | 14 +- testpar/t_cache.c | 417 ++-- 22 files changed, 4056 insertions(+), 4370 deletions(-) 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/src/H5C.c b/src/H5C.c index d6a89e6..5cdd65f 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -1718,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) @@ -1943,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, @@ -1976,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, @@ -2027,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 */ @@ -4647,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; @@ -4680,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) @@ -4748,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 ) { @@ -4918,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) { @@ -4929,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", @@ -4973,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, @@ -8229,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 */ @@ -8330,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; diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 7c278e8..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,3552 +55,3536 @@ * * -- JRM */ - #define H5C__MAX_PASSES_ON_FLUSH 4 - +/* 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 /**************************************************************************** * - * 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. + * We maintain doubly linked lists of instances of H5C_cache_entry_t for a + * variety of reasons -- protected list, LRU list, and the clean and dirty + * LRU lists at present. The following macros support linking and unlinking + * of instances of H5C_cache_entry_t by both their regular and auxilary next + * and previous pointers. * - * log_flush: If provided, this function is called whenever a dirty - * entry is flushed to disk. + * The size and length fields are also maintained. * + * Note that the relevant pair of prev and next pointers are presumed to be + * NULL on entry in the insertion macros. * - * 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. + * Finally, observe that the sanity checking macros evaluate to the empty + * string when H5C_DO_SANITY_CHECKS is FALSE. They also contain calls + * to the HGOTO_ERROR macro, which may not be appropriate in all cases. + * If so, we will need versions of the insertion and deletion macros which + * do not reference the sanity checking macros. + * JRM - 5/5/04 * - * 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. + * Changes: * + * - Removed the line: * - * The cache requires an index to facilitate searching for entries. The - * following fields support that index. + * ( ( (Size) == (entry_ptr)->size ) && ( (len) != 1 ) ) || * - * index_len: Number of entries currently in the hash table used to index - * the cache. + * 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 invariant need not hold, as the epoch markers are of size 0. * - * index_size: Number of bytes of cache entries currently stored in the - * hash table used to index the cache. + * 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 invariant. * - * 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. + * Alternatively, I could pass the current decr_mode in to the macro, + * and just skip the check whenever epoch markers may be in use. * - * 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. + * However, any size errors should be caught when the cache is flushed + * and destroyed. Until we are tracking such an error, this should be + * good enough. + * JRM - 12/9/04 * - * 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. + * - In the H5C__DLL_PRE_INSERT_SC macro, replaced the lines: * - * 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. + * ( ( (len) == 1 ) && + * ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || + * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) + * ) + * ) || * - * 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. + * with: * - * WARNING: + * ( ( (len) == 1 ) && + * ( ( (head_ptr) != (tail_ptr) ) || + * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) + * ) + * ) || * - * 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. + * Epoch markers have size 0, so we can now have a non-empty list with + * zero size. Hence the "( (Size) <= 0 )" clause cause false failures + * in the sanity check. Since "Size" is typically a size_t, it can't + * take on negative values, and thus the revised clause "( (Size) < 0 )" + * caused compiler warnings. + * JRM - 12/22/04 * - * 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. + * - In the H5C__DLL_SC macro, replaced the lines: * - * 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. + * ( ( (len) == 1 ) && + * ( ( (head_ptr) != (tail_ptr) ) || ( (cache_ptr)->size <= 0 ) || + * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) + * ) + * ) || * - * 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 * + * ( ( (len) == 1 ) && + * ( ( (head_ptr) != (tail_ptr) ) || + * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) + * ) + * ) || * - * 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. + * Epoch markers have size 0, so we can now have a non-empty list with + * zero size. Hence the "( (Size) <= 0 )" clause cause false failures + * in the sanity check. Since "Size" is typically a size_t, it can't + * take on negative values, and thus the revised clause "( (Size) < 0 )" + * caused compiler warnings. + * JRM - 1/10/05 * - * 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) + * - Added the H5C__DLL_UPDATE_FOR_SIZE_CHANGE macro and the associated + * sanity checking macros. These macro are used to update the size of + * a DLL when one of its entries changes size. * - * slist_len: Number of entries currently in the skip list - * used to maintain a sorted list of dirty entries in the - * cache. + * JRM - 9/8/05 * - * 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 + ****************************************************************************/ + +#if H5C_DO_SANITY_CHECKS + +#define H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ +if ( ( (head_ptr) == NULL ) || \ + ( (tail_ptr) == NULL ) || \ + ( (entry_ptr) == NULL ) || \ + ( (len) <= 0 ) || \ + ( (Size) < (entry_ptr)->size ) || \ + ( ( (entry_ptr)->prev == NULL ) && ( (head_ptr) != (entry_ptr) ) ) || \ + ( ( (entry_ptr)->next == NULL ) && ( (tail_ptr) != (entry_ptr) ) ) || \ + ( ( (len) == 1 ) && \ + ( ! ( ( (head_ptr) == (entry_ptr) ) && \ + ( (tail_ptr) == (entry_ptr) ) && \ + ( (entry_ptr)->next == NULL ) && \ + ( (entry_ptr)->prev == NULL ) && \ + ( (Size) == (entry_ptr)->size ) \ + ) \ + ) \ + ) \ + ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL pre remove SC failed") \ +} + +#define H5C__DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ +if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ + ( (head_ptr) != (tail_ptr) ) \ + ) || \ + ( (len) < 0 ) || \ + ( (Size) < 0 ) || \ + ( ( (len) == 1 ) && \ + ( ( (head_ptr) != (tail_ptr) ) || \ + ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ + ) \ + ) || \ + ( ( (len) >= 1 ) && \ + ( ( (head_ptr) == NULL ) || ( (head_ptr)->prev != NULL ) || \ + ( (tail_ptr) == NULL ) || ( (tail_ptr)->next != NULL ) \ + ) \ + ) \ + ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL sanity check failed") \ +} + +#define H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ +if ( ( (entry_ptr) == NULL ) || \ + ( (entry_ptr)->next != NULL ) || \ + ( (entry_ptr)->prev != NULL ) || \ + ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ + ( (head_ptr) != (tail_ptr) ) \ + ) || \ + ( (len) < 0 ) || \ + ( ( (len) == 1 ) && \ + ( ( (head_ptr) != (tail_ptr) ) || \ + ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ + ) \ + ) || \ + ( ( (len) >= 1 ) && \ + ( ( (head_ptr) == NULL ) || ( (head_ptr)->prev != NULL ) || \ + ( (tail_ptr) == NULL ) || ( (tail_ptr)->next != NULL ) \ + ) \ + ) \ + ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL pre insert SC failed") \ +} + +#define H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ +if ( ( (dll_len) <= 0 ) || \ + ( (dll_size) <= 0 ) || \ + ( (old_size) <= 0 ) || \ + ( (old_size) > (dll_size) ) || \ + ( (new_size) <= 0 ) || \ + ( ( (dll_len) == 1 ) && ( (old_size) != (dll_size) ) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "DLL pre size update SC failed") \ +} + +#define H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ +if ( ( (new_size) > (dll_size) ) || \ + ( ( (dll_len) == 1 ) && ( (new_size) != (dll_size) ) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "DLL post size update SC failed") \ +} + +#else /* H5C_DO_SANITY_CHECKS */ + +#define H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) +#define H5C__DLL_SC(head_ptr, tail_ptr, len, Size, fv) +#define H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) +#define H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) +#define H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) + +#endif /* H5C_DO_SANITY_CHECKS */ + + +#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_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_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_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_UPDATE_FOR_SIZE_CHANGE() */ + +#if H5C_DO_SANITY_CHECKS + +#define H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ +if ( ( (hd_ptr) == NULL ) || \ + ( (tail_ptr) == NULL ) || \ + ( (entry_ptr) == NULL ) || \ + ( (len) <= 0 ) || \ + ( (Size) < (entry_ptr)->size ) || \ + ( ( (Size) == (entry_ptr)->size ) && ( ! ( (len) == 1 ) ) ) || \ + ( ( (entry_ptr)->aux_prev == NULL ) && ( (hd_ptr) != (entry_ptr) ) ) || \ + ( ( (entry_ptr)->aux_next == NULL ) && ( (tail_ptr) != (entry_ptr) ) ) || \ + ( ( (len) == 1 ) && \ + ( ! ( ( (hd_ptr) == (entry_ptr) ) && ( (tail_ptr) == (entry_ptr) ) && \ + ( (entry_ptr)->aux_next == NULL ) && \ + ( (entry_ptr)->aux_prev == NULL ) && \ + ( (Size) == (entry_ptr)->size ) \ + ) \ + ) \ + ) \ + ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "aux DLL pre remove SC failed") \ +} + +#define H5C__AUX_DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ +if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ + ( (head_ptr) != (tail_ptr) ) \ + ) || \ + ( (len) < 0 ) || \ + ( (Size) < 0 ) || \ + ( ( (len) == 1 ) && \ + ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ + ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ + ) \ + ) || \ + ( ( (len) >= 1 ) && \ + ( ( (head_ptr) == NULL ) || ( (head_ptr)->aux_prev != NULL ) || \ + ( (tail_ptr) == NULL ) || ( (tail_ptr)->aux_next != NULL ) \ + ) \ + ) \ + ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "AUX DLL sanity check failed") \ +} + +#define H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ +if ( ( (entry_ptr) == NULL ) || \ + ( (entry_ptr)->aux_next != NULL ) || \ + ( (entry_ptr)->aux_prev != NULL ) || \ + ( ( ( (hd_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ + ( (hd_ptr) != (tail_ptr) ) \ + ) || \ + ( (len) < 0 ) || \ + ( ( (len) == 1 ) && \ + ( ( (hd_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ + ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (Size) ) \ + ) \ + ) || \ + ( ( (len) >= 1 ) && \ + ( ( (hd_ptr) == NULL ) || ( (hd_ptr)->aux_prev != NULL ) || \ + ( (tail_ptr) == NULL ) || ( (tail_ptr)->aux_next != NULL ) \ + ) \ + ) \ + ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "AUX DLL pre insert SC failed") \ +} + +#else /* H5C_DO_SANITY_CHECKS */ + +#define H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) +#define H5C__AUX_DLL_SC(head_ptr, tail_ptr, len, Size, fv) +#define H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) + +#endif /* H5C_DO_SANITY_CHECKS */ + + +#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_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_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_REMOVE() */ + + +/*********************************************************************** * - * total_ht_insertions: Number of times entries have been inserted into the - * hash table in the current epoch. + * Stats collection macros * - * total_ht_deletions: Number of times entries have been deleted from the - * hash table in the current epoch. + * The following macros must handle stats collection when this collection + * is enabled, and evaluate to the empty string when it is not. * - * successful_ht_searches: int64 containing the total number of successful - * searches of the hash table in the current epoch. + * The sole exception to this rule is + * H5C__UPDATE_CACHE_HIT_RATE_STATS(), which is always active as + * the cache hit rate stats are always collected and available. * - * 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. + * Changes: * - * failed_ht_searches: int64 containing the total number of unsuccessful - * searches of the hash table in the current epoch. + * JRM -- 3/21/06 + * Added / updated macros for pinned entry related stats. * - * total_failed_ht_search_depth: int64 containing the total number of - * entries examined in unsuccessful searches of the hash - * table in the current epoch. + * JRM -- 8/9/06 + * More pinned entry stats related updates. * - * max_index_len: Largest value attained by the index_len field in the - * current epoch. + * JRM -- 3/31/07 + * Updated H5C__UPDATE_STATS_FOR_PROTECT() to keep stats on + * read and write protects. * - * max_index_size: Largest value attained by the index_size field in the - * current epoch. + * MAM -- 1/15/09 + * Created H5C__UPDATE_MAX_INDEX_SIZE_STATS to contain + * common code within macros that update the maximum + * index, clean_index, and dirty_index statistics fields. * - * max_clean_index_size: Largest value attained by the clean_index_size field - * in the current epoch. + ***********************************************************************/ + +#define H5C__UPDATE_CACHE_HIT_RATE_STATS(cache_ptr, hit) \ + (cache_ptr->cache_accesses)++; \ + if ( hit ) { \ + (cache_ptr->cache_hits)++; \ + } \ + +#if H5C_COLLECT_CACHE_STATS + +#define H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ + if ( (cache_ptr)->index_size > (cache_ptr)->max_index_size ) \ + (cache_ptr)->max_index_size = (cache_ptr)->index_size; \ + if ( (cache_ptr)->clean_index_size > \ + (cache_ptr)->max_clean_index_size ) \ + (cache_ptr)->max_clean_index_size = \ + (cache_ptr)->clean_index_size; \ + if ( (cache_ptr)->dirty_index_size > \ + (cache_ptr)->max_dirty_index_size ) \ + (cache_ptr)->max_dirty_index_size = \ + (cache_ptr)->dirty_index_size; + +#define H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) \ + (((cache_ptr)->dirty_pins)[(entry_ptr)->type->id])++; + +#define H5C__UPDATE_STATS_FOR_UNPROTECT(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 ( (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_MOVE(cache_ptr, entry_ptr) \ + if ( cache_ptr->flush_in_progress ) { \ + ((cache_ptr)->cache_flush_moves[(entry_ptr)->type->id])++; \ + } \ + if ( entry_ptr->flush_in_progress ) { \ + ((cache_ptr)->entry_flush_moves[(entry_ptr)->type->id])++; \ + } \ + (((cache_ptr)->moves)[(entry_ptr)->type->id])++; + +#define H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size)\ + if ( cache_ptr->flush_in_progress ) { \ + ((cache_ptr)->cache_flush_size_changes[(entry_ptr)->type->id])++; \ + } \ + if ( entry_ptr->flush_in_progress ) { \ + ((cache_ptr)->entry_flush_size_changes[(entry_ptr)->type->id])++; \ + } \ + if ( (entry_ptr)->size < (new_size) ) { \ + ((cache_ptr)->size_increases[(entry_ptr)->type->id])++; \ + H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ + if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ + (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ + if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ + (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ + } else if ( (entry_ptr)->size > (new_size) ) { \ + ((cache_ptr)->size_decreases[(entry_ptr)->type->id])++; \ + } + +#define H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \ + (cache_ptr)->total_ht_insertions++; + +#define H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) \ + (cache_ptr)->total_ht_deletions++; + +#define H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, success, depth) \ + if ( success ) { \ + (cache_ptr)->successful_ht_searches++; \ + (cache_ptr)->total_successful_ht_search_depth += depth; \ + } else { \ + (cache_ptr)->failed_ht_searches++; \ + (cache_ptr)->total_failed_ht_search_depth += depth; \ + } + +#define H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) \ + ((cache_ptr)->unpins)[(entry_ptr)->type->id]++; + +#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; \ +} + +#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_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; \ +} + +#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ + +#else /* H5C_COLLECT_CACHE_STATS */ + +#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) +#define H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) +#define H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size) +#define H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) +#define H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) +#define H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, success, depth) +#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) +#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) + +#endif /* H5C_COLLECT_CACHE_STATS */ + + +/*********************************************************************** * - * max_dirty_index_size: Largest value attained by the dirty_index_size field - * in the current epoch. + * Hash table access and manipulation macros: * - * max_slist_len: Largest value attained by the slist_len field in the - * current epoch. + * The following macros handle searches, insertions, and deletion in + * the hash table. * - * max_slist_size: Largest value attained by the slist_size field in the - * current epoch. + * When modifying these macros, remember to modify the similar macros + * in tst/cache.c * - * max_pl_len: Largest value attained by the pl_len field in the - * current epoch. + * Changes: * - * max_pl_size: Largest value attained by the pl_size field in the - * current epoch. + * - Updated existing index macros and sanity check macros to maintain + * the clean_index_size and dirty_index_size fields of H5C_t. Also + * added macros to allow us to track entry cleans and dirties. * - * max_pel_len: Largest value attained by the pel_len field in the - * current epoch. + * JRM -- 11/5/08 * - * max_pel_size: Largest value attained by the pel_size field in the - * current epoch. + ***********************************************************************/ + +/* H5C__HASH_TABLE_LEN is defined in H5Cpkg.h. It mut be a power of two. */ + +#define H5C__HASH_MASK ((size_t)(H5C__HASH_TABLE_LEN - 1) << 3) + +#define H5C__HASH_FCN(x) (int)(((x) & H5C__HASH_MASK) >> 3) + +#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 ) || \ + ( 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) \ +if ( ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ + ( (cache_ptr)->index_len < 1 ) || \ + ( (entry_ptr) == NULL ) || \ + ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ + ( ! H5F_addr_defined((entry_ptr)->addr) ) || \ + ( (entry_ptr)->size <= 0 ) || \ + ( H5C__HASH_FCN((entry_ptr)->addr) < 0 ) || \ + ( H5C__HASH_FCN((entry_ptr)->addr) >= H5C__HASH_TABLE_LEN ) || \ + ( ((cache_ptr)->index)[(H5C__HASH_FCN((entry_ptr)->addr))] \ + == NULL ) || \ + ( ( ((cache_ptr)->index)[(H5C__HASH_FCN((entry_ptr)->addr))] \ + != (entry_ptr) ) && \ + ( (entry_ptr)->ht_prev == NULL ) ) || \ + ( ( ((cache_ptr)->index)[(H5C__HASH_FCN((entry_ptr)->addr))] == \ + (entry_ptr) ) && \ + ( (entry_ptr)->ht_prev != NULL ) ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + \ + (cache_ptr)->dirty_index_size) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Pre HT remove SC failed") \ +} + +/* (Keep in sync w/H5C_TEST__PRE_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ +#define H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) \ +if ( ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ + ( ! H5F_addr_defined(Addr) ) || \ + ( H5C__HASH_FCN(Addr) < 0 ) || \ + ( H5C__HASH_FCN(Addr) >= H5C__HASH_TABLE_LEN ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "Pre HT search SC failed") \ +} + +/* (Keep in sync w/H5C_TEST__POST_SUC_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ +#define H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) \ +if ( ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ + ( (cache_ptr)->index_len < 1 ) || \ + ( (entry_ptr) == NULL ) || \ + ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ + ( H5F_addr_ne((entry_ptr)->addr, (Addr)) ) || \ + ( (entry_ptr)->size <= 0 ) || \ + ( ((cache_ptr)->index)[k] == NULL ) || \ + ( ( ((cache_ptr)->index)[k] != (entry_ptr) ) && \ + ( (entry_ptr)->ht_prev == NULL ) ) || \ + ( ( ((cache_ptr)->index)[k] == (entry_ptr) ) && \ + ( (entry_ptr)->ht_prev != NULL ) ) || \ + ( ( (entry_ptr)->ht_prev != NULL ) && \ + ( (entry_ptr)->ht_prev->ht_next != (entry_ptr) ) ) || \ + ( ( (entry_ptr)->ht_next != NULL ) && \ + ( (entry_ptr)->ht_next->ht_prev != (entry_ptr) ) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ + "Post successful HT search SC failed") \ +} + +/* (Keep in sync w/H5C_TEST__POST_HT_SHIFT_TO_FRONT macro in test/cache_common.h -QAK) */ +#define H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) \ +if ( ( (cache_ptr) == NULL ) || \ + ( ((cache_ptr)->index)[k] != (entry_ptr) ) || \ + ( (entry_ptr)->ht_prev != NULL ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ + "Post HT shift to front SC failed") \ +} + +#define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ + entry_ptr, was_clean) \ +if ( ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->index_len <= 0 ) || \ + ( (cache_ptr)->index_size <= 0 ) || \ + ( (new_size) <= 0 ) || \ + ( (old_size) > (cache_ptr)->index_size ) || \ + ( (new_size) <= 0 ) || \ + ( ( (cache_ptr)->index_len == 1 ) && \ + ( (cache_ptr)->index_size != (old_size) ) ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + \ + (cache_ptr)->dirty_index_size) ) || \ + ( ( !( was_clean ) || \ + ( (cache_ptr)->clean_index_size < (old_size) ) ) && \ + ( ( (was_clean) ) || \ + ( (cache_ptr)->dirty_index_size < (old_size) ) ) ) || \ + ( (entry_ptr) == NULL ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Pre HT entry size change SC failed") \ +} + +#define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ + entry_ptr) \ +if ( ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->index_len <= 0 ) || \ + ( (cache_ptr)->index_size <= 0 ) || \ + ( (new_size) > (cache_ptr)->index_size ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + \ + (cache_ptr)->dirty_index_size) ) || \ + ( ( !((entry_ptr)->is_dirty ) || \ + ( (cache_ptr)->dirty_index_size < (new_size) ) ) && \ + ( ( ((entry_ptr)->is_dirty) ) || \ + ( (cache_ptr)->clean_index_size < (new_size) ) ) ) || \ + ( ( (cache_ptr)->index_len == 1 ) && \ + ( (cache_ptr)->index_size != (new_size) ) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Post HT entry size change SC failed") \ +} + +#define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ +if ( \ + ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ + ( (cache_ptr)->index_len <= 0 ) || \ + ( (entry_ptr) == NULL ) || \ + ( (entry_ptr)->is_dirty != FALSE ) || \ + ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ + ( (cache_ptr)->dirty_index_size < (entry_ptr)->size ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Pre HT update for entry clean SC failed") \ +} + +#define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ +if ( \ + ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ + ( (cache_ptr)->index_len <= 0 ) || \ + ( (entry_ptr) == NULL ) || \ + ( (entry_ptr)->is_dirty != TRUE ) || \ + ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ + ( (cache_ptr)->clean_index_size < (entry_ptr)->size ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Pre HT update for entry dirty SC failed") \ +} + +#define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ +if ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Post HT update for entry clean SC failed") \ +} + +#define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ +if ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Post HT update for entry dirty SC failed") \ +} + +#else /* H5C_DO_SANITY_CHECKS */ + +#define H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) +#define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) +#define H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) +#define H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) +#define H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) +#define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) +#define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) +#define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ + entry_ptr, was_clean) +#define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ + entry_ptr) +#define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) +#define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) + +#endif /* H5C_DO_SANITY_CHECKS */ + + +#define H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, fail_val) \ +{ \ + int k; \ + 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 { \ + (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 ) \ + (cache_ptr)->dirty_index_size += (entry_ptr)->size; \ + 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); \ + } \ + H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \ +} + +#define H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) \ +{ \ + int k; \ + 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 ) \ + (cache_ptr)->dirty_index_size -= (entry_ptr)->size; \ + 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); \ + } \ + H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) \ +} + +#define H5C__SEARCH_INDEX(cache_ptr, Addr, entry_ptr, fail_val) \ +{ \ + int k; \ + int depth = 0; \ + 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) ) ) { \ + (entry_ptr) = (entry_ptr)->ht_next; \ + (depth)++; \ + } \ + 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)->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); \ + (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \ + (entry_ptr)->ht_prev = NULL; \ + ((cache_ptr)->index)[k] = (entry_ptr); \ + H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) \ + } \ + } \ + H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, (entry_ptr != NULL), depth) \ +} + +#define H5C__SEARCH_INDEX_NO_STATS(cache_ptr, Addr, entry_ptr, fail_val) \ +{ \ + int k; \ + int depth = 0; \ + 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) ) ) { \ + (entry_ptr) = (entry_ptr)->ht_next; \ + (depth)++; \ + } \ + 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)->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); \ + (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \ + (entry_ptr)->ht_prev = NULL; \ + ((cache_ptr)->index)[k] = (entry_ptr); \ + H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) \ + } \ + } \ +} + +#define H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr) \ +{ \ + H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr); \ + (cache_ptr)->dirty_index_size -= (entry_ptr)->size; \ + (cache_ptr)->clean_index_size += (entry_ptr)->size; \ + H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr); \ +} + +#define H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr) \ +{ \ + H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \ + (cache_ptr)->clean_index_size -= (entry_ptr)->size; \ + (cache_ptr)->dirty_index_size += (entry_ptr)->size; \ + H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \ +} + +#define H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size, \ + entry_ptr, was_clean) \ +{ \ + H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ + entry_ptr, was_clean) \ + (cache_ptr)->index_size -= (old_size); \ + (cache_ptr)->index_size += (new_size); \ + if ( was_clean ) \ + (cache_ptr)->clean_index_size -= (old_size); \ + else \ + (cache_ptr)->dirty_index_size -= (old_size); \ + if ( (entry_ptr)->is_dirty ) \ + (cache_ptr)->dirty_index_size += (new_size); \ + else \ + (cache_ptr)->clean_index_size += (new_size); \ + H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ + entry_ptr) \ +} + + +/************************************************************************** * - * calls_to_msic: Total number of calls to H5C_make_space_in_cache + * Skip list insertion and deletion macros: * - * total_entries_skipped_in_msic: Number of clean entries skipped while - * enforcing the min_clean_fraction in H5C_make_space_in_cache(). + * These used to be functions, but I converted them to macros to avoid some + * function call overhead. * - * 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(). + * Macro: H5C__INSERT_ENTRY_IN_SLIST * - * max_entries_scanned_in_msic: Maximum number of entries scanned over - * in any one call to H5C_make_space_in_cache(). + * Purpose: Insert the specified instance of H5C_cache_entry_t into + * the skip list in the specified instance of H5C_t. Update + * the associated length and size fields. * - * 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. + * Return: N/A * - * 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. + * Programmer: John Mainzer, 5/10/04 * - * 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. + * Modifications: * - * 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. + * JRM -- 7/21/04 + * Updated function to set the in_tree flag when inserting + * an entry into the tree. Also modified the function to + * update the tree size and len fields instead of the similar + * index fields. * - * 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. + * All of this is part of the modifications to support the + * hash table. * - * 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. + * JRM -- 7/27/04 + * Converted the function H5C_insert_entry_in_tree() into + * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of + * wringing a little more speed out of the cache. * - * 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. + * Note that we don't bother to check if the entry is already + * in the tree -- if it is, H5SL_insert() will fail. * + * QAK -- 11/27/04 + * Switched over to using skip list routines. * - * Fields supporting testing: + * JRM -- 6/27/06 + * Added fail_val parameter. * - * prefix Array of char used to prefix debugging output. The - * field is intended to allow marking of output of with - * the processes mpi rank. + * JRM -- 8/25/06 + * Added the H5C_DO_SANITY_CHECKS version of the macro. * - * 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. + * This version maintains the slist_len_increase and + * slist_size_increase fields that are used in sanity + * checks in the flush routines. * - ****************************************************************************/ - -#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; + * All this is needed as the fractal heap needs to be + * able to dirty, resize and/or move entries during the + * flush. + * + *------------------------------------------------------------------------- + */ - 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]; +#define H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( (entry_ptr)->size > 0 ); \ + 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) \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ + "Can't insert entry in skip list") \ + \ + (entry_ptr)->in_slist = TRUE; \ + (cache_ptr)->slist_len++; \ + (cache_ptr)->slist_size += (entry_ptr)->size; \ + (cache_ptr)->slist_len_increase++; \ + (cache_ptr)->slist_size_increase += (int64_t)((entry_ptr)->size); \ + \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + HDassert( (cache_ptr)->slist_size > 0 ); \ + \ +} /* H5C__INSERT_ENTRY_IN_SLIST */ -#ifndef NDEBUG +#else /* H5C_DO_SANITY_CHECKS */ - int64_t get_entry_ptr_from_addr_counter; +#define H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( (entry_ptr)->size > 0 ); \ + 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) \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ + "Can't insert entry in skip list") \ + \ + (entry_ptr)->in_slist = TRUE; \ + (cache_ptr)->slist_len++; \ + (cache_ptr)->slist_size += (entry_ptr)->size; \ + \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + HDassert( (cache_ptr)->slist_size > 0 ); \ + \ +} /* H5C__INSERT_ENTRY_IN_SLIST */ -#endif /* NDEBUG */ -}; +#endif /* H5C_DO_SANITY_CHECKS */ -/****************************************************************************/ -/***************************** Macro Definitions ****************************/ -/****************************************************************************/ - -/**************************************************************************** - * - * We maintain doubly linked lists of instances of H5C_cache_entry_t for a - * variety of reasons -- protected list, LRU list, and the clean and dirty - * LRU lists at present. The following macros support linking and unlinking - * of instances of H5C_cache_entry_t by both their regular and auxilary next - * and previous pointers. - * - * The size and length fields are also maintained. - * - * Note that the relevant pair of prev and next pointers are presumed to be - * NULL on entry in the insertion macros. - * - * Finally, observe that the sanity checking macros evaluate to the empty - * string when H5C_DO_SANITY_CHECKS is FALSE. They also contain calls - * to the HGOTO_ERROR macro, which may not be appropriate in all cases. - * If so, we will need versions of the insertion and deletion macros which - * do not reference the sanity checking macros. - * JRM - 5/5/04 - * - * Changes: - * - * - Removed the line: +/*------------------------------------------------------------------------- * - * ( ( (Size) == (entry_ptr)->size ) && ( (len) != 1 ) ) || + * Function: H5C__REMOVE_ENTRY_FROM_SLIST * - * 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. + * Purpose: Remove the specified instance of H5C_cache_entry_t from the + * index skip list in the specified instance of H5C_t. Update + * the associated length and size fields. * - * 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. + * Return: N/A * - * Alternatively, I could pass the current decr_mode in to the macro, - * and just skip the check whenever epoch markers may be in use. + * Programmer: John Mainzer, 5/10/04 * - * However, any size errors should be caught when the cache is flushed - * and destroyed. Until we are tracking such an error, this should be - * good enough. - * JRM - 12/9/04 + * Modifications: * + * JRM -- 7/21/04 + * Updated function for the addition of the hash table. * - * - In the H5C__DLL_PRE_INSERT_SC macro, replaced the lines: + * JRM - 7/27/04 + * Converted from the function H5C_remove_entry_from_tree() + * to the macro H5C__REMOVE_ENTRY_FROM_TREE in the hopes of + * wringing a little more performance out of the cache. * - * ( ( (len) == 1 ) && - * ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) - * ) || + * QAK -- 11/27/04 + * Switched over to using skip list routines. * - * with: + * JRM -- 3/28/07 + * Updated sanity checks for the new is_read_only and + * ro_ref_count fields in H5C_cache_entry_t. * - * ( ( (len) == 1 ) && - * ( ( (head_ptr) != (tail_ptr) ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) - * ) || + *------------------------------------------------------------------------- + */ + +#define H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + HDassert( (entry_ptr)->in_slist ); \ + HDassert( (cache_ptr)->slist_ptr ); \ + \ + if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \ + != (entry_ptr) ) \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, \ + "Can't delete entry from skip list.") \ + \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + (cache_ptr)->slist_len--; \ + HDassert( (cache_ptr)->slist_size >= (entry_ptr)->size ); \ + (cache_ptr)->slist_size -= (entry_ptr)->size; \ + (entry_ptr)->in_slist = FALSE; \ +} /* H5C__REMOVE_ENTRY_FROM_SLIST */ + + +/*------------------------------------------------------------------------- * - * Epoch markers have size 0, so we can now have a non-empty list with - * zero size. Hence the "( (Size) <= 0 )" clause cause false failures - * in the sanity check. Since "Size" is typically a size_t, it can't - * take on negative values, and thus the revised clause "( (Size) < 0 )" - * caused compiler warnings. - * JRM - 12/22/04 + * Function: H5C__UPDATE_SLIST_FOR_SIZE_CHANGE * - * - In the H5C__DLL_SC macro, replaced the lines: + * Purpose: Update cache_ptr->slist_size for a change in the size of + * and entry in the slist. * - * ( ( (len) == 1 ) && - * ( ( (head_ptr) != (tail_ptr) ) || ( (cache_ptr)->size <= 0 ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) - * ) || + * Return: N/A * - * with + * Programmer: John Mainzer, 9/07/05 * - * ( ( (len) == 1 ) && - * ( ( (head_ptr) != (tail_ptr) ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) - * ) || + * Modifications: * - * Epoch markers have size 0, so we can now have a non-empty list with - * zero size. Hence the "( (Size) <= 0 )" clause cause false failures - * in the sanity check. Since "Size" is typically a size_t, it can't - * take on negative values, and thus the revised clause "( (Size) < 0 )" - * caused compiler warnings. - * JRM - 1/10/05 + * JRM -- 8/27/06 + * Added the H5C_DO_SANITY_CHECKS version of the macro. * - * - Added the H5C__DLL_UPDATE_FOR_SIZE_CHANGE macro and the associated - * sanity checking macros. These macro are used to update the size of - * a DLL when one of its entries changes size. + * This version maintains the slist_size_increase field + * that are used in sanity checks in the flush routines. * - * JRM - 9/8/05 + * All this is needed as the fractal heap needs to be + * able to dirty, resize and/or move entries during the + * flush. * - ****************************************************************************/ + *------------------------------------------------------------------------- + */ #if H5C_DO_SANITY_CHECKS -#define H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ -if ( ( (head_ptr) == NULL ) || \ - ( (tail_ptr) == NULL ) || \ - ( (entry_ptr) == NULL ) || \ - ( (len) <= 0 ) || \ - ( (Size) < (entry_ptr)->size ) || \ - ( ( (entry_ptr)->prev == NULL ) && ( (head_ptr) != (entry_ptr) ) ) || \ - ( ( (entry_ptr)->next == NULL ) && ( (tail_ptr) != (entry_ptr) ) ) || \ - ( ( (len) == 1 ) && \ - ( ! ( ( (head_ptr) == (entry_ptr) ) && \ - ( (tail_ptr) == (entry_ptr) ) && \ - ( (entry_ptr)->next == NULL ) && \ - ( (entry_ptr)->prev == NULL ) && \ - ( (Size) == (entry_ptr)->size ) \ - ) \ - ) \ - ) \ - ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL pre remove SC failed") \ -} - -#define H5C__DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ -if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ - ( (head_ptr) != (tail_ptr) ) \ - ) || \ - ( (len) < 0 ) || \ - ( (Size) < 0 ) || \ - ( ( (len) == 1 ) && \ - ( ( (head_ptr) != (tail_ptr) ) || \ - ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ - ) \ - ) || \ - ( ( (len) >= 1 ) && \ - ( ( (head_ptr) == NULL ) || ( (head_ptr)->prev != NULL ) || \ - ( (tail_ptr) == NULL ) || ( (tail_ptr)->next != NULL ) \ - ) \ - ) \ - ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL sanity check failed") \ -} - -#define H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ -if ( ( (entry_ptr) == NULL ) || \ - ( (entry_ptr)->next != NULL ) || \ - ( (entry_ptr)->prev != NULL ) || \ - ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ - ( (head_ptr) != (tail_ptr) ) \ - ) || \ - ( (len) < 0 ) || \ - ( ( (len) == 1 ) && \ - ( ( (head_ptr) != (tail_ptr) ) || \ - ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ - ) \ - ) || \ - ( ( (len) >= 1 ) && \ - ( ( (head_ptr) == NULL ) || ( (head_ptr)->prev != NULL ) || \ - ( (tail_ptr) == NULL ) || ( (tail_ptr)->next != NULL ) \ - ) \ - ) \ - ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL pre insert SC failed") \ -} +#define H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (old_size) > 0 ); \ + HDassert( (new_size) > 0 ); \ + HDassert( (old_size) <= (cache_ptr)->slist_size ); \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + HDassert( ((cache_ptr)->slist_len > 1) || \ + ( (cache_ptr)->slist_size == (old_size) ) ); \ + \ + (cache_ptr)->slist_size -= (old_size); \ + (cache_ptr)->slist_size += (new_size); \ + \ + (cache_ptr)->slist_size_increase -= (int64_t)(old_size); \ + (cache_ptr)->slist_size_increase += (int64_t)(new_size); \ + \ + HDassert( (new_size) <= (cache_ptr)->slist_size ); \ + HDassert( ( (cache_ptr)->slist_len > 1 ) || \ + ( (cache_ptr)->slist_size == (new_size) ) ); \ +} /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ -#define H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ -if ( ( (dll_len) <= 0 ) || \ - ( (dll_size) <= 0 ) || \ - ( (old_size) <= 0 ) || \ - ( (old_size) > (dll_size) ) || \ - ( (new_size) <= 0 ) || \ - ( ( (dll_len) == 1 ) && ( (old_size) != (dll_size) ) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "DLL pre size update SC failed") \ -} +#else /* H5C_DO_SANITY_CHECKS */ -#define H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ -if ( ( (new_size) > (dll_size) ) || \ - ( ( (dll_len) == 1 ) && ( (new_size) != (dll_size) ) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "DLL post size update SC failed") \ -} +#define H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (old_size) > 0 ); \ + HDassert( (new_size) > 0 ); \ + HDassert( (old_size) <= (cache_ptr)->slist_size ); \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + HDassert( ((cache_ptr)->slist_len > 1) || \ + ( (cache_ptr)->slist_size == (old_size) ) ); \ + \ + (cache_ptr)->slist_size -= (old_size); \ + (cache_ptr)->slist_size += (new_size); \ + \ + HDassert( (new_size) <= (cache_ptr)->slist_size ); \ + HDassert( ( (cache_ptr)->slist_len > 1 ) || \ + ( (cache_ptr)->slist_size == (new_size) ) ); \ +} /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ -#else /* H5C_DO_SANITY_CHECKS */ +#endif /* H5C_DO_SANITY_CHECKS */ -#define H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) -#define H5C__DLL_SC(head_ptr, tail_ptr, len, Size, fv) -#define H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) -#define H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) -#define H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) + +/************************************************************************** + * + * Replacement policy update macros: + * + * These used to be functions, but I converted them to macros to avoid some + * function call overhead. + * + **************************************************************************/ -#endif /* H5C_DO_SANITY_CHECKS */ +/*------------------------------------------------------------------------- + * + * Macro: H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS + * + * Purpose: For efficiency, we sometimes change the order of flushes -- + * but doing so can confuse the replacement policy. This + * macro exists to allow us to specify an entry as the + * most recently touched so we can repair any such + * confusion. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the macro + * should switch on the current policy and act accordingly. + * + * Return: N/A + * + * Programmer: John Mainzer, 10/13/05 + * + * Modifications: + * + * JRM -- 3/20/06 + * Modified macro to ignore pinned entries. Pinned entries + * do not appear in the data structures maintained by the + * replacement policy code, and thus this macro has nothing + * to do if called for such an entry. + * + * JRM -- 3/28/07 + * Added sanity checks using the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. + * + *------------------------------------------------------------------------- + */ +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#define H5C__DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ +#define H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS(cache_ptr, entry_ptr, 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); \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( ! ((entry_ptr)->is_pinned) ) { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list, and re-insert it at the head.\ + */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* Use the dirty flag to infer whether the entry is on the clean or \ + * dirty LRU list, and remove it. Then insert it at the head of \ + * the same LRU list. \ + * \ + * At least initially, all entries should be clean. That may \ + * change, so we may as well deal with both cases now. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + } else { \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + } \ + \ + /* End modified LRU specific code. */ \ } \ - (len)++; \ - (Size) += (entry_ptr)->size; \ -} /* H5C__DLL_APPEND() */ +} /* H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS */ -#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_PREPEND() */ +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ +#define H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS(cache_ptr, entry_ptr, 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; \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( ! ((entry_ptr)->is_pinned) ) { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list, and re-insert it at the head \ + */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ } \ -} /* 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_UPDATE_FOR_SIZE_CHANGE() */ +} /* H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS */ -#if H5C_DO_SANITY_CHECKS +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ -if ( ( (hd_ptr) == NULL ) || \ - ( (tail_ptr) == NULL ) || \ - ( (entry_ptr) == NULL ) || \ - ( (len) <= 0 ) || \ - ( (Size) < (entry_ptr)->size ) || \ - ( ( (Size) == (entry_ptr)->size ) && ( ! ( (len) == 1 ) ) ) || \ - ( ( (entry_ptr)->aux_prev == NULL ) && ( (hd_ptr) != (entry_ptr) ) ) || \ - ( ( (entry_ptr)->aux_next == NULL ) && ( (tail_ptr) != (entry_ptr) ) ) || \ - ( ( (len) == 1 ) && \ - ( ! ( ( (hd_ptr) == (entry_ptr) ) && ( (tail_ptr) == (entry_ptr) ) && \ - ( (entry_ptr)->aux_next == NULL ) && \ - ( (entry_ptr)->aux_prev == NULL ) && \ - ( (Size) == (entry_ptr)->size ) \ - ) \ - ) \ - ) \ - ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "aux DLL pre remove SC failed") \ -} + +/*------------------------------------------------------------------------- + * + * Macro: H5C__UPDATE_RP_FOR_EVICTION + * + * Purpose: Update the replacement policy data structures for an + * eviction of the specified cache entry. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. + * + * Return: Non-negative on success/Negative on failure. + * + * Programmer: John Mainzer, 5/10/04 + * + * Modifications: + * + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_eviction() to the + * macro H5C__UPDATE_RP_FOR_EVICTION in an effort to squeeze + * a bit more performance out of the cache. + * + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause dificulties with + * the pre-processor, I'll have to remove them. + * + * JRM - 7/28/04 + * Split macro into two version, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. + * + * JRM - 3/20/06 + * Pinned entries can't be evicted, so this entry should never + * be called on a pinned entry. Added assert to verify this. + * + * JRM -- 3/28/07 + * Added sanity checks for the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. + * + *------------------------------------------------------------------------- + */ -#define H5C__AUX_DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ -if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ - ( (head_ptr) != (tail_ptr) ) \ - ) || \ - ( (len) < 0 ) || \ - ( (Size) < 0 ) || \ - ( ( (len) == 1 ) && \ - ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ - ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ - ) \ - ) || \ - ( ( (len) >= 1 ) && \ - ( ( (head_ptr) == NULL ) || ( (head_ptr)->aux_prev != NULL ) || \ - ( (tail_ptr) == NULL ) || ( (tail_ptr)->aux_next != NULL ) \ - ) \ - ) \ - ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "AUX DLL sanity check failed") \ -} +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#define H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ -if ( ( (entry_ptr) == NULL ) || \ - ( (entry_ptr)->aux_next != NULL ) || \ - ( (entry_ptr)->aux_prev != NULL ) || \ - ( ( ( (hd_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ - ( (hd_ptr) != (tail_ptr) ) \ - ) || \ - ( (len) < 0 ) || \ - ( ( (len) == 1 ) && \ - ( ( (hd_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ - ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (Size) ) \ - ) \ - ) || \ - ( ( (len) >= 1 ) && \ - ( ( (hd_ptr) == NULL ) || ( (hd_ptr)->aux_prev != NULL ) || \ - ( (tail_ptr) == NULL ) || ( (tail_ptr)->aux_next != NULL ) \ - ) \ - ) \ - ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "AUX DLL pre insert SC failed") \ -} +#define H5C__UPDATE_RP_FOR_EVICTION(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( !((entry_ptr)->is_pinned) ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list. */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* If the entry is clean when it is evicted, it should be on the \ + * clean LRU list, if it was dirty, it should be on the dirty LRU list. \ + * Remove it from the appropriate list according to the value of the \ + * dirty flag. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + } else { \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + } \ + \ +} /* H5C__UPDATE_RP_FOR_EVICTION */ -#else /* H5C_DO_SANITY_CHECKS */ +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) -#define H5C__AUX_DLL_SC(head_ptr, tail_ptr, len, Size, fv) -#define H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) +#define H5C__UPDATE_RP_FOR_EVICTION(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( !((entry_ptr)->is_pinned) ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list. */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ +} /* H5C__UPDATE_RP_FOR_EVICTION */ -#endif /* H5C_DO_SANITY_CHECKS */ +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + +/*------------------------------------------------------------------------- + * + * Macro: H5C__UPDATE_RP_FOR_FLUSH + * + * Purpose: Update the replacement policy data structures for a flush + * of the specified cache entry. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. + * + * Return: N/A + * + * Programmer: John Mainzer, 5/6/04 + * + * Modifications: + * + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_flush() to the + * macro H5C__UPDATE_RP_FOR_FLUSH in an effort to squeeze + * a bit more performance out of the cache. + * + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause dificulties with + * pre-processor, I'll have to remove them. + * + * JRM - 7/28/04 + * Split macro into two versions, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. + * + * JRM - 3/20/06 + * While pinned entries can be flushed, they don't reside in + * the replacement policy data structures when unprotected. + * Thus I modified this macro to do nothing if the entry is + * pinned. + * + * JRM - 3/28/07 + * Added sanity checks based on the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. + * + *------------------------------------------------------------------------- + */ -#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_APPEND() */ +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#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_PREPEND() */ +#define H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( ! ((entry_ptr)->is_pinned) ) { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list, and re-insert it at the \ + * head. \ + */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* since the entry is being flushed or cleared, one would think \ + * that it must be dirty -- but that need not be the case. Use the \ + * dirty flag to infer whether the entry is on the clean or dirty \ + * LRU list, and remove it. Then insert it at the head of the \ + * clean LRU list. \ + * \ + * The function presumes that a dirty entry will be either cleared \ + * or flushed shortly, so it is OK if we put a dirty entry on the \ + * clean LRU list. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + } else { \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + } \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + } \ +} /* H5C__UPDATE_RP_FOR_FLUSH */ -#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_REMOVE() */ +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + +#define H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( ! ((entry_ptr)->is_pinned) ) { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list, and re-insert it at the \ + * head. \ + */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + } \ +} /* H5C__UPDATE_RP_FOR_FLUSH */ + +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -/*********************************************************************** +/*------------------------------------------------------------------------- * - * Stats collection macros + * Macro: H5C__UPDATE_RP_FOR_INSERTION * - * The following macros must handle stats collection when this collection - * is enabled, and evaluate to the empty string when it is not. + * Purpose: Update the replacement policy data structures for an + * insertion of the specified cache entry. * - * The sole exception to this rule is - * H5C__UPDATE_CACHE_HIT_RATE_STATS(), which is always active as - * the cache hit rate stats are always collected and available. + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. * - * Changes: + * Return: N/A * - * JRM -- 3/21/06 - * Added / updated macros for pinned entry related stats. + * Programmer: John Mainzer, 5/17/04 * - * JRM -- 8/9/06 - * More pinned entry stats related updates. + * Modifications: * - * JRM -- 3/31/07 - * Updated H5C__UPDATE_STATS_FOR_PROTECT() to keep stats on - * read and write protects. + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_insertion() to the + * macro H5C__UPDATE_RP_FOR_INSERTION in an effort to squeeze + * a bit more performance out of the cache. * - * MAM -- 1/15/09 - * Created H5C__UPDATE_MAX_INDEX_SIZE_STATS to contain - * common code within macros that update the maximum - * index, clean_index, and dirty_index statistics fields. + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause dificulties with + * pre-processor, I'll have to remove them. * - ***********************************************************************/ - -#define H5C__UPDATE_CACHE_HIT_RATE_STATS(cache_ptr, hit) \ - (cache_ptr->cache_accesses)++; \ - if ( hit ) { \ - (cache_ptr->cache_hits)++; \ - } \ - -#if H5C_COLLECT_CACHE_STATS - -#define H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->index_size > (cache_ptr)->max_index_size ) \ - (cache_ptr)->max_index_size = (cache_ptr)->index_size; \ - if ( (cache_ptr)->clean_index_size > \ - (cache_ptr)->max_clean_index_size ) \ - (cache_ptr)->max_clean_index_size = \ - (cache_ptr)->clean_index_size; \ - if ( (cache_ptr)->dirty_index_size > \ - (cache_ptr)->max_dirty_index_size ) \ - (cache_ptr)->max_dirty_index_size = \ - (cache_ptr)->dirty_index_size; - -#define H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) \ - (((cache_ptr)->dirty_pins)[(entry_ptr)->type->id])++; - -#define H5C__UPDATE_STATS_FOR_UNPROTECT(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 ( (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_MOVE(cache_ptr, entry_ptr) \ - if ( cache_ptr->flush_in_progress ) { \ - ((cache_ptr)->cache_flush_moves[(entry_ptr)->type->id])++; \ - } \ - if ( entry_ptr->flush_in_progress ) { \ - ((cache_ptr)->entry_flush_moves[(entry_ptr)->type->id])++; \ - } \ - (((cache_ptr)->moves)[(entry_ptr)->type->id])++; - -#define H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size)\ - if ( cache_ptr->flush_in_progress ) { \ - ((cache_ptr)->cache_flush_size_changes[(entry_ptr)->type->id])++; \ - } \ - if ( entry_ptr->flush_in_progress ) { \ - ((cache_ptr)->entry_flush_size_changes[(entry_ptr)->type->id])++; \ - } \ - if ( (entry_ptr)->size < (new_size) ) { \ - ((cache_ptr)->size_increases[(entry_ptr)->type->id])++; \ - H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ - (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ - if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ - (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ - } else if ( (entry_ptr)->size > (new_size) ) { \ - ((cache_ptr)->size_decreases[(entry_ptr)->type->id])++; \ - } - -#define H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \ - (cache_ptr)->total_ht_insertions++; - -#define H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) \ - (cache_ptr)->total_ht_deletions++; - -#define H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, success, depth) \ - if ( success ) { \ - (cache_ptr)->successful_ht_searches++; \ - (cache_ptr)->total_successful_ht_search_depth += depth; \ - } else { \ - (cache_ptr)->failed_ht_searches++; \ - (cache_ptr)->total_failed_ht_search_depth += depth; \ - } - -#define H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) \ - ((cache_ptr)->unpins)[(entry_ptr)->type->id]++; - -#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; \ -} + * JRM - 7/28/04 + * Split macro into two version, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. + * + * JRM - 3/10/06 + * This macro should never be called on a pinned entry. + * Inserted an assert to verify this. + * + * JRM - 8/9/06 + * Not any more. We must now allow insertion of pinned + * entries. Updated macro to support this. + * + * JRM - 3/28/07 + * Added sanity checks using the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. + * + *------------------------------------------------------------------------- + */ -#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; \ - } \ -} +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#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_RP_FOR_INSERTION(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* insert the entry at the head of the LRU list. */ \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* insert the entry at the head of the clean or dirty LRU list as \ + * appropriate. \ + */ \ + \ + if ( entry_ptr->is_dirty ) { \ + H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + } else { \ + H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + } \ + \ + /* End modified LRU specific code. */ \ + } \ } -#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_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + +#define H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* insert the entry at the head of the LRU list. */ \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + } \ } -#else /* H5C_COLLECT_CACHE_ENTRY_STATS */ +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) + +/*------------------------------------------------------------------------- + * + * Macro: H5C__UPDATE_RP_FOR_PROTECT + * + * Purpose: Update the replacement policy data structures for a + * protect of the specified cache entry. + * + * To do this, unlink the specified entry from any data + * structures used by the replacement policy, and add the + * entry to the protected list. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. + * + * Return: N/A + * + * Programmer: John Mainzer, 5/17/04 + * + * Modifications: + * + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_protect() to the + * macro H5C__UPDATE_RP_FOR_PROTECT in an effort to squeeze + * a bit more performance out of the cache. + * + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause dificulties with + * pre-processor, I'll have to remove them. + * + * JRM - 7/28/04 + * Split macro into two version, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. + * + * JRM - 3/17/06 + * Modified macro to attempt to remove pinned entriese from + * the pinned entry list instead of from the data structures + * maintained by the replacement policy. + * + * JRM - 3/28/07 + * Added sanity checks based on the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. + * + *------------------------------------------------------------------------- + */ -#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])++; \ -} +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + +#define H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + HDassert( (cache_ptr)->pel_len >= 0 ); \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list. */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* Similarly, remove the entry from the clean or dirty LRU list \ + * as appropriate. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + \ + } else { \ + \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + } \ + \ + /* End modified LRU specific code. */ \ + } \ + \ + /* Regardless of the replacement policy, or whether the entry is \ + * pinned, now add the entry to the protected list. \ + */ \ + \ + H5C__DLL_APPEND((entry_ptr), (cache_ptr)->pl_head_ptr, \ + (cache_ptr)->pl_tail_ptr, \ + (cache_ptr)->pl_len, \ + (cache_ptr)->pl_size, (fail_val)) \ +} /* H5C__UPDATE_RP_FOR_PROTECT */ -#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])++; \ -} +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \ - (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; +#define H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + HDassert( (cache_ptr)->pel_len >= 0 ); \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list. */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + } \ + \ + /* Regardless of the replacement policy, or whether the entry is \ + * pinned, now add the entry to the protected list. \ + */ \ + \ + H5C__DLL_APPEND((entry_ptr), (cache_ptr)->pl_head_ptr, \ + (cache_ptr)->pl_tail_ptr, \ + (cache_ptr)->pl_len, \ + (cache_ptr)->pl_size, (fail_val)) \ +} /* H5C__UPDATE_RP_FOR_PROTECT */ -#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; \ -} +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#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; \ -} + +/*------------------------------------------------------------------------- + * + * Macro: H5C__UPDATE_RP_FOR_MOVE + * + * Purpose: Update the replacement policy data structures for a + * move of the specified cache entry. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. + * + * Return: N/A + * + * Programmer: John Mainzer, 5/17/04 + * + *------------------------------------------------------------------------- + */ -#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; \ -} +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ +#define H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( ! ( (entry_ptr)->is_pinned ) ) { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list, and re-insert it at the head. \ + */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* remove the entry from either the clean or dirty LUR list as \ + * indicated by the was_dirty parameter \ + */ \ + if ( was_dirty ) { \ + \ + H5C__AUX_DLL_REMOVE((entry_ptr), \ + (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, \ + (fail_val)) \ + \ + } else { \ + \ + H5C__AUX_DLL_REMOVE((entry_ptr), \ + (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, \ + (fail_val)) \ + } \ + \ + /* insert the entry at the head of either the clean or dirty \ + * LRU list as appropriate. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), \ + (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, \ + (fail_val)) \ + \ + } else { \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), \ + (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, \ + (fail_val)) \ + } \ + \ + /* End modified LRU specific code. */ \ + } \ +} /* H5C__UPDATE_RP_FOR_MOVE */ -#else /* H5C_COLLECT_CACHE_STATS */ +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) -#define H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) -#define H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size) -#define H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) -#define H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) -#define H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, success, depth) -#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) -#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) +#define H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( ! ( (entry_ptr)->is_pinned ) ) { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list, and re-insert it at the head. \ + */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + } \ +} /* H5C__UPDATE_RP_FOR_MOVE */ -#endif /* H5C_COLLECT_CACHE_STATS */ +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -/*********************************************************************** +/*------------------------------------------------------------------------- + * + * Macro: H5C__UPDATE_RP_FOR_SIZE_CHANGE + * + * Purpose: Update the replacement policy data structures for a + * size change of the specified cache entry. * - * Hash table access and manipulation macros: + * To do this, determine if the entry is pinned. If it is, + * update the size of the pinned entry list. * - * The following macros handle searches, insertions, and deletion in - * the hash table. + * If it isn't pinned, the entry must handled by the + * replacement policy. Update the appropriate replacement + * policy data structures. * - * When modifying these macros, remember to modify the similar macros - * in tst/cache.c + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. * - * Changes: + * Return: N/A * - * - Updated existing index macros and sanity check macros to maintain - * the clean_index_size and dirty_index_size fields of H5C_t. Also - * added macros to allow us to track entry cleans and dirties. + * Programmer: John Mainzer, 8/23/06 * - * JRM -- 11/5/08 + * Modifications: * - ***********************************************************************/ - -/* H5C__HASH_TABLE_LEN is defined in H5Cpkg.h. It mut be a power of two. */ - -#define H5C__HASH_MASK ((size_t)(H5C__HASH_TABLE_LEN - 1) << 3) - -#define H5C__HASH_FCN(x) (int)(((x) & H5C__HASH_MASK) >> 3) - -#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_REMOVE_SC(cache_ptr, entry_ptr) \ -if ( ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ - ( (cache_ptr)->index_len < 1 ) || \ - ( (entry_ptr) == NULL ) || \ - ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ - ( ! H5F_addr_defined((entry_ptr)->addr) ) || \ - ( (entry_ptr)->size <= 0 ) || \ - ( H5C__HASH_FCN((entry_ptr)->addr) < 0 ) || \ - ( H5C__HASH_FCN((entry_ptr)->addr) >= H5C__HASH_TABLE_LEN ) || \ - ( ((cache_ptr)->index)[(H5C__HASH_FCN((entry_ptr)->addr))] \ - == NULL ) || \ - ( ( ((cache_ptr)->index)[(H5C__HASH_FCN((entry_ptr)->addr))] \ - != (entry_ptr) ) && \ - ( (entry_ptr)->ht_prev == NULL ) ) || \ - ( ( ((cache_ptr)->index)[(H5C__HASH_FCN((entry_ptr)->addr))] == \ - (entry_ptr) ) && \ - ( (entry_ptr)->ht_prev != NULL ) ) || \ - ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + \ - (cache_ptr)->dirty_index_size) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Pre HT remove SC failed") \ -} - -/* (Keep in sync w/H5C_TEST__PRE_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ -#define H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) \ -if ( ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ - ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ - ( ! H5F_addr_defined(Addr) ) || \ - ( H5C__HASH_FCN(Addr) < 0 ) || \ - ( H5C__HASH_FCN(Addr) >= H5C__HASH_TABLE_LEN ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "Pre HT search SC failed") \ -} - -/* (Keep in sync w/H5C_TEST__POST_SUC_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ -#define H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) \ -if ( ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ - ( (cache_ptr)->index_len < 1 ) || \ - ( (entry_ptr) == NULL ) || \ - ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ - ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ - ( H5F_addr_ne((entry_ptr)->addr, (Addr)) ) || \ - ( (entry_ptr)->size <= 0 ) || \ - ( ((cache_ptr)->index)[k] == NULL ) || \ - ( ( ((cache_ptr)->index)[k] != (entry_ptr) ) && \ - ( (entry_ptr)->ht_prev == NULL ) ) || \ - ( ( ((cache_ptr)->index)[k] == (entry_ptr) ) && \ - ( (entry_ptr)->ht_prev != NULL ) ) || \ - ( ( (entry_ptr)->ht_prev != NULL ) && \ - ( (entry_ptr)->ht_prev->ht_next != (entry_ptr) ) ) || \ - ( ( (entry_ptr)->ht_next != NULL ) && \ - ( (entry_ptr)->ht_next->ht_prev != (entry_ptr) ) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ - "Post successful HT search SC failed") \ -} - -/* (Keep in sync w/H5C_TEST__POST_HT_SHIFT_TO_FRONT macro in test/cache_common.h -QAK) */ -#define H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) \ -if ( ( (cache_ptr) == NULL ) || \ - ( ((cache_ptr)->index)[k] != (entry_ptr) ) || \ - ( (entry_ptr)->ht_prev != NULL ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ - "Post HT shift to front SC failed") \ -} + * JRM -- 3/28/07 + * Added sanity checks based on the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. + * + *------------------------------------------------------------------------- + */ -#define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) \ -if ( ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->index_len <= 0 ) || \ - ( (cache_ptr)->index_size <= 0 ) || \ - ( (new_size) <= 0 ) || \ - ( (old_size) > (cache_ptr)->index_size ) || \ - ( (new_size) <= 0 ) || \ - ( ( (cache_ptr)->index_len == 1 ) && \ - ( (cache_ptr)->index_size != (old_size) ) ) || \ - ( (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) ) || \ - ( (cache_ptr)->dirty_index_size < (old_size) ) ) ) || \ - ( (entry_ptr) == NULL ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Pre HT entry size change SC failed") \ -} +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr) \ -if ( ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->index_len <= 0 ) || \ - ( (cache_ptr)->index_size <= 0 ) || \ - ( (new_size) > (cache_ptr)->index_size ) || \ - ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + \ - (cache_ptr)->dirty_index_size) ) || \ - ( ( !((entry_ptr)->is_dirty ) || \ - ( (cache_ptr)->dirty_index_size < (new_size) ) ) && \ - ( ( ((entry_ptr)->is_dirty) ) || \ - ( (cache_ptr)->clean_index_size < (new_size) ) ) ) || \ - ( ( (cache_ptr)->index_len == 1 ) && \ - ( (cache_ptr)->index_size != (new_size) ) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Post HT entry size change SC failed") \ -} +#define H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_size) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + HDassert( new_size > 0 ); \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, \ + (entry_ptr)->size, \ + (new_size)); \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* Update the size of the LRU list */ \ + \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, \ + (entry_ptr)->size, \ + (new_size)); \ + \ + /* Similarly, update the size of the clean or dirty LRU list as \ + * appropriate. At present, the entry must be clean, but that \ + * could change. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, \ + (entry_ptr)->size, \ + (new_size)); \ + \ + } else { \ + \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, \ + (entry_ptr)->size, \ + (new_size)); \ + } \ + \ + /* End modified LRU specific code. */ \ + } \ + \ +} /* H5C__UPDATE_RP_FOR_SIZE_CHANGE */ -#define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ -if ( \ - ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ - ( (cache_ptr)->index_len <= 0 ) || \ - ( (entry_ptr) == NULL ) || \ - ( (entry_ptr)->is_dirty != FALSE ) || \ - ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ - ( (cache_ptr)->dirty_index_size < (entry_ptr)->size ) || \ - ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Pre HT update for entry clean SC failed") \ -} +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ -if ( \ - ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ - ( (cache_ptr)->index_len <= 0 ) || \ - ( (entry_ptr) == NULL ) || \ - ( (entry_ptr)->is_dirty != TRUE ) || \ - ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ - ( (cache_ptr)->clean_index_size < (entry_ptr)->size ) || \ - ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Pre HT update for entry dirty SC failed") \ -} +#define H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_size) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + HDassert( new_size > 0 ); \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, \ + (entry_ptr)->size, \ + (new_size)); \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* Update the size of the LRU list */ \ + \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, \ + (entry_ptr)->size, \ + (new_size)); \ + \ + /* End modified LRU specific code. */ \ + } \ + \ +} /* H5C__UPDATE_RP_FOR_SIZE_CHANGE */ -#define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ -if ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Post HT update for entry clean SC failed") \ -} +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ -if ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Post HT update for entry dirty SC failed") \ -} + +/*------------------------------------------------------------------------- + * + * Macro: H5C__UPDATE_RP_FOR_UNPIN + * + * Purpose: Update the replacement policy data structures for an + * unpin of the specified cache entry. + * + * To do this, unlink the specified entry from the protected + * entry list, and re-insert it in the data structures used + * by the current replacement policy. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the macro + * should switch on the current policy and act accordingly. + * + * Return: N/A + * + * Programmer: John Mainzer, 3/22/06 + * + * Modifications: + * + * JRM -- 3/28/07 + * Added sanity checks based on the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. + * + *------------------------------------------------------------------------- + */ -#else /* H5C_DO_SANITY_CHECKS */ +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#define H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) -#define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) -#define H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) -#define H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) -#define H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) -#define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) -#define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) -#define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) -#define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr) -#define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) -#define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) +#define H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->is_pinned); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + /* Regardless of the replacement policy, remove the entry from the \ + * pinned entry list. \ + */ \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + HDassert( (cache_ptr)->pel_len >= 0 ); \ + \ + /* modified LRU specific code */ \ + \ + /* insert the entry at the head of the LRU list. */ \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* Similarly, insert the entry at the head of either the clean \ + * or dirty LRU list as appropriate. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), \ + (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, \ + (fail_val)) \ + \ + } else { \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), \ + (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, \ + (fail_val)) \ + } \ + \ + /* End modified LRU specific code. */ \ + \ +} /* H5C__UPDATE_RP_FOR_UNPIN */ -#endif /* H5C_DO_SANITY_CHECKS */ +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + +#define H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->is_pinned); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + /* Regardless of the replacement policy, remove the entry from the \ + * pinned entry list. \ + */ \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + HDassert( (cache_ptr)->pel_len >= 0 ); \ + \ + /* modified LRU specific code */ \ + \ + /* insert the entry at the head of the LRU list. */ \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + \ +} /* H5C__UPDATE_RP_FOR_UNPIN */ +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, fail_val) \ -{ \ - int k; \ - 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 \ - { \ - (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 ) { \ - (cache_ptr)->dirty_index_size += (entry_ptr)->size; \ - } 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); \ - } \ - H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \ -} + +/*------------------------------------------------------------------------- + * + * Macro: H5C__UPDATE_RP_FOR_UNPROTECT + * + * Purpose: Update the replacement policy data structures for an + * unprotect of the specified cache entry. + * + * To do this, unlink the specified entry from the protected + * list, and re-insert it in the data structures used by the + * current replacement policy. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. + * + * Return: N/A + * + * Programmer: John Mainzer, 5/19/04 + * + * Modifications: + * + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_unprotect() to + * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to + * squeeze a bit more performance out of the cache. + * + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause dificulties with + * pre-processor, I'll have to remove them. + * + * JRM - 7/28/04 + * Split macro into two version, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. + * + * JRM - 3/17/06 + * Modified macro to put pinned entries on the pinned entry + * list instead of inserting them in the data structures + * maintained by the replacement policy. + * + *------------------------------------------------------------------------- + */ -#define H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) \ -{ \ - int k; \ - 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 ) { \ - (cache_ptr)->dirty_index_size -= (entry_ptr)->size; \ - } 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); \ - } \ - H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) \ -} +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + +#define H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( (entry_ptr)->is_protected); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + /* Regardless of the replacement policy, remove the entry from the \ + * protected list. \ + */ \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pl_head_ptr, \ + (cache_ptr)->pl_tail_ptr, (cache_ptr)->pl_len, \ + (cache_ptr)->pl_size, (fail_val)) \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* insert the entry at the head of the LRU list. */ \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* Similarly, insert the entry at the head of either the clean or \ + * dirty LRU list as appropriate. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + \ + } else { \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + } \ + \ + /* End modified LRU specific code. */ \ + } \ + \ +} /* H5C__UPDATE_RP_FOR_UNPROTECT */ -#define H5C__SEARCH_INDEX(cache_ptr, Addr, entry_ptr, fail_val) \ -{ \ - int k; \ - int depth = 0; \ - 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) ) ) \ - { \ - (entry_ptr) = (entry_ptr)->ht_next; \ - (depth)++; \ - } \ - 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)->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); \ - (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \ - (entry_ptr)->ht_prev = NULL; \ - ((cache_ptr)->index)[k] = (entry_ptr); \ - H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) \ - } \ - } \ - H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, (entry_ptr != NULL), depth) \ -} +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__SEARCH_INDEX_NO_STATS(cache_ptr, Addr, entry_ptr, fail_val) \ -{ \ - int k; \ - int depth = 0; \ - 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) ) ) \ - { \ - (entry_ptr) = (entry_ptr)->ht_next; \ - (depth)++; \ - } \ - 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)->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); \ - (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \ - (entry_ptr)->ht_prev = NULL; \ - ((cache_ptr)->index)[k] = (entry_ptr); \ - H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) \ - } \ - } \ -} +#define H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( (entry_ptr)->is_protected); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + /* Regardless of the replacement policy, remove the entry from the \ + * protected list. \ + */ \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pl_head_ptr, \ + (cache_ptr)->pl_tail_ptr, (cache_ptr)->pl_len, \ + (cache_ptr)->pl_size, (fail_val)) \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* insert the entry at the head of the LRU list. */ \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + } \ +} /* H5C__UPDATE_RP_FOR_UNPROTECT */ -#define H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr) \ -{ \ - H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr); \ - (cache_ptr)->dirty_index_size -= (entry_ptr)->size; \ - (cache_ptr)->clean_index_size += (entry_ptr)->size; \ - H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr); \ -} +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr) \ -{ \ - H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \ - (cache_ptr)->clean_index_size -= (entry_ptr)->size; \ - (cache_ptr)->dirty_index_size += (entry_ptr)->size; \ - H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \ -} -#define H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) \ -{ \ - H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) \ - (cache_ptr)->index_size -= (old_size); \ - (cache_ptr)->index_size += (new_size); \ - if ( was_clean ) { \ - (cache_ptr)->clean_index_size -= (old_size); \ - } else { \ - (cache_ptr)->dirty_index_size -= (old_size); \ - } \ - if ( (entry_ptr)->is_dirty ) { \ - (cache_ptr)->dirty_index_size += (new_size); \ - } else { \ - (cache_ptr)->clean_index_size += (new_size); \ - } \ - H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr) \ -} +/****************************/ +/* 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. * - * Skip list insertion and deletion macros: + * 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. * - * These used to be functions, but I converted them to macros to avoid some - * function call overhead. + * 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. * - **************************************************************************/ - -/*------------------------------------------------------------------------- * - * Macro: H5C__INSERT_ENTRY_IN_SLIST + * 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: * - * Purpose: Insert the specified instance of H5C_cache_entry_t into - * the skip list in the specified instance of H5C_t. Update - * the associated length and size fields. + * 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. * - * Return: N/A + * 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. * - * Programmer: John Mainzer, 5/10/04 + * write_permitted: If check_write_permitted is NULL, this boolean flag + * indicates whether writes are permitted. * - * Modifications: + * log_flush: If provided, this function is called whenever a dirty + * entry is flushed to disk. * - * JRM -- 7/21/04 - * Updated function to set the in_tree flag when inserting - * an entry into the tree. Also modified the function to - * update the tree size and len fields instead of the similar - * index fields. * - * All of this is part of the modifications to support the - * hash table. + * 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. * - * JRM -- 7/27/04 - * Converted the function H5C_insert_entry_in_tree() into - * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of - * wringing a little more speed out of the cache. + * 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. * - * Note that we don't bother to check if the entry is already - * in the tree -- if it is, H5SL_insert() will fail. * - * QAK -- 11/27/04 - * Switched over to using skip list routines. + * The cache requires an index to facilitate searching for entries. The + * following fields support that index. * - * JRM -- 6/27/06 - * Added fail_val parameter. + * index_len: Number of entries currently in the hash table used to index + * the cache. * - * JRM -- 8/25/06 - * Added the H5C_DO_SANITY_CHECKS version of the macro. + * index_size: Number of bytes of cache entries currently stored in the + * hash table used to index the cache. * - * This version maintains the slist_len_increase and - * slist_size_increase fields that are used in sanity - * checks in the flush routines. + * 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. * - * All this is needed as the fractal heap needs to be - * able to dirty, resize and/or move entries during the - * flush. + * 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. * - *------------------------------------------------------------------------- - */ - -#if H5C_DO_SANITY_CHECKS - -#define H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( (entry_ptr)->size > 0 ); \ - 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 ) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ - "Can't insert entry in skip list") \ - \ - (entry_ptr)->in_slist = TRUE; \ - (cache_ptr)->slist_len++; \ - (cache_ptr)->slist_size += (entry_ptr)->size; \ - (cache_ptr)->slist_len_increase++; \ - (cache_ptr)->slist_size_increase += (int64_t)((entry_ptr)->size); \ - \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - HDassert( (cache_ptr)->slist_size > 0 ); \ - \ -} /* H5C__INSERT_ENTRY_IN_SLIST */ - -#else /* H5C_DO_SANITY_CHECKS */ - -#define H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( (entry_ptr)->size > 0 ); \ - 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 ) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ - "Can't insert entry in skip list") \ - \ - (entry_ptr)->in_slist = TRUE; \ - (cache_ptr)->slist_len++; \ - (cache_ptr)->slist_size += (entry_ptr)->size; \ - \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - HDassert( (cache_ptr)->slist_size > 0 ); \ - \ -} /* H5C__INSERT_ENTRY_IN_SLIST */ - -#endif /* H5C_DO_SANITY_CHECKS */ - - -/*------------------------------------------------------------------------- + * WARNING: * - * Function: H5C__REMOVE_ENTRY_FROM_SLIST + * 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. * - * Purpose: Remove the specified instance of H5C_cache_entry_t from the - * index skip list in the specified instance of H5C_t. Update - * the associated length and size fields. + * 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. * - * Return: N/A + * 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. * - * Programmer: John Mainzer, 5/10/04 + * WARNING: * - * Modifications: + * 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. * - * JRM -- 7/21/04 - * Updated function for the addition of the hash table. + * 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. * - * JRM - 7/27/04 - * Converted from the function H5C_remove_entry_from_tree() - * to the macro H5C__REMOVE_ENTRY_FROM_TREE in the hopes of - * wringing a little more performance out of the cache. + * 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. * - * QAK -- 11/27/04 - * Switched over to using skip list routines. + * 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. * - * JRM -- 3/28/07 - * Updated sanity checks for the new is_read_only and - * ro_ref_count fields in H5C_cache_entry_t. * - *------------------------------------------------------------------------- - */ - -#define H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - HDassert( (entry_ptr)->in_slist ); \ - HDassert( (cache_ptr)->slist_ptr ); \ - \ - if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \ - != (entry_ptr) ) \ - \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, \ - "Can't delete entry from skip list.") \ - \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - (cache_ptr)->slist_len--; \ - HDassert( (cache_ptr)->slist_size >= (entry_ptr)->size ); \ - (cache_ptr)->slist_size -= (entry_ptr)->size; \ - (entry_ptr)->in_slist = FALSE; \ -} /* H5C__REMOVE_ENTRY_FROM_SLIST */ - - -/*------------------------------------------------------------------------- + * 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. * - * Function: H5C__UPDATE_SLIST_FOR_SIZE_CHANGE + * The following field is maintained to facilitate this. * - * Purpose: Update cache_ptr->slist_size for a change in the size of - * and entry in the slist. + * ignore_tags: Boolean flag to disable tag validation during entry insertion. * - * Return: N/A + * 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. * - * Programmer: John Mainzer, 9/07/05 + * 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) * - * Modifications: + * 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. * - * JRM -- 8/27/06 - * Added the H5C_DO_SANITY_CHECKS version of the macro. + * 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. * - * This version maintains the slist_size_increase field - * that are used in sanity checks in the flush routines. + * slist_len_increase: Number of entries that have been added to the + * slist since the last time this field was set to zero. * - * All this is needed as the fractal heap needs to be - * able to dirty, resize and/or move entries during the - * flush. + * 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. * - *------------------------------------------------------------------------- - */ - -#if H5C_DO_SANITY_CHECKS - -#define H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (old_size) > 0 ); \ - HDassert( (new_size) > 0 ); \ - HDassert( (old_size) <= (cache_ptr)->slist_size ); \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - HDassert( ((cache_ptr)->slist_len > 1) || \ - ( (cache_ptr)->slist_size == (old_size) ) ); \ - \ - (cache_ptr)->slist_size -= (old_size); \ - (cache_ptr)->slist_size += (new_size); \ - \ - (cache_ptr)->slist_size_increase -= (int64_t)(old_size); \ - (cache_ptr)->slist_size_increase += (int64_t)(new_size); \ - \ - HDassert( (new_size) <= (cache_ptr)->slist_size ); \ - HDassert( ( (cache_ptr)->slist_len > 1 ) || \ - ( (cache_ptr)->slist_size == (new_size) ) ); \ -} /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ - -#else /* H5C_DO_SANITY_CHECKS */ - -#define H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (old_size) > 0 ); \ - HDassert( (new_size) > 0 ); \ - HDassert( (old_size) <= (cache_ptr)->slist_size ); \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - HDassert( ((cache_ptr)->slist_len > 1) || \ - ( (cache_ptr)->slist_size == (old_size) ) ); \ - \ - (cache_ptr)->slist_size -= (old_size); \ - (cache_ptr)->slist_size += (new_size); \ - \ - HDassert( (new_size) <= (cache_ptr)->slist_size ); \ - HDassert( ( (cache_ptr)->slist_len > 1 ) || \ - ( (cache_ptr)->slist_size == (new_size) ) ); \ -} /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ - -#endif /* H5C_DO_SANITY_CHECKS */ - - -/************************************************************************** * - * Replacement policy update macros: + * 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). * - * These used to be functions, but I converted them to macros to avoid some - * function call overhead. + * 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. * - * Macro: H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS + * 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. * - * Purpose: For efficiency, we sometimes change the order of flushes -- - * but doing so can confuse the replacement policy. This - * macro exists to allow us to specify an entry as the - * most recently touched so we can repair any such - * confusion. + * This field is NULL if the list is empty. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the macro - * should switch on the current policy and act accordingly. + * 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. * - * Return: N/A + * This field is NULL if the list is empty. * - * Programmer: John Mainzer, 10/13/05 * - * Modifications: + * 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. * - * JRM -- 3/20/06 - * Modified macro to ignore pinned entries. Pinned entries - * do not appear in the data structures maintained by the - * replacement policy code, and thus this macro has nothing - * to do if called for such an entry. + * Pinning an entry has the following implications: * - * JRM -- 3/28/07 - * Added sanity checks using the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * 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). * - *------------------------------------------------------------------------- - */ - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - -#define H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( ! ((entry_ptr)->is_pinned) ) { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list, and re-insert it at the head.\ - */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* Use the dirty flag to infer whether the entry is on the clean or \ - * dirty LRU list, and remove it. Then insert it at the head of \ - * the same LRU list. \ - * \ - * At least initially, all entries should be clean. That may \ - * change, so we may as well deal with both cases now. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - } else { \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - } \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS */ - -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - -#define H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( ! ((entry_ptr)->is_pinned) ) { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list, and re-insert it at the head \ - */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS */ - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - - -/*------------------------------------------------------------------------- + * 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. * - * Macro: H5C__UPDATE_RP_FOR_EVICTION + * 3) A pinned entry can be marked as dirty (and possibly + * change size) while it is unprotected. * - * Purpose: Update the replacement policy data structures for an - * eviction of the specified cache entry. + * 4) The flush-destroy code must allow pinned entries to + * be unpinned (and possibly unprotected) during the + * flush. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * 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. * - * Return: Non-negative on success/Negative on failure. + * Maintaining the pinned entry list requires the following fields: * - * Programmer: John Mainzer, 5/10/04 + * pel_len: Number of entries currently residing on the pinned + * entry list. * - * Modifications: + * pel_size: Number of bytes of cache entries currently residing on + * the pinned entry list. * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_eviction() to the - * macro H5C__UPDATE_RP_FOR_EVICTION in an effort to squeeze - * a bit more performance out of the cache. + * 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. * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause dificulties with - * the pre-processor, I'll have to remove them. + * This field is NULL if the list is empty. * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. + * 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. * - * JRM - 3/20/06 - * Pinned entries can't be evicted, so this entry should never - * be called on a pinned entry. Added assert to verify this. + * This field is NULL if the list is empty. * - * JRM -- 3/28/07 - * Added sanity checks for the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. * - *------------------------------------------------------------------------- - */ - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - -#define H5C__UPDATE_RP_FOR_EVICTION(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( !((entry_ptr)->is_pinned) ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list. */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* If the entry is clean when it is evicted, it should be on the \ - * clean LRU list, if it was dirty, it should be on the dirty LRU list. \ - * Remove it from the appropriate list according to the value of the \ - * dirty flag. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - } else { \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - } \ - \ -} /* H5C__UPDATE_RP_FOR_EVICTION */ - -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - -#define H5C__UPDATE_RP_FOR_EVICTION(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( !((entry_ptr)->is_pinned) ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list. */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ -} /* H5C__UPDATE_RP_FOR_EVICTION */ - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - - -/*------------------------------------------------------------------------- + * The cache must have a replacement policy, and the fields supporting this + * policy must be accessible from this structure. * - * Macro: H5C__UPDATE_RP_FOR_FLUSH + * 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. * - * Purpose: Update the replacement policy data structures for a flush - * of the specified cache entry. + * 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. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. * - * Return: N/A + * Fields supporting the modified LRU policy: * - * Programmer: John Mainzer, 5/6/04 + * See most any OS text for a discussion of the LRU replacement policy. * - * Modifications: + * 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. * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_flush() to the - * macro H5C__UPDATE_RP_FOR_FLUSH in an effort to squeeze - * a bit more performance out of the cache. + * To deal with this issue, I have modified the usual LRU policy by adding + * clean and dirty LRU lists to the usual LRU list. * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause dificulties with - * pre-processor, I'll have to remove them. + * The clean LRU list is simply the regular LRU list with all dirty cache + * entries removed. * - * JRM - 7/28/04 - * Split macro into two versions, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. + * Similarly, the dirty LRU list is the regular LRU list with all the clean + * cache entries removed. * - * JRM - 3/20/06 - * While pinned entries can be flushed, they don't reside in - * the replacement policy data structures when unprotected. - * Thus I modified this macro to do nothing if the entry is - * pinned. + * 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. * - * JRM - 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * We attempt to do this by trying to flush enough entries on each write + * to keep the cLRU_list_size >= min_clean_size. * - *------------------------------------------------------------------------- - */ - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - -#define H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( ! ((entry_ptr)->is_pinned) ) { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list, and re-insert it at the \ - * head. \ - */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* since the entry is being flushed or cleared, one would think \ - * that it must be dirty -- but that need not be the case. Use the \ - * dirty flag to infer whether the entry is on the clean or dirty \ - * LRU list, and remove it. Then insert it at the head of the \ - * clean LRU list. \ - * \ - * The function presumes that a dirty entry will be either cleared \ - * or flushed shortly, so it is OK if we put a dirty entry on the \ - * clean LRU list. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - } else { \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - } \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__UPDATE_RP_FOR_FLUSH */ - -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - -#define H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( ! ((entry_ptr)->is_pinned) ) { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list, and re-insert it at the \ - * head. \ - */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__UPDATE_RP_FOR_FLUSH */ - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - - -/*------------------------------------------------------------------------- + * 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. * - * Macro: H5C__UPDATE_RP_FOR_INSERTION + * Discussions of the individual fields used by the modified LRU replacement + * policy follow: * - * Purpose: Update the replacement policy data structures for an - * insertion of the specified cache entry. + * LRU_list_len: Number of cache entries currently on the LRU list. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * Observe that LRU_list_len + pl_len must always equal + * index_len. * - * Return: N/A + * LRU_list_size: Number of bytes of cache entries currently residing on the + * LRU list. * - * Programmer: John Mainzer, 5/17/04 + * Observe that LRU_list_size + pl_size must always equal + * index_size. * - * Modifications: + * 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. * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_insertion() to the - * macro H5C__UPDATE_RP_FOR_INSERTION in an effort to squeeze - * a bit more performance out of the cache. + * This field is NULL if the list is empty. * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause dificulties with - * pre-processor, I'll have to remove them. + * 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. * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. + * This field is NULL if the list is empty. * - * JRM - 3/10/06 - * This macro should never be called on a pinned entry. - * Inserted an assert to verify this. + * cLRU_list_len: Number of cache entries currently on the clean LRU list. * - * JRM - 8/9/06 - * Not any more. We must now allow insertion of pinned - * entries. Updated macro to support this. + * Observe that cLRU_list_len + dLRU_list_len must always + * equal LRU_list_len. * - * JRM - 3/28/07 - * Added sanity checks using the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * cLRU_list_size: Number of bytes of cache entries currently residing on + * the clean LRU list. * - *------------------------------------------------------------------------- - */ - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - -#define H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* insert the entry at the head of the LRU list. */ \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* insert the entry at the head of the clean or dirty LRU list as \ - * appropriate. \ - */ \ - \ - if ( entry_ptr->is_dirty ) { \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - } else { \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - } \ - \ - /* End modified LRU specific code. */ \ - } \ -} - -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - -#define H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* insert the entry at the head of the LRU list. */ \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ -} - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - - -/*------------------------------------------------------------------------- + * 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. * - * Macro: H5C__UPDATE_RP_FOR_PROTECT + * epoch_marker_ringbuf_first: Integer field containing the index of the + * first entry in the ring buffer. * - * Purpose: Update the replacement policy data structures for a - * protect of the specified cache entry. + * epoch_marker_ringbuf_last: Integer field containing the index of the + * last entry in the ring buffer. * - * To do this, unlink the specified entry from any data - * structures used by the replacement policy, and add the - * entry to the protected list. + * epoch_marker_ringbuf_size: Integer field containing the number of entries + * in the ring buffer. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * 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. * - * Return: N/A + * 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. * - * Programmer: John Mainzer, 5/17/04 + * 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. * - * Modifications: + * All other fields are unused. * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_protect() to the - * macro H5C__UPDATE_RP_FOR_PROTECT in an effort to squeeze - * a bit more performance out of the cache. * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause dificulties with - * pre-processor, I'll have to remove them. + * Cache hit rate collection fields: * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. + * 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. * - * JRM - 3/17/06 - * Modified macro to attempt to remove pinned entriese from - * the pinned entry list instead of from the data structures - * maintained by the replacement policy. + * 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. * - * JRM - 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * 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. * - *------------------------------------------------------------------------- - */ - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - -#define H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - HDassert( (cache_ptr)->pel_len >= 0 ); \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list. */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* Similarly, remove the entry from the clean or dirty LRU list \ - * as appropriate. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - \ - } else { \ - \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - } \ - \ - /* End modified LRU specific code. */ \ - } \ - \ - /* Regardless of the replacement policy, or whether the entry is \ - * pinned, now add the entry to the protected list. \ - */ \ - \ - H5C__DLL_APPEND((entry_ptr), (cache_ptr)->pl_head_ptr, \ - (cache_ptr)->pl_tail_ptr, \ - (cache_ptr)->pl_len, \ - (cache_ptr)->pl_size, (fail_val)) \ -} /* H5C__UPDATE_RP_FOR_PROTECT */ - -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - -#define H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - HDassert( (cache_ptr)->pel_len >= 0 ); \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list. */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ - \ - /* Regardless of the replacement policy, or whether the entry is \ - * pinned, now add the entry to the protected list. \ - */ \ - \ - H5C__DLL_APPEND((entry_ptr), (cache_ptr)->pl_head_ptr, \ - (cache_ptr)->pl_tail_ptr, \ - (cache_ptr)->pl_len, \ - (cache_ptr)->pl_size, (fail_val)) \ -} /* H5C__UPDATE_RP_FOR_PROTECT */ - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - - -/*------------------------------------------------------------------------- * - * Macro: H5C__UPDATE_RP_FOR_MOVE + * 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. * - * Purpose: Update the replacement policy data structures for a - * move of the specified cache entry. + * 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. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * 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. * - * Return: N/A + * 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. * - * Programmer: John Mainzer, 5/17/04 + * 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. * - *------------------------------------------------------------------------- - */ - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - -#define H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( ! ( (entry_ptr)->is_pinned ) ) { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list, and re-insert it at the head. \ - */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* remove the entry from either the clean or dirty LUR list as \ - * indicated by the was_dirty parameter \ - */ \ - if ( was_dirty ) { \ - \ - H5C__AUX_DLL_REMOVE((entry_ptr), \ - (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, \ - (fail_val)) \ - \ - } else { \ - \ - H5C__AUX_DLL_REMOVE((entry_ptr), \ - (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, \ - (fail_val)) \ - } \ - \ - /* insert the entry at the head of either the clean or dirty \ - * LRU list as appropriate. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), \ - (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, \ - (fail_val)) \ - \ - } else { \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), \ - (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, \ - (fail_val)) \ - } \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__UPDATE_RP_FOR_MOVE */ - -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - -#define H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( ! ( (entry_ptr)->is_pinned ) ) { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list, and re-insert it at the head. \ - */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__UPDATE_RP_FOR_MOVE */ - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + * 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. * - * Macro: H5C__UPDATE_RP_FOR_SIZE_CHANGE + * 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. * - * Purpose: Update the replacement policy data structures for a - * size change of the specified cache entry. + * 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. * - * To do this, determine if the entry is pinned. If it is, - * update the size of the pinned entry list. + * 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. * - * If it isn't pinned, the entry must handled by the - * replacement policy. Update the appropriate replacement - * policy data structures. + * 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. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * 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. * - * Return: N/A * - * Programmer: John Mainzer, 8/23/06 + * Fields supporting testing: * - * Modifications: + * prefix Array of char used to prefix debugging output. The + * field is intended to allow marking of output of with + * the processes mpi rank. * - * JRM -- 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * 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; -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + /* 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]); -#define H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_size) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - HDassert( new_size > 0 ); \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, \ - (entry_ptr)->size, \ - (new_size)); \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* Update the size of the LRU list */ \ - \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, \ - (entry_ptr)->size, \ - (new_size)); \ - \ - /* Similarly, update the size of the clean or dirty LRU list as \ - * appropriate. At present, the entry must be clean, but that \ - * could change. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, \ - (entry_ptr)->size, \ - (new_size)); \ - \ - } else { \ - \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, \ - (entry_ptr)->size, \ - (new_size)); \ - } \ - \ - /* End modified LRU specific code. */ \ - } \ - \ -} /* H5C__UPDATE_RP_FOR_SIZE_CHANGE */ + /* Field to disable tag validation */ + hbool_t ignore_tags; -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + 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 */ -#define H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_size) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - HDassert( new_size > 0 ); \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, \ - (entry_ptr)->size, \ - (new_size)); \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* Update the size of the LRU list */ \ - \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, \ - (entry_ptr)->size, \ - (new_size)); \ - \ - /* End modified LRU specific code. */ \ - } \ - \ -} /* H5C__UPDATE_RP_FOR_SIZE_CHANGE */ + /* 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; -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + /* 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; - -/*------------------------------------------------------------------------- - * - * Macro: H5C__UPDATE_RP_FOR_UNPIN - * - * Purpose: Update the replacement policy data structures for an - * unpin of the specified cache entry. - * - * To do this, unlink the specified entry from the protected - * entry list, and re-insert it in the data structures used - * by the current replacement policy. - * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the macro - * should switch on the current policy and act accordingly. - * - * Return: N/A - * - * Programmer: John Mainzer, 3/22/06 - * - * Modifications: - * - * JRM -- 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. - * - *------------------------------------------------------------------------- - */ + /* 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; -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + /* 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; -#define H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->is_pinned); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - /* Regardless of the replacement policy, remove the entry from the \ - * pinned entry list. \ - */ \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - HDassert( (cache_ptr)->pel_len >= 0 ); \ - \ - /* modified LRU specific code */ \ - \ - /* insert the entry at the head of the LRU list. */ \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* Similarly, insert the entry at the head of either the clean \ - * or dirty LRU list as appropriate. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), \ - (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, \ - (fail_val)) \ - \ - } else { \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), \ - (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, \ - (fail_val)) \ - } \ - \ - /* End modified LRU specific code. */ \ - \ -} /* H5C__UPDATE_RP_FOR_UNPIN */ + /* Fields for in-order skip list */ + int32_t max_slist_len; + size_t max_slist_size; -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + /* Fields for protected entry list */ + int32_t max_pl_len; + size_t max_pl_size; -#define H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->is_pinned); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - /* Regardless of the replacement policy, remove the entry from the \ - * pinned entry list. \ - */ \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - HDassert( (cache_ptr)->pel_len >= 0 ); \ - \ - /* modified LRU specific code */ \ - \ - /* insert the entry at the head of the LRU list. */ \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - \ -} /* H5C__UPDATE_RP_FOR_UNPIN */ + /* Fields for pinned entry list */ + int32_t max_pel_len; + size_t max_pel_size; -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + /* 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; - -/*------------------------------------------------------------------------- - * - * Macro: H5C__UPDATE_RP_FOR_UNPROTECT - * - * Purpose: Update the replacement policy data structures for an - * unprotect of the specified cache entry. - * - * To do this, unlink the specified entry from the protected - * list, and re-insert it in the data structures used by the - * current replacement policy. - * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. - * - * Return: N/A - * - * Programmer: John Mainzer, 5/19/04 - * - * Modifications: - * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_unprotect() to - * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to - * squeeze a bit more performance out of the cache. - * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause dificulties with - * pre-processor, I'll have to remove them. - * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. - * - * JRM - 3/17/06 - * Modified macro to put pinned entries on the pinned entry - * list instead of inserting them in the data structures - * maintained by the replacement policy. - * - *------------------------------------------------------------------------- - */ +#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 */ -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + char prefix[H5C__PREFIX_LEN]; -#define H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( (entry_ptr)->is_protected); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - /* Regardless of the replacement policy, remove the entry from the \ - * protected list. \ - */ \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pl_head_ptr, \ - (cache_ptr)->pl_tail_ptr, (cache_ptr)->pl_len, \ - (cache_ptr)->pl_size, (fail_val)) \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* insert the entry at the head of the LRU list. */ \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* Similarly, insert the entry at the head of either the clean or \ - * dirty LRU list as appropriate. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - \ - } else { \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - } \ - \ - /* End modified LRU specific code. */ \ - } \ - \ -} /* H5C__UPDATE_RP_FOR_UNPROTECT */ +#ifndef NDEBUG + int64_t get_entry_ptr_from_addr_counter; +#endif /* NDEBUG */ +}; -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ +/*****************************/ +/* Package Private Variables */ +/*****************************/ -#define H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( (entry_ptr)->is_protected); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - /* Regardless of the replacement policy, remove the entry from the \ - * protected list. \ - */ \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pl_head_ptr, \ - (cache_ptr)->pl_tail_ptr, (cache_ptr)->pl_len, \ - (cache_ptr)->pl_size, (fail_val)) \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* insert the entry at the head of the LRU list. */ \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__UPDATE_RP_FOR_UNPROTECT */ -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ +/******************************/ +/* Package Private Prototypes */ +/******************************/ #endif /* _H5Cpkg_H */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 301dd19..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,47 +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, - 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); - -/* 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); /**************************************************************************** * @@ -578,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; @@ -613,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 @@ -886,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, @@ -934,301 +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); - +/***************************************/ +/* 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_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/test/cache.c b/test/cache.c index 9bf225e..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,20 +255,20 @@ 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, /* lag */ lag, @@ -287,7 +286,7 @@ 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, /* lag */ lag, @@ -305,7 +304,7 @@ 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, /* lag */ lag, @@ -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,7 +333,7 @@ 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, /* lag */ lag, @@ -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,7 +357,7 @@ 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, /* lag */ lag, @@ -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,20 +439,20 @@ 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, /* lag */ lag, @@ -472,7 +470,7 @@ 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, /* lag */ lag, @@ -490,7 +488,7 @@ 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, /* lag */ lag, @@ -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,7 +517,7 @@ 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, /* lag */ lag, @@ -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,7 +541,7 @@ 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, /* lag */ lag, @@ -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,20 +622,20 @@ 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, /* lag */ lag, @@ -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,20 +806,20 @@ 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, /* lag */ lag, @@ -841,7 +837,7 @@ 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, /* lag */ lag, @@ -859,7 +855,7 @@ 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, /* lag */ lag, @@ -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,7 +884,7 @@ 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, /* lag */ lag, @@ -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,7 +908,7 @@ 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, /* lag */ lag, @@ -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; @@ -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 3c0871f..6953d17 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; @@ -2885,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; @@ -3032,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; @@ -3058,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; @@ -3086,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)) @@ -3101,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); @@ -3123,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 { @@ -3141,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 { @@ -3160,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 { @@ -3182,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 { @@ -3200,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 { @@ -3221,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 { @@ -3250,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 { @@ -3269,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 { @@ -3290,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 { @@ -3311,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 { @@ -3330,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 ) || @@ -3352,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 ) { @@ -3371,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 4abc0f4..60ab827 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -2391,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; @@ -2405,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; @@ -2422,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 ) ) { @@ -2444,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 { @@ -2455,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. @@ -2473,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 ) { @@ -2494,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 { @@ -2507,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); } } } @@ -2515,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 ) { @@ -2567,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 ) { @@ -2577,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 ) { @@ -2586,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 */ @@ -2606,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 ) { @@ -2620,7 +2619,7 @@ setup_cache(size_t max_cache_size, if ( verbose ) { HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n", - fcn_name); + FUNC); } } @@ -2629,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 ) { @@ -2642,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() */ @@ -2762,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; @@ -2825,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(); @@ -2861,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), @@ -3579,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 ) { @@ -3871,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; @@ -3880,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 ) { @@ -3983,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 ) { @@ -4269,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; @@ -4278,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 ) { @@ -4376,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 ) { @@ -4477,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; @@ -4486,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 ) { @@ -4594,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 ) { @@ -4620,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 ) ) @@ -4668,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 ) ) { @@ -4676,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; @@ -4708,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 ) { @@ -5101,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."; @@ -5294,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); @@ -5304,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); @@ -5314,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); @@ -5332,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 be3195b..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 */ 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; imagic != MSSG_MAGIC ) { @@ -1048,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 ) { @@ -1057,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); } } } @@ -1092,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; @@ -1111,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); } } @@ -1133,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); } } } @@ -1160,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; @@ -1186,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 { @@ -1208,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); } } } @@ -1223,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); } } } @@ -1250,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; @@ -1262,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); } } @@ -1292,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; @@ -1319,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); } } @@ -1330,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); } } @@ -1369,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; @@ -1381,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); } } @@ -1401,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: @@ -1411,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: @@ -1421,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: @@ -1431,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: @@ -1441,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: @@ -1451,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: @@ -1461,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: @@ -1471,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: @@ -1484,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; } } @@ -1516,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; @@ -1531,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); } } @@ -1546,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 ) { @@ -1555,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) ) { @@ -1565,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); @@ -1644,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; @@ -1657,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); } } @@ -1719,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; @@ -1737,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); } } @@ -1752,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 ) { @@ -1761,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); } } @@ -1778,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); } } @@ -1862,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; @@ -1875,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); } } @@ -1942,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; @@ -1955,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); } } @@ -2022,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; @@ -2037,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); } } @@ -2052,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 { @@ -2120,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; @@ -2135,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); } } @@ -2150,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 { @@ -2217,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; @@ -2230,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); } } @@ -2417,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; @@ -2464,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 ) { @@ -2490,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 @@ -2512,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 ) || @@ -2526,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); } } } @@ -2575,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; @@ -2610,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); } } @@ -2622,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); } } } @@ -2641,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); } @@ -2684,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 */ @@ -2800,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; @@ -2825,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); } } @@ -2840,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); } } } @@ -2884,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; @@ -2916,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); } } @@ -2939,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)); } } @@ -2988,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 ) { @@ -3057,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 ) { @@ -3101,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 ) { @@ -3144,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; @@ -3204,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; @@ -3249,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 ) { @@ -3297,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; @@ -3323,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 { @@ -3355,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; @@ -3380,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 ) ) @@ -3413,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; @@ -3480,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; @@ -3506,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); } } @@ -3554,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; @@ -3617,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 { @@ -3644,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)); } } @@ -3675,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; @@ -3698,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); } } } @@ -3711,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 ) || @@ -3727,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); } } } @@ -3756,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; @@ -3783,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 { @@ -3831,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; @@ -3850,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 *)H5I_object_verify(fid, H5I_FILE); @@ -3866,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; @@ -3876,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; @@ -3902,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 { @@ -3914,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); } } } @@ -3936,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 ) { @@ -3945,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 ) { @@ -3954,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); } } } @@ -3972,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 ) { @@ -3983,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); } } } @@ -3999,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); } } } @@ -4014,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); } } } @@ -4055,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; @@ -4076,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); } } } @@ -4103,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); } } } @@ -4119,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); } } @@ -4143,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); } } } @@ -4175,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}; @@ -4190,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); @@ -4201,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); @@ -4238,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 */ @@ -4247,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 ) { @@ -4257,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 { @@ -4297,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; @@ -4321,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); } } } @@ -4334,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); } } } @@ -4353,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 { @@ -4370,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); } } @@ -4405,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; @@ -4429,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); } } } @@ -4442,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); } } } @@ -4461,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 { @@ -4478,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); } } @@ -4511,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; @@ -4535,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); } } } @@ -4548,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 ) || @@ -4562,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 { @@ -4579,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); } @@ -4613,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; @@ -4637,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); } } } @@ -4650,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 ) || @@ -4664,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 { @@ -4681,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); } } @@ -4715,7 +4670,6 @@ 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; @@ -4750,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 { @@ -4803,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; @@ -4848,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); } } } @@ -4892,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; @@ -4914,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); } } } @@ -4936,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); } } @@ -4952,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); } } } @@ -4972,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); } } } @@ -4988,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); } } @@ -5021,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); } } @@ -5045,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); } } } @@ -5060,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); } } } @@ -5080,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); } } } @@ -5092,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); } } @@ -5124,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); } } @@ -5141,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); } } @@ -5173,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); } } @@ -5197,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); } } } @@ -5241,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; @@ -5283,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); } } } @@ -5297,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); } } @@ -5335,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); } } } @@ -5370,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); } } } @@ -5417,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; @@ -5459,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); } } } @@ -5473,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); } } @@ -5558,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); } } } @@ -5593,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); } } } @@ -5643,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; @@ -5689,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); } } } @@ -5703,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); } } @@ -5768,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); } } @@ -5882,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); } } } @@ -5918,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); } } } @@ -5968,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; @@ -6014,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); } } } @@ -6028,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); } } @@ -6104,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); } } @@ -6200,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); } } } @@ -6236,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); } } } @@ -6281,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; @@ -6324,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); } } } @@ -6339,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); } } @@ -6353,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); } } @@ -6411,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); } } } @@ -6446,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); } } } @@ -6520,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[] = { @@ -6643,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); } } } @@ -6658,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); } } @@ -6672,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 { @@ -6685,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); } } } @@ -6721,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); } } @@ -6735,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 { @@ -6749,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); } } } @@ -6761,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); } } } @@ -6796,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); } } } @@ -6811,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); } } } @@ -6848,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 { @@ -6920,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; @@ -6999,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); } } @@ -7008,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); } } @@ -7021,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; } @@ -7032,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); } } @@ -7044,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); } } @@ -7053,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); } } } -- cgit v0.12 From f34bdad87c4af43bd09a6b9e6f8859cb268ce6ec Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Mon, 15 Jun 2015 13:35:00 -0500 Subject: [svn-r27206] fix for HDFFV-9418. - Moving truncate to H5F_flush() where it was done a long time ago. - Add a second H5AC_flush() call after the truncate is done to make sure we write the correct EOA. tested with h5committest --- src/H5Fint.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/H5Fint.c b/src/H5Fint.c index e012ba6..94d76cc 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -857,14 +857,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*/ @@ -1182,6 +1174,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, (unsigned)TRUE) < 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))) -- cgit v0.12 From afb85e30e5874454fe890bb06c1a8cc67d2dc245 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Mon, 15 Jun 2015 14:29:30 -0500 Subject: [svn-r27207] use "closing" flag instead of always TRUE in the truncate call. --- src/H5Fint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Fint.c b/src/H5Fint.c index 94d76cc..df8e886 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1175,7 +1175,7 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, hbool_t closing) 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, (unsigned)TRUE) < 0) + 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. */ -- cgit v0.12 From 6e9e9e0dd200979642de8d2a2bce2f66f9728237 Mon Sep 17 00:00:00 2001 From: Barbara Jones Date: Tue, 16 Jun 2015 13:32:04 -0500 Subject: [svn-r27216] The comments in this example were incorrect regarding the resulting dataset. They were updated to match the output of the file. (HDFFV-637) --- examples/h5_extend_write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/h5_extend_write.c b/examples/h5_extend_write.c index 74f6c01..56bd025 100644 --- a/examples/h5_extend_write.c +++ b/examples/h5_extend_write.c @@ -165,9 +165,9 @@ main (void) /* * Resulting dataset * - * 3 3 3 2 2 - * 3 3 3 2 2 - * 3 3 3 0 0 + * 1 1 1 3 3 + * 1 1 1 3 3 + * 1 1 1 0 0 * 2 0 0 0 0 * 2 0 0 0 0 * 2 0 0 0 0 -- cgit v0.12 From f30ab55f41296667eab0b273132ffc20c4323717 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 17 Jun 2015 19:58:49 -0500 Subject: [svn-r27237] Description: Merge v3 metadata cache changes to trunk. Yay! :-) Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.x (jam) w/serial & parallel (daily tested on branch) --- src/H5AC.c | 98 +- src/H5ACpkg.h | 6 + src/H5ACprivate.h | 108 +- src/H5B.c | 34 +- src/H5B2.c | 23 +- src/H5B2cache.c | 967 +++--- src/H5B2dbg.c | 13 +- src/H5B2int.c | 94 +- src/H5B2pkg.h | 11 +- src/H5B2test.c | 4 +- src/H5Bcache.c | 363 +- src/H5Bdbg.c | 6 +- src/H5C.c | 3235 +++++++++++++----- src/H5Cpkg.h | 272 +- src/H5Cprivate.h | 1120 ++++++- src/H5Dlayout.c | 2 +- src/H5EA.c | 31 +- src/H5EAcache.c | 2043 ++++++------ src/H5EAdbg.c | 14 +- src/H5EAdblkpage.c | 8 +- src/H5EAdblock.c | 10 +- src/H5EAhdr.c | 13 +- src/H5EAiblock.c | 10 +- src/H5EApkg.h | 23 +- src/H5EAsblock.c | 11 +- src/H5FA.c | 16 +- src/H5FAcache.c | 1099 +++--- src/H5FAdbg.c | 8 +- src/H5FAdblkpage.c | 8 +- src/H5FAdblock.c | 10 +- src/H5FAhdr.c | 13 +- src/H5FApkg.h | 15 +- src/H5FDfamily.c | 2 +- src/H5FDpublic.h | 6 +- src/H5FS.c | 23 +- src/H5FScache.c | 1397 ++++---- src/H5FSdbg.c | 4 +- src/H5FSpkg.h | 4 +- src/H5FSsection.c | 33 +- src/H5Fint.c | 8 + src/H5Fpkg.h | 55 +- src/H5Fsuper.c | 463 ++- src/H5Fsuper_cache.c | 1439 ++++---- src/H5Gcache.c | 400 +-- src/H5Gent.c | 2 +- src/H5Gnode.c | 24 +- src/H5Gstab.c | 22 +- src/H5Gtest.c | 6 +- src/H5HF.c | 8 +- src/H5HFcache.c | 2432 ++++++++------ src/H5HFdbg.c | 12 +- src/H5HFdblock.c | 27 +- src/H5HFhdr.c | 11 +- src/H5HFiblock.c | 38 +- src/H5HFiter.c | 2 +- src/H5HFman.c | 20 +- src/H5HFpkg.h | 35 +- src/H5HFsection.c | 12 +- src/H5HG.c | 17 +- src/H5HGcache.c | 498 +-- src/H5HGdbg.c | 2 +- src/H5HGpkg.h | 2 +- src/H5HL.c | 25 +- src/H5HLcache.c | 778 +++-- src/H5HLdbg.c | 2 +- src/H5HLpkg.h | 4 + src/H5HLprivate.h | 2 +- src/H5O.c | 39 +- src/H5Oattribute.c | 10 +- src/H5Ocache.c | 1029 +++--- src/H5Ochunk.c | 6 +- src/H5Ocopy.c | 2 +- src/H5Odbg.c | 2 +- src/H5Oefl.c | 6 +- src/H5Omessage.c | 14 +- src/H5Oprivate.h | 4 +- src/H5Otest.c | 14 +- src/H5SM.c | 30 +- src/H5SMcache.c | 781 +++-- src/H5SMtest.c | 2 +- test/cache.c | 9063 +++++++++++++++++++++++++++++++------------------- test/cache_api.c | 3 + test/cache_common.c | 2326 ++++++++----- test/cache_common.h | 88 +- test/cache_tagging.c | 6 +- test/earray.c | 335 +- test/lheap.c | 4 +- test/ohdr.c | 6 +- testpar/t_cache.c | 911 +++-- 89 files changed, 19349 insertions(+), 12835 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index db5a06f..c6b0b47 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -128,8 +128,7 @@ 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__receive_and_apply_clean_list(H5F_t *f, hid_t 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); @@ -201,6 +200,7 @@ static const char *H5AC_entry_type_names[H5AC_NTYPES] = "fixed array data block", "fixed array data block pages", "superblock", + "driver info", "test entry" /* for testing only -- not used for actual files */ }; @@ -575,7 +575,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) #endif /* H5_HAVE_PARALLEL */ /* Destroy the cache */ - if(H5C_dest(f, dxpl_id, H5AC_dxpl_id) < 0) + if(H5C_dest(f, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't destroy cache") f->shared->cache = NULL; @@ -628,8 +628,7 @@ H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, HDassert(f->shared); HDassert(f->shared->cache); HDassert(type); - HDassert(type->clear); - HDassert(type->dest); + HDassert(type->serialize); HDassert(H5F_addr_defined(addr)); #if H5AC__TRACE_FILE_ENABLED @@ -645,7 +644,7 @@ H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, } #endif /* H5AC__TRACE_FILE_ENABLED */ - if(H5C_expunge_entry(f, dxpl_id, H5AC_dxpl_id, type, addr, flags) < 0) + if(H5C_expunge_entry(f, dxpl_id, type, addr, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_expunge_entry() failed.") done: @@ -710,7 +709,7 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id) /* 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) + if(H5C_flush_cache(f, dxpl_id, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache.") done: @@ -818,8 +817,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add HDassert(f->shared); HDassert(f->shared->cache); HDassert(type); - HDassert(type->flush); - HDassert(type->size); + HDassert(type->serialize); HDassert(H5F_addr_defined(addr)); HDassert(thing); @@ -841,7 +839,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add #endif /* H5AC__TRACE_FILE_ENABLED */ /* Insert entry into metadata cache */ - if(H5C_insert_entry(f, dxpl_id, H5AC_dxpl_id, type, addr, thing, flags) < 0) + if(H5C_insert_entry(f, dxpl_id, type, addr, thing, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C_insert_entry() failed") #if H5AC__TRACE_FILE_ENABLED @@ -1138,9 +1136,8 @@ 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) + void *udata, unsigned flags) { - unsigned protect_flags = H5C__NO_FLAGS_SET; void * thing; /* Pointer to native data structure for entry */ #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -1156,47 +1153,36 @@ H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, HDassert(f->shared); HDassert(f->shared->cache); HDassert(type); - HDassert(type->flush); - HDassert(type->load); + HDassert(type->serialize); HDassert(H5F_addr_defined(addr)); + /* Check for unexpected flags -- H5C__FLUSH_COLLECTIVELY_FLAG + * only permitted in the parallel case. + */ +#ifdef H5_HAVE_PARALLEL + HDassert(0 == (flags & (unsigned)(~(H5C__READ_ONLY_FLAG | \ + H5C__FLUSH_LAST_FLAG | \ + H5C__FLUSH_COLLECTIVELY_FLAG)))); +#else /* H5_HAVE_PARALLEL */ + HDassert(0 == (flags & (unsigned)(~(H5C__READ_ONLY_FLAG | \ + H5C__FLUSH_LAST_FLAG)))); +#endif /* H5_HAVE_PARALLEL */ + /* Check for invalid access request */ - if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR) && rw == H5AC_WRITE) + if((0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) && (0 == (flags & H5C__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "no write intent on file") #if H5AC__TRACE_FILE_ENABLED - /* For the protect call, only the addr and type id is really necessary - * in the trace file. Include the size of the entry protected as a - * sanity check. Also indicate whether the call was successful to - * catch occult errors. + /* For the protect call, only the addr, size, type id, and flags are + * necessary in the trace file. Also indicate whether the call was + * successful to catch occult errors. */ - if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr))) { - - const char * rw_string; - - if ( rw == H5AC_WRITE ) { - - rw_string = "H5AC_WRITE"; - - } else if ( rw == H5AC_READ ) { - - rw_string = "H5AC_READ"; - - } else { - - rw_string = "???"; - } - - sprintf(trace, "%s 0x%lx %d %s", FUNC, (unsigned long)addr, - (int)(type->id), rw_string); - } + if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr))) + sprintf(trace, "%s 0x%lx %d 0x%x", FUNC, (unsigned long)addr, + (int)(type->id), flags); #endif /* H5AC__TRACE_FILE_ENABLED */ - if ( rw == H5AC_READ ) - protect_flags |= H5C__READ_ONLY_FLAG; - - if(NULL == (thing = H5C_protect(f, dxpl_id, H5AC_dxpl_id, type, addr, udata, protect_flags))) - + if(NULL == (thing = H5C_protect(f, dxpl_id, type, addr, udata, flags))) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_protect() failed.") #if H5AC__TRACE_FILE_ENABLED @@ -1438,8 +1424,8 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, HDassert(f->shared); HDassert(f->shared->cache); HDassert(type); - HDassert(type->clear); - HDassert(type->flush); + HDassert(type->deserialize); + HDassert(type->image_len); HDassert(H5F_addr_defined(addr)); HDassert(thing); HDassert( ((H5AC_info_t *)thing)->addr == addr ); @@ -1462,9 +1448,11 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, * the entry. */ if(dirtied && !deleted) { + hbool_t curr_compressed = FALSE; /* dummy for call */ size_t curr_size = 0; + size_t curr_compressed_size = 0; /* dummy for call */ - if((type->size)(f, thing, &curr_size) < 0) + if((type->image_len)(thing, &curr_size, &curr_compressed, &curr_compressed_size) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing") if(((H5AC_info_t *)thing)->size != curr_size) @@ -1483,7 +1471,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, } /* end if */ #endif /* H5_HAVE_PARALLEL */ - if(H5C_unprotect(f, dxpl_id, H5AC_dxpl_id, type, addr, thing, flags) < 0) + if(H5C_unprotect(f, dxpl_id, type, addr, thing, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5C_unprotect() failed.") #ifdef H5_HAVE_PARALLEL @@ -3419,7 +3407,7 @@ H5AC__propagate_and_apply_candidate_list(H5F_t *f, hid_t dxpl_id) aux_ptr->write_permitted = TRUE; /* Apply the candidate list */ - result = H5C_apply_candidate_list(f, dxpl_id, dxpl_id, cache_ptr, num_candidates, + result = H5C_apply_candidate_list(f, dxpl_id, cache_ptr, num_candidates, candidates_list_ptr, aux_ptr->mpi_rank, aux_ptr->mpi_size); /* Disable writes again */ @@ -3563,7 +3551,7 @@ H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f, hid_t dxpl_id) 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) < 0) + if(H5AC__receive_and_apply_clean_list(f, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't receive and/or process clean slist broadcast.") } /* end else */ @@ -3667,7 +3655,7 @@ done: */ #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__receive_and_apply_clean_list(H5F_t *f, hid_t dxpl_id) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -3693,7 +3681,7 @@ H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t primary_dxpl_id, hid_t second 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) + if(H5C_mark_entries_as_clean(f, dxpl_id, (int32_t)num_entries, haddr_buf_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't mark entries clean.") /* if it is defined, call the sync point done callback. Note @@ -3860,7 +3848,7 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id) aux_ptr->write_permitted = TRUE; /* Apply the candidate list */ - result = H5C_apply_candidate_list(f, dxpl_id, dxpl_id, cache_ptr, num_entries, + result = H5C_apply_candidate_list(f, dxpl_id, cache_ptr, num_entries, haddr_buf_ptr, aux_ptr->mpi_rank, aux_ptr->mpi_size); /* Disable writes again */ @@ -4073,7 +4061,7 @@ H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id) aux_ptr->write_permitted = TRUE; /* Flush the cache */ - result = H5C_flush_cache(f, dxpl_id, dxpl_id, H5AC__NO_FLAGS_SET); + result = H5C_flush_cache(f, dxpl_id, H5AC__NO_FLAGS_SET); /* Disable writes again */ aux_ptr->write_permitted = FALSE; @@ -4197,7 +4185,7 @@ H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f, hid_t dxpl_id) aux_ptr->write_permitted = TRUE; /* Flush the cache */ - result = H5C_flush_to_min_clean(f, dxpl_id, H5AC_dxpl_id); + result = H5C_flush_to_min_clean(f, dxpl_id); /* Disable writes again */ aux_ptr->write_permitted = FALSE; diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index 950bdea..28965d2 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -392,6 +392,12 @@ typedef struct H5AC_aux_t } H5AC_aux_t; /* struct H5AC_aux_t */ +/* Package scoped functions */ +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)); + #endif /* H5_HAVE_PARALLEL */ #endif /* _H5ACpkg_H */ diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index a4e7c5a..584ce9d 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -79,6 +79,7 @@ typedef enum { H5AC_FARRAY_DBLOCK_ID, /*fixed array data block */ H5AC_FARRAY_DBLK_PAGE_ID, /*fixed array data block page */ H5AC_SUPERBLOCK_ID, /* file superblock */ + H5AC_DRVRINFO_ID, /* driver info block (supplements superblock)*/ H5AC_TEST_ID, /*test entry -- not used for actual files */ H5AC_NTYPES /* Number of types, must be last */ } H5AC_type_t; @@ -91,6 +92,17 @@ typedef enum { * times for debugging purposes. * * Hence the following, somewhat odd set of #defines. + * + * NOTE: test/cache plays games with the f->shared->cache, and thus + * setting H5AC_DUMP_STATS_ON_CLOSE will generate constant, + * irrelevant data when run with that test program. See + * comments on setup_cache() / takedown_cache() in test/cache_common.c. + * for details. + * + * If you need to dump stats at file close in test/cache.c, + * use the dump_stats parameter to takedown_cache(), or call + * H5C_stats() directly. + * JRM -- 4/12/15 */ #if H5C_COLLECT_CACHE_STATS @@ -113,81 +125,48 @@ typedef enum { /* * Class methods pertaining to caching. Each type of cached object will * have a constant variable with permanent life-span that describes how - * to cache the object. That variable will be of type H5AC_class_t and - * have the following required fields... - * - * LOAD: Loads an object from disk to memory. The function - * should allocate some data structure and return it. - * - * FLUSH: Writes some data structure back to disk. It would be - * wise for the data structure to include dirty flags to - * indicate whether it really needs to be written. This - * function is also responsible for freeing memory allocated - * by the LOAD method if the DEST argument is non-zero (by - * calling the DEST method). - * - * DEST: Just frees memory allocated by the LOAD method. - * - * CLEAR: Just marks object as non-dirty. - * - * NOTIFY: Notify client that an action on an entry has taken/will take - * place - * - * SIZE: Report the size (on disk) of the specified cache object. - * Note that the space allocated on disk may not be contiguous. + * to cache the object. */ -#define H5AC_CALLBACK__NO_FLAGS_SET H5C_CALLBACK__NO_FLAGS_SET -#define H5AC_CALLBACK__SIZE_CHANGED_FLAG H5C_CALLBACK__SIZE_CHANGED_FLAG -#define H5AC_CALLBACK__MOVED_FLAG H5C_CALLBACK__MOVED_FLAG +#define H5AC__SERIALIZE_RESIZED_FLAG H5C__SERIALIZE_RESIZED_FLAG +#define H5AC__SERIALIZE_MOVED_FLAG H5C__SERIALIZE_MOVED_FLAG +#define H5AC__SERIALIZE_COMPRESSED_FLAG H5C__SERIALIZE_COMPRESSED_FLAG /* Aliases for 'notify action' type & values */ typedef H5C_notify_action_t H5AC_notify_action_t; #define H5AC_NOTIFY_ACTION_AFTER_INSERT H5C_NOTIFY_ACTION_AFTER_INSERT +#define H5AC_NOTIFY_ACTION_AFTER_LOAD H5C_NOTIFY_ACTION_AFTER_LOAD +#define H5AC_NOTIFY_ACTION_AFTER_FLUSH H5C_NOTIFY_ACTION_AFTER_FLUSH #define H5AC_NOTIFY_ACTION_BEFORE_EVICT H5C_NOTIFY_ACTION_BEFORE_EVICT -typedef H5C_load_func_t H5AC_load_func_t; -typedef H5C_flush_func_t H5AC_flush_func_t; -typedef H5C_dest_func_t H5AC_dest_func_t; -typedef H5C_clear_func_t H5AC_clear_func_t; -typedef H5C_notify_func_t H5AC_notify_func_t; -typedef H5C_size_func_t H5AC_size_func_t; +#define H5AC__CLASS_NO_FLAGS_SET H5C__CLASS_NO_FLAGS_SET +#define H5AC__CLASS_SPECULATIVE_LOAD_FLAG H5C__CLASS_SPECULATIVE_LOAD_FLAG +#define H5AC__CLASS_COMPRESSED_FLAG H5C__CLASS_COMPRESSED_FLAG -typedef H5C_class_t H5AC_class_t; +/* The following flags should only appear in test code */ +#define H5AC__CLASS_NO_IO_FLAG H5C__CLASS_NO_IO_FLAG +#define H5AC__CLASS_SKIP_READS H5C__CLASS_SKIP_READS +#define H5AC__CLASS_SKIP_WRITES H5C__CLASS_SKIP_WRITES +typedef H5C_get_load_size_func_t H5AC_get_load_size_func_t; +typedef H5C_deserialize_func_t H5AC_deserialize_func_t; +typedef H5C_image_len_func_t H5AC_image_len_func_t; -/* The H5AC_NSLOTS #define is now obsolete, as the metadata cache no longer - * uses slots. However I am leaving it in for now to avoid modifying the - * interface between the metadata cache and the rest of HDF. It should - * be removed when we get to dealing with the size_hint parameter in - * H5AC_create(). - * JRM - 5/20/04 - * - * Old comment on H5AC_NSLOTS follows: - * - * A cache has a certain number of entries. Objects are mapped into a - * cache entry by hashing the object's file address. Each file has its - * own cache, an array of slots. - */ -#define H5AC_NSLOTS 10330 /* The library "likes" this number... */ - - -typedef H5C_cache_entry_t H5AC_info_t; +#define H5AC__SERIALIZE_NO_FLAGS_SET H5C__SERIALIZE_NO_FLAGS_SET +#define H5AC__SERIALIZE_RESIZED_FLAG H5C__SERIALIZE_RESIZED_FLAG +#define H5AC__SERIALIZE_MOVED_FLAG H5C__SERIALIZE_MOVED_FLAG +typedef H5C_pre_serialize_func_t H5AC_pre_serialize_func_t; +typedef H5C_serialize_func_t H5AC_serialize_func_t; +typedef H5C_notify_func_t H5AC_notify_func_t; +typedef H5C_free_icr_func_t H5AC_free_icr_func_t; +typedef H5C_clear_func_t H5AC_clear_func_t; +typedef H5C_get_fsf_size_t H5AC_get_fsf_size_t; -/*===----------------------------------------------------------------------=== - * Protect Types - *===----------------------------------------------------------------------=== - * - * These are for the wrapper functions to H5AC_protect. They specify what - * type of operation you're planning on doing to the metadata. The - * Flexible Parallel HDF5 locking can then act accordingly. - */ +typedef H5C_class_t H5AC_class_t; -typedef enum H5AC_protect_t { - H5AC_WRITE, /* Protect object for writing */ - H5AC_READ /* Protect object for reading */ -} H5AC_protect_t; +/* Cache entry info */ +typedef H5C_cache_entry_t H5AC_info_t; /* Typedef for metadata cache (defined in H5Cpkg.h) */ @@ -317,6 +296,7 @@ H5_DLLVAR hid_t H5AC_ind_dxpl_id; #define H5AC__FLUSH_CLEAR_ONLY_FLAG H5C__FLUSH_CLEAR_ONLY_FLAG #define H5AC__FLUSH_MARKED_ENTRIES_FLAG H5C__FLUSH_MARKED_ENTRIES_FLAG #define H5AC__FLUSH_IGNORE_PROTECTED_FLAG H5C__FLUSH_IGNORE_PROTECTED_FLAG +#define H5AC__READ_ONLY_FLAG H5C__READ_ONLY_FLAG #define H5AC__FREE_FILE_SPACE_FLAG H5C__FREE_FILE_SPACE_FLAG #define H5AC__TAKE_OWNERSHIP_FLAG H5C__TAKE_OWNERSHIP_FLAG #define H5AC__FLUSH_LAST_FLAG H5C__FLUSH_LAST_FLAG @@ -346,7 +326,7 @@ H5_DLL herr_t H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *typ H5_DLL herr_t H5AC_pin_protected_entry(void *thing); H5_DLL herr_t H5AC_create_flush_dependency(void *parent_thing, void *child_thing); H5_DLL void * H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, - haddr_t addr, void *udata, H5AC_protect_t rw); + haddr_t addr, void *udata, unsigned flags); H5_DLL herr_t H5AC_resize_entry(void *thing, size_t new_size); H5_DLL herr_t H5AC_unpin_entry(void *thing); H5_DLL herr_t H5AC_destroy_flush_dependency(void *parent_thing, void *child_thing); @@ -359,10 +339,6 @@ H5_DLL herr_t H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, H5_DLL herr_t H5AC_dest(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, unsigned flags); -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_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, diff --git a/src/H5B.c b/src/H5B.c index 765a57e..b1f3388 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -336,7 +336,7 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC_READ))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node") rt = bt->nchildren; @@ -485,7 +485,7 @@ H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, cache_udata.f = f; cache_udata.type = shared->type; cache_udata.rc_shared = bt_ud->bt->rc_shared; - if(NULL == (split_bt_ud->bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, split_bt_ud->addr, &cache_udata, H5AC_WRITE))) + if(NULL == (split_bt_ud->bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, split_bt_ud->addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree") split_bt_ud->bt->level = bt_ud->bt->level; @@ -518,7 +518,7 @@ H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, if(H5F_addr_defined(bt_ud->bt->right)) { H5B_t *tmp_bt; - if(NULL == (tmp_bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt_ud->bt->right, &cache_udata, H5AC_WRITE))) + if(NULL == (tmp_bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt_ud->bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load right sibling") tmp_bt->left = split_bt_ud->addr; @@ -597,7 +597,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void cache_udata.type = type; cache_udata.rc_shared = rc_shared; bt_ud.addr = addr; - if(NULL == (bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC_WRITE))) + if(NULL == (bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to locate root of B-tree") /* Insert the object */ @@ -901,7 +901,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * Follow the minimum branch out of this node to a subtree. */ child_bt_ud.addr = bt->child[idx]; - if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC_WRITE))) + if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, @@ -947,7 +947,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, */ idx = bt->nchildren - 1; child_bt_ud.addr = bt->child[idx]; - if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC_WRITE))) + if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, @@ -1002,7 +1002,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, */ HDassert(idx < bt->nchildren); child_bt_ud.addr = bt->child[idx]; - if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC_WRITE))) + if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, @@ -1164,7 +1164,7 @@ H5B__iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t ad cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC_READ))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load B-tree node") /* Iterate over node's children */ @@ -1287,7 +1287,7 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC_WRITE))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load B-tree node") rt = bt->nchildren; @@ -1387,7 +1387,7 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ * "critical" for any child in its node to maintain this * consistency (and avoid breaking key/child consistency) */ if(H5F_addr_defined(bt->left)) { - if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->left, &cache_udata, H5AC_WRITE))) + if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->left, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node from tree") /* Copy right-most key from deleted node to right-most key @@ -1404,7 +1404,7 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ sibling = NULL; /* Make certain future references will be caught */ } /* end if */ if(H5F_addr_defined(bt->right)) { - if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, &cache_udata, H5AC_WRITE))) + if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to unlink node from tree") /* Copy left-most key from deleted node to left-most key in @@ -1524,7 +1524,7 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ HDassert(level > 0); /* Update the rightmost key in the left sibling */ - if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->left, &cache_udata, H5AC_WRITE))) + if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->left, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to protect node") HDmemcpy(H5B_NKEY(sibling, shared, sibling->nchildren), @@ -1539,7 +1539,7 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ HDassert(level > 0); /* Update the lefttmost key in the right sibling */ - if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, &cache_udata, H5AC_WRITE))) + if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to protect node") HDmemcpy(H5B_NKEY(sibling, shared, 0), @@ -1646,7 +1646,7 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC_WRITE))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node") /* Iterate over all children in tree, deleting them */ @@ -1908,7 +1908,7 @@ H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t a cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC_READ))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node") /* Cache information from this node */ @@ -1932,7 +1932,7 @@ H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t a while(H5F_addr_defined(next_addr)) { /* Protect the next node to the right */ addr = next_addr; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC_READ))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "B-tree node") /* Cache information from this node */ @@ -2059,7 +2059,7 @@ H5B_valid(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr) cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC_READ))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree node") done: diff --git a/src/H5B2.c b/src/H5B2.c index 0c0f24f..7b5aa16 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -155,8 +155,9 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat /* Look up the B-tree header */ cache_udata.f = f; + cache_udata.addr = hdr_addr; cache_udata.ctx_udata = ctx_udata; - if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, &cache_udata, H5AC_WRITE))) + if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to load B-tree header") /* Point v2 B-tree wrapper at header and bump it's ref count */ @@ -215,8 +216,9 @@ H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata) /* Look up the B-tree header */ cache_udata.f = f; + cache_udata.addr = addr; cache_udata.ctx_udata = ctx_udata; - if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, &cache_udata, H5AC_READ))) + if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to load B-tree header") /* Check for pending heap deletion */ @@ -479,7 +481,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Locate node pointer for child */ @@ -542,7 +544,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Locate record */ @@ -662,7 +664,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, unsigned u; /* Local index variable */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Search for record with correct index */ @@ -734,7 +736,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Sanity check index */ @@ -1070,7 +1072,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_WRITE))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Locate node pointer for child */ @@ -1142,7 +1144,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, hbool_t changed = FALSE;/* Whether the 'modify' callback changed the record */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_WRITE))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Locate record */ @@ -1276,7 +1278,7 @@ H5B2_close(H5B2_t *bt2, hid_t dxpl_id) /* Lock the v2 B-tree header into memory */ /* (OK to pass in NULL for callback context, since we know the header must be in the cache) */ - if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(bt2->f, dxpl_id, H5AC_BT2_HDR, bt2_addr, NULL, H5AC_WRITE))) + if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(bt2->f, dxpl_id, H5AC_BT2_HDR, bt2_addr, NULL, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect v2 B-tree header") /* Set the shared v2 B-tree header's file context for this operation */ @@ -1352,8 +1354,9 @@ H5B2_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata, HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr); #endif /* QAK */ cache_udata.f = f; + cache_udata.addr = addr; cache_udata.ctx_udata = ctx_udata; - if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, &cache_udata, H5AC_WRITE))) + if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect v2 B-tree header") /* Remember the callback & context for later */ diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 3b30e02..64e304c 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -37,7 +37,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5B2pkg.h" /* v2 B-trees */ #include "H5Eprivate.h" /* Error handling */ -#include "H5MFprivate.h" /* File memory management */ #include "H5WBprivate.h" /* Wrapped Buffers */ @@ -50,9 +49,6 @@ #define H5B2_INT_VERSION 0 /* Internal node */ #define H5B2_LEAF_VERSION 0 /* Leaf node */ -/* Size of stack buffer for serialized headers */ -#define H5B2_HDR_BUF_SIZE 128 - /******************/ /* Local Typedefs */ @@ -69,22 +65,32 @@ /********************/ /* Metadata cache callbacks */ -static H5B2_hdr_t *H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5B2__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr); -static herr_t H5B2__cache_hdr_dest(H5F_t *f, H5B2_hdr_t *hdr); -static herr_t H5B2__cache_hdr_clear(H5F_t *f, H5B2_hdr_t *hdr, hbool_t destroy); -static herr_t H5B2__cache_hdr_size(const H5F_t *f, const H5B2_hdr_t *hdr, size_t *size_ptr); -static H5B2_internal_t *H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5B2__cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_internal_t *i, unsigned H5_ATTR_UNUSED * flags_ptr); -static herr_t H5B2__cache_internal_dest(H5F_t *f, H5B2_internal_t *internal); -static herr_t H5B2__cache_internal_clear(H5F_t *f, H5B2_internal_t *i, hbool_t destroy); -static herr_t H5B2__cache_internal_size(const H5F_t *f, const H5B2_internal_t *i, size_t *size_ptr); -static H5B2_leaf_t *H5B2__cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5B2__cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_leaf_t *l, unsigned H5_ATTR_UNUSED * flags_ptr); -static herr_t H5B2__cache_leaf_dest(H5F_t *f, H5B2_leaf_t *leaf); -static herr_t H5B2__cache_leaf_clear(H5F_t *f, H5B2_leaf_t *l, hbool_t destroy); -static herr_t H5B2__cache_leaf_size(const H5F_t *f, const H5B2_leaf_t *l, size_t *size_ptr); - +static herr_t H5B2__cache_hdr_get_load_size(const void *udata, size_t *image_len); +static void *H5B2__cache_hdr_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5B2__cache_hdr_image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5B2__cache_hdr_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5B2__cache_hdr_free_icr(void *thing); + +static herr_t H5B2__cache_int_get_load_size(const void *udata, size_t *image_len); +static void *H5B2__cache_int_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5B2__cache_int_image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5B2__cache_int_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5B2__cache_int_free_icr(void *thing); + +static herr_t H5B2__cache_leaf_get_load_size(const void *udata, size_t *image_len); +static void *H5B2__cache_leaf_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5B2__cache_leaf_image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5B2__cache_leaf_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5B2__cache_leaf_free_icr(void *thing); /*********************/ /* Package Variables */ @@ -92,35 +98,53 @@ static herr_t H5B2__cache_leaf_size(const H5F_t *f, const H5B2_leaf_t *l, size_t /* H5B2 inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_BT2_HDR[1] = {{ - H5AC_BT2_HDR_ID, - (H5AC_load_func_t)H5B2__cache_hdr_load, - (H5AC_flush_func_t)H5B2__cache_hdr_flush, - (H5AC_dest_func_t)H5B2__cache_hdr_dest, - (H5AC_clear_func_t)H5B2__cache_hdr_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5B2__cache_hdr_size, + H5AC_BT2_HDR_ID, /* Metadata client ID */ + "v2 B-tree header", /* Metadata client name (for debugging) */ + H5FD_MEM_BTREE, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5B2__cache_hdr_get_load_size, /* 'get_load_size' callback */ + H5B2__cache_hdr_deserialize, /* 'deserialize' callback */ + H5B2__cache_hdr_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5B2__cache_hdr_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5B2__cache_hdr_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; /* H5B2 inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_BT2_INT[1] = {{ - H5AC_BT2_INT_ID, - (H5AC_load_func_t)H5B2__cache_internal_load, - (H5AC_flush_func_t)H5B2__cache_internal_flush, - (H5AC_dest_func_t)H5B2__cache_internal_dest, - (H5AC_clear_func_t)H5B2__cache_internal_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5B2__cache_internal_size, + H5AC_BT2_INT_ID, /* Metadata client ID */ + "v2 B-tree internal node", /* Metadata client name (for debugging) */ + H5FD_MEM_BTREE, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5B2__cache_int_get_load_size, /* 'get_load_size' callback */ + H5B2__cache_int_deserialize, /* 'deserialize' callback */ + H5B2__cache_int_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5B2__cache_int_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5B2__cache_int_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; /* H5B2 inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_BT2_LEAF[1] = {{ - H5AC_BT2_LEAF_ID, - (H5AC_load_func_t)H5B2__cache_leaf_load, - (H5AC_flush_func_t)H5B2__cache_leaf_flush, - (H5AC_dest_func_t)H5B2__cache_leaf_dest, - (H5AC_clear_func_t)H5B2__cache_leaf_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5B2__cache_leaf_size, + H5AC_BT2_LEAF_ID, /* Metadata client ID */ + "v2 B-tree leaf node", /* Metadata client name (for debugging) */ + H5FD_MEM_BTREE, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5B2__cache_leaf_get_load_size, /* 'get_load_size' callback */ + H5B2__cache_leaf_deserialize, /* 'deserialize' callback */ + H5B2__cache_leaf_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5B2__cache_leaf_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5B2__cache_leaf_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; @@ -136,7 +160,38 @@ const H5AC_class_t H5AC_BT2_LEAF[1] = {{ /*------------------------------------------------------------------------- - * Function: H5B2__cache_hdr_load + * Function: H5B2__cache_hdr_get_load_size + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5B2__cache_hdr_get_load_size(const void *_udata, size_t *image_len) +{ + const H5B2_hdr_cache_ud_t *udata = (const H5B2_hdr_cache_ud_t *)_udata; /* User data for callback */ + + FUNC_ENTER_STATIC_NOERR + + /* Check arguments */ + HDassert(udata); + HDassert(image_len); + + /* Set the image length size */ + *image_len = H5B2_HEADER_SIZE_FILE(udata->f); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5B2__cache_hdr_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5B2__cache_hdr_deserialize * * Purpose: Loads a B-tree header from the disk. * @@ -149,8 +204,9 @@ const H5AC_class_t H5AC_BT2_LEAF[1] = {{ * *------------------------------------------------------------------------- */ -static H5B2_hdr_t * -H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5B2__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, + void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5B2_hdr_t *hdr = NULL; /* B-tree header */ H5B2_hdr_cache_ud_t *udata = (H5B2_hdr_cache_ud_t *)_udata; @@ -159,78 +215,59 @@ H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) uint16_t depth; /* Depth of B-tree */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5B2_HDR_BUF_SIZE]; /* Buffer for header */ - uint8_t *buf; /* Pointer to header buffer */ - const uint8_t *p; /* Pointer into raw data buffer */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ H5B2_hdr_t *ret_value; /* Return value */ FUNC_ENTER_STATIC /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); HDassert(udata); /* Allocate new B-tree header and reset cache info */ if(NULL == (hdr = H5B2__hdr_alloc(udata->f))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "allocation failed for B-tree header") - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for header */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, hdr->hdr_size))) - HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read header from disk */ - if(H5F_block_read(f, H5FD_MEM_BTREE, addr, hdr->hdr_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree header") - - /* Get temporary pointer to serialized header */ - p = buf; - /* Magic number */ - if(HDmemcmp(p, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree header signature") - p += H5_SIZEOF_MAGIC; + image += H5_SIZEOF_MAGIC; /* Version */ - if(*p++ != H5B2_HDR_VERSION) + if(*image++ != H5B2_HDR_VERSION) HGOTO_ERROR(H5E_BTREE, H5E_BADRANGE, NULL, "wrong B-tree header version") /* B-tree class */ - id = (H5B2_subid_t)*p++; + id = (H5B2_subid_t)*image++; if(id >= H5B2_NUM_BTREE_ID) HGOTO_ERROR(H5E_BTREE, H5E_BADTYPE, NULL, "incorrect B-tree type") /* Node size (in bytes) */ - UINT32DECODE(p, cparam.node_size); + UINT32DECODE(image, cparam.node_size); /* Raw key size (in bytes) */ - UINT16DECODE(p, cparam.rrec_size); + UINT16DECODE(image, cparam.rrec_size); /* Depth of tree */ - UINT16DECODE(p, depth); + UINT16DECODE(image, depth); /* Split & merge %s */ - cparam.split_percent = *p++; - cparam.merge_percent = *p++; + cparam.split_percent = *image++; + cparam.merge_percent = *image++; /* Root node pointer */ - H5F_addr_decode(udata->f, (const uint8_t **)&p, &(hdr->root.addr)); - UINT16DECODE(p, hdr->root.node_nrec); - H5F_DECODE_LENGTH(udata->f, p, hdr->root.all_nrec); + H5F_addr_decode(udata->f, (const uint8_t **)&image, &(hdr->root.addr)); + UINT16DECODE(image, hdr->root.node_nrec); + H5F_DECODE_LENGTH(udata->f, image, hdr->root.all_nrec); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - (const uint8_t *)buf) == hdr->hdr_size); + HDassert((size_t)(image - (const uint8_t *)_image) == hdr->hdr_size); /* Compute checksum on entire header */ - computed_chksum = H5_checksum_metadata(buf, (hdr->hdr_size - H5B2_SIZEOF_CHKSUM), 0); + computed_chksum = H5_checksum_metadata(_image, (hdr->hdr_size - H5B2_SIZEOF_CHKSUM), 0); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -242,131 +279,59 @@ H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't initialize B-tree header info") /* Set the B-tree header's address */ - hdr->addr = addr; + hdr->addr = udata->addr; + + /* Sanity check */ + HDassert((size_t)(image - (const uint8_t *)_image) <= len); /* Set return value */ ret_value = hdr; done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value && hdr) if(H5B2__hdr_free(hdr) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTRELEASE, NULL, "can't release v2 B-tree header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2__cache_hdr_load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* end H5B2__cache_hdr_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5B2__cache_hdr_flush + * Function: H5B2__cache_hdr_image_len * - * Purpose: Flushes a dirty B-tree header to disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 1 2005 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 20, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5B2_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr) +H5B2__cache_hdr_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5B2_HDR_BUF_SIZE]; /* Buffer for header */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5B2_hdr_t *hdr = (const H5B2_hdr_t *)_thing; /* Pointer to the B-tree header */ - FUNC_ENTER_STATIC + FUNC_ENTER_STATIC_NOERR /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); HDassert(hdr); + HDassert(image_len); - if(hdr->cache_info.is_dirty) { - uint8_t *buf; /* Pointer to header buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - - /* Set the B-tree header's file context for this operation */ - hdr->f = f; - - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for header */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, hdr->hdr_size))) - HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, FAIL, "can't get actual buffer") - - /* Get temporary pointer to serialized header */ - p = buf; - - /* Magic number */ - HDmemcpy(p, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; - - /* Version # */ - *p++ = H5B2_HDR_VERSION; - - /* B-tree type */ - *p++ = hdr->cls->id; + /* Set the image length size */ + *image_len = hdr->hdr_size; - /* Node size (in bytes) */ - UINT32ENCODE(p, hdr->node_size); - - /* Raw key size (in bytes) */ - UINT16ENCODE(p, hdr->rrec_size); - - /* Depth of tree */ - UINT16ENCODE(p, hdr->depth); - - /* Split & merge %s */ - H5_CHECK_OVERFLOW(hdr->split_percent, /* From: */ unsigned, /* To: */ uint8_t); - *p++ = (uint8_t)hdr->split_percent; - H5_CHECK_OVERFLOW(hdr->merge_percent, /* From: */ unsigned, /* To: */ uint8_t); - *p++ = (uint8_t)hdr->merge_percent; - - /* Root node pointer */ - H5F_addr_encode(f, &p, hdr->root.addr); - UINT16ENCODE(p, hdr->root.node_nrec); - H5F_ENCODE_LENGTH(f, p, hdr->root.all_nrec); - - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(buf, (hdr->hdr_size - H5B2_SIZEOF_CHKSUM), 0); - - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); - - /* Write the B-tree header. */ - HDassert((size_t)(p - buf) == hdr->hdr_size); - if(H5F_block_write(f, H5FD_MEM_BTREE, addr, hdr->hdr_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to save B-tree header to disk") - - hdr->cache_info.is_dirty = FALSE; - } /* end if */ - - if(destroy) - if(H5B2__cache_hdr_dest(f, hdr) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree header") - -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2__cache_hdr_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5B2__cache_hdr_image_len() */ /*------------------------------------------------------------------------- - * Function: H5B2__cache_hdr_dest + * Function: H5B2__cache_hdr_serialize * - * Purpose: Destroys a B-tree header in memory. + * Purpose: Flushes a dirty B-tree header to disk. * * Return: Non-negative on success/Negative on failure * @@ -377,109 +342,132 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_hdr_dest(H5F_t *f, H5B2_hdr_t *hdr) +H5B2__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, + void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5B2_hdr_t *hdr = (H5B2_hdr_t *)_thing; /* Pointer to the B-tree header */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ - FUNC_ENTER_STATIC + FUNC_ENTER_STATIC_NOERR - /* Check arguments */ + /* check arguments */ + HDassert(f); + HDassert(image); HDassert(hdr); - HDassert(hdr->rc == 0); - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!hdr->cache_info.free_file_space_on_destroy || H5F_addr_defined(hdr->cache_info.addr)); + /* Magic number */ + HDmemcpy(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; + + /* Version # */ + *image++ = H5B2_HDR_VERSION; - /* Check for freeing file space for B-tree header */ - if(hdr->cache_info.free_file_space_on_destroy) { - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_BTREE, H5AC_dxpl_id, hdr->cache_info.addr, (hsize_t)hdr->hdr_size) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free v2 B-tree header") - } /* end if */ + /* B-tree type */ + *image++ = hdr->cls->id; - /* Release B-tree header info */ - if(H5B2__hdr_free(hdr) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free v2 B-tree header info") + /* Node size (in bytes) */ + UINT32ENCODE(image, hdr->node_size); -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2__cache_hdr_dest() */ + /* Raw key size (in bytes) */ + UINT16ENCODE(image, hdr->rrec_size); + + /* Depth of tree */ + UINT16ENCODE(image, hdr->depth); + + /* Split & merge %s */ + H5_CHECK_OVERFLOW(hdr->split_percent, /* From: */ unsigned, /* To: */ uint8_t); + *image++ = (uint8_t)hdr->split_percent; + H5_CHECK_OVERFLOW(hdr->merge_percent, /* From: */ unsigned, /* To: */ uint8_t); + *image++ = (uint8_t)hdr->merge_percent; + + /* Root node pointer */ + H5F_addr_encode(f, &image, hdr->root.addr); + UINT16ENCODE(image, hdr->root.node_nrec); + H5F_ENCODE_LENGTH(f, image, hdr->root.all_nrec); + + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(_image, (hdr->hdr_size - H5B2_SIZEOF_CHKSUM), 0); + + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); + + /* Sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) <= len); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5B2__cache_hdr_serialize() */ /*------------------------------------------------------------------------- - * Function: H5B2__cache_hdr_clear + * Function: H5B2__cache_hdr_free_icr * - * Purpose: Mark a B-tree header in memory as non-dirty. + * Purpose: Destroy/release an "in core representation" of a data + * structure * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 1 2005 + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * June 18, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_hdr_clear(H5F_t *f, H5B2_hdr_t *hdr, hbool_t destroy) +H5B2__cache_hdr_free_icr(void *thing) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - /* - * Check arguments. - */ - HDassert(hdr); - - /* Reset the dirty flag. */ - hdr->cache_info.is_dirty = FALSE; + /* Check arguments */ + HDassert(thing); - if(destroy) - if(H5B2__cache_hdr_dest(f, hdr) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree header") + /* Destroy v2 B-tree header */ + if(H5B2__hdr_free((H5B2_hdr_t *)thing) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free v2 B-tree header") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2__cache_hdr_clear() */ +} /* H5B2__cache_hdr_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5B2__cache_hdr_size + * Function: H5B2__cache_int_get_load_size * - * Purpose: Compute the size in bytes of a B-tree header - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Compute the size of the data structure on disk. * - * Return: SUCCEED (Can't fail) + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * koziol@hdfgroup.org - * Feb 1 2005 + * May 18, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5B2_hdr_t *hdr, size_t *size_ptr) +H5B2__cache_int_get_load_size(const void *_udata, size_t *image_len) { + const H5B2_internal_cache_ud_t *udata = (const H5B2_internal_cache_ud_t *)_udata; /* User data for callback */ + FUNC_ENTER_STATIC_NOERR /* Check arguments */ - HDassert(f); - HDassert(hdr); - HDassert(size_ptr); + HDassert(udata); + HDassert(udata->hdr); + HDassert(image_len); - /* Set size value */ - *size_ptr = hdr->hdr_size; + /* Set the image length size */ + *image_len = udata->hdr->node_size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B2__cache_hdr_size() */ +} /* end H5B2__cache_int_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5B2__cache_internal_load + * Function: H5B2__cache_int_deserialize * - * Purpose: Loads a B-tree internal node from the disk. + * Purpose: Deserialize a B-tree internal node from the disk. * * Return: Success: Pointer to a new B-tree internal node. * Failure: NULL @@ -490,12 +478,13 @@ H5B2__cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5B2_hdr_t *hdr, size_ * *------------------------------------------------------------------------- */ -static H5B2_internal_t * -H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, + void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5B2_internal_cache_ud_t *udata = (H5B2_internal_cache_ud_t *)_udata; /* Pointer to user data */ H5B2_internal_t *internal = NULL; /* Internal node read */ - const uint8_t *p; /* Pointer into raw data buffer */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint8_t *native; /* Pointer to native record info */ H5B2_node_ptr_t *int_node_ptr; /* Pointer to node pointer info */ uint32_t stored_chksum; /* Stored metadata checksum value */ @@ -506,8 +495,7 @@ H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) FUNC_ENTER_STATIC /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); HDassert(udata); /* Allocate new internal node and reset cache info */ @@ -515,9 +503,6 @@ H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") HDmemset(&internal->cache_info, 0, sizeof(H5AC_info_t)); - /* Set the B-tree header's file context for this operation */ - udata->hdr->f = f; - /* Increment ref. count on B-tree header */ if(H5B2__hdr_incr(udata->hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment ref. count on B-tree header") @@ -525,23 +510,17 @@ H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Share B-tree information */ internal->hdr = udata->hdr; - /* Read header from disk */ - if(H5F_block_read(f, H5FD_MEM_BTREE, addr, udata->hdr->node_size, dxpl_id, udata->hdr->page) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree internal node") - - p = udata->hdr->page; - /* Magic number */ - if(HDmemcmp(p, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC)) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree internal node signature") - p += H5_SIZEOF_MAGIC; + image += H5_SIZEOF_MAGIC; /* Version */ - if(*p++ != H5B2_INT_VERSION) + if(*image++ != H5B2_INT_VERSION) HGOTO_ERROR(H5E_BTREE, H5E_BADRANGE, NULL, "wrong B-tree internal node version") /* B-tree type */ - if(*p++ != (uint8_t)udata->hdr->cls->id) + if(*image++ != (uint8_t)udata->hdr->cls->id) HGOTO_ERROR(H5E_BTREE, H5E_BADTYPE, NULL, "incorrect B-tree type") /* Allocate space for the native keys in memory */ @@ -560,11 +539,11 @@ H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) native = internal->int_native; for(u = 0; u < internal->nrec; u++) { /* Decode record */ - if((udata->hdr->cls->decode)(p, native, udata->hdr->cb_ctx) < 0) + if((udata->hdr->cls->decode)(image, native, udata->hdr->cb_ctx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDECODE, NULL, "unable to decode B-tree record") /* Move to next record */ - p += udata->hdr->rrec_size; + image += udata->hdr->rrec_size; native += udata->hdr->cls->nrec_size; } /* end for */ @@ -572,10 +551,10 @@ H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) int_node_ptr = internal->node_ptrs; for(u = 0; u < (unsigned)(internal->nrec + 1); u++) { /* Decode node pointer */ - H5F_addr_decode(udata->f, (const uint8_t **)&p, &(int_node_ptr->addr)); - UINT64DECODE_VAR(p, int_node_ptr->node_nrec, udata->hdr->max_nrec_size); + H5F_addr_decode(udata->f, (const uint8_t **)&image, &(int_node_ptr->addr)); + UINT64DECODE_VAR(image, int_node_ptr->node_nrec, udata->hdr->max_nrec_size); if(udata->depth > 1) - UINT64DECODE_VAR(p, int_node_ptr->all_nrec, udata->hdr->node_info[udata->depth - 1].cum_max_nrec_size) + UINT64DECODE_VAR(image, int_node_ptr->all_nrec, udata->hdr->node_info[udata->depth - 1].cum_max_nrec_size) else int_node_ptr->all_nrec = int_node_ptr->node_nrec; @@ -584,13 +563,13 @@ H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) } /* end for */ /* Compute checksum on internal node */ - computed_chksum = H5_checksum_metadata(udata->hdr->page, (size_t)(p - (const uint8_t *)udata->hdr->page), 0); + computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (const uint8_t *)_image), 0); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Sanity check parsing */ - HDassert((size_t)(p - (const uint8_t *)udata->hdr->page) <= udata->hdr->node_size); + HDassert((size_t)(image - (const uint8_t *)_image) <= len); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -605,224 +584,194 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree internal node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2__cache_internal_load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* H5B2__cache_int_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5B2__cache_internal_flush + * Function: H5B2__cache_int_image_len * - * Purpose: Flushes a dirty B-tree internal node to disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 3 2005 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 20, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_internal_t *internal, unsigned H5_ATTR_UNUSED * flags_ptr) +H5B2__cache_int_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + const H5B2_internal_t *internal = (const H5B2_internal_t *)_thing; /* Pointer to the B-tree internal node */ - FUNC_ENTER_STATIC + FUNC_ENTER_STATIC_NOERR /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); HDassert(internal); HDassert(internal->hdr); + HDassert(image_len); - if(internal->cache_info.is_dirty) { - uint8_t *p; /* Pointer into raw data buffer */ - uint8_t *native; /* Pointer to native record info */ - H5B2_node_ptr_t *int_node_ptr; /* Pointer to node pointer info */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - unsigned u; /* Local index variable */ - - /* Set the B-tree header's file context for this operation */ - internal->hdr->f = f; - - p = internal->hdr->page; - - /* Magic number */ - HDmemcpy(p, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; - - /* Version # */ - *p++ = H5B2_INT_VERSION; - - /* B-tree type */ - *p++ = internal->hdr->cls->id; - HDassert((size_t)(p - internal->hdr->page) == (H5B2_INT_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); - - /* Serialize records for internal node */ - native = internal->int_native; - for(u = 0; u < internal->nrec; u++) { - /* Encode record */ - if((internal->hdr->cls->encode)(p, native, internal->hdr->cb_ctx) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree record") - - /* Move to next record */ - p += internal->hdr->rrec_size; - native += internal->hdr->cls->nrec_size; - } /* end for */ - - /* Serialize node pointers for internal node */ - int_node_ptr = internal->node_ptrs; - for(u = 0; u < (unsigned)(internal->nrec + 1); u++) { - /* Encode node pointer */ - H5F_addr_encode(f, &p, int_node_ptr->addr); - UINT64ENCODE_VAR(p, int_node_ptr->node_nrec, internal->hdr->max_nrec_size); - if(internal->depth > 1) - UINT64ENCODE_VAR(p, int_node_ptr->all_nrec, internal->hdr->node_info[internal->depth - 1].cum_max_nrec_size); - - /* Move to next node pointer */ - int_node_ptr++; - } /* end for */ - - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(internal->hdr->page, (size_t)(p - internal->hdr->page), 0); - - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); - - /* Write the B-tree internal node */ - HDassert((size_t)(p - internal->hdr->page) <= internal->hdr->node_size); - if(H5F_block_write(f, H5FD_MEM_BTREE, addr, internal->hdr->node_size, dxpl_id, internal->hdr->page) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to save B-tree internal node to disk") + /* Set the image length size */ + *image_len = internal->hdr->node_size; - internal->cache_info.is_dirty = FALSE; - } /* end if */ - - if(destroy) - if(H5B2__cache_internal_dest(f, internal) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree internal node") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2__cache_internal_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5B2__cache_int_image_len() */ /*------------------------------------------------------------------------- - * Function: H5B2__cache_internal_dest + * Function: H5B2__cache_int_serialize * - * Purpose: Destroys a B-tree internal node in memory. + * Purpose: Serializes a B-tree internal node for writing to disk. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * koziol@ncsa.uiuc.edu - * Feb 2 2005 + * Feb 3 2005 * *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_internal_dest(H5F_t *f, H5B2_internal_t *internal) +H5B2__cache_int_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, + void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5B2_internal_t *internal = (H5B2_internal_t *)_thing; /* Pointer to the B-tree internal node */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint8_t *native; /* Pointer to native record info */ + H5B2_node_ptr_t *int_node_ptr; /* Pointer to node pointer info */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - /* Check arguments */ + /* check arguments */ HDassert(f); + HDassert(image); HDassert(internal); HDassert(internal->hdr); - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!internal->cache_info.free_file_space_on_destroy || H5F_addr_defined(internal->cache_info.addr)); + /* Magic number */ + HDmemcpy(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; + + /* Version # */ + *image++ = H5B2_INT_VERSION; - /* Check for freeing file space for B-tree internal node */ - if(internal->cache_info.free_file_space_on_destroy) { - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_BTREE, H5AC_dxpl_id, internal->cache_info.addr, (hsize_t)internal->hdr->node_size) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free v2 B-tree internal node") - } /* end if */ + /* B-tree type */ + *image++ = internal->hdr->cls->id; + HDassert((size_t)(image - (uint8_t *)_image) == (H5B2_INT_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); - /* Release v2 b-tree internal node */ - if(H5B2__internal_free(internal) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to release v2 B-tree internal node") + /* Serialize records for internal node */ + native = internal->int_native; + for(u = 0; u < internal->nrec; u++) { + /* Encode record */ + if((internal->hdr->cls->encode)(image, native, internal->hdr->cb_ctx) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree record") + + /* Move to next record */ + image += internal->hdr->rrec_size; + native += internal->hdr->cls->nrec_size; + } /* end for */ + + /* Serialize node pointers for internal node */ + int_node_ptr = internal->node_ptrs; + for(u = 0; u < (unsigned)(internal->nrec + 1); u++) { + /* Encode node pointer */ + H5F_addr_encode(f, &image, int_node_ptr->addr); + UINT64ENCODE_VAR(image, int_node_ptr->node_nrec, internal->hdr->max_nrec_size); + if(internal->depth > 1) + UINT64ENCODE_VAR(image, int_node_ptr->all_nrec, internal->hdr->node_info[internal->depth - 1].cum_max_nrec_size); + + /* Move to next node pointer */ + int_node_ptr++; + } /* end for */ + + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0); + + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); + + /* Sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) <= len); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2__cache_internal_dest() */ +} /* H5B2__cache_int_serialize() */ /*------------------------------------------------------------------------- - * Function: H5B2__cache_internal_clear + * Function: H5B2__cache_int_free_icr * - * Purpose: Mark a B-tree internal node in memory as non-dirty. + * Purpose: Destroy/release an "in core representation" of a data + * structure * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 2 2005 + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * June 18, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_internal_clear(H5F_t *f, H5B2_internal_t *internal, hbool_t destroy) +H5B2__cache_int_free_icr(void *thing) { - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - /* - * Check arguments. - */ - HDassert(internal); - - /* Reset the dirty flag. */ - internal->cache_info.is_dirty = FALSE; + /* Check arguments */ + HDassert(thing); - if(destroy) - if(H5B2__cache_internal_dest(f, internal) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree internal node") + /* Release v2 B-tree internal node */ + if(H5B2__internal_free((H5B2_internal_t *)thing) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to release v2 B-tree internal node") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2__cache_internal_clear() */ +} /* H5B2__cache_int_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5B2__cache_internal_size + * Function: H5B2__cache_leaf_get_load_size * - * Purpose: Compute the size in bytes of a B-tree internal node - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 2 2005 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_internal_size(const H5F_t H5_ATTR_UNUSED *f, const H5B2_internal_t *internal, size_t *size_ptr) +H5B2__cache_leaf_get_load_size(const void *_udata, size_t *image_len) { + const H5B2_leaf_cache_ud_t *udata = (const H5B2_leaf_cache_ud_t *)_udata; /* User data for callback */ + FUNC_ENTER_STATIC_NOERR /* Check arguments */ - HDassert(internal); - HDassert(internal->hdr); - HDassert(size_ptr); + HDassert(udata); + HDassert(udata->hdr); + HDassert(image_len); - /* Set size value */ - *size_ptr = internal->hdr->node_size; + /* Set the image length size */ + *image_len = udata->hdr->node_size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B2__cache_internal_size() */ +} /* end H5B2__cache_leaf_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5B2__cache_leaf_load + * Function: H5B2__cache_leaf_deserialize * - * Purpose: Loads a B-tree leaf from the disk. + * Purpose: Deserialize a B-tree leaf from the disk. * * Return: Success: Pointer to a new B-tree leaf node. * Failure: NULL @@ -833,12 +782,13 @@ H5B2__cache_internal_size(const H5F_t H5_ATTR_UNUSED *f, const H5B2_internal_t * * *------------------------------------------------------------------------- */ -static H5B2_leaf_t * -H5B2__cache_leaf_load(H5F_t H5_ATTR_UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5B2__cache_leaf_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, + void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5B2_leaf_cache_ud_t *udata = (H5B2_leaf_cache_ud_t *)_udata; H5B2_leaf_t *leaf = NULL; /* Pointer to lead node loaded */ - const uint8_t *p; /* Pointer into raw data buffer */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint8_t *native; /* Pointer to native keys */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ @@ -848,8 +798,7 @@ H5B2__cache_leaf_load(H5F_t H5_ATTR_UNUSED *f, hid_t dxpl_id, haddr_t addr, void FUNC_ENTER_STATIC /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); HDassert(udata); /* Allocate new leaf node and reset cache info */ @@ -857,9 +806,6 @@ H5B2__cache_leaf_load(H5F_t H5_ATTR_UNUSED *f, hid_t dxpl_id, haddr_t addr, void HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed") HDmemset(&leaf->cache_info, 0, sizeof(H5AC_info_t)); - /* Set the B-tree header's file context for this operation */ - udata->hdr->f = udata->f; - /* Increment ref. count on B-tree header */ if(H5B2__hdr_incr(udata->hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment ref. count on B-tree header") @@ -867,23 +813,17 @@ H5B2__cache_leaf_load(H5F_t H5_ATTR_UNUSED *f, hid_t dxpl_id, haddr_t addr, void /* Share B-tree header information */ leaf->hdr = udata->hdr; - /* Read header from disk */ - if(H5F_block_read(udata->f, H5FD_MEM_BTREE, addr, udata->hdr->node_size, dxpl_id, udata->hdr->page) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree leaf node") - - p = udata->hdr->page; - /* Magic number */ - if(HDmemcmp(p, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC)) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree leaf node signature") - p += H5_SIZEOF_MAGIC; + image += H5_SIZEOF_MAGIC; /* Version */ - if(*p++ != H5B2_LEAF_VERSION) + if(*image++ != H5B2_LEAF_VERSION) HGOTO_ERROR(H5E_BTREE, H5E_BADRANGE, NULL, "wrong B-tree leaf node version") /* B-tree type */ - if(*p++ != (uint8_t)udata->hdr->cls->id) + if(*image++ != (uint8_t)udata->hdr->cls->id) HGOTO_ERROR(H5E_BTREE, H5E_BADTYPE, NULL, "incorrect B-tree type") /* Allocate space for the native keys in memory */ @@ -897,27 +837,30 @@ H5B2__cache_leaf_load(H5F_t H5_ATTR_UNUSED *f, hid_t dxpl_id, haddr_t addr, void native = leaf->leaf_native; for(u = 0; u < leaf->nrec; u++) { /* Decode record */ - if((udata->hdr->cls->decode)(p, native, udata->hdr->cb_ctx) < 0) + if((udata->hdr->cls->decode)(image, native, udata->hdr->cb_ctx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, NULL, "unable to decode B-tree record") /* Move to next record */ - p += udata->hdr->rrec_size; + image += udata->hdr->rrec_size; native += udata->hdr->cls->nrec_size; } /* end for */ /* Compute checksum on leaf node */ - computed_chksum = H5_checksum_metadata(udata->hdr->page, (size_t)(p - (const uint8_t *)udata->hdr->page), 0); + computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (const uint8_t *)_image), 0); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Sanity check parsing */ - HDassert((size_t)(p - (const uint8_t *)udata->hdr->page) <= udata->hdr->node_size); + HDassert((size_t)(image - (const uint8_t *)_image) <= udata->hdr->node_size); /* Verify checksum */ if(stored_chksum != computed_chksum) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "incorrect metadata checksum for v2 leaf node") + /* Sanity check */ + HDassert((size_t)(image - (const uint8_t *)_image) <= len); + /* Set return value */ ret_value = leaf; @@ -927,96 +870,46 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2__cache_leaf_load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* H5B2__cache_leaf_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5B2__cache_leaf_flush + * Function: H5B2__cache_leaf_image_len * - * Purpose: Flushes a dirty B-tree leaf node to disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 2 2005 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 20, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_leaf_t *leaf, unsigned H5_ATTR_UNUSED * flags_ptr) +H5B2__cache_leaf_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + const H5B2_leaf_t *leaf = (const H5B2_leaf_t *)_thing; /* Pointer to the B-tree leaf node */ - FUNC_ENTER_STATIC + FUNC_ENTER_STATIC_NOERR /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); HDassert(leaf); HDassert(leaf->hdr); + HDassert(image_len); - if(leaf->cache_info.is_dirty) { - uint8_t *p; /* Pointer into raw data buffer */ - uint8_t *native; /* Pointer to native keys */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - unsigned u; /* Local index variable */ - - /* Set the B-tree header's file context for this operation */ - leaf->hdr->f = f; - - p = leaf->hdr->page; - - /* magic number */ - HDmemcpy(p, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; - - /* version # */ - *p++ = H5B2_LEAF_VERSION; - - /* b-tree type */ - *p++ = leaf->hdr->cls->id; - HDassert((size_t)(p - leaf->hdr->page) == (H5B2_LEAF_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); + /* Set the image length size */ + *image_len = leaf->hdr->node_size; - /* Serialize records for leaf node */ - native = leaf->leaf_native; - for(u = 0; u < leaf->nrec; u++) { - /* Encode record */ - if((leaf->hdr->cls->encode)(p, native, leaf->hdr->cb_ctx) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree record") - - /* Move to next record */ - p += leaf->hdr->rrec_size; - native += leaf->hdr->cls->nrec_size; - } /* end for */ - - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(leaf->hdr->page, (size_t)(p - leaf->hdr->page), 0); - - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); - - /* Write the B-tree leaf node */ - HDassert((size_t)(p - leaf->hdr->page) <= leaf->hdr->node_size); - if(H5F_block_write(f, H5FD_MEM_BTREE, addr, leaf->hdr->node_size, dxpl_id, leaf->hdr->page) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to save B-tree leaf node to disk") - - leaf->cache_info.is_dirty = FALSE; - } /* end if */ - - if(destroy) - if(H5B2__cache_leaf_dest(f, leaf) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree leaf node") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2__cache_leaf_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5B2__cache_leaf_image_len() */ /*------------------------------------------------------------------------- - * Function: H5B2__cache_leaf_dest + * Function: H5B2__cache_leaf_serialize * - * Purpose: Destroys a B-tree leaf node in memory. + * Purpose: Serializes a B-tree leaf node for writing to disk. * * Return: Non-negative on success/Negative on failure * @@ -1027,102 +920,90 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_leaf_dest(H5F_t *f, H5B2_leaf_t *leaf) +H5B2__cache_leaf_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, + void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5B2_leaf_t *leaf = (H5B2_leaf_t *)_thing; /* Pointer to the B-tree leaf node */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint8_t *native; /* Pointer to native keys */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - /* Check arguments */ + /* check arguments */ HDassert(f); + HDassert(image); HDassert(leaf); HDassert(leaf->hdr); - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!leaf->cache_info.free_file_space_on_destroy || H5F_addr_defined(leaf->cache_info.addr)); - - /* Check for freeing file space for B-tree leaf node */ - if(leaf->cache_info.free_file_space_on_destroy) { - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_BTREE, H5AC_dxpl_id, leaf->cache_info.addr, (hsize_t)leaf->hdr->node_size) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free v2 B-tree leaf node") - } /* end if */ + /* magic number */ + HDmemcpy(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; - /* Destroy v2 b-tree leaf node */ - if(H5B2__leaf_free(leaf) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree leaf node") + /* version # */ + *image++ = H5B2_LEAF_VERSION; -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2__cache_leaf_dest() */ + /* B-tree type */ + *image++ = leaf->hdr->cls->id; + HDassert((size_t)(image - (uint8_t *)_image) == (H5B2_LEAF_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); - -/*------------------------------------------------------------------------- - * Function: H5B2__cache_leaf_clear - * - * Purpose: Mark a B-tree leaf node in memory as non-dirty. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 2 2005 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5B2__cache_leaf_clear(H5F_t *f, H5B2_leaf_t *leaf, hbool_t destroy) -{ - herr_t ret_value = SUCCEED; + /* Serialize records for leaf node */ + native = leaf->leaf_native; + for(u = 0; u < leaf->nrec; u++) { + /* Encode record */ + if((leaf->hdr->cls->encode)(image, native, leaf->hdr->cb_ctx) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree record") - FUNC_ENTER_STATIC + /* Move to next record */ + image += leaf->hdr->rrec_size; + native += leaf->hdr->cls->nrec_size; + } /* end for */ - /* - * Check arguments. - */ - HDassert(leaf); + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(_image, (size_t)((const uint8_t *)image - (const uint8_t *)_image), 0); - /* Reset the dirty flag. */ - leaf->cache_info.is_dirty = FALSE; + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); - if(destroy) - if(H5B2__cache_leaf_dest(f, leaf) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree leaf node") + /* Sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) <= len); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2__cache_leaf_clear() */ +} /* H5B2__cache_leaf_serialize() */ /*------------------------------------------------------------------------- - * Function: H5B2__cache_leaf_size + * Function: H5B2__cache_leaf_free_icr * - * Purpose: Compute the size in bytes of a B-tree leaf node - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Destroy/release an "in core representation" of a data + * structure * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 2 2005 + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * June 18, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_leaf_size(const H5F_t H5_ATTR_UNUSED *f, const H5B2_leaf_t *leaf, size_t *size_ptr) +H5B2__cache_leaf_free_icr(void *thing) { - FUNC_ENTER_STATIC_NOERR + herr_t ret_value = SUCCEED; /* Return value */ - /* check arguments */ - HDassert(leaf); - HDassert(leaf->hdr); - HDassert(size_ptr); + FUNC_ENTER_STATIC - /* Set size value */ - *size_ptr = leaf->hdr->node_size; + /* Check arguments */ + HDassert(thing); - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B2__cache_leaf_size() */ + /* Destroy v2 B-tree leaf node */ + if(H5B2__leaf_free((H5B2_leaf_t *)thing) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree leaf node") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5B2__cache_leaf_free_icr() */ diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index 50283f8..6e1250b 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -123,8 +123,9 @@ H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, * Load the B-tree header. */ cache_udata.f = f; + cache_udata.addr = addr; cache_udata.ctx_udata = dbg_ctx; - if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, &cache_udata, H5AC_READ))) + if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header") /* Set file pointer for this B-tree operation */ @@ -241,8 +242,9 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, * Load the B-tree header. */ cache_udata.f = f; + cache_udata.addr = hdr_addr; cache_udata.ctx_udata = dbg_ctx; - if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, &cache_udata, H5AC_READ))) + if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header") /* Set file pointer for this B-tree operation */ @@ -253,7 +255,7 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, */ H5_CHECK_OVERFLOW(nrec, unsigned, uint16_t); H5_CHECK_OVERFLOW(depth, unsigned, uint16_t); - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, addr, (uint16_t)nrec, (uint16_t)depth, H5AC_READ))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, addr, (uint16_t)nrec, (uint16_t)depth, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node") /* Print opening message */ @@ -375,8 +377,9 @@ H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent * Load the B-tree header. */ cache_udata.f = f; + cache_udata.addr = hdr_addr; cache_udata.ctx_udata = dbg_ctx; - if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, &cache_udata, H5AC_READ))) + if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree header") /* Set file pointer for this B-tree operation */ @@ -386,7 +389,7 @@ H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent * Load the B-tree leaf node */ H5_CHECK_OVERFLOW(nrec, unsigned, uint16_t); - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, addr, (uint16_t)nrec, H5AC_READ))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, addr, (uint16_t)nrec, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Print opening message */ diff --git a/src/H5B2int.c b/src/H5B2int.c index 638b4b3..0f884c2 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -215,9 +215,9 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Protect both leaves */ - if(NULL == (left_int = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) + if(NULL == (left_int = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") - if(NULL == (right_int = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) + if(NULL == (right_int = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* More setup for child nodes */ @@ -244,9 +244,9 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Protect both leaves */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* More setup for child nodes */ @@ -403,7 +403,7 @@ H5B2__split_root(H5B2_hdr_t *hdr, hid_t dxpl_id) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create new internal node") /* Protect new root node */ - if(NULL == (new_root = H5B2__protect_internal(hdr, dxpl_id, hdr->root.addr, hdr->root.node_nrec, hdr->depth, H5AC_WRITE))) + if(NULL == (new_root = H5B2__protect_internal(hdr, dxpl_id, hdr->root.addr, hdr->root.node_nrec, hdr->depth, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Set first node pointer in root node to old root node pointer info */ @@ -467,9 +467,9 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock left & right B-tree child nodes */ - if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* More setup for child nodes */ @@ -492,9 +492,9 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock left & right B-tree child nodes */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* More setup for child nodes */ @@ -704,11 +704,11 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock B-tree child nodes */ - if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") - if(NULL == (middle_internal = H5B2__protect_internal(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) + if(NULL == (middle_internal = H5B2__protect_internal(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") - if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* More setup for child nodes */ @@ -737,11 +737,11 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock B-tree child nodes */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, H5AC_WRITE))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (middle_leaf = H5B2__protect_leaf(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) + if(NULL == (middle_leaf = H5B2__protect_leaf(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* More setup for child nodes */ @@ -1084,9 +1084,9 @@ H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock left & right B-tree child nodes */ - if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") - if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* More setup for accessing child node information */ @@ -1109,9 +1109,9 @@ H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock left & right B-tree child nodes */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* More setup for accessing child node information */ @@ -1246,11 +1246,11 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock B-tree child nodes */ - if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") - if(NULL == (middle_internal = H5B2__protect_internal(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) + if(NULL == (middle_internal = H5B2__protect_internal(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") - if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* More setup for accessing child node information */ @@ -1279,11 +1279,11 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock B-tree child nodes */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, H5AC_WRITE))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (middle_leaf = H5B2__protect_leaf(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) + if(NULL == (middle_leaf = H5B2__protect_leaf(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* More setup for accessing child node information */ @@ -1460,7 +1460,7 @@ H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, child_addr = internal->node_ptrs[idx].addr; /* Lock B-tree child nodes */ - if(NULL == (child_internal = H5B2__protect_internal(hdr, dxpl_id, child_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) + if(NULL == (child_internal = H5B2__protect_internal(hdr, dxpl_id, child_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* More setup for accessing child node information */ @@ -1475,7 +1475,7 @@ H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, child_addr = internal->node_ptrs[idx].addr; /* Lock B-tree child node */ - if(NULL == (child_leaf = H5B2__protect_leaf(hdr, dxpl_id, child_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) + if(NULL == (child_leaf = H5B2__protect_leaf(hdr, dxpl_id, child_addr, internal->node_ptrs[idx].node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* More setup for accessing child node information */ @@ -1538,7 +1538,7 @@ H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, H5AC_WRITE))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Must have a leaf node with enough space to insert a record now */ @@ -1637,7 +1637,7 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, depth, H5AC_WRITE))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, depth, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Split or redistribute child node pointers, if necessary */ @@ -1834,7 +1834,7 @@ done: */ H5B2_leaf_t * H5B2__protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, uint16_t nrec, - H5AC_protect_t rw) + unsigned flags) { H5B2_leaf_cache_ud_t udata; /* User-data for callback */ H5B2_leaf_t *ret_value; /* Return value */ @@ -1845,13 +1845,16 @@ H5B2__protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, uint16_t nrec, HDassert(hdr); HDassert(H5F_addr_defined(addr)); + /* only H5AC__READ_ONLY_FLAG may appear in flags */ + HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* Set up user data for callback */ udata.f = hdr->f; udata.hdr = hdr; H5_CHECKED_ASSIGN(udata.nrec, uint16_t, nrec, unsigned) /* Protect the leaf node */ - if(NULL == (ret_value = (H5B2_leaf_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_BT2_LEAF, addr, &udata, rw))) + if(NULL == (ret_value = (H5B2_leaf_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_BT2_LEAF, addr, &udata, flags))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to protect B-tree leaf node") done: @@ -1953,7 +1956,7 @@ done: */ H5B2_internal_t * H5B2__protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, - uint16_t nrec, uint16_t depth, H5AC_protect_t rw) + uint16_t nrec, uint16_t depth, unsigned flags) { H5B2_internal_cache_ud_t udata; /* User data to pass through to cache 'deserialize' callback */ H5B2_internal_t *ret_value; /* Return value */ @@ -1965,6 +1968,9 @@ H5B2__protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, HDassert(H5F_addr_defined(addr)); HDassert(depth > 0); + /* only H5AC__READ_ONLY_FLAG may appear in flags */ + HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* Set up user data for callback */ udata.f = hdr->f; udata.hdr = hdr; @@ -1972,7 +1978,7 @@ H5B2__protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, udata.depth = depth; /* Protect the internal node */ - if(NULL == (ret_value = (H5B2_internal_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_BT2_INT, addr, &udata, rw))) + if(NULL == (ret_value = (H5B2_internal_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_BT2_INT, addr, &udata, flags))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to protect B-tree internal node") done: @@ -2021,7 +2027,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_internal_t *internal; /* Pointer to internal node */ /* Lock the current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, depth, H5AC_READ))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, depth, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Set up information about current node */ @@ -2040,7 +2046,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_leaf_t *leaf; /* Pointer to leaf node */ /* Lock the current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, H5AC_READ))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Set up information about current node */ @@ -2125,7 +2131,7 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr /* Lock current B-tree node */ leaf_addr = curr_node_ptr->addr; - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, leaf_addr, curr_node_ptr->node_nrec, H5AC_WRITE))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, leaf_addr, curr_node_ptr->node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Sanity check number of records */ @@ -2234,7 +2240,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, /* Lock current B-tree node */ internal_addr = curr_node_ptr->addr; - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, internal_addr, curr_node_ptr->node_nrec, depth, H5AC_WRITE))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, internal_addr, curr_node_ptr->node_nrec, depth, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Determine the correct number of records to merge at */ @@ -2443,7 +2449,7 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Lock B-tree leaf node */ leaf_addr = curr_node_ptr->addr; - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, leaf_addr, curr_node_ptr->node_nrec, H5AC_WRITE))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, leaf_addr, curr_node_ptr->node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Sanity check number of records */ @@ -2551,7 +2557,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Lock current B-tree node */ internal_addr = curr_node_ptr->addr; - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, internal_addr, curr_node_ptr->node_nrec, depth, H5AC_WRITE))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, internal_addr, curr_node_ptr->node_nrec, depth, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") HDassert(internal->nrec == curr_node_ptr->node_nrec); HDassert(depth == hdr->depth || internal->nrec > 1); @@ -2827,7 +2833,7 @@ H5B2__neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_p HDassert(op); /* Lock current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, H5AC_READ))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Locate node pointer for child */ @@ -2914,7 +2920,7 @@ H5B2__neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, HDassert(op); /* Lock current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, depth, H5AC_READ))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, depth, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Locate node pointer for child */ @@ -2987,7 +2993,7 @@ H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, unsigned u; /* Local index */ /* Lock the current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, depth, H5AC_WRITE))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, depth, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Set up information about current node */ @@ -3004,7 +3010,7 @@ H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_leaf_t *leaf; /* Pointer to leaf node */ /* Lock the current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, H5AC_WRITE))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Set up information about current node */ @@ -3063,7 +3069,7 @@ H5B2__node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, HDassert(depth > 0); /* Lock the current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, depth, H5AC_READ))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, depth, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Recursively descend into child nodes, if we are above the "twig" level in the B-tree */ diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index a2d32e6..b13c58d 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -231,6 +231,7 @@ typedef enum H5B2_nodepos_t { /* Callback info for loading a free space header into the cache */ typedef struct H5B2_hdr_cache_ud_t { H5F_t *f; /* File that v2 b-tree header is within */ + haddr_t addr; /* Address of B-tree header in the file */ void *ctx_udata; /* User-data for protecting */ } H5B2_hdr_cache_ud_t; @@ -305,11 +306,11 @@ H5_DLL herr_t H5B2__hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id); /* Routines for operating on leaf nodes */ H5B2_leaf_t *H5B2__protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, - uint16_t nrec, H5AC_protect_t rw); + uint16_t nrec, unsigned flags); /* Routines for operating on internal nodes */ H5_DLL H5B2_internal_t *H5B2__protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - haddr_t addr, uint16_t nrec, uint16_t depth, H5AC_protect_t rw); + haddr_t addr, uint16_t nrec, uint16_t depth, unsigned flags); /* Routines for allocating nodes */ H5_DLL herr_t H5B2__split_root(H5B2_hdr_t *hdr, hid_t dxpl_id); @@ -347,7 +348,7 @@ H5_DLL herr_t H5B2__neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Routines for removing records */ H5_DLL herr_t H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, void *swap_loc, uint16_t depth, - H5AC_info_t *parent_cache_info, hbool_t *parent_cache_info_dirtied_ptr, + H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_nodepos_t curr_pos, H5B2_node_ptr_t *curr_node_ptr, void *udata, H5B2_remove_t op, void *op_data); H5_DLL herr_t H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, @@ -355,8 +356,8 @@ H5_DLL herr_t H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, void *udata, H5B2_remove_t op, void *op_data); H5_DLL herr_t H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, void *swap_loc, uint16_t depth, - H5AC_info_t *parent_cache_info, hbool_t *parent_cache_info_dirtied_ptr, - H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t idx, + H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, + H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t n, H5B2_remove_t op, void *op_data); H5_DLL herr_t H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, diff --git a/src/H5B2test.c b/src/H5B2test.c index 1d31af8..35771f2 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -430,7 +430,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Locate node pointer for child */ @@ -470,7 +470,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Locate record */ diff --git a/src/H5Bcache.c b/src/H5Bcache.c index a161e88..dfa4dab 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -37,7 +37,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Bpkg.h" /* B-link trees */ #include "H5Eprivate.h" /* Error handling */ -#include "H5MFprivate.h" /* File memory management */ /****************/ @@ -55,11 +54,14 @@ /********************/ /* Metadata cache callbacks */ -static H5B_t *H5B__load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5B__flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *b, unsigned H5_ATTR_UNUSED * flags_ptr); -static herr_t H5B__dest(H5F_t *f, H5B_t *bt); -static herr_t H5B__clear(H5F_t *f, H5B_t *b, hbool_t destroy); -static herr_t H5B__compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_ptr); +static herr_t H5B__get_load_size(const void *udata, size_t *image_len); +static void *H5B__deserialize(const void *image, size_t len, void *udata, + hbool_t *dirty); +static herr_t H5B__image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5B__serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5B__free_icr(void *thing); /*********************/ @@ -68,13 +70,19 @@ static herr_t H5B__compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_pt /* H5B inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_BT[1] = {{ - H5AC_BT_ID, - (H5AC_load_func_t)H5B__load, - (H5AC_flush_func_t)H5B__flush, - (H5AC_dest_func_t)H5B__dest, - (H5AC_clear_func_t)H5B__clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5B__compute_size, + H5AC_BT_ID, /* Metadata client ID */ + "v1 B-tree", /* Metadata client name (for debugging) */ + H5FD_MEM_BTREE, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5B__get_load_size, /* 'get_load_size' callback */ + H5B__deserialize, /* 'deserialize' callback */ + H5B__image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5B__serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5B__free_icr, /* 'free_icr' callback */ + NULL, /* 'clear" callback */ + NULL, /* 'fsf_size' callback */ }}; /*******************/ @@ -84,35 +92,71 @@ const H5AC_class_t H5AC_BT[1] = {{ /*------------------------------------------------------------------------- - * Function: H5B__load + * Function: H5B__get_load_size * - * Purpose: Loads a B-tree node from the disk. + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5B__get_load_size(const void *_udata, size_t *image_len) +{ + const H5B_cache_ud_t *udata = (const H5B_cache_ud_t *)_udata; /* User data for callback */ + H5B_shared_t *shared; /* Pointer to shared B-tree info */ + + FUNC_ENTER_STATIC_NOERR + + /* Check arguments */ + HDassert(udata); + HDassert(image_len); + + /* Get shared info for B-tree */ + shared = (H5B_shared_t *)H5UC_GET_OBJ(udata->rc_shared); + HDassert(shared); + + /* Set the image length size */ + *image_len = shared->sizeof_rnode; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5B__get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5B__deserialize + * + * Purpose: Deserialize the data structure from disk. * * Return: Success: Pointer to a new B-tree node. * Failure: NULL * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Mar 24, 2008 * *------------------------------------------------------------------------- */ -static H5B_t * -H5B__load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5B__deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void *_udata, + hbool_t H5_ATTR_UNUSED *dirty) { H5B_t *bt = NULL; /* Pointer to the deserialized B-tree node */ H5B_cache_ud_t *udata = (H5B_cache_ud_t *)_udata; /* User data for callback */ H5B_shared_t *shared; /* Pointer to shared B-tree info */ - const uint8_t *p; /* Pointer into raw data buffer */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into image buffer */ uint8_t *native; /* Pointer to native keys */ unsigned u; /* Local index variable */ H5B_t *ret_value; /* Return value */ FUNC_ENTER_STATIC - /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* check arguments */ + HDassert(image); HDassert(udata); /* Allocate the B-tree node in memory */ @@ -134,53 +178,50 @@ H5B__load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) if(NULL == (bt->child = H5FL_SEQ_MALLOC(haddr_t, (size_t)shared->two_k))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate buffer for child addresses") - if(H5F_block_read(f, H5FD_MEM_BTREE, addr, shared->sizeof_rnode, dxpl_id, shared->page) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree node") - - /* Set the pointer into the raw data buffer */ - p = shared->page; - /* magic number */ - if(HDmemcmp(p, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC)) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree signature") - p += 4; + image += H5_SIZEOF_MAGIC; /* node type and level */ - if(*p++ != (uint8_t)udata->type->id) + if(*image++ != (uint8_t)udata->type->id) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "incorrect B-tree node type") - bt->level = *p++; + bt->level = *image++; /* entries used */ - UINT16DECODE(p, bt->nchildren); + UINT16DECODE(image, bt->nchildren); /* Check if bt->nchildren is greater than two_k */ if(bt->nchildren > shared->two_k) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "number of children is greater than maximum") /* sibling pointers */ - H5F_addr_decode(udata->f, (const uint8_t **)&p, &(bt->left)); - H5F_addr_decode(udata->f, (const uint8_t **)&p, &(bt->right)); + H5F_addr_decode(udata->f, (const uint8_t **)&image, &(bt->left)); + H5F_addr_decode(udata->f, (const uint8_t **)&image, &(bt->right)); /* the child/key pairs */ native = bt->native; for(u = 0; u < bt->nchildren; u++) { /* Decode native key value */ - if((udata->type->decode)(shared, p, native) < 0) + if((udata->type->decode)(shared, image, native) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDECODE, NULL, "unable to decode key") - p += shared->sizeof_rkey; + image += shared->sizeof_rkey; native += udata->type->sizeof_nkey; /* Decode address value */ - H5F_addr_decode(udata->f, (const uint8_t **)&p, bt->child + u); + H5F_addr_decode(udata->f, (const uint8_t **)&image, bt->child + u); } /* end for */ /* Decode final key */ if(bt->nchildren > 0) { /* Decode native key value */ - if((udata->type->decode)(shared, p, native) < 0) + if((udata->type->decode)(shared, image, native) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDECODE, NULL, "unable to decode key") } /* end if */ + /* Sanity check */ + HDassert((size_t)((const uint8_t *)image - (const uint8_t *)_image) <= len); + /* Set return value */ ret_value = bt; @@ -190,223 +231,151 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B__load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* end H5B__deserialize() */ /*------------------------------------------------------------------------- - * Function: H5B__flush + * Function: H5B__image_len * - * Purpose: Flushes a dirty B-tree node to disk. + * Purpose: Compute the size of the data structure on disk. * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 20, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5B__flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *bt, unsigned H5_ATTR_UNUSED * flags_ptr) +H5B__image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { + const H5B_t *bt = (const H5B_t *)_thing; /* Pointer to the B-tree node */ H5B_shared_t *shared; /* Pointer to shared B-tree info */ - herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC + FUNC_ENTER_STATIC_NOERR - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(bt); + HDassert(image_len); + + /* Get shared info for B-tree */ shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared); HDassert(shared); - HDassert(shared->type); - HDassert(shared->type->encode); - if(bt->cache_info.is_dirty) { - uint8_t *p; /* Pointer into raw data buffer */ - uint8_t *native; /* Pointer to native keys */ - unsigned u; /* Local index variable */ - - p = shared->page; - - /* magic number */ - HDmemcpy(p, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += 4; - - /* node type and level */ - *p++ = (uint8_t)shared->type->id; - H5_CHECK_OVERFLOW(bt->level, unsigned, uint8_t); - *p++ = (uint8_t)bt->level; - - /* entries used */ - UINT16ENCODE(p, bt->nchildren); - - /* sibling pointers */ - H5F_addr_encode(f, &p, bt->left); - H5F_addr_encode(f, &p, bt->right); - - /* child keys and pointers */ - native = bt->native; - for(u = 0; u < bt->nchildren; ++u) { - /* encode the key */ - if(shared->type->encode(shared, p, native) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key") - p += shared->sizeof_rkey; - native += shared->type->sizeof_nkey; - - /* encode the child address */ - H5F_addr_encode(f, &p, bt->child[u]); - } /* end for */ - if(bt->nchildren > 0) { - /* Encode the final key */ - if(shared->type->encode(shared, p, native) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key") - } /* end if */ - - /* - * Write the disk page. We always write the header, but we don't - * bother writing data for the child entries that don't exist or - * for the final unchanged children. - */ - if(H5F_block_write(f, H5FD_MEM_BTREE, addr, shared->sizeof_rnode, dxpl_id, shared->page) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to save B-tree node to disk") - - bt->cache_info.is_dirty = FALSE; - } /* end if */ - - if(destroy) - if(H5B__dest(f, bt) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") + /* Set the image length size */ + *image_len = shared->sizeof_rnode; -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B__flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5B__image_len() */ /*------------------------------------------------------------------------- - * Function: H5B__dest + * Function: H5B__serialize * - * Purpose: Destroys a B-tree node in memory. + * Purpose: Serialize the data structure for writing to disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 15 2003 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Mar 24, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5B__dest(H5F_t *f, H5B_t *bt) +H5B__serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, + void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5B_t *bt = (H5B_t *)_thing; /* Pointer to the B-tree node */ + H5B_shared_t *shared; /* Pointer to shared B-tree info */ + uint8_t *image = (uint8_t *)_image; /* Pointer into image buffer */ + uint8_t *native; /* Pointer to native keys */ + unsigned u; /* Local index counter */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - /* - * Check arguments. - */ - HDassert(f); + /* check arguments */ + HDassert(image); HDassert(bt); HDassert(bt->rc_shared); + shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared); + HDassert(shared); + HDassert(shared->type); + HDassert(shared->type->encode); - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!bt->cache_info.free_file_space_on_destroy || H5F_addr_defined(bt->cache_info.addr)); + /* magic number */ + HDmemcpy(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += 4; - /* Check for freeing file space for B-tree node */ - if(bt->cache_info.free_file_space_on_destroy) { - H5B_shared_t *shared; /* Pointer to shared B-tree info */ + /* node type and level */ + *image++ = (uint8_t)shared->type->id; + H5_CHECK_OVERFLOW(bt->level, unsigned, uint8_t); + *image++ = (uint8_t)bt->level; - /* Get the pointer to the shared B-tree info */ - shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared); - HDassert(shared); + /* entries used */ + UINT16ENCODE(image, bt->nchildren); + + /* sibling pointers */ + H5F_addr_encode(f, &image, bt->left); + H5F_addr_encode(f, &image, bt->right); - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_BTREE, H5AC_dxpl_id, bt->cache_info.addr, (hsize_t)shared->sizeof_rnode) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree node") + /* child keys and pointers */ + native = bt->native; + for(u = 0; u < bt->nchildren; ++u) { + /* encode the key */ + if(shared->type->encode(shared, image, native) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key") + image += shared->sizeof_rkey; + native += shared->type->sizeof_nkey; + + /* encode the child address */ + H5F_addr_encode(f, &image, bt->child[u]); + } /* end for */ + if(bt->nchildren > 0) { + /* Encode the final key */ + if(shared->type->encode(shared, image, native) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key") } /* end if */ - /* Destroy B-tree node */ - if(H5B__node_dest(bt) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") + /* Sanity check */ + HDassert((size_t)((const uint8_t *)image - (const uint8_t *)_image) <= len); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B__dest() */ +} /* end H5B__serialize() */ /*------------------------------------------------------------------------- - * Function: H5B__clear + * Function: H5B__free_icr * - * Purpose: Mark a B-tree node in memory as non-dirty. + * Purpose: Destroy/release an "in core representation" of a data structure * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 20 2003 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Mar 26, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5B__clear(H5F_t *f, H5B_t *bt, hbool_t destroy) +H5B__free_icr(void *thing) { - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - /* - * Check arguments. - */ - HDassert(bt); - - /* Reset the dirty flag. */ - bt->cache_info.is_dirty = FALSE; + /* Check arguments */ + HDassert(thing); - if(destroy) - if(H5B__dest(f, bt) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") + /* Destroy B-tree node */ + if(H5B__node_dest((H5B_t *)thing) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B__clear() */ - - -/*------------------------------------------------------------------------- - * Function: H5B__compute_size - * - * Purpose: Compute the size in bytes of the specified instance of - * H5B_t on disk, and return it in *len_ptr. On failure, - * the value of *len_ptr is undefined. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer - * 5/13/04 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5B__compute_size(const H5F_t H5_ATTR_UNUSED *f, const H5B_t *bt, size_t *size_ptr) -{ - H5B_shared_t *shared; /* Pointer to shared B-tree info */ - - FUNC_ENTER_STATIC_NOERR - - /* check arguments */ - HDassert(f); - HDassert(bt); - HDassert(bt->rc_shared); - shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared); - HDassert(shared); - HDassert(shared->type); - HDassert(size_ptr); - - /* Set size value */ - *size_ptr = shared->sizeof_rnode; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B__compute_size() */ +} /* end H5B__free_icr() */ diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c index 526a647..e6d54dc 100644 --- a/src/H5Bdbg.c +++ b/src/H5Bdbg.c @@ -89,7 +89,7 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC_READ))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node") /* @@ -206,7 +206,7 @@ H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC_READ); + bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG); HDassert(bt); shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared); HDassert(shared); @@ -227,7 +227,7 @@ H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void * test. */ for(ncell = 0; cur; ncell++) { - bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, cur->addr, &cache_udata, H5AC_READ); + bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, cur->addr, &cache_udata, H5AC__READ_ONLY_FLAG); HDassert(bt); /* Check node header */ diff --git a/src/H5C.c b/src/H5C.c index 5cdd65f..fc4e8a5 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -85,12 +85,23 @@ #include "H5FDprivate.h" /* File drivers */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ +#include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ #include "H5SLprivate.h" /* Skip lists */ /* + * Private macros. + */ +#if H5C_DO_MEMORY_SANITY_CHECKS +#define H5C_IMAGE_EXTRA_SPACE 8 +#define H5C_IMAGE_SANITY_VALUE "DeadBeef" +#else /* H5C_DO_MEMORY_SANITY_CHECKS */ +#define H5C_IMAGE_EXTRA_SPACE 0 +#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ + +/* * Private file-scope variables. */ @@ -103,27 +114,21 @@ H5FL_DEFINE_STATIC(H5C_t); */ static herr_t H5C__auto_adjust_cache_size(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - hbool_t write_permitted, - hbool_t * first_flush_ptr); + hid_t dxpl_id, + hbool_t write_permitted); static herr_t H5C__autoadjust__ageout(H5F_t * f, + hid_t dxpl_id, double hit_rate, enum H5C_resize_status * status_ptr, size_t * new_max_cache_size_ptr, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - hbool_t write_permitted, - hbool_t * first_flush_ptr); + hbool_t write_permitted); static herr_t H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr); static herr_t H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - hbool_t write_permitted, - hbool_t * first_flush_ptr); + hid_t dxpl_id, + hbool_t write_permitted); static herr_t H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr); @@ -135,19 +140,16 @@ static herr_t H5C__flash_increase_cache_size(H5C_t * cache_ptr, size_t old_entry_size, size_t new_entry_size); -static herr_t H5C_flush_single_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - const H5C_class_t * type_ptr, - haddr_t addr, - unsigned flags, - hbool_t * first_flush_ptr, - hbool_t del_entry_from_slist_on_destroy); +static herr_t H5C_flush_single_entry(const H5F_t * f, + hid_t dxpl_id, + haddr_t addr, + unsigned flags, + hbool_t del_entry_from_slist_on_destroy, + int64_t *entry_size_change_ptr); -static herr_t H5C_flush_invalidate_cache(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - unsigned flags); +static herr_t H5C_flush_invalidate_cache(const H5F_t * f, + hid_t dxpl_id, + unsigned flags); static void * H5C_load_entry(H5F_t * f, hid_t dxpl_id, @@ -156,19 +158,16 @@ static void * H5C_load_entry(H5F_t * f, void * udata); static herr_t H5C_make_space_in_cache(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - size_t space_needed, - hbool_t write_permitted, - hbool_t * first_flush_ptr); + hid_t dxpl_id, + size_t space_needed, + hbool_t write_permitted); static herr_t H5C_tag_entry(H5C_t * cache_ptr, H5C_cache_entry_t * entry_ptr, hid_t dxpl_id); static herr_t H5C_flush_tagged_entries(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, H5C_t * cache_ptr, haddr_t tag); @@ -176,20 +175,29 @@ static herr_t H5C_mark_tagged_entries(H5C_t * cache_ptr, haddr_t tag); static herr_t H5C_flush_marked_entries(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, H5C_t * cache_ptr); #if H5C_DO_TAGGING_SANITY_CHECKS static herr_t H5C_verify_tag(int id, haddr_t tag); #endif +#if H5C_DO_SLIST_SANITY_CHECKS +static hbool_t H5C_entry_in_skip_list(H5C_t * cache_ptr, + H5C_cache_entry_t *target_ptr); +#endif /* H5C_DO_SLIST_SANITY_CHECKS */ + #if H5C_DO_EXTREME_SANITY_CHECKS static herr_t H5C_validate_lru_list(H5C_t * cache_ptr); static herr_t H5C_validate_pinned_entry_list(H5C_t * cache_ptr); static herr_t H5C_validate_protected_entry_list(H5C_t * cache_ptr); #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ +#if 0 /* debugging routines */ +herr_t H5C_dump_cache(H5C_t * cache_ptr, const char * cache_name); +herr_t H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn); +#endif /* debugging routines */ + /**************************************************************************** * @@ -208,25 +216,53 @@ static herr_t H5C_validate_protected_entry_list(H5C_t * cache_ptr); #define H5C__EPOCH_MARKER_TYPE H5C__MAX_NUM_TYPE_IDS -static void *H5C_epoch_marker_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, - void *udata); -static herr_t H5C_epoch_marker_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, - unsigned *flags_ptr); -static herr_t H5C_epoch_marker_dest(H5F_t *f, void *thing); -static herr_t H5C_epoch_marker_clear(H5F_t *f, void *thing, hbool_t dest); -static herr_t H5C_epoch_marker_notify(H5C_notify_action_t action, void *thing); -static herr_t H5C_epoch_marker_size(const H5F_t *f, const void *thing, size_t *size_ptr); +static herr_t H5C__epoch_marker_get_load_size(const void *udata_ptr, + size_t *image_len_ptr); +static void * H5C__epoch_marker_deserialize(const void * image_ptr, + size_t len, + void * udata, + hbool_t * dirty_ptr); +static herr_t H5C__epoch_marker_image_len(const void * thing, + size_t *image_len_ptr, + hbool_t *compressed_ptr, + size_t *compressed_len_ptr); +static herr_t H5C__epoch_marker_pre_serialize(const H5F_t *f, + hid_t dxpl_id, + void * thing, + haddr_t addr, + size_t len, + size_t compressed_len, + haddr_t * new_addr_ptr, + size_t * new_len_ptr, + size_t * new_compressed_len_ptr, + unsigned * flags_ptr); +static herr_t H5C__epoch_marker_serialize(const H5F_t *f, + void * image_ptr, + size_t len, + void * thing); +static herr_t H5C__epoch_marker_notify(H5C_notify_action_t action, void *thing); +static herr_t H5C__epoch_marker_free_icr(void * thing); + +static herr_t H5C__epoch_marker_clear(const H5F_t *f, void * thing, + hbool_t about_to_destroy); +static herr_t H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, + size_t H5_ATTR_UNUSED * fsf_size_ptr); const H5C_class_t epoch_marker_class = { - /* id = */ H5C__EPOCH_MARKER_TYPE, - /* load = */ &H5C_epoch_marker_load, - /* flush = */ &H5C_epoch_marker_flush, - /* dest = */ &H5C_epoch_marker_dest, - /* clear = */ &H5C_epoch_marker_clear, - /* notify = */&H5C_epoch_marker_notify, - /* size = */ &H5C_epoch_marker_size + /* id = */ H5C__EPOCH_MARKER_TYPE, + /* name = */ "epoch marker", + /* mem_type = */ H5FD_MEM_DEFAULT, /* value doesn't matter */ + /* flags = */ H5AC__CLASS_NO_FLAGS_SET, + /* get_load_size = */ H5C__epoch_marker_get_load_size, + /* deserialize = */ H5C__epoch_marker_deserialize, + /* image_len = */ H5C__epoch_marker_image_len, + /* pre_serialize = */ H5C__epoch_marker_pre_serialize, + /* serialize = */ H5C__epoch_marker_serialize, + /* notify = */ H5C__epoch_marker_notify, + /* free_icr = */ H5C__epoch_marker_free_icr, + /* clear = */ H5C__epoch_marker_clear, + /* fsf_size = */ H5C__epoch_marker_fsf_size, }; @@ -239,107 +275,114 @@ const H5C_class_t epoch_marker_class = * JRM - 11/16/04 * ***************************************************************************/ - -static void * -H5C_epoch_marker_load(H5F_t H5_ATTR_UNUSED * f, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t H5_ATTR_UNUSED addr, - void H5_ATTR_UNUSED * udata) +static herr_t +H5C__epoch_marker_get_load_size(const void H5_ATTR_UNUSED *udata_ptr, + size_t H5_ATTR_UNUSED *image_len_ptr) { - void * ret_value = NULL; /* Return value */ + FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ - FUNC_ENTER_NOAPI_NOINIT + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn."); - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "called unreachable fcn.") + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5C__epoch_marker_get_load_size() */ -done: + +static void * +H5C__epoch_marker_deserialize(const void H5_ATTR_UNUSED * image_ptr, size_t H5_ATTR_UNUSED len, + void H5_ATTR_UNUSED * udata, hbool_t H5_ATTR_UNUSED * dirty_ptr) +{ + FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ - FUNC_LEAVE_NOAPI(ret_value) -} + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn."); + FUNC_LEAVE_NOAPI(NULL) +} /* end H5C__epoch_marker_deserialize() */ static herr_t -H5C_epoch_marker_flush(H5F_t H5_ATTR_UNUSED *f, - hid_t H5_ATTR_UNUSED dxpl_id, - hbool_t H5_ATTR_UNUSED dest, - haddr_t H5_ATTR_UNUSED addr, - void H5_ATTR_UNUSED *thing, - unsigned H5_ATTR_UNUSED * flags_ptr) +H5C__epoch_marker_image_len(const void H5_ATTR_UNUSED *thing, + size_t H5_ATTR_UNUSED *image_len_ptr, hbool_t H5_ATTR_UNUSED *compressed_ptr, + size_t H5_ATTR_UNUSED *compressed_len_ptr) { - herr_t ret_value = FAIL; /* Return value */ + FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ - FUNC_ENTER_NOAPI_NOINIT + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn."); - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "called unreachable fcn.") + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5C__epoch_marker_image_len() */ -done: + +static herr_t +H5C__epoch_marker_pre_serialize(const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, + void H5_ATTR_UNUSED *thing, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED len, + size_t H5_ATTR_UNUSED compressed_len, haddr_t H5_ATTR_UNUSED *new_addr_ptr, + size_t H5_ATTR_UNUSED *new_len_ptr, size_t H5_ATTR_UNUSED *new_compressed_len_ptr, + unsigned H5_ATTR_UNUSED *flags_ptr) +{ + FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ - FUNC_LEAVE_NOAPI(ret_value) -} + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn."); + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5C__epoch_marker_pre_serialize() */ static herr_t -H5C_epoch_marker_dest(H5F_t H5_ATTR_UNUSED * f, - void H5_ATTR_UNUSED * thing) +H5C__epoch_marker_serialize(const H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED *image_ptr, + size_t H5_ATTR_UNUSED len, void H5_ATTR_UNUSED *thing) { - herr_t ret_value = FAIL; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "called unreachable fcn.") + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn."); -done: - - FUNC_LEAVE_NOAPI(ret_value) -} + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5C__epoch_marker_serialize() */ + static herr_t -H5C_epoch_marker_clear(H5F_t H5_ATTR_UNUSED * f, - void H5_ATTR_UNUSED * thing, - hbool_t H5_ATTR_UNUSED dest) +H5C__epoch_marker_notify(H5C_notify_action_t H5_ATTR_UNUSED action, + void H5_ATTR_UNUSED * thing) { - herr_t ret_value = FAIL; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "called unreachable fcn.") + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn."); -done: - - FUNC_LEAVE_NOAPI(ret_value) -} + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5C__epoch_marker_notify() */ + static herr_t -H5C_epoch_marker_notify(H5C_notify_action_t H5_ATTR_UNUSED action, - void H5_ATTR_UNUSED * thing) +H5C__epoch_marker_free_icr(void H5_ATTR_UNUSED * thing) { - herr_t ret_value = FAIL; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "called unreachable fcn.") + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn."); -done: - FUNC_LEAVE_NOAPI(ret_value) -} + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5C__epoch_marker_free_icr() */ -static herr_t -H5C_epoch_marker_size(const H5F_t H5_ATTR_UNUSED * f, - const void H5_ATTR_UNUSED * thing, - size_t H5_ATTR_UNUSED * size_ptr) + +static herr_t +H5C__epoch_marker_clear(const H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED * thing, hbool_t H5_ATTR_UNUSED about_to_destroy) { - herr_t ret_value = FAIL; /* Return value */ + FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ - FUNC_ENTER_NOAPI_NOINIT + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn."); - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "called unreachable fcn.") + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5C__epoch_marker_clear() */ -done: + +static herr_t +H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, size_t H5_ATTR_UNUSED *fsf_size_ptr) +{ + FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ + + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn."); + + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5C__epoch_marker_fsf_size() */ - FUNC_LEAVE_NOAPI(ret_value) -} /*------------------------------------------------------------------------- @@ -423,21 +466,46 @@ done: * Programmer: John Mainzer * 3/17/10 * + * Changes: Ported code to detect next entry status changes as the + * the result of a flush from the serial code in the scan of + * the LRU. Also added code to detect and adapt to the + * removal from the cache of the next entry in the scan of + * the LRU. + * + * Note that at present, all of these changes should not + * be required as the operations on entries as they are + * flushed that can cause these condiditions are not premitted + * in the parallel case. However, Quincey indicates that + * this may change, and thus has requested the modification. + * + * Note the assert(FALSE) in the if statement whose body + * restarts the scan of the LRU. As the body of the if + * statement should be unreachable, it should never be + * triggered until the constraints on the parallel case + * are relaxed. Please remove the assertion at that time. + * + * Also added warning on the Pinned Entry List scan, as it + * is potentially subject to the same issue. As there is + * no cognate of this scan in the serial code, I don't have + * a fix to port to it. + * + * JRM -- 4/10/19 + * *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL #define H5C_APPLY_CANDIDATE_LIST__DEBUG 0 herr_t H5C_apply_candidate_list(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, H5C_t * cache_ptr, int num_candidates, haddr_t * candidates_list_ptr, int mpi_rank, int mpi_size) { - hbool_t first_flush = FALSE; + hbool_t restart_scan; + hbool_t prev_is_dirty; int i; int m; int n; @@ -457,6 +525,7 @@ H5C_apply_candidate_list(H5F_t * f, int * candidate_assignment_table = NULL; haddr_t addr; H5C_cache_entry_t * clear_ptr = NULL; + H5C_cache_entry_t * next_ptr = NULL; H5C_cache_entry_t * entry_ptr = NULL; H5C_cache_entry_t * flush_ptr = NULL; H5C_cache_entry_t * delayed_ptr = NULL; @@ -634,16 +703,29 @@ H5C_apply_candidate_list(H5F_t * f, * should be reworked to account for additional cases. * ===================================================================== */ + HDassert(entries_to_flush >= 0); + + restart_scan = FALSE; entries_examined = 0; initial_list_len = cache_ptr->LRU_list_len; entry_ptr = cache_ptr->LRU_tail_ptr; /* Examine each entry in the LRU list */ - while((entry_ptr != NULL) && (entries_examined <= initial_list_len) && - ((entries_cleared + entries_flushed) < num_candidates)) { + while ( ( entry_ptr != NULL ) + && + ( entries_examined <= (entries_to_flush + 1) * initial_list_len ) + && + ( (entries_cleared + entries_flushed) < num_candidates ) ) { + + if ( entry_ptr->prev != NULL ) + prev_is_dirty = entry_ptr->prev->is_dirty; /* If this process needs to clear this entry. */ if(entry_ptr->clear_on_unprotect) { + + HDassert(entry_ptr->is_dirty); + + next_ptr = entry_ptr->next; entry_ptr->clear_on_unprotect = FALSE; clear_ptr = entry_ptr; entry_ptr = entry_ptr->prev; @@ -654,20 +736,26 @@ H5C_apply_candidate_list(H5F_t * f, (long long)clear_ptr->addr); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ + /* No need to check for the next entry in the scan being + * removed from the cache, as this call to H5C_flush_single_entry() + * will not call either the pre_serialize or serialize callbacks. + */ + if(H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - clear_ptr->type, + dxpl_id, clear_ptr->addr, H5C__FLUSH_CLEAR_ONLY_FLAG, - &first_flush, - TRUE) < 0) + TRUE, + NULL) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't clear entry.") } /* end if */ /* Else, if this process needs to flush this entry. */ else if (entry_ptr->flush_immediately) { + HDassert(entry_ptr->is_dirty); + + next_ptr = entry_ptr->next; entry_ptr->flush_immediately = FALSE; flush_ptr = entry_ptr; entry_ptr = entry_ptr->prev; @@ -678,22 +766,94 @@ H5C_apply_candidate_list(H5F_t * f, (long long)flush_ptr->addr); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ + /* reset entries_removed_counter and + * last_entry_removed_ptr prior to the call to + * H5C_flush_single_entry() so that we can spot + * unexpected removals of entries from the cache, + * and set the restart_scan flag if proceeding + * would be likely to cause us to scan an entry + * that is no longer in the cache. + * + * Note that as of this writing (April 2015) this + * case cannot occur in the parallel case. However + * Quincey is making noises about changing this, hence + * the insertion of this test. + * + * Note also that there is no test code to verify + * that this code actually works (although similar code + * in the serial version exists and is tested). + * + * Implementing a test will likely require implementing + * flush op like facilities in the parallel tests. At + * a guess this will not be terribly painful, but it + * will take a bit of time. + */ + cache_ptr->entries_removed_counter = 0; + cache_ptr->last_entry_removed_ptr = NULL; + if(H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - flush_ptr->type, + dxpl_id, flush_ptr->addr, H5C__NO_FLAGS_SET, - &first_flush, - TRUE) < 0) + TRUE, + NULL) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't flush entry.") + + if ( ( cache_ptr->entries_removed_counter > 1 ) || + ( cache_ptr->last_entry_removed_ptr == entry_ptr ) ) + + restart_scan = TRUE; + } /* end else-if */ /* Otherwise, no action to be taken on this entry. Grab the next. */ else { entry_ptr = entry_ptr->prev; + + if ( entry_ptr != NULL ) + next_ptr = entry_ptr->next; + } /* end else */ + if ( ( entry_ptr != NULL ) + && + ( ( restart_scan ) + || + ( entry_ptr->is_dirty != prev_is_dirty ) + || + ( entry_ptr->next != next_ptr ) + || + ( entry_ptr->is_protected ) + || + ( entry_ptr->is_pinned ) + ) + ) { + + /* something has happened to the LRU -- start over + * from the tail. + * + * Recall that this code should be un-reachable at present, + * as all the operations by entries on flush that could cause + * it to be reachable are disallowed in the parallel case at + * present. Hence the following assertion which should be + * removed if the above changes. + */ + + HDassert( ! restart_scan ); + HDassert( entry_ptr->is_dirty == prev_is_dirty ); + HDassert( entry_ptr->next == next_ptr ); + HDassert( ! entry_ptr->is_protected ); + HDassert( ! entry_ptr->is_pinned ); + + HDassert(FALSE); /* see comment above */ + + restart_scan = FALSE; + entry_ptr = cache_ptr->LRU_tail_ptr; +/* + H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) +*/ + } + entries_examined++; } /* end while */ @@ -705,6 +865,30 @@ H5C_apply_candidate_list(H5F_t * f, /* It is also possible that some of the cleared entries are on the * pinned list. Must scan that also. + * + * WARNING: + * + * As we now allow unpinning, and removal of other entries as a side + * effect of flushing an entry, it is possible that the next entry + * in a PEL scan could either be no longer pinned, or no longer in + * the cache by the time we get to it. + * + * At present, this is not possible in this case, as we disallow such + * operations in the parallel version of the library. However, Quincey + * has been making noises about relaxing this. If and when he does, + * we have a potential problem here. + * + * The same issue exists in the serial cache, and there are tests + * to detect this problem when it occurs, and adjust to it. As seen + * above in the LRU scan, I have ported such tests to the parallel + * code where a close cognate exists in the serial code. + * + * I haven't done so here, as there are no PEL scans where the problem + * can occur in the serial code. Needless to say, this will have to + * be repaired if the constraints on pre_serialize and serialize + * callbacks are relaxed in the parallel version of the metadata cache. + * + * JRM -- 4/1/15 */ #if H5C_APPLY_CANDIDATE_LIST__DEBUG @@ -772,14 +956,12 @@ H5C_apply_candidate_list(H5F_t * f, #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ if(H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - clear_ptr->type, - clear_ptr->addr, - H5C__FLUSH_CLEAR_ONLY_FLAG, - &first_flush, - TRUE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't clear entry.") + dxpl_id, + clear_ptr->addr, + H5C__FLUSH_CLEAR_ONLY_FLAG, + TRUE, + NULL) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't clear entry.") } /* end else-if */ /* Else, if this process needs to independently flush this entry. */ @@ -795,14 +977,12 @@ H5C_apply_candidate_list(H5F_t * f, #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ if(H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - flush_ptr->type, - flush_ptr->addr, - H5C__NO_FLAGS_SET, - &first_flush, - TRUE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't flush entry.") + dxpl_id, + flush_ptr->addr, + H5C__NO_FLAGS_SET, + TRUE, + NULL) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't clear entry.") } /* end else-if */ } /* end if */ @@ -843,13 +1023,11 @@ H5C_apply_candidate_list(H5F_t * f, } /* end if */ if(H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - delayed_ptr->type, + dxpl_id, delayed_ptr->addr, H5C__NO_FLAGS_SET, - &first_flush, - TRUE) < 0) + TRUE, + NULL) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't flush entry collectively.") @@ -1184,6 +1362,9 @@ H5C_create(size_t max_cache_size, /* Tagging Field Initializations */ cache_ptr->ignore_tags = FALSE; + cache_ptr->slist_changed = FALSE; + cache_ptr->slist_change_in_pre_serialize = FALSE; + cache_ptr->slist_change_in_serialize = FALSE; cache_ptr->slist_len = 0; cache_ptr->slist_size = (size_t)0; @@ -1197,6 +1378,9 @@ H5C_create(size_t max_cache_size, (cache_ptr->index)[i] = NULL; } + cache_ptr->entries_removed_counter = 0; + cache_ptr->last_entry_removed_ptr = NULL; + cache_ptr->pl_len = 0; cache_ptr->pl_size = (size_t)0; cache_ptr->pl_head_ptr = NULL; @@ -1271,11 +1455,8 @@ H5C_create(size_t max_cache_size, /* Set non-zero/FALSE/NULL fields for epoch markers */ for ( i = 0; i < H5C__MAX_EPOCH_MARKERS; i++ ) { - (cache_ptr->epoch_marker_active)[i] = FALSE; -#ifndef NDEBUG ((cache_ptr->epoch_markers)[i]).magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; -#endif /* NDEBUG */ ((cache_ptr->epoch_markers)[i]).addr = (haddr_t)i; ((cache_ptr->epoch_markers)[i]).type = &epoch_marker_class; } @@ -1530,9 +1711,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, *------------------------------------------------------------------------- */ herr_t -H5C_dest(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id) +H5C_dest(H5F_t * f, hid_t dxpl_id) { H5C_t * cache_ptr = f->shared->cache; herr_t ret_value = SUCCEED; /* Return value */ @@ -1544,8 +1723,7 @@ H5C_dest(H5F_t * f, HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); /* Flush and invalidate all cache entries */ - if(H5C_flush_invalidate_cache(f, primary_dxpl_id, secondary_dxpl_id, - H5C__NO_FLAGS_SET) < 0 ) + if(H5C_flush_invalidate_cache(f, dxpl_id, H5C__NO_FLAGS_SET) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") if(cache_ptr->slist_ptr != NULL) { @@ -1570,7 +1748,9 @@ H5C_dest(H5F_t * f, #endif /* H5C_DO_SANITY_CHECKS */ #endif /* NDEBUG */ +#ifndef NDEBUG cache_ptr->magic = 0; +#endif /* NDEBUG */ cache_ptr = H5FL_FREE(H5C_t, cache_ptr); @@ -1595,17 +1775,16 @@ done: *------------------------------------------------------------------------- */ 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) +H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, + haddr_t addr, unsigned flags) { H5C_t * cache_ptr; - herr_t result; - hbool_t first_flush = TRUE; H5C_cache_entry_t * entry_ptr = NULL; + unsigned flush_flags = (H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG); +#if H5C_DO_SANITY_CHECKS + hbool_t entry_was_dirty; + hsize_t entry_size; +#endif /* H5C_DO_SANITY_CHECKS */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1616,8 +1795,6 @@ H5C_expunge_entry(H5F_t * f, HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(type); - HDassert(type->clear); - HDassert(type->dest); HDassert(H5F_addr_defined(addr)); #if H5C_DO_EXTREME_SANITY_CHECKS @@ -1641,27 +1818,34 @@ H5C_expunge_entry(H5F_t * f, if(entry_ptr->is_pinned) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "Target entry is pinned.") - /* Pass along 'free file space' flag to cache client */ - entry_ptr->free_file_space_on_destroy = ( (flags & H5C__FREE_FILE_SPACE_FLAG) != 0 ); - /* If we get this far, call H5C_flush_single_entry() with the * H5C__FLUSH_INVALIDATE_FLAG and the H5C__FLUSH_CLEAR_ONLY_FLAG. * This will clear the entry, and then delete it from the cache. */ - result = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - entry_ptr->type, - entry_ptr->addr, - H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, - &first_flush, - TRUE); - if ( result < 0 ) { + /* Pass along 'free file space' flag to cache client. */ + flush_flags |= (flags & H5C__FREE_FILE_SPACE_FLAG); + +#if H5C_DO_SANITY_CHECKS + entry_was_dirty = entry_ptr->is_dirty; + entry_size = entry_ptr->size; +#endif /* H5C_DO_EXTREME_SANITY_CHECKS */ + + if(H5C_flush_single_entry(f, dxpl_id, entry_ptr->addr, flush_flags, TRUE, NULL) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_flush_single_entry() failed.") - HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, \ - "H5C_flush_single_entry() failed.") +#if H5C_DO_SANITY_CHECKS + if ( entry_was_dirty ) + { + /* we have just removed an entry from the skip list. Thus + * we must touch up cache_ptr->slist_len_increase and + * cache_ptr->slist_size_increase to keep from skewing + * the sanity checks on flushes. + */ + cache_ptr->slist_len_increase -= 1; + cache_ptr->slist_size_increase -= (int64_t)(entry_size); } +#endif /* H5C_DO_SANITY_CHECKS */ done: #if H5C_DO_EXTREME_SANITY_CHECKS @@ -1698,10 +1882,24 @@ done: * Programmer: John Mainzer * 6/2/04 * + * Changes: Modified function to test for slist chamges in + * pre_serialize and serialize callbacks, and re-start + * scans through the slist when such changes occur. + * + * This has been a potential problem for some time, + * and there has been code in this function to deal + * with elements of this issue. However the shift + * to the V3 cache in combination with the activities + * of some of the cache clients (in particular the + * free space manager and the fractal heap) have + * made this re-work necessary. + * + * JRM -- 12/13/14 + * *------------------------------------------------------------------------- */ herr_t -H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsigned flags) +H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) { H5C_t * cache_ptr = f->shared->cache; herr_t status; @@ -1709,9 +1907,9 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign hbool_t destroy; hbool_t flushed_entries_last_pass; hbool_t flush_marked_entries; - hbool_t first_flush = TRUE; hbool_t ignore_protected; hbool_t tried_to_flush_protected_entry = FALSE; + hbool_t restart_slist_scan; int32_t passes = 0; int32_t protected_entries = 0; H5SL_node_t * node_ptr = NULL; @@ -1722,6 +1920,10 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign int64_t flushed_entries_size = 0; int64_t initial_slist_len = 0; size_t initial_slist_size = 0; + int64_t entry_size_change; + int64_t * entry_size_change_ptr = &entry_size_change; +#else /* H5C_DO_SANITY_CHECKS */ + int64_t * entry_size_change_ptr = NULL; #endif /* H5C_DO_SANITY_CHECKS */ FUNC_ENTER_NOAPI(FAIL) @@ -1758,10 +1960,7 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign if ( destroy ) { - status = H5C_flush_invalidate_cache(f, - primary_dxpl_id, - secondary_dxpl_id, - flags); + status = H5C_flush_invalidate_cache(f, dxpl_id, flags); if ( status < 0 ) { @@ -1780,6 +1979,18 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign flushed_entries_last_pass = TRUE; + /* set the cache_ptr->slist_change_in_pre_serialize and + * cache_ptr->slist_change_in_serialize to false. + * + * These flags are set to TRUE by H5C_flush_single_entry if the + * slist is modified by a pre_serialize or serialize call respectively. + * H5C_flush_cache uses these flags to detect any modifications + * to the slist that might corrupt the scan of the slist -- and + * restart the scan in this event. + */ + cache_ptr->slist_change_in_pre_serialize = FALSE; + cache_ptr->slist_change_in_serialize = FALSE; + while ( ( passes < H5C__MAX_PASSES_ON_FLUSH ) && ( cache_ptr->slist_len != 0 ) && ( protected_entries == 0 ) && @@ -1797,18 +2008,6 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign { hbool_t flushed_during_dep_loop = FALSE; - /* Start at beginning of skip list each time */ - node_ptr = H5SL_first(cache_ptr->slist_ptr); - HDassert( node_ptr != NULL ); - - /* Get cache entry for this node */ - next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - if ( NULL == next_entry_ptr ) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") - HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); - HDassert( next_entry_ptr->is_dirty ); - HDassert( next_entry_ptr->in_slist ); - #if H5C_DO_SANITY_CHECKS /* For sanity checking, try to verify that the skip list has * the expected size and number of entries at the end of each @@ -1818,8 +2017,10 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign * or may not flush all the entries in the slist. * * To make things more entertaining, with the advent of the - * fractal heap, the entry flush callback can cause entries - * to be dirtied, resized, and/or moved. + * fractal heap, the entry serialize callback can cause entries + * to be dirtied, resized, and/or moved. Also, the + * pre_serialize callback can result in an entry being + * removed from the cache via the take ownership flag. * * To deal with this, we first make note of the initial * skip list length and size: @@ -1834,7 +2035,8 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign flushed_entries_size = 0; /* As mentioned above, there is the possibility that - * entries will be dirtied, resized, and/or flushed during + * entries will be dirtied, resized, flushed, or removed + * from the cache via the take ownership flag during * our pass through the skip list. To capture the number * of entries added, and the skip list size delta, * zero the slist_len_increase and slist_size_increase of @@ -1851,53 +2053,60 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign */ #endif /* H5C_DO_SANITY_CHECKS */ - while ( node_ptr != NULL ) + restart_slist_scan = TRUE; + + while ( ( restart_slist_scan ) || ( node_ptr != NULL ) ) { - entry_ptr = next_entry_ptr; + if ( restart_slist_scan ) + { + restart_slist_scan = FALSE; - /* With the advent of the fractal heap, it is possible - * that the flush callback will dirty and/or resize - * other entries in the cache. In particular, while - * Quincey has promised me that this will never happen, - * it is possible that the flush callback for an - * entry may protect an entry that is not in the cache, - * perhaps causing the cache to flush and possibly - * evict the entry associated with node_ptr to make - * space for the new entry. - * - * Thus we do a bit of extra sanity checking on entry_ptr, - * and break out of this scan of the skip list if we - * detect minor problems. We have a bit of leaway on the - * number of passes though the skip list, so this shouldn't - * be an issue in the flush in and of itself, as it should - * be all but impossible for this to happen more than once - * in any flush. - * - * Observe that that breaking out of the scan early - * shouldn't break the sanity checks just after the end - * of this while loop. - * - * If an entry has merely been marked clean and removed from - * the s-list, we simply break out of the scan. - * - * If the entry has been evicted, we flag an error and - * exit. - */ -#ifndef NDEBUG - if ( entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) { + /* Start at beginning of skip list */ + node_ptr = H5SL_first(cache_ptr->slist_ptr); - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry_ptr->magic is invalid ?!?!") + if ( node_ptr == NULL ) + { + /* the slist is empty -- break out of inner loop */ + break; + } + HDassert( node_ptr != NULL ); - } else -#endif /* NDEBUG */ - if ( ( ! entry_ptr->is_dirty ) || - ( ! entry_ptr->in_slist ) ) { + /* Get cache entry for this node */ + next_entry_ptr = + (H5C_cache_entry_t *)H5SL_item(node_ptr); - /* the s-list has been modified out from under us. - * break out of the loop. - */ - goto end_of_inner_loop;; + if(NULL == next_entry_ptr) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "next_entry_ptr == NULL ?!?!") + + HDassert( next_entry_ptr->magic == \ + H5C__H5C_CACHE_ENTRY_T_MAGIC ); + HDassert( next_entry_ptr->is_dirty ); + HDassert( next_entry_ptr->in_slist ); } + + entry_ptr = next_entry_ptr; + + /* With the advent of the fractal heap, the free space + * manager, and the version 3 cache, it is possible + * that the pre-serialize or serialize callback will + * dirty, resize, or take ownership of other entries + * in the cache. + * + * To deal with this, I have inserted code to detect any + * change in the skip list not directly under the control + * of this function. If such modifications are detected, + * we must re-start the scan of the skip list to avoid + * the possibility that the target of the next_entry_ptr + * may have been flushed or deleted from the cache. + * + * To verify that all such possibilities have been dealt + * with, we do a bit of extra sanity checking on + * entry_ptr. + */ + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(entry_ptr->in_slist); + HDassert(entry_ptr->is_dirty); /* increment node pointer now, before we delete its target * from the slist. @@ -1911,6 +2120,7 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); HDassert( next_entry_ptr->is_dirty ); HDassert( next_entry_ptr->in_slist ); + HDassert( entry_ptr != next_entry_ptr ); } else { next_entry_ptr = NULL; } @@ -1927,9 +2137,9 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign if ( entry_ptr->is_protected ) { - /* we probably have major problems -- but lets flush - * everything we can before we decide whether to flag - * an error. + /* we probably have major problems -- but lets + * flush everything we can before we decide + * whether to flag an error. */ tried_to_flush_protected_entry = TRUE; protected_entries++; @@ -1944,15 +2154,14 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign #if H5C_DO_SANITY_CHECKS flushed_entries_count++; flushed_entries_size += (int64_t)entry_ptr->size; + entry_size_change = 0; #endif /* H5C_DO_SANITY_CHECKS */ status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - NULL, - entry_ptr->addr, - flags, - &first_flush, - FALSE); + dxpl_id, + entry_ptr->addr, + flags, + FALSE, + entry_size_change_ptr); if ( status < 0 ) { /* This shouldn't happen -- if it does, @@ -1961,7 +2170,35 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ "dirty pinned entry flush failed.") } /* end if */ + +#if H5C_DO_SANITY_CHECKS + /* it is possible that the entry size changed + * during flush -- update flushed_entries_size + * to account for this. + */ + flushed_entries_size += entry_size_change; +#endif /* H5C_DO_SANITY_CHECKS */ + flushed_during_dep_loop = TRUE; + + if ((cache_ptr->slist_change_in_serialize) || + (cache_ptr->slist_change_in_pre_serialize)) + { + /* The slist has been modified by something + * other than the simple removal of the + * of the flushed entry after the flush. + * + * This has the potential to corrupt the + * scan through the slist, so restart it. + */ + restart_slist_scan = TRUE; + cache_ptr->slist_change_in_pre_serialize + = FALSE; + cache_ptr->slist_change_in_serialize + = FALSE; + + H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) + } } /* end if */ else if(entry_ptr->flush_dep_height < curr_flush_dep_height) /* This shouldn't happen -- if it does, just scream and die. */ @@ -1977,15 +2214,14 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign #if H5C_DO_SANITY_CHECKS flushed_entries_count++; flushed_entries_size += (int64_t)entry_ptr->size; + entry_size_change = 0; #endif /* H5C_DO_SANITY_CHECKS */ status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - NULL, - entry_ptr->addr, - flags, - &first_flush, - FALSE); + dxpl_id, + entry_ptr->addr, + flags, + FALSE, + entry_size_change_ptr); if ( status < 0 ) { /* This shouldn't happen -- if it does, @@ -1994,14 +2230,42 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ "Can't flush entry.") } + +#if H5C_DO_SANITY_CHECKS + /* it is possible that the entry size changed + * during flush -- update flushed_entries_size + * to account for this. + */ + flushed_entries_size += entry_size_change; +#endif /* H5C_DO_SANITY_CHECKS */ + flushed_during_dep_loop = TRUE; + + if ((cache_ptr->slist_change_in_serialize) || + (cache_ptr->slist_change_in_pre_serialize)) + { + /* The slist has been modified by something + * other than the simple removal of the + * of the flushed entry after the flush. + * + * This has the potential to corrupt the + * scan through the slist, so restart it. + */ + restart_slist_scan = TRUE; + cache_ptr->slist_change_in_pre_serialize + = FALSE; + cache_ptr->slist_change_in_serialize + = FALSE; + + H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) + } } /* end if */ else if(entry_ptr->flush_dep_height < curr_flush_dep_height) /* This shouldn't happen -- if it does, just scream and die. */ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.") } /* end else */ } /* end if */ - } /* while ( node_ptr != NULL ) */ + } /* while ( ( restart_slist_scan ) || ( node_ptr != NULL ) ) */ /* Check for incrementing flush dependency height */ if(flushed_during_dep_loop) { @@ -2020,7 +2284,8 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign curr_flush_dep_height++; } /* while ( curr_flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS) */ -end_of_inner_loop: + + passes++; #if H5C_DO_SANITY_CHECKS /* Verify that the slist size and length are as expected. */ @@ -2032,8 +2297,6 @@ end_of_inner_loop: flushed_entries_size) == cache_ptr->slist_size ); #endif /* H5C_DO_SANITY_CHECKS */ - passes++; - } /* while */ HDassert( protected_entries <= cache_ptr->pl_len ); @@ -2098,12 +2361,10 @@ done: */ herr_t H5C_flush_to_min_clean(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id) + hid_t dxpl_id) { H5C_t * cache_ptr; herr_t result; - hbool_t first_flush = TRUE; hbool_t write_permitted; #if 0 /* modified code -- commented out for now */ int i; @@ -2146,11 +2407,9 @@ H5C_flush_to_min_clean(H5F_t * f, } #if 1 /* original code */ result = H5C_make_space_in_cache(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, (size_t)0, - write_permitted, - &first_flush); + write_permitted); if ( result < 0 ) { @@ -2645,8 +2904,7 @@ H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr) */ herr_t H5C_insert_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, const H5C_class_t * type, haddr_t addr, void * thing, @@ -2654,7 +2912,6 @@ H5C_insert_entry(H5F_t * f, { H5C_t * cache_ptr; herr_t result; - hbool_t first_flush = TRUE; hbool_t insert_pinned; hbool_t flush_last; #ifdef H5_HAVE_PARALLEL @@ -2678,8 +2935,6 @@ H5C_insert_entry(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( type ); - HDassert( type->flush ); - HDassert( type->size ); HDassert( H5F_addr_defined(addr) ); HDassert( thing ); @@ -2718,15 +2973,16 @@ H5C_insert_entry(H5F_t * f, HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "duplicate entry in cache.") } /* end if */ -#ifndef NDEBUG entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; -#endif /* NDEBUG */ entry_ptr->cache_ptr = cache_ptr; entry_ptr->addr = addr; entry_ptr->type = type; + entry_ptr->image_ptr = NULL; + entry_ptr->image_up_to_date = FALSE; + /* Apply tag to newly inserted entry */ - if(H5C_tag_entry(cache_ptr, entry_ptr, primary_dxpl_id) < 0) + if(H5C_tag_entry(cache_ptr, entry_ptr, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "Cannot tag metadata entry") entry_ptr->is_protected = FALSE; @@ -2747,10 +3003,27 @@ H5C_insert_entry(H5F_t * f, /* not protected, so can't be dirtied */ entry_ptr->dirtied = FALSE; - /* Retrieve the size of the thing */ - if((type->size)(f, thing, &(entry_ptr->size)) < 0) + /* Retrieve the size of the thing. Set the compressed field to FALSE + * and the compressed_size field to zero first, as they may not be + * initialized by the image_len call. + */ + entry_ptr->compressed = FALSE; + entry_ptr->compressed_size = 0; + if((type->image_len)(thing, &(entry_ptr->size), &(entry_ptr->compressed), + &(entry_ptr->compressed_size)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing") HDassert(entry_ptr->size > 0 && entry_ptr->size < H5C_MAX_ENTRY_SIZE); + HDassert(((type->flags & H5C__CLASS_COMPRESSED_FLAG) != 0) || + (entry_ptr->compressed == FALSE)); + + /* entry has just been inserted -- thus compressed size cannot have + * been computed yet. Thus if entry_ptr->compressed is TRUE, + * entry_ptr->size must equal entry_ptr->compressed_size. + */ + HDassert((entry_ptr->compressed == FALSE) || + (entry_ptr->size == entry_ptr->compressed_size)); + HDassert((entry_ptr->compressed == TRUE) || + (entry_ptr->compressed_size == 0)); entry_ptr->in_slist = FALSE; @@ -2761,7 +3034,6 @@ H5C_insert_entry(H5F_t * f, entry_ptr->flush_in_progress = FALSE; entry_ptr->destroy_in_progress = FALSE; - entry_ptr->free_file_space_on_destroy = FALSE; /* Initialize flush dependency height fields */ entry_ptr->flush_dep_parent = NULL; @@ -2860,11 +3132,9 @@ H5C_insert_entry(H5F_t * f, */ result = H5C_make_space_in_cache(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, space_needed, - write_permitted, - &first_flush); + write_permitted); if ( result < 0 ) { @@ -2956,18 +3226,39 @@ done: * Programmer: John Mainzer * 7/5/05 * + * Changes: Tidied up code, removeing some old commented out + * code that had been left in pending success of the + * new version. + * + * Note that unlike H5C_apply_candidate_list(), + * H5C_mark_entries_as_clean() makes all its calls to + * H6C_flush_single_entry() with the + * H5C__FLUSH_CLEAR_ONLY_FLAG set. As a result, + * the pre_serialize() and serialize calls are not made. + * + * This then implies that (assuming such actions were + * permitted in the parallel case) no loads, dirties, + * resizes, or removals of other entries can occur as + * a side effect of the flush. Hence, there is no need + * for the checks for entry removal / status change + * that I ported to H5C_apply_candidate_list(). + * + * However, if (in addition to allowing such operations + * in the parallel case), we allow such operations outside + * of the pre_serialize / serialize routines, this may + * cease to be the case -- requiring a review of this + * function. + * *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL herr_t H5C_mark_entries_as_clean(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, int32_t ce_array_len, haddr_t * ce_array_ptr) { H5C_t * cache_ptr; - hbool_t first_flush = TRUE; int entries_cleared; int entries_examined; int i; @@ -3061,27 +3352,9 @@ H5C_mark_entries_as_clean(H5F_t * f, #endif /* H5C_DO_SANITY_CHECKS */ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Listed entry not dirty?!?!?.") -#if 0 /* original code */ - } else if ( entry_ptr->is_protected ) { - - entry_ptr->clear_on_unprotect = TRUE; } else { - if ( H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - entry_ptr->type, - addr, - H5C__FLUSH_CLEAR_ONLY_FLAG, - &first_flush, - TRUE) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't clear entry.") - } - } -#else /* modified code */ - } else { /* Mark the entry to be cleared on unprotect. We will * scan the LRU list shortly, and clear all those entries * not currently protected. @@ -3102,13 +3375,32 @@ H5C_mark_entries_as_clean(H5F_t * f, } #endif /* H5C_DO_SANITY_CHECKS */ } -#endif /* end modified code */ } -#if 1 /* modified code */ + /* Scan through the LRU list from back to front, and flush the * entries whose clear_on_unprotect flags are set. Observe that * any protected entries will not be on the LRU, and therefore * will not be flushed at this time. + * + * Note that unlike H5C_apply_candidate_list(), + * H5C_mark_entries_as_clean() makes all its calls to + * H6C_flush_single_entry() with the H5C__FLUSH_CLEAR_ONLY_FLAG + * set. As a result, the pre_serialize() and serialize calls are + * not made. + * + * This then implies that (assuming such actions were + * permitted in the parallel case) no loads, dirties, + * resizes, or removals of other entries can occur as + * a side effect of the flush. Hence, there is no need + * for the checks for entry removal / status change + * that I ported to H5C_apply_candidate_list(). + * + * However, if (in addition to allowing such operations + * in the parallel case), we allow such operations outside + * of the pre_serialize / serialize routines, this may + * cease to be the case -- requiring a review of this + * point. + * JRM -- 4/7/15 */ entries_cleared = 0; @@ -3128,13 +3420,11 @@ H5C_mark_entries_as_clean(H5F_t * f, entries_cleared++; if ( H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - clear_ptr->type, + dxpl_id, clear_ptr->addr, H5C__FLUSH_CLEAR_ONLY_FLAG, - &first_flush, - TRUE) < 0 ) { + TRUE, + NULL) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't clear entry.") } @@ -3165,13 +3455,11 @@ H5C_mark_entries_as_clean(H5F_t * f, entries_cleared++; if ( H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - clear_ptr->type, + dxpl_id, clear_ptr->addr, H5C__FLUSH_CLEAR_ONLY_FLAG, - &first_flush, - TRUE) < 0 ) { + TRUE, + NULL) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't clear entry.") } @@ -3202,7 +3490,6 @@ H5C_mark_entries_as_clean(H5F_t * f, } HDassert( (entries_cleared + i) == ce_array_len ); #endif /* H5C_DO_SANITY_CHECKS */ -#endif /* modified code */ done: @@ -3278,6 +3565,7 @@ H5C_mark_entry_dirty(void *thing) /* mark the entry as dirty if it isn't already */ entry_ptr->is_dirty = TRUE; + entry_ptr->image_up_to_date = FALSE; if ( was_pinned_unprotected_and_clean ) { @@ -3427,36 +3715,32 @@ H5C_move_entry(H5C_t * cache_ptr, was_dirty = entry_ptr->is_dirty; #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - if ( ! ( entry_ptr->flush_in_progress ) ) { - - entry_ptr->is_dirty = TRUE; - } + entry_ptr->is_dirty = TRUE; + /* This shouldn't be needed, but it keeps the test code happy */ + entry_ptr->image_up_to_date = FALSE; H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL) - if ( ! ( entry_ptr->flush_in_progress ) ) { - - H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) + H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) #if H5C_DO_SANITY_CHECKS - if ( removed_entry_from_slist ) { - - /* we just removed the entry from the slist. Thus we - * must touch up cache_ptr->slist_len_increase and - * cache_ptr->slist_size_increase to keep from skewing - * the sanity checks. - */ - HDassert( cache_ptr->slist_len_increase > 1 ); - HDassert( cache_ptr->slist_size_increase > - (int64_t)(entry_ptr->size) ); + if ( removed_entry_from_slist ) { - cache_ptr->slist_len_increase -= 1; - cache_ptr->slist_size_increase -= (int64_t)(entry_ptr->size); - } + /* we just removed the entry from the slist. Thus we + * must touch up cache_ptr->slist_len_increase and + * cache_ptr->slist_size_increase to keep from skewing + * the sanity checks. + */ + cache_ptr->slist_len_increase -= 1; + cache_ptr->slist_size_increase -= (int64_t)(entry_ptr->size); + } #endif /* H5C_DO_SANITY_CHECKS */ + if ( ! ( entry_ptr->flush_in_progress ) ) { + + /* skip the update if a flush is in progress */ H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, FAIL) } } @@ -3536,6 +3820,11 @@ H5C_resize_entry(void *thing, size_t new_size) /* mark the entry as dirty if it isn't already */ entry_ptr->is_dirty = TRUE; + entry_ptr->image_up_to_date = FALSE; + + /* Release the current image */ + if( entry_ptr->image_ptr ) + entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr); /* do a flash cache size increase if appropriate */ if ( cache_ptr->flash_size_increase_possible ) { @@ -3743,18 +4032,6 @@ done: * or flushed -- nor may it be accessed by another call to * H5C_protect. Any attempt to do so will result in a failure. * - * The primary_dxpl_id and secondary_dxpl_id parameters - * specify the dxpl_ids used on the first write occasioned - * by the insertion (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the - * metadata cache, but may not be needed elsewhere. If so, - * just use the same dxpl_id for both parameters. - * - * All reads are performed with the primary_dxpl_id. - * - * Similarly, the primary_dxpl_id is passed to the - * check_write_permitted function if it is called. - * * Return: Success: Ptr to the desired entry * Failure: NULL * @@ -3776,12 +4053,21 @@ done: * entries long before we actually have to evict something * to make space. * + * JRM -- 9/1/14 + * Replace the old rw parameter with the flags parameter. + * This allows H5C_protect to accept flags other than + * H5C__READ_ONLY_FLAG. + * + * Added support for the H5C__FLUSH_LAST_FLAG and + * H5C__FLUSH_COLLECTIVELY_FLAG flags. At present, these + * flags are only applied if the entry is not in cache, and + * is loaded into the cache as a result of this call. + * *------------------------------------------------------------------------- */ void * H5C_protect(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, const H5C_class_t * type, haddr_t addr, void * udata, @@ -3789,9 +4075,12 @@ H5C_protect(H5F_t * f, { H5C_t * cache_ptr; hbool_t hit; - hbool_t first_flush; hbool_t have_write_permitted = FALSE; hbool_t read_only = FALSE; + hbool_t flush_last; +#ifdef H5_HAVE_PARALLEL + hbool_t flush_collectively; +#endif /* H5_HAVE_PARALLEL */ hbool_t write_permitted; herr_t result; size_t empty_space; @@ -3812,8 +4101,6 @@ H5C_protect(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( type ); - HDassert( type->flush ); - HDassert( type->load ); HDassert( H5F_addr_defined(addr) ); #if H5C_DO_EXTREME_SANITY_CHECKS @@ -3827,6 +4114,10 @@ H5C_protect(H5F_t * f, #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ read_only = ( (flags & H5C__READ_ONLY_FLAG) != 0 ); + flush_last = ( (flags & H5C__FLUSH_LAST_FLAG) != 0 ); +#ifdef H5_HAVE_PARALLEL + flush_collectively = ( (flags & H5C__FLUSH_COLLECTIVELY_FLAG) != 0 ); +#endif /* H5_HAVE_PARALLEL */ /* first check to see if the target is in cache */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, NULL) @@ -3845,7 +4136,7 @@ H5C_protect(H5F_t * f, from disk. */ /* Get the dataset transfer property list */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(primary_dxpl_id, H5I_GENPROP_LST))) + if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list"); /* Get the tag from the DXPL */ @@ -3871,7 +4162,7 @@ H5C_protect(H5F_t * f, hit = FALSE; - thing = H5C_load_entry(f, primary_dxpl_id, type, addr, udata); + thing = H5C_load_entry(f, dxpl_id, type, addr, udata); if ( thing == NULL ) { @@ -3881,7 +4172,7 @@ H5C_protect(H5F_t * f, entry_ptr = (H5C_cache_entry_t *)thing; /* Apply tag to newly protected entry */ - if(H5C_tag_entry(cache_ptr, entry_ptr, primary_dxpl_id) < 0) + if(H5C_tag_entry(cache_ptr, entry_ptr, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, NULL, "Cannot tag metadata entry") /* If the entry is very large, and we are configured to allow it, @@ -3936,7 +4227,6 @@ H5C_protect(H5F_t * f, have_write_permitted = TRUE; - first_flush = TRUE; } } else { @@ -3944,7 +4234,6 @@ H5C_protect(H5F_t * f, have_write_permitted = TRUE; - first_flush = TRUE; } HDassert( entry_ptr->size <= H5C_MAX_ENTRY_SIZE ); @@ -3985,10 +4274,10 @@ H5C_protect(H5F_t * f, * see no point in worrying about the fourth. */ - result = H5C_make_space_in_cache(f, primary_dxpl_id, - secondary_dxpl_id, - space_needed, write_permitted, - &first_flush); + result = H5C_make_space_in_cache(f, + dxpl_id, + space_needed, + write_permitted); if ( result < 0 ) { @@ -4002,7 +4291,24 @@ H5C_protect(H5F_t * f, * * This is no longer true -- due to a bug fix, we may modify * data on load to repair a file. + * + * ******************************************* + * + * Set the flush_last (and possibly flush_collectively) fields + * of the newly loaded entry before inserting it into the + * index. Must do this, as the index tracked the number of + * entries with the flush_last field set, but assumes that + * the field will not change after insertion into the index. + * + * Note that this means that the H5C__FLUSH_LAST_FLAG and + * H5C__FLUSH_COLLECTIVELY_FLAG flags are ignored if the + * entry is already in cache. */ + entry_ptr->flush_me_last = flush_last; +#ifdef H5_HAVE_PARALLEL + entry_ptr->flush_me_collectively = flush_collectively; +#endif + H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, NULL) if ( ( entry_ptr->is_dirty ) && ( ! (entry_ptr->in_slist) ) ) { @@ -4017,11 +4323,11 @@ H5C_protect(H5F_t * f, */ H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, NULL) - /* If the entry's type has a 'notify' callback send a 'after insertion' + /* If the entry's type has a 'notify' callback send a 'after load' * notice now that the entry is fully integrated into the cache. */ if(entry_ptr->type->notify && - (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_AFTER_INSERT, entry_ptr) < 0) + (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_AFTER_LOAD, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, NULL, "can't notify client about entry inserted into cache") } @@ -4083,7 +4389,6 @@ H5C_protect(H5F_t * f, have_write_permitted = TRUE; - first_flush = TRUE; } } else { @@ -4091,7 +4396,6 @@ H5C_protect(H5F_t * f, have_write_permitted = TRUE; - first_flush = TRUE; } } @@ -4100,10 +4404,8 @@ H5C_protect(H5F_t * f, (cache_ptr->resize_ctl).epoch_length ) ) { result = H5C__auto_adjust_cache_size(f, - primary_dxpl_id, - secondary_dxpl_id, - write_permitted, - &first_flush); + dxpl_id, + write_permitted); if ( result != SUCCEED ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, \ @@ -4137,10 +4439,10 @@ H5C_protect(H5F_t * f, if(cache_ptr->index_size > cache_ptr->max_cache_size) cache_ptr->cache_full = TRUE; - result = H5C_make_space_in_cache(f, primary_dxpl_id, - secondary_dxpl_id, - (size_t)0, write_permitted, - &first_flush); + result = H5C_make_space_in_cache(f, + dxpl_id, + (size_t)0, + write_permitted); if ( result < 0 ) { @@ -4636,6 +4938,10 @@ done: * total_entries_skipped_in_msic, total_entries_scanned_in_msic, * and max_entries_skipped_in_msic fields. * + * JRM -- 4/11/15 + * Added code displaying the new slist_scan_restarts, + * LRU_scan_restarts, and hash_bucket_scan_restarts fields; + * *------------------------------------------------------------------------- */ herr_t @@ -4659,6 +4965,7 @@ H5C_stats(H5C_t * cache_ptr, int64_t total_clears = 0; int64_t total_flushes = 0; int64_t total_evictions = 0; + int64_t total_take_ownerships = 0; int64_t total_moves = 0; int64_t total_entry_flush_moves = 0; int64_t total_cache_flush_moves = 0; @@ -4687,6 +4994,8 @@ H5C_stats(H5C_t * cache_ptr, FUNC_ENTER_NOAPI(FAIL) + HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + /* This would normally be an assert, but we need to use an HGOTO_ERROR * call to shut up the compiler. */ @@ -4713,6 +5022,7 @@ 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_take_ownerships += cache_ptr->take_ownerships[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]; @@ -4864,11 +5174,16 @@ H5C_stats(H5C_t * cache_ptr, (long)max_read_protects); HDfprintf(stdout, - "%s Total clears / flushes / evictions = %ld / %ld / %ld\n", + "%s Total clears / flushes = %ld / %ld\n", cache_ptr->prefix, (long)total_clears, - (long)total_flushes, - (long)total_evictions); + (long)total_flushes); + + HDfprintf(stdout, + "%s Total evictions / take ownerships = %ld / %ld\n", + cache_ptr->prefix, + (long)total_evictions, + (long)total_take_ownerships); HDfprintf(stdout, "%s Total insertions(pinned) / moves = %ld(%ld) / %ld\n", @@ -4940,6 +5255,13 @@ H5C_stats(H5C_t * cache_ptr, (long long)(cache_ptr->total_entries_scanned_in_msic - cache_ptr->entries_scanned_to_make_space)); + HDfprintf(stdout, + "%s slist/LRU/hash bkt scan restarts = %lld / %lld / %lld.\n", + cache_ptr->prefix, + (long long)(cache_ptr->slist_scan_restarts), + (long long)(cache_ptr->LRU_scan_restarts), + (long long)(cache_ptr->hash_bucket_scan_restarts)); + #if H5C_COLLECT_CACHE_ENTRY_STATS HDfprintf(stdout, "%s aggregate max / min accesses = %d / %d\n", @@ -4993,11 +5315,16 @@ H5C_stats(H5C_t * cache_ptr, (int)(cache_ptr->max_read_protects[i])); HDfprintf(stdout, - "%s clears / flushes / evictions = %ld / %ld / %ld\n", + "%s clears / flushes = %ld / %ld\n", cache_ptr->prefix, (long)(cache_ptr->clears[i]), - (long)(cache_ptr->flushes[i]), - (long)(cache_ptr->evictions[i])); + (long)(cache_ptr->flushes[i])); + + HDfprintf(stdout, + "%s evictions / take ownerships = %ld / %ld\n", + cache_ptr->prefix, + (long)(cache_ptr->evictions[i]), + (long)(cache_ptr->take_ownerships[i])); HDfprintf(stdout, "%s insertions(pinned) / moves = %ld(%ld) / %ld\n", @@ -5092,6 +5419,11 @@ done: * total_entries_skipped_in_msic, total_entries_scanned_in_msic, * and max_entries_skipped_in_msic fields. * + * JRM 4/11/15 + * Added code to initialize the new slist_scan_restarts, + * LRU_scan_restarts, hash_bucket_scan_restarts, and + * take_ownerships fields. + * *------------------------------------------------------------------------- */ void @@ -5125,6 +5457,7 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED * cache_ptr) cache_ptr->clears[i] = 0; cache_ptr->flushes[i] = 0; cache_ptr->evictions[i] = 0; + cache_ptr->take_ownerships[i] = 0; cache_ptr->moves[i] = 0; cache_ptr->entry_flush_moves[i] = 0; cache_ptr->cache_flush_moves[i] = 0; @@ -5167,6 +5500,10 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED * cache_ptr) cache_ptr->max_entries_scanned_in_msic = 0; cache_ptr->entries_scanned_to_make_space = 0; + cache_ptr->slist_scan_restarts = 0; + cache_ptr->LRU_scan_restarts = 0; + cache_ptr->hash_bucket_scan_restarts = 0; + #if H5C_COLLECT_CACHE_ENTRY_STATS for ( i = 0; i <= cache_ptr->max_type_id; i++ ) @@ -5319,24 +5656,125 @@ done: /*------------------------------------------------------------------------- - * Function: H5C_unpin_entry_from_client() + * Function: H5C_dump_cache_skip_list * - * Purpose: Internal routine to unpin a cache entry from a client action. + * Purpose: Debugging routine that prints a summary of the contents of + * the skip list used by the metadata cache metadata cache to + * maintain an address sorted list of dirty entries. * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * 3/24/09 + * Programmer: John Mainzer + * 11/15/14 * *------------------------------------------------------------------------- */ -static herr_t -H5C_unpin_entry_from_client(H5C_t * cache_ptr, - H5C_cache_entry_t * entry_ptr, - hbool_t update_rp) +#if 0 /* debugging routine */ +herr_t +H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) { - herr_t ret_value = SUCCEED; /* Return value */ - + herr_t ret_value = SUCCEED; /* Return value */ + int i; + H5C_cache_entry_t * entry_ptr = NULL; + H5SL_node_t * node_ptr = NULL; + + FUNC_ENTER_NOAPI(FAIL) + + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(calling_fcn != NULL); + + HDfprintf(stdout, "\n\nDumping metadata cache skip list from %s.\n", + calling_fcn); + HDfprintf(stdout, " slist len = %d.\n", cache_ptr->slist_len); + HDfprintf(stdout, " slist size = %lld.\n", + (long long)(cache_ptr->slist_size)); + + if ( cache_ptr->slist_len > 0 ) + { + /* If we get this far, all entries in the cache are listed in the + * skip list -- scan the skip list generating the desired output. + */ + + HDfprintf(stdout, + "Num: Addr: Len: Prot/Pind: Dirty: Type:\n"); + + i = 0; + + node_ptr = H5SL_first(cache_ptr->slist_ptr); + + if ( node_ptr != NULL ) { + + entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); + + } else { + + entry_ptr = NULL; + } + + while ( entry_ptr != NULL ) { + + HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); + + HDfprintf(stdout, + "%s%d 0x%016llx %4lld %d/%d %d %s\n", + cache_ptr->prefix, i, + (long long)(entry_ptr->addr), + (long long)(entry_ptr->size), + (int)(entry_ptr->is_protected), + (int)(entry_ptr->is_pinned), + (int)(entry_ptr->is_dirty), + entry_ptr->type->name); + + HDfprintf(stdout, " node_ptr = 0x%llx, item = 0x%llx\n", + (unsigned long long)node_ptr, + (unsigned long long)H5SL_item(node_ptr)); + + /* increment node_ptr before we delete its target */ + node_ptr = H5SL_next(node_ptr); + + if ( node_ptr != NULL ) { + + entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); + + } else { + + entry_ptr = NULL; + } + + i++; + } + } + + HDfprintf(stdout, "\n\n"); + +done: + + FUNC_LEAVE_NOAPI(ret_value) + +} /* H5C_dump_cache_skip_list() */ +#endif /* debugging routine */ + + +/*------------------------------------------------------------------------- + * Function: H5C_unpin_entry_from_client() + * + * Purpose: Internal routine to unpin a cache entry from a client action. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * 3/24/09 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5C_unpin_entry_from_client(H5C_t * cache_ptr, + H5C_cache_entry_t * entry_ptr, + hbool_t update_rp) +{ + herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_NOAPI_NOINIT /* Sanity checking */ @@ -5474,8 +5912,7 @@ done: */ herr_t H5C_unprotect(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, const H5C_class_t * type, haddr_t addr, void * thing, @@ -5515,8 +5952,6 @@ H5C_unprotect(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( type ); - HDassert( type->clear ); - HDassert( type->flush ); HDassert( H5F_addr_defined(addr) ); HDassert( thing ); HDassert( ! ( pin_entry && unpin_entry ) ); @@ -5615,6 +6050,19 @@ H5C_unprotect(H5F_t * f, /* Mark the entry as dirty if appropriate */ entry_ptr->is_dirty = (entry_ptr->is_dirty || dirtied); + /* the image_up_to_date field was introduced to support + * journaling. Until we re-introduce journaling, this + * field should be equal to !entry_ptr->is_dirty. + * + * When journaling is re-enabled it should be set + * to FALSE if dirtied is TRUE. + */ +#if 1 /* JRM */ + entry_ptr->image_up_to_date = FALSE; +#else /* JRM */ + entry_ptr->image_up_to_date = !entry_ptr->is_dirty; +#endif /* JRM */ + /* Update index for newly dirtied entry */ if(was_clean && entry_ptr->is_dirty) H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr) @@ -5656,13 +6104,6 @@ H5C_unprotect(H5F_t * f, * JRM - 5/19/04 */ if ( deleted ) { - - /* the following first flush flag will never be used as we are - * calling H5C_flush_single_entry with both the - * H5C__FLUSH_CLEAR_ONLY_FLAG and H5C__FLUSH_INVALIDATE_FLAG flags. - * However, it is needed for the function call. - */ - hbool_t dummy_first_flush = TRUE; unsigned flush_flags = (H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_INVALIDATE_FLAG); @@ -5684,36 +6125,40 @@ H5C_unprotect(H5F_t * f, "hash table contains multiple entries for addr?!?.") } - /* Pass along 'free file space' flag to cache client */ - - entry_ptr->free_file_space_on_destroy = free_file_space; + /* Set the 'free file space' flag for the flush, if needed */ + if(free_file_space) + flush_flags |= H5C__FREE_FILE_SPACE_FLAG; /* Set the "take ownership" flag for the flush, if needed */ if(take_ownership) flush_flags |= H5C__TAKE_OWNERSHIP_FLAG; if ( H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - type, + dxpl_id, addr, flush_flags, - &dummy_first_flush, - TRUE) < 0 ) { + TRUE, + NULL) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't flush.") } + +#if H5C_DO_SANITY_CHECKS + if ( ( take_ownership ) && ( ! was_clean ) ) + { + /* we have just removed an entry from the skip list. Thus + * we must touch up cache_ptr->slist_len_increase and + * cache_ptr->slist_size_increase to keep from skewing + * the sanity checks on flushes. + */ + cache_ptr->slist_len_increase -= 1; + cache_ptr->slist_size_increase -= (int64_t)(entry_ptr->size); + } +#endif /* H5C_DO_SANITY_CHECKS */ } #ifdef H5_HAVE_PARALLEL else if ( clear_entry ) { - /* the following first flush flag will never be used as we are - * calling H5C_flush_single_entry with the - * H5C__FLUSH_CLEAR_ONLY_FLAG flag. However, it is needed for - * the function call. - */ - hbool_t dummy_first_flush = TRUE; - /* verify that the target entry is in the cache. */ H5C__SEARCH_INDEX(cache_ptr, addr, test_entry_ptr, FAIL) @@ -5730,13 +6175,11 @@ H5C_unprotect(H5F_t * f, } if ( H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - type, + dxpl_id, addr, H5C__FLUSH_CLEAR_ONLY_FLAG, - &dummy_first_flush, - TRUE) < 0 ) { + TRUE, + NULL) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't clear.") } @@ -6392,10 +6835,8 @@ done: */ static herr_t H5C__auto_adjust_cache_size(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - hbool_t write_permitted, - hbool_t * first_flush_ptr) + hid_t dxpl_id, + hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; herr_t result; @@ -6596,13 +7037,11 @@ H5C__auto_adjust_cache_size(H5F_t * f, } else { result = H5C__autoadjust__ageout(f, + dxpl_id, hit_rate, &status, &new_max_cache_size, - primary_dxpl_id, - secondary_dxpl_id, - write_permitted, - first_flush_ptr); + write_permitted); if ( result != SUCCEED ) { @@ -6745,13 +7184,11 @@ done: */ static herr_t H5C__autoadjust__ageout(H5F_t * f, + hid_t dxpl_id, double hit_rate, enum H5C_resize_status * status_ptr, size_t * new_max_cache_size_ptr, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - hbool_t write_permitted, - hbool_t * first_flush_ptr) + hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; herr_t result; @@ -6792,8 +7229,7 @@ H5C__autoadjust__ageout(H5F_t * f, if ( cache_ptr->max_cache_size > (cache_ptr->resize_ctl).min_size ){ /* evict aged out cache entries if appropriate... */ - if(H5C__autoadjust__ageout__evict_aged_out_entries(f, primary_dxpl_id, - secondary_dxpl_id, write_permitted, first_flush_ptr) < 0) + if(H5C__autoadjust__ageout__evict_aged_out_entries(f, dxpl_id, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error flushing aged out entries.") /* ... and then reduce cache size if appropriate */ @@ -6990,20 +7426,32 @@ done: * * Programmer: John Mainzer, 11/22/04 * + * Changes: Modified function to detect deletions of entries + * during a scan of the LRU, and where appropriate, + * restart the scan to avoid proceeding with a next + * entry that is no longer in the cache. + * + * Note the absence of checks after flushes of clean + * entries. As a second entry can only be removed by + * by a call to the pre_serialize or serialize callback + * of the first, and as these callbacks will not be called + * on clean entries, no checks are needed. + * + * JRM -- 4/6/15 + * *------------------------------------------------------------------------- */ static herr_t H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - hbool_t write_permitted, - hbool_t * first_flush_ptr) + hid_t dxpl_id, + hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; herr_t result; size_t eviction_size_limit; size_t bytes_evicted = 0; hbool_t prev_is_dirty = FALSE; + hbool_t restart_scan; H5C_cache_entry_t * entry_ptr; H5C_cache_entry_t * next_ptr; H5C_cache_entry_t * prev_ptr; @@ -7032,13 +7480,17 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, if ( write_permitted ) { + restart_scan = FALSE; entry_ptr = cache_ptr->LRU_tail_ptr; while ( ( entry_ptr != NULL ) && ( (entry_ptr->type)->id != H5C__EPOCH_MARKER_TYPE ) && ( bytes_evicted < eviction_size_limit ) ) { + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert( ! (entry_ptr->is_protected) ); + HDassert( ! (entry_ptr->is_read_only) ); + HDassert( (entry_ptr->ro_ref_count) == 0 ); next_ptr = entry_ptr->next; prev_ptr = entry_ptr->prev; @@ -7050,26 +7502,39 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, if ( entry_ptr->is_dirty ) { + /* reset entries_removed_counter and + * last_entry_removed_ptr prior to the call to + * H5C_flush_single_entry() so that we can spot + * unexpected removals of entries from the cache, + * and set the restart_scan flag if proceeding + * would be likely to cause us to scan an entry + * that is no longer in the cache. + */ + cache_ptr->entries_removed_counter = 0; + cache_ptr->last_entry_removed_ptr = NULL; + result = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - entry_ptr->type, + dxpl_id, entry_ptr->addr, H5C__NO_FLAGS_SET, - first_flush_ptr, - FALSE); + FALSE, + NULL); + + if ( ( cache_ptr->entries_removed_counter > 1 ) || + ( cache_ptr->last_entry_removed_ptr == prev_ptr ) ) + + restart_scan = TRUE; + } else { bytes_evicted += entry_ptr->size; result = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - entry_ptr->type, + dxpl_id, entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, - first_flush_ptr, - TRUE); + TRUE, + NULL); } if ( result < 0 ) { @@ -7079,30 +7544,25 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, } if ( prev_ptr != NULL ) { -#ifndef NDEBUG - if ( prev_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) { - - /* something horrible has happened to *prev_ptr -- - * scream and die. - */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "*prev_ptr corrupt") - } else -#endif /* NDEBUG */ - if ( ( prev_ptr->is_dirty != prev_is_dirty ) - || - ( prev_ptr->next != next_ptr ) - || - ( prev_ptr->is_protected ) - || - ( prev_ptr->is_pinned ) ) { + if ( ( restart_scan ) + || + ( prev_ptr->is_dirty != prev_is_dirty ) + || + ( prev_ptr->next != next_ptr ) + || + ( prev_ptr->is_protected ) + || + ( prev_ptr->is_pinned ) ) { /* something has happened to the LRU -- start over * from the tail. */ + restart_scan = FALSE; entry_ptr = cache_ptr->LRU_tail_ptr; + H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) + } else { entry_ptr = prev_ptr; @@ -7161,13 +7621,11 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, if ( ! (entry_ptr->is_dirty) ) { result = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - entry_ptr->type, + dxpl_id, entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, - first_flush_ptr, - TRUE); + TRUE, + NULL); if ( result < 0 ) { @@ -7177,6 +7635,10 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, } /* just skip the entry if it is dirty, as we can't do * anything with it now since we can't write. + * + * Since all entries are clean, serialize() will not be called, + * and thus we needn't test to see if the LRU has been changed + * out from under us. */ entry_ptr = prev_ptr; @@ -7640,17 +8102,45 @@ done: * Programmer: John Mainzer * 3/24/065 * + * Changes: Modified function to test for slist chamges in + * pre_serialize and serialize callbacks, and re-start + * scans through the slist when such changes occur. + * + * This has been a potential problem for some time, + * and there has been code in this function to deal + * with elements of this issue. However the shift + * to the V3 cache in combination with the activities + * of some of the cache clients (in particular the + * free space manager and the fractal heap) have + * made this re-work necessary in H5C_flush_cache. + * + * At present, this issue doesn't seem to be causing problems + * in H5C_flush_invalidate_cache(). However, it seems + * prudent to port the H5C_flush_cache changes to this + * function as well. + * + * JRM -- 12/14/14 + * + * Added code to track entry size change during flush single + * entry. This didn't used to be a problem, as the entry + * was largely removed from the cache data structures before + * the flush proper. However, re-entrant calls to the cache + * in the parallel case required a re-factoring of the + * H5C_flush_single_entry() function to keep entries fully + * in the cache until after the pre-serialize and serialize + * calls. + * JRM -- 12/25/14 + * *------------------------------------------------------------------------- */ static herr_t -H5C_flush_invalidate_cache(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_flush_invalidate_cache(const H5F_t * f, + hid_t dxpl_id, unsigned flags) { H5C_t * cache_ptr = f->shared->cache; herr_t status; - hbool_t first_flush = TRUE; + hbool_t restart_slist_scan; int32_t protected_entries = 0; int32_t i; int32_t cur_pel_len; @@ -7661,10 +8151,14 @@ H5C_flush_invalidate_cache(H5F_t * f, H5C_cache_entry_t * entry_ptr = NULL; H5C_cache_entry_t * next_entry_ptr = NULL; #if H5C_DO_SANITY_CHECKS - int64_t actual_slist_len = 0; + int64_t flushed_slist_len = 0; int64_t initial_slist_len = 0; - size_t actual_slist_size = 0; + int64_t flushed_slist_size = 0; size_t initial_slist_size = 0; + int64_t entry_size_change; + int64_t * entry_size_change_ptr = &entry_size_change; +#else /* H5C_DO_SANITY_CHECKS */ + int64_t * entry_size_change_ptr = NULL; #endif /* H5C_DO_SANITY_CHECKS */ herr_t ret_value = SUCCEED; @@ -7743,25 +8237,6 @@ H5C_flush_invalidate_cache(H5F_t * f, * may be created by the flush call backs. Thus it is possible * that the slist will not be empty after we finish the scan. */ - if ( cache_ptr->slist_len == 0 ) { - - node_ptr = NULL; - HDassert( cache_ptr->slist_size == 0 ); - - } else { - - /* Start at beginning of skip list each time */ - node_ptr = H5SL_first(cache_ptr->slist_ptr); - HDassert( node_ptr != NULL ); - - /* Get cache entry for this node */ - next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - if ( NULL == next_entry_ptr ) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") - HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); - HDassert( next_entry_ptr->is_dirty ); - HDassert( next_entry_ptr->in_slist ); - } #if H5C_DO_SANITY_CHECKS /* Depending on circumstances, H5C_flush_single_entry() will @@ -7785,63 +8260,80 @@ H5C_flush_invalidate_cache(H5F_t * f, cache_ptr->slist_len_increase = 0; cache_ptr->slist_size_increase = 0; - /* Finally, reset the actual_slist_len and actual_slist_size + /* Finally, reset the flushed_slist_len and flushed_slist_size * fields to zero, as these fields are used to accumulate * the slist lenght and size that we see as we scan through * the slist. */ - actual_slist_len = 0; - actual_slist_size = 0; + flushed_slist_len = 0; + flushed_slist_size = 0; #endif /* H5C_DO_SANITY_CHECKS */ - while ( node_ptr != NULL ) + /* set the cache_ptr->slist_change_in_pre_serialize and + * cache_ptr->slist_change_in_serialize to false. + * + * These flags are set to TRUE by H5C_flush_single_entry if the + * slist is modified by a pre_serialize or serialize call + * respectively. + * + * H5C_flush_invalidate_cache() uses these flags to detect any + * modifications to the slist that might corrupt the scan of + * the slist -- and restart the scan in this event. + */ + cache_ptr->slist_change_in_pre_serialize = FALSE; + cache_ptr->slist_change_in_serialize = FALSE; + + /* this done, start the scan of the slist */ + + restart_slist_scan = TRUE; + + while ( ( restart_slist_scan ) || ( node_ptr != NULL ) ) { - entry_ptr = next_entry_ptr; + if ( restart_slist_scan ) + { + restart_slist_scan = FALSE; - /* With the advent of the fractal heap, it is possible - * that the flush callback will dirty and/or resize - * other entries in the cache. In particular, while - * Quincey has promised me that this will never happen, - * it is possible that the flush callback for an - * entry may protect an entry that is not in the cache, - * perhaps causing the cache to flush and possibly - * evict the entry associated with node_ptr to make - * space for the new entry. - * - * Thus we do a bit of extra sanity checking on entry_ptr, - * and break out of this scan of the skip list if we - * detect major problems. We have a bit of leaway on the - * number of passes though the skip list, so this shouldn't - * be an issue in the flush in and of itself, as it should - * be all but impossible for this to happen more than once - * in any flush. - * - * Observe that that breaking out of the scan early - * shouldn't break the sanity checks just after the end - * of this while loop. - * - * If an entry has merely been marked clean and removed from - * the s-list, we simply break out of the scan. - * - * If the entry has been evicted, we flag an error and - * exit. - */ -#ifndef NDEBUG - if ( entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) { + /* Start at beginning of skip list */ + node_ptr = H5SL_first(cache_ptr->slist_ptr); - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry_ptr->magic is invalid ?!?!") + if ( node_ptr == NULL ) + { + /* the slist is empty -- break out of inner loop */ + break; + } + HDassert( node_ptr != NULL ); - } else -#endif /* NDEBUG */ - if ( ( ! entry_ptr->is_dirty ) || - ( ! entry_ptr->in_slist ) ) { + /* Get cache entry for this node */ + next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - /* the s-list has been modified out from under us. - * break out of the loop. - */ - goto end_of_inner_loop;; + if(NULL == next_entry_ptr) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "next_entry_ptr == NULL ?!?!") + + HDassert( next_entry_ptr->magic == \ + H5C__H5C_CACHE_ENTRY_T_MAGIC ); + HDassert( next_entry_ptr->is_dirty ); + HDassert( next_entry_ptr->in_slist ); } + entry_ptr = next_entry_ptr; + + /* It is possible that entries will be dirtied, resized, + * flushed, or removed from the cache via the take ownership + * flag as the result of pre_serialize or serialized callbacks. + * + * This in turn can corrupt the scan through the slist. + * + * We test for slist modifications in the pre_serialize + * and serialize callbacks, and restart the scan of the + * slist if we find them. However, best we do some extra + * sanity checking just in case. + */ + + HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); + HDassert( entry_ptr->in_slist ); + HDassert( entry_ptr->is_dirty ); + /* increment node pointer now, before we delete its target * from the slist. */ @@ -7854,6 +8346,7 @@ H5C_flush_invalidate_cache(H5F_t * f, HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); HDassert( next_entry_ptr->is_dirty ); HDassert( next_entry_ptr->in_slist ); + HDassert( entry_ptr != next_entry_ptr ); } else { next_entry_ptr = NULL; } @@ -7877,21 +8370,6 @@ H5C_flush_invalidate_cache(H5F_t * f, ( cache_ptr->num_last_entries >= cache_ptr->slist_len ) ) ) { -#if H5C_DO_SANITY_CHECKS - /* update actual_slist_len & actual_slist_size before - * the flush. Note that the entry will be removed - * from the slist after the flush, and thus may be - * resized by the flush callback. This is OK, as - * we will catch the size delta in - * cache_ptr->slist_size_increase. - * - * Note that we include pinned entries in this count, even - * though we will not actually flush them. - */ - actual_slist_len++; - actual_slist_size += entry_ptr->size; -#endif /* H5C_DO_SANITY_CHECKS */ - if ( entry_ptr->is_protected ) { /* we have major problems -- but lets flush @@ -7907,14 +8385,26 @@ H5C_flush_invalidate_cache(H5F_t * f, * as pinned entries can't be evicted. */ if(entry_ptr->flush_dep_height == curr_flush_dep_height ) { +#if H5C_DO_SANITY_CHECKS + /* update flushed_slist_len & flushed_slist_size + * before the flush. Note that the entry will + * be removed from the slist after the flush, + * and thus may be resized by the flush callback. + * This is OK, as we will catch the size delta in + * cache_ptr->slist_size_increase. + * + */ + flushed_slist_len++; + flushed_slist_size += (int64_t)entry_ptr->size; + entry_size_change = 0; +#endif /* H5C_DO_SANITY_CHECKS */ + status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - NULL, + dxpl_id, entry_ptr->addr, H5C__NO_FLAGS_SET, - &first_flush, - FALSE); + FALSE, + entry_size_change_ptr); if ( status < 0 ) { /* This shouldn't happen -- if it does, we @@ -7924,7 +8414,32 @@ H5C_flush_invalidate_cache(H5F_t * f, HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ "dirty pinned entry flush failed.") } /* end if */ + +#if H5C_DO_SANITY_CHECKS + /* entry size may have changed during the flush. + * Update flushed_slist_size to account for this. + */ + flushed_slist_size += entry_size_change; +#endif /* H5C_DO_SANITY_CHECKS */ + flushed_during_dep_loop = TRUE; + + if ( ( cache_ptr->slist_change_in_serialize ) || + ( cache_ptr->slist_change_in_pre_serialize ) ) + { + /* The slist has been modified by something + * other than the simple removal of the + * of the flushed entry after the flush. + * + * This has the potential to corrupt the + * scan through the slist, so restart it. + */ + restart_slist_scan = TRUE; + cache_ptr->slist_change_in_pre_serialize + = FALSE; + cache_ptr->slist_change_in_serialize = FALSE; + H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr); + } } /* end if */ else if(entry_ptr->flush_dep_height < curr_flush_dep_height) /* This shouldn't happen -- if it does, just scream and die. */ @@ -7932,15 +8447,26 @@ H5C_flush_invalidate_cache(H5F_t * f, } /* end if */ else { if(entry_ptr->flush_dep_height == curr_flush_dep_height ){ +#if H5C_DO_SANITY_CHECKS + /* update flushed_slist_len & flushed_slist_size + * before the flush. Note that the entry will + * be removed from the slist after the flush, + * and thus may be resized by the flush callback. + * This is OK, as we will catch the size delta in + * cache_ptr->slist_size_increase. + * + */ + flushed_slist_len++; + flushed_slist_size += (int64_t)entry_ptr->size; + entry_size_change = 0; +#endif /* H5C_DO_SANITY_CHECKS */ status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - NULL, - entry_ptr->addr, - (cooked_flags | H5C__FLUSH_INVALIDATE_FLAG), - &first_flush, - TRUE); + dxpl_id, + entry_ptr->addr, + (cooked_flags | H5C__FLUSH_INVALIDATE_FLAG), + TRUE, + entry_size_change_ptr); if ( status < 0 ) { /* This shouldn't happen -- if it does, we @@ -7950,7 +8476,32 @@ H5C_flush_invalidate_cache(H5F_t * f, HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ "dirty entry flush destroy failed.") } /* end if */ + +#if H5C_DO_SANITY_CHECKS + /* entry size may have changed during the flush. + * Update flushed_slist_size to account for this. + */ + flushed_slist_size += entry_size_change; +#endif /* H5C_DO_SANITY_CHECKS */ + flushed_during_dep_loop = TRUE; + + if ((cache_ptr->slist_change_in_serialize) || + (cache_ptr->slist_change_in_pre_serialize)) + { + /* The slist has been modified by something + * other than the simple removal of the + * of the flushed entry after the flush. + * + * This has the potential to corrupt the + * scan through the slist, so restart it. + */ + restart_slist_scan = TRUE; + cache_ptr->slist_change_in_pre_serialize + = FALSE; + cache_ptr->slist_change_in_serialize = FALSE; + H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) + } } /* end if */ else if(entry_ptr->flush_dep_height < curr_flush_dep_height) /* This shouldn't happen -- if it does, just scream and die. */ @@ -7971,11 +8522,10 @@ H5C_flush_invalidate_cache(H5F_t * f, if ( node_ptr == NULL ) { - HDassert( (actual_slist_len + cache_ptr->slist_len) == + HDassert( (flushed_slist_len + cache_ptr->slist_len) == (initial_slist_len + cache_ptr->slist_len_increase) ); - HDassert( (actual_slist_size + cache_ptr->slist_size) == - (initial_slist_size + - (size_t)(cache_ptr->slist_size_increase)) ); + HDassert( (flushed_slist_size + (int64_t)cache_ptr->slist_size) == + ((int64_t)initial_slist_size + cache_ptr->slist_size_increase) ); } #endif /* H5C_DO_SANITY_CHECKS */ @@ -7997,9 +8547,7 @@ H5C_flush_invalidate_cache(H5F_t * f, while ( next_entry_ptr != NULL ) { entry_ptr = next_entry_ptr; -#ifndef NDEBUG HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); -#endif /* NDEBUG */ next_entry_ptr = entry_ptr->ht_next; HDassert ( ( next_entry_ptr == NULL ) || @@ -8028,14 +8576,40 @@ H5C_flush_invalidate_cache(H5F_t * f, * If we can, go ahead and flush. */ if(entry_ptr->flush_dep_height == curr_flush_dep_height ){ + /* if *entry_ptr is dirty, it is possible + * that one or more other entries may be + * either removed from the cache, loaded + * into the cache, or moved to a new location + * in the file as a side effect of the flush. + * + * If this happens, and one of the target + * entries happens to be the next entry in + * the hash bucket, we could find ourselves + * either find ourselves either scanning a + * non-existant entry, scanning through a + * different bucket, or skipping an entry. + * + * Neither of these are good, so restart the + * the scan at the head of the hash bucket + * after the flush if *entry_ptr was dirty, + * on the off chance that the next entry was + * a target. + * + * This is not as inefficient at it might seem, + * as hash buckets typically have at most two + * or three entries. + */ + hbool_t entry_was_dirty; + + entry_was_dirty = entry_ptr->is_dirty; + status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - NULL, - entry_ptr->addr, - (cooked_flags | H5C__FLUSH_INVALIDATE_FLAG), - &first_flush, - TRUE); + dxpl_id, + entry_ptr->addr, + (cooked_flags | H5C__FLUSH_INVALIDATE_FLAG), + TRUE, + NULL); + if ( status < 0 ) { /* This shouldn't happen -- if it does, @@ -8045,6 +8619,17 @@ H5C_flush_invalidate_cache(H5F_t * f, HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ "Entry flush destroy failed.") } + + if ( entry_was_dirty ) { + + /* update stats for hash bucket scan + * restart here. + * -- JRM + */ + next_entry_ptr = cache_ptr->index[i]; + H5C__UPDATE_STATS_FOR_HASH_BUCKET_SCAN_RESTART(cache_ptr) + } + flushed_during_dep_loop = TRUE; } /* end if */ else if(entry_ptr->flush_dep_height < curr_flush_dep_height) @@ -8060,7 +8645,7 @@ H5C_flush_invalidate_cache(H5F_t * f, * of pinned entries from pass to pass. If it stops * shrinking before it hits zero, we scream and die. */ - /* if the flush function on the entry we last evicted + /* if the serialize function on the entry we last evicted * loaded an entry into cache (as Quincey has promised me * it never will), and if the cache was full, it is * possible that *next_entry_ptr was flushed or evicted. @@ -8069,8 +8654,13 @@ H5C_flush_invalidate_cache(H5F_t * f, * test is triggred, we are accessing a deallocated piece * of dynamically allocated memory, so we just scream and * die. + * + * Update: The code to restart the scan after flushes + * of dirty entries should make it impossible + * to satisfy the following test. Leave it in + * in case I am wrong. + * -- JRM */ -#ifndef NDEBUG if ( ( next_entry_ptr != NULL ) && ( next_entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) ) { @@ -8081,7 +8671,6 @@ H5C_flush_invalidate_cache(H5F_t * f, HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "next_entry_ptr->magic is invalid?!?!?.") } -#endif /* NDEBUG */ } /* end while loop scanning hash table bin */ } /* end for loop scanning hash table */ @@ -8099,7 +8688,6 @@ H5C_flush_invalidate_cache(H5F_t * f, curr_flush_dep_height++; } /* end while loop over flush dependency heights */ -end_of_inner_loop: old_pel_len = cur_pel_len; cur_pel_len = cache_ptr->pel_len; @@ -8177,22 +8765,9 @@ done: * Attempts to flush a protected entry will result in an * error. * - * *first_flush_ptr should be true if only one - * flush is contemplated before the next load, or if this - * is the first of a sequence of flushes that will be - * completed before the next load. *first_flush_ptr is set - * to false if a flush actually takes place, and should be - * left false until the end of the sequence. - * - * The primary_dxpl_id is used if *first_flush_ptr is TRUE - * on entry, and a flush actually takes place. The - * secondary_dxpl_id is used in any subsequent flush where - * *first_flush_ptr is FALSE on entry. - * * If the H5C__FLUSH_INVALIDATE_FLAG flag is set, the entry will - * be cleared and not flushed -- in the case *first_flush_ptr, - * primary_dxpl_id, and secondary_dxpl_id are all irrelevent, - * and the call can't be part of a sequence of flushes. + * be cleared and not flushed, and the call can't be part of a + * sequence of flushes. * * If the caller knows the address of the skip list node at * which the target entry resides, it can avoid a lookup @@ -8209,26 +8784,57 @@ done: * * Programmer: John Mainzer, 5/5/04 * + * Changes: Refactored function to remove the type_ptr parameter. + * + * JRM -- 8/7/14 + * + * Added code to check for slist changes in pre_serialize and + * serialize calls, and set + * cache_ptr->slist_change_in_pre_serialize and + * cache_ptr->slist_change_in_serialize as appropriate. + * + * JRM -- 12/13/14 + * + * Refactored function to delay all modifications of the + * metadata cache data structures until after any calls + * to the pre-serialize or serialize callbacks. + * + * Need to do this, as some pre-serialize or serialize + * calls result in calls to the metadata cache and + * modifications to its data structures. Thus, at the + * time of any such call, the target entry flags and + * the metadata cache must all be consistant. + * + * Also added the entry_size_change_ptr parameter, which + * allows the function to report back any change in the size + * of the entry during the flush. Such size changes may + * occur during the pre-serialize callback. + * + * JRM -- 12/24/14 + * *------------------------------------------------------------------------- */ static herr_t -H5C_flush_single_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - const H5C_class_t * type_ptr, +H5C_flush_single_entry(const H5F_t * f, + hid_t dxpl_id, haddr_t addr, unsigned flags, - hbool_t * first_flush_ptr, - hbool_t del_entry_from_slist_on_destroy) + hbool_t del_entry_from_slist_on_destroy, + int64_t * entry_size_change_ptr) { H5C_t * cache_ptr = f->shared->cache; hbool_t destroy; /* external flag */ hbool_t clear_only; /* external flag */ + hbool_t free_file_space; /* external flag */ hbool_t take_ownership; /* external flag */ + hbool_t write_entry; /* internal flag */ + hbool_t destroy_entry; /* internal flag */ hbool_t was_dirty; - hbool_t destroy_entry; herr_t status; - unsigned flush_flags = H5C_CALLBACK__NO_FLAGS_SET; + haddr_t new_addr = HADDR_UNDEF; + haddr_t old_addr = HADDR_UNDEF; + size_t new_len = 0; + size_t new_compressed_len = 0; H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -8238,11 +8844,15 @@ H5C_flush_single_entry(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( H5F_addr_defined(addr) ); - HDassert( first_flush_ptr ); + + /* If defined, initialize *entry_size_change_ptr to 0 */ + if(entry_size_change_ptr != NULL) + *entry_size_change_ptr = 0; /* setup external flags from the flags parameter */ destroy = ((flags & H5C__FLUSH_INVALIDATE_FLAG) != 0); clear_only = ((flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); + free_file_space = ((flags & H5C__FREE_FILE_SPACE_FLAG) != 0); take_ownership = ((flags & H5C__TAKE_OWNERSHIP_FLAG) != 0); /* Set the flag for destroying the entry, based on the 'take ownership' @@ -8256,6 +8866,14 @@ H5C_flush_single_entry(H5F_t * f, /* attempt to find the target entry in the hash table */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) + /* we will write the entry to disk if it exists, is dirty, and if the + * clear only flag is not set. + */ + if ( ( entry_ptr != NULL ) && ( entry_ptr->is_dirty ) && ( ! clear_only ) ) + write_entry = TRUE; + else + write_entry = FALSE; + /* run initial sanity checks */ #if H5C_DO_SANITY_CHECKS if ( entry_ptr != NULL ) { @@ -8264,6 +8882,8 @@ H5C_flush_single_entry(H5F_t * f, if ( entry_ptr->in_slist ) { + HDassert(entry_ptr->is_dirty); + if ( ( ( entry_ptr->flush_marker ) && ( ! entry_ptr->is_dirty ) ) || ( entry_ptr->addr != addr ) ) { @@ -8272,6 +8892,10 @@ H5C_flush_single_entry(H5F_t * f, } } else { + HDassert(!entry_ptr->is_dirty); + HDassert(!entry_ptr->flush_marker); + HDassert(entry_ptr->addr == addr); + if ( ( entry_ptr->is_dirty ) || ( entry_ptr->flush_marker ) || ( entry_ptr->addr != addr ) ) { @@ -8285,22 +8909,32 @@ H5C_flush_single_entry(H5F_t * f, if ( ( entry_ptr != NULL ) && ( entry_ptr->is_protected ) ) { + HDassert(!entry_ptr->is_protected); /* Attempt to flush a protected entry -- scream and die. */ HGOTO_ERROR(H5E_CACHE, H5E_PROTECT, FAIL, \ "Attempt to flush a protected entry.") } - if ( ( entry_ptr != NULL ) && - ( ( type_ptr == NULL ) || ( type_ptr->id == entry_ptr->type->id ) ) ) + /* if the entry exists, set entry_ptr->flush_in_progress = TRUE + * and set entry_ptr->flush_marker = FALSE + * + * in the parallel case, do some sanity checking in passing. + */ + if ( entry_ptr != NULL ) { /* we have work to do */ + HDassert(entry_ptr->type); + + was_dirty = entry_ptr->is_dirty; /* needed later for logging */ /* We will set flush_in_progress back to FALSE at the end if the * entry still exists at that point. */ entry_ptr->flush_in_progress = TRUE; + entry_ptr->flush_marker = FALSE; + #ifdef H5_HAVE_PARALLEL #ifndef NDEBUG /* If MPI based VFD is used, do special parallel I/O sanity checks. @@ -8314,7 +8948,7 @@ H5C_flush_single_entry(H5F_t * f, unsigned coll_meta; /* Collective metadata write flag */ /* Get the dataset transfer property list */ - if(NULL == (dxpl = H5I_object(primary_dxpl_id))) + if(NULL == (dxpl = H5I_object(dxpl_id))) HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "not a dataset transfer property list") /* Get the collective metadata write property */ @@ -8326,273 +8960,644 @@ H5C_flush_single_entry(H5F_t * f, } /* end if */ #endif /* NDEBUG */ #endif /* H5_HAVE_PARALLEL */ + } - was_dirty = entry_ptr->is_dirty; - - entry_ptr->flush_marker = FALSE; - - if ( clear_only ) { - H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) - } else { - H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) - } - - if ( destroy ) { - H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) - } + if ( ( entry_ptr != NULL ) && ( write_entry ) ) + { + /* serialize the entry if necessary, and then write it to disk. */ - /* If the entry's type has a 'notify' callback and the entry is about - * to be removed from the cache, send a 'before eviction' notice while - * the entry is still fully integrated in the cache. - */ - if(destroy) { - if(entry_ptr->type->notify && - (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_BEFORE_EVICT, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client about entry to evict") - } /* end if */ + unsigned serialize_flags = H5C__SERIALIZE_NO_FLAGS_SET; - /* Always remove the entry from the hash table on a destroy. On a - * flush with destroy, it is cheaper to discard the skip list all at - * once rather than remove the entries one by one, so we only delete - * from the slist only if requested. + /* The entry is dirty, and we are doing either a flush, + * or a flush destroy. In either case, serialize the + * entry and write it to disk. * - * We must do deletions now as the callback routines will free the - * entry if destroy is true. + * Note that this may cause the entry to be re-sized and/or + * moved in the cache. * - * Note that it is possible that the entry will be moved during - * its call to flush. This will upset H5C_move_entry() if we - * don't tell it that it doesn't have to worry about updating the - * index and SLIST. Use the destroy_in_progress field for this - * purpose. + * As we will not update the metadata cache's data structures + * until we we finish the write, we must touch up these + * data structures for size and location changes even if we + * are about to delete the entry from the cache (i.e. on a + * flush destroy). */ - if ( destroy ) { - - entry_ptr->destroy_in_progress = TRUE; - - H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) - - if ( ( entry_ptr->in_slist ) && - ( del_entry_from_slist_on_destroy ) ) { - H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) - } - } + HDassert(entry_ptr->is_dirty); - /* Update the replacement policy for the flush or eviction. - * Again, do this now so we don't have to reference freed - * memory in the destroy case. - */ - if ( destroy ) { /* AKA eviction */ +#if H5C_DO_SANITY_CHECKS + if ( ( cache_ptr->check_write_permitted == NULL ) && + ( !(cache_ptr->write_permitted) ) ) - H5C__UPDATE_RP_FOR_EVICTION(cache_ptr, entry_ptr, FAIL) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Write when writes are always forbidden!?!?!") +#endif /* H5C_DO_SANITY_CHECKS */ - } else { + if ( NULL == entry_ptr->image_ptr ) + { + size_t image_size; - H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, FAIL) - } + if ( entry_ptr->compressed ) + image_size = entry_ptr->compressed_size; + else + image_size = entry_ptr->size; - /* Clear the dirty flag only, if requested */ - if ( clear_only ) { + HDassert(image_size > 0); - if ( destroy ) { -#ifndef NDEBUG - /* we are about to call the clear callback with the - * destroy flag set -- this will result in *entry_ptr - * being freed. Set the magic field to bad magic - * so we can detect a freed cache entry if we see - * one. - */ - entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC; -#endif /* NDEBUG */ - entry_ptr->cache_ptr = NULL; - } - /* Call the callback routine to clear all dirty flags for object */ - if ( (entry_ptr->type->clear)(f, entry_ptr, destroy_entry) < 0 ) { + entry_ptr->image_ptr = + H5MM_malloc(image_size + H5C_IMAGE_EXTRA_SPACE); - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't clear entry") + if ( NULL == entry_ptr->image_ptr) + { + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, \ + "memory allocation failed for on disk image buffer") } - } else { +#if H5C_DO_MEMORY_SANITY_CHECKS -#if H5C_DO_SANITY_CHECKS - if ( ( entry_ptr->is_dirty ) && - ( cache_ptr->check_write_permitted == NULL ) && - ( ! (cache_ptr->write_permitted) ) ) + HDmemcpy(((uint8_t *)entry_ptr->image_ptr) + image_size, + H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Write when writes are always forbidden!?!?!") -#endif /* H5C_DO_SANITY_CHECKS */ +#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ - if ( destroy ) { -#ifndef NDEBUG - /* we are about to call the flush callback with the - * destroy flag set -- this will result in *entry_ptr - * being freed. Set the magic field to bad magic - * so we can detect a freed cache entry if we see - * one. - */ - entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC; -#endif /* NDEBUG */ - entry_ptr->cache_ptr = NULL; - } + } /* end if */ - /* Only block for all the processes on the first piece of metadata + if ( ! (entry_ptr->image_up_to_date) ) + { + /* reset cache_ptr->slist_changed so we can detect slist + * modifications in the pre_serialize call. */ + cache_ptr->slist_changed = FALSE; + + /* make note of the entry's current address */ + old_addr = entry_ptr->addr; + + /* Call client's pre-serialize callback, if there's one */ + if ( ( entry_ptr->type->pre_serialize != NULL ) && + ( (entry_ptr->type->pre_serialize)(f, dxpl_id, + (void *)entry_ptr, + entry_ptr->addr, + entry_ptr->size, + entry_ptr->compressed_size, + &new_addr, &new_len, + &new_compressed_len, + &serialize_flags) < 0 ) ) + { + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "unable to pre-serialize entry") + } - if ( *first_flush_ptr && entry_ptr->is_dirty ) { + /* set cache_ptr->slist_change_in_pre_serialize if the + * slist was modified. + */ + if ( cache_ptr->slist_changed ) + cache_ptr->slist_change_in_pre_serialize = TRUE; - status = (entry_ptr->type->flush)(f, primary_dxpl_id, destroy_entry, - entry_ptr->addr, entry_ptr, - &flush_flags); - *first_flush_ptr = FALSE; + /* Check for any flags set in the pre-serialize callback */ + if ( serialize_flags != H5C__SERIALIZE_NO_FLAGS_SET ) + { + /* Check for unexpected flags from serialize callback */ + if ( serialize_flags & ~(H5C__SERIALIZE_RESIZED_FLAG | + H5C__SERIALIZE_MOVED_FLAG | + H5C__SERIALIZE_COMPRESSED_FLAG)) + { + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "unknown serialize flag(s)") + } +#ifdef H5_HAVE_PARALLEL + /* In the parallel case, resizes and moves in + * the serialize operation can cause problems. + * If they occur, scream and die. + * + * At present, in the parallel case, the aux_ptr + * will only be set if there is more than one + * process. Thus we can use this to detect + * the parallel case. + * + * This works for now, but if we start using the + * aux_ptr for other purposes, we will have to + * change this test accordingly. + * + * NB: While this test detects entryies that attempt + * to resize or move themselves during a flush + * in the parallel case, it will not detect an + * entry that dirties, resizes, and/or moves + * other entries during its flush. + * + * From what Quincey tells me, this test is + * sufficient for now, as any flush routine that + * does the latter will also do the former. + * + * If that ceases to be the case, further + * tests will be necessary. + */ + if ( cache_ptr->aux_ptr != NULL ) - } else { + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "resize/move in serialize occured in parallel case.") +#endif /* H5_HAVE_PARALLEL */ + + /* Resize the buffer if required */ + if ( ( ( ! entry_ptr->compressed ) && + ( serialize_flags & H5C__SERIALIZE_RESIZED_FLAG ) ) || + ( ( entry_ptr->compressed ) && + ( serialize_flags & H5C__SERIALIZE_COMPRESSED_FLAG ) ) ) + { + size_t new_image_size; + + if ( entry_ptr->compressed ) + new_image_size = new_compressed_len; + else + new_image_size = new_len; + + HDassert(new_image_size > 0); + + /* Release the current image */ + if ( entry_ptr->image_ptr ) + { + entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr); + } + + /* Allocate a new image buffer */ + entry_ptr->image_ptr = + H5MM_malloc(new_image_size + H5C_IMAGE_EXTRA_SPACE); + + if ( NULL == entry_ptr->image_ptr ) + { + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, \ + "memory allocation failed for on disk image buffer") + } + +#if H5C_DO_MEMORY_SANITY_CHECKS + + HDmemcpy(((uint8_t *)entry_ptr->image_ptr) + new_image_size, + H5C_IMAGE_SANITY_VALUE, + H5C_IMAGE_EXTRA_SPACE); + +#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ + + } /* end if */ + + /* If required, update the entry and the cache data structures + * for a resize. + */ + if ( serialize_flags & H5C__SERIALIZE_RESIZED_FLAG ) { + + H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, \ + entry_ptr, new_len) + + /* update the hash table for the size change*/ + H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, \ + entry_ptr->size, \ + new_len, entry_ptr, \ + !(entry_ptr->is_dirty)); + + /* The entry can't be protected since we are + * in the process of flushing it. Thus we must + * update the replacement policy data + * structures for the size change. The macro + * deals with the pinned case. + */ + H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_len); + + /* as we haven't updated the cache data structures for + * for the flush or flush destroy yet, the entry should + * be in the slist. Thus update it for the size change. + */ + HDassert(entry_ptr->in_slist); + H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, \ + new_len) + + /* if defined, update *entry_size_change_ptr for the + * change in entry size. + */ + if(entry_size_change_ptr != NULL) + *entry_size_change_ptr = (int64_t)new_len - (int64_t)(entry_ptr->size); + + /* finally, update the entry for its new size */ + entry_ptr->size = new_len; + } /* end if */ + + /* If required, udate the entry and the cache data structures + * for a move + */ + if(serialize_flags & H5C__SERIALIZE_MOVED_FLAG) + { +#if H5C_DO_SANITY_CHECKS + int64_t saved_slist_len_increase; + int64_t saved_slist_size_increase; +#endif /* H5C_DO_SANITY_CHECKS */ + + H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) + + if ( entry_ptr->addr == old_addr ) + { + /* we must update cache data structures for the + * change in address. + */ + + /* delete the entry from the hash table and the slist */ + H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) + H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) + + /* update the entry for its new address */ + entry_ptr->addr = new_addr; + + /* and then reinsert in the index and slist */ + H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL) + +#if H5C_DO_SANITY_CHECKS + /* save cache_ptr->slist_len_increase and + * cache_ptr->slist_size_increase before the + * reinsertion into the slist, and restore + * them afterwards to avoid skewing our sanity + * checking. + */ + saved_slist_len_increase = cache_ptr->slist_len_increase; + saved_slist_size_increase = cache_ptr->slist_size_increase; +#endif /* H5C_DO_SANITY_CHECKS */ + + H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) + +#if H5C_DO_SANITY_CHECKS + cache_ptr->slist_len_increase = saved_slist_len_increase; + cache_ptr->slist_size_increase = saved_slist_size_increase; +#endif /* H5C_DO_SANITY_CHECKS */ + } + else /* move is alread done for us -- just do sanity checks */ + { + HDassert(entry_ptr->addr == new_addr); + } + } /* end if */ + + if ( serialize_flags & H5C__SERIALIZE_COMPRESSED_FLAG ) { + /* just save the new compressed entry size in + * entry_ptr->compressed_size. We don't need to + * do more, as compressed size is only used for I/O. + */ + HDassert(entry_ptr->compressed); + entry_ptr->compressed_size = new_compressed_len; + } + } /* end if ( serialize_flags != H5C__SERIALIZE_NO_FLAGS_SET ) */ + + /* Serialize object into buffer */ + { + size_t image_len; + + if ( entry_ptr->compressed ) + image_len = entry_ptr->compressed_size; + else + image_len = entry_ptr->size; + + /* reset cache_ptr->slist_changed so we can detect slist + * modifications in the serialize call. + */ + cache_ptr->slist_changed = FALSE; + + + if ( entry_ptr->type->serialize(f, entry_ptr->image_ptr, + image_len, + (void *)entry_ptr) < 0 ) + { + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "unable to serialize entry") + } - status = (entry_ptr->type->flush)(f, secondary_dxpl_id, - destroy_entry, entry_ptr->addr, - entry_ptr, &flush_flags); + /* set cache_ptr->slist_change_in_serialize if the + * slist was modified. + */ + if ( cache_ptr->slist_changed ) + cache_ptr->slist_change_in_pre_serialize = TRUE; + +#if H5C_DO_MEMORY_SANITY_CHECKS + + HDassert(0 == HDmemcmp(((uint8_t *)entry_ptr->image_ptr) + + image_len, + H5C_IMAGE_SANITY_VALUE, + H5C_IMAGE_EXTRA_SPACE)); + +#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ + + entry_ptr->image_up_to_date = TRUE; } + } /* end if ( ! (entry_ptr->image_up_to_date) ) */ + + /* Finally, write the image to disk. + * + * Note that if either the H5C__CLASS_NO_IO_FLAG or the + * the H5AC__CLASS_SKIP_WRITES flag is set in the + * in the entry's type, we silently skip the write. This + * flag should only be used in test code. + */ + if ( ( ((entry_ptr->type->flags) & H5C__CLASS_NO_IO_FLAG) == 0 ) && + ( ((entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0 ) ) + { + /* If compression is not enabled, the size of the entry on + * disk is entry_prt->size. However if entry_ptr->compressed + * is TRUE, the on disk size is entry_ptr->compressed_size. + */ + size_t image_size; - if ( status < 0 ) { + if ( entry_ptr->compressed ) + image_size = entry_ptr->compressed_size; + else + image_size = entry_ptr->size; + if ( ( H5F_block_write(f, entry_ptr->type->mem_type, + entry_ptr->addr, + image_size, dxpl_id, + entry_ptr->image_ptr) < 0 ) ) + { HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "unable to flush entry") + "Can't write image to file.") } + } -#ifdef H5_HAVE_PARALLEL - if ( flush_flags != H5C_CALLBACK__NO_FLAGS_SET ) { - - /* In the parallel case, flush operations can - * cause problems. If they occur, scream and - * die. - * - * At present, in the parallel case, the aux_ptr - * will only be set if there is more than one - * process. Thus we can use this to detect - * the parallel case. - * - * This works for now, but if we start using the - * aux_ptr for other purposes, we will have to - * change this test accordingly. - * - * NB: While this test detects entryies that attempt - * to resize or move themselves during a flush - * in the parallel case, it will not detect an - * entry that dirties, resizes, and/or moves - * other entries during its flush. - * - * From what Quincey tells me, this test is - * sufficient for now, as any flush routine that - * does the latter will also do the former. - * - * If that ceases to be the case, further - * tests will be necessary. - */ - if ( cache_ptr->aux_ptr != NULL ) + /* if the entry has a notify callback, notify it that we have + * just flushed the entry. + */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "resize/move in serialize occured in parallel case.") + if ( ( entry_ptr->type->notify ) && + ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_AFTER_FLUSH, + entry_ptr) < 0 ) ) + { + HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ + "can't notify client of entry flush") + } + } /* if ( ( entry_ptr != NULL ) && ( write_entry ) ) */ + + + /* At this point, all pre-serialize and serialize calls have been + * made if it was appropriate to make them. Similarly, the entry + * has been written to disk if desired. + * + * Thus it is now safe to update the cache data structures for the + * flush. + */ + + if ( entry_ptr != NULL ) + { + /* start by updating the statistics */ + + if ( clear_only ) { + + /* only log a clear if the entry was dirty */ + if ( was_dirty ) { + + H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) + } + } else if ( write_entry ) { + + HDassert( was_dirty ); + + /* only log a flush if we actually wrote to disk */ + H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) - } -#endif /* H5_HAVE_PARALLEL */ } - if ( ( ! destroy ) && ( entry_ptr->in_slist ) ) { + if ( destroy ) + { + if ( take_ownership ) + { + HDassert(!destroy_entry); + } + else + { + HDassert(destroy_entry); + } - H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) + H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr, \ + take_ownership) + } + /* If the entry's type has a 'notify' callback and the entry is about + * to be removed from the cache, send a 'before eviction' notice while + * the entry is still fully integrated in the cache. + */ + if ( destroy ) { + + if ( ( entry_ptr->type->notify ) && + ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_BEFORE_EVICT, + entry_ptr) < 0 ) ) + { + HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ + "can't notify client about entry to evict") + } + } /* end if */ + + + /* Update the cache internal data structures. */ + if ( destroy ) + { + /* Update the cache internal data structures as appropriate + * for a destroy. Specifically: + * + * 1) Delete it from the index + * + * 2) Delete it from the skip list if requested. + * + * 3) Update the replacement policy for eviction + * + * Finally, if the destroy_entry flag is set, discard the + * entry. + */ + + H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) + + if ( ( entry_ptr->in_slist ) && + ( del_entry_from_slist_on_destroy ) ) { + + H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) + } + + H5C__UPDATE_RP_FOR_EVICTION(cache_ptr, entry_ptr, FAIL) } + else + { + HDassert(clear_only || write_entry); + HDassert(entry_ptr->is_dirty); + HDassert(entry_ptr->in_slist); + + /* We are either doing a flush or a clear. + * + * A clear and a flush are the same from the point of + * view of the replacement policy and the slist. + * Hence no differentiation between them. + * + * JRM -- 7/7/07 + */ + + H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, FAIL) + + H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) - if ( ( ! destroy ) && ( was_dirty ) ) { + + /* mark the entry as clean and update the index for + * entry clean. Also, call the clear callback + * if defined. + */ + + entry_ptr->is_dirty = FALSE; H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr); + + if ( ( entry_ptr->type->clear != NULL ) && + ( (entry_ptr->type->clear)(f, (void *)entry_ptr, FALSE) ) ) + { + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "unable to clear entry") + } } - if ( ! destroy ) { /* i.e. if the entry still exists */ + /* reset the flush_in progress flag */ - HDassert( !(entry_ptr->is_dirty) ); - HDassert( !(entry_ptr->flush_marker) ); - HDassert( !(entry_ptr->in_slist) ); - HDassert( !(entry_ptr->is_protected) ); - HDassert( !(entry_ptr->is_read_only) ); - HDassert( (entry_ptr->ro_ref_count) == 0 ); + entry_ptr->flush_in_progress = FALSE; - if ( (flush_flags & H5C_CALLBACK__SIZE_CHANGED_FLAG) != 0 ) { + } /* end if */ - /* The entry size changed as a result of the flush. - * - * Most likely, the entry was compressed, and the - * new version is of a different size than the old. - * - * In any case, we must update entry and cache size - * accordingly. - */ - size_t new_size; - if ( (entry_ptr->type->size)(f, (void *)entry_ptr, &new_size) - < 0 ) { + /* Internal cache data structures should now be up to date, and + * consistant with the status of the entry. + * + * Now discard the entry if appropriate. + */ + if ( entry_ptr != NULL ) + { + if ( destroy ) + { + /* start by freeing the buffer for the on disk image */ + if(entry_ptr->image_ptr != NULL) + entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr); + + /* Check whether we should free the space in the file that + * the entry occupies + */ + if ( free_file_space ) + { + + size_t fsf_size; + + /* Sanity checks */ + HDassert(H5F_addr_defined(entry_ptr->addr)); + HDassert(!H5F_IS_TMP_ADDR(f, entry_ptr->addr)); +#ifndef NDEBUG +{ + hbool_t curr_compressed = FALSE; + size_t curr_len; + size_t curr_compressed_len = 0; + + /* Get the actual image size for the thing again */ + entry_ptr->type->image_len((void *)entry_ptr, &curr_len, &curr_compressed, &curr_compressed_len); + HDassert(curr_len == entry_ptr->size); + HDassert(curr_compressed == entry_ptr->compressed); + HDassert(curr_compressed_len == entry_ptr->compressed_size); +} +#endif /* NDEBUG */ - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, \ - "Can't get entry size after flush") + /* if the file space free size callback is defined, use + * it to get the size of the block of file space to free. + * Otherwise use entry_ptr->compressed_size if + * entry_ptr->compressed == TRUE, and entry_ptr->size + * if entry_ptr->compressed == FALSE. + */ + if ( entry_ptr->type->fsf_size ) + { + if ( (entry_ptr->type->fsf_size)((void *)entry_ptr, + &fsf_size) < 0 ) + { + HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, \ + "unable to get file space free size") + } + } + else if ( entry_ptr->compressed ) /* use compressed size */ + { + fsf_size = entry_ptr->compressed_size; + } + else /* no file space free size callback -- use entry size */ + { + fsf_size = entry_ptr->size; } - if ( new_size != entry_ptr->size ) { + /* Release the space on disk */ + if ( H5MF_xfree(f, entry_ptr->type->mem_type, dxpl_id, + entry_ptr->addr, (hsize_t)fsf_size) < 0) + { + HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, \ + "unable to free file space for cache entry") + } + } /* end if ( free_file_space ) */ - HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); - /* update the hash table for the size change - * We pass TRUE as the was_clean parameter, as we - * have already updated the clean and dirty index - * size fields for the fact that the entry has - * been flushed. (See above call to - * H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN()). - */ - H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), \ - (entry_ptr->size), \ - (new_size), \ - (entry_ptr), \ - (TRUE)) - - /* The entry can't be protected since we just flushed it. - * Thus we must update the replacement policy data - * structures for the size change. The macro deals - * with the pinned case. - */ - H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, \ - new_size) + /* Reset the pointer to the cache the entry is within. -QAK */ + entry_ptr->cache_ptr = NULL; - /* The entry can't be in the slist, so no need to update - * the slist for the size change. - */ + /* increment entries_removed_counter and set + * last_entry_removed_ptr. As we are likely abuut to + * free the entry, recall that last_entry_removed_ptr + * must NEVER be dereferenced. + * + * Recall that these fields are maintained to allow functions + * that perform scans of lists of entries to detect the + * unexpected removal of entries (via expunge, eviction, + * or take ownership at present), so that they can re-start + * their scans if necessary. + */ + cache_ptr->last_entry_removed_ptr++; + cache_ptr->last_entry_removed_ptr = entry_ptr; - /* update stats for the size change */ - H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, \ - entry_ptr, \ - new_size) + /* Check for actually destroying the entry in memory */ + /* (As opposed to taking ownership of it) */ + if ( destroy_entry ) + { + /* if the entry is dirty and it has a clear callback, + * call this callback now. Since this callback exists, + * it follows tht the client maintains its own dirty bits, + * which must be cleared before the entry is freed to avoid + * sanity check failures. Also clear the dirty flag for + * the same reason. + */ - /* finally, update the entry size proper */ - entry_ptr->size = new_size; - } - } + if ( entry_ptr->is_dirty ) { - if ( (flush_flags & H5C_CALLBACK__MOVED_FLAG) != 0 ) { - - /* The entry was moved as the result of the flush. - * - * Most likely, the entry was compressed, and the - * new version is larger than the old and thus had - * to be relocated. - * - * At preset, all processing for this case is - * handled elsewhere. But lets keep the if statement - * around just in case. - */ + entry_ptr->is_dirty = FALSE; - } + if ( ( entry_ptr->type->clear != NULL ) && + ( (entry_ptr->type->clear)(f, (void *)entry_ptr, TRUE) ) ) + { + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "unable to clear entry") + } + } - /* reset the flush_in progress flag */ - entry_ptr->flush_in_progress = FALSE; - } + /* we are about to discard the in core representation -- + * set the magic field to bad magic so we can detect a + * freed entry if we see one. + */ + entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC; + + + /* verify that the image has been freed */ + HDassert( entry_ptr->image_ptr == NULL ); + + if ( entry_ptr->type->free_icr((void *)entry_ptr) < 0 ) + { + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "free_icr callback failed.") + } + } + else + { + HDassert(take_ownership); + + /* client is taking ownership of the entry. + * set bad magic here too so the cache will choke + * unless the entry is re-inserted properly + */ + entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC; + } + } /* if ( destroy ) */ + } + if ( entry_ptr != NULL ) + { if ( cache_ptr->log_flush ) { status = (cache_ptr->log_flush)(cache_ptr, addr, was_dirty, flags); @@ -8606,8 +9611,14 @@ H5C_flush_single_entry(H5F_t * f, } done: - HDassert( ( destroy ) || + + HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || ( ( entry_ptr ) && ( ! entry_ptr->flush_in_progress ) ) ); + + HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || + ( take_ownership ) || + ( ( entry_ptr ) && ( ! entry_ptr->is_dirty ) ) ); + FUNC_LEAVE_NOAPI(ret_value) } /* H5C_flush_single_entry() */ @@ -8637,8 +9648,19 @@ H5C_load_entry(H5F_t * f, haddr_t addr, void * udata) { + hbool_t dirty = FALSE; /* Flag indicating whether thing was dirtied during deserialize */ + hbool_t compressed = FALSE; /* flag indicating whether thing */ + /* will be run through filters on */ + /* on read and write. Usually FALSE */ + /* set to true if appropriate. */ + size_t compressed_size = 0; /* entry compressed size if */ + /* known -- otherwise uncompressed. */ + /* Zero indicates compression not */ + /* enabled. */ + void * image = NULL; /* Buffer for disk image */ void * thing = NULL; /* Pointer to thing loaded */ H5C_cache_entry_t * entry; /* Alias for thing loaded, as cache entry */ + size_t len; /* Size of image in file */ unsigned u; /* Local index variable */ void * ret_value; /* Return value */ @@ -8648,14 +9670,310 @@ H5C_load_entry(H5F_t * f, HDassert(f->shared); HDassert(f->shared->cache); HDassert(type); - HDassert(type->load); - HDassert(type->size); + + /* verify absence of prohibited or unsupported type flag combinations */ + HDassert(!(type->flags & H5C__CLASS_NO_IO_FLAG)); + + /* for now, we do not combine the speculative load and compressed flags */ + HDassert(!((type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG) && + (type->flags & H5C__CLASS_COMPRESSED_FLAG))); + + /* Can't see how skip reads could be usefully combined with + * either the speculative read or compressed flags. Hence disallow. + */ + HDassert(!((type->flags & H5C__CLASS_SKIP_READS) && + (type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG))); + HDassert(!((type->flags & H5C__CLASS_SKIP_READS) && + (type->flags & H5C__CLASS_COMPRESSED_FLAG))); + HDassert(H5F_addr_defined(addr)); + HDassert(type->get_load_size); + HDassert(type->deserialize); + + /* Call the get_load_size callback, to retrieve the initial + * size of image + */ + if(type->get_load_size(udata, &len) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "can't retrieve image size") + + HDassert(len > 0); + + /* Check for possible speculative read off the end of the file */ + if(type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG) { + +/* Quincey has added patches for eoa calculations -- leave the original + * code around until we see the effect of these patches. + * JRM -- 1/1/15 + */ +#if 0 /* original code */ /* JRM */ + /* the original version of this code has several problems: + * + * First, the sblock is not available until the sblock + * has been read in, which causes a seg fault. This is + * dealt with easily enough by testing to see if + * f->shared->sblock is NULL, and calling H5FD_get_base_addr() + * to obtain the base addr when it is. + * + * The second issue is more subtle. H5F_get_eoa() calls + * H5FD_get_eoa(). However, this function returns the EOA as + * a relative address -- i.e. relative to the base address. + * This means that the base addr + addr < eoa sanity check will + * fail whenever the super block is not at address 0 when + * reading in the first chunk of the super block. + * + * To address these issues, I have rewritten the code to + * simply verify that the address plus length is less than + * the eoa. I think this is sufficient, but further testing + * should tell me if it isn't. + * JRM -- 8/29/14 + */ + haddr_t eoa; /* End-of-allocation in the file */ + haddr_t base_addr; /* Base address of file data */ + + /* Get the file's end-of-allocation value */ + eoa = H5F_get_eoa(f, type->mem_type); + HDassert(H5F_addr_defined(eoa)); + + /* Get the file's base address */ + if ( f->shared->sblock ) + + base_addr = H5F_BASE_ADDR(f); + + else { /* sblock not loaded yet -- use file driver info */ + + HDassert(f->shared->lf); + base_addr = H5FD_get_base_addr(f->shared->lf); + + } + HDassert(H5F_addr_defined(base_addr)); + + /* Check for bad address in general */ + if((addr + base_addr) > eoa) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, \ + "address of object past end of allocation") + + /* Check if the amount of data to read will be past the eoa */ + if((addr + base_addr + len) > eoa) + /* Trim down the length of the metadata */ + len = (size_t)(eoa - (addr + base_addr)); + +#else /* modified code */ /* JRM */ + + haddr_t eoa; /* End-of-allocation in the file */ + H5FD_mem_t cooked_type; + + /* if type == H5FD_MEM_GHEAP, H5F_block_read() forces + * type to H5FD_MEM_DRAW via its call to H5F__accum_read(). + * Thus we do the same for purposes of computing the eoa + * for sanity checks. + */ + cooked_type = + (type->mem_type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type->mem_type; + + /* Get the file's end-of-allocation value */ + eoa = H5F_get_eoa(f, cooked_type); + + HDassert(H5F_addr_defined(eoa)); + + /* Check for bad address in general */ + if ( H5F_addr_gt(addr, eoa) ) + + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, \ + "address of object past end of allocation") + + /* Check if the amount of data to read will be past the eoa */ + if( H5F_addr_gt((addr + len), eoa) ) { + + /* Trim down the length of the metadata */ + + /* Note that for some cache clients, this will cause an + * assertion failure. JRM -- 8/29/14 + */ + len = (size_t)(eoa - addr); + } + + if ( len <= 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, \ + "len not positive after adjustment for EOA.") + +#endif /* modified code */ /* JRM */ + } + /* Allocate the buffer for reading the on-disk entry image */ + if(NULL == (image = H5MM_malloc(len + H5C_IMAGE_EXTRA_SPACE))) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, \ + "memory allocation failed for on disk image buffer.") + +#if H5C_DO_MEMORY_SANITY_CHECKS + HDmemcpy(((uint8_t *)image) + len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); +#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ + + /* Get the on-disk entry image */ + if ( 0 == (type->flags & H5C__CLASS_SKIP_READS) ) + if(H5F_block_read(f, type->mem_type, addr, len, dxpl_id, image) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_READERROR, NULL, "Can't read image*") + + /* Deserialize the on-disk image into the native memory form */ + if(NULL == (thing = type->deserialize(image, len, udata, &dirty))) + HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "Can't deserialize image") + + /* If the client's cache has an image_len callback, check it */ + if(type->image_len) { + size_t new_len; /* New size of on-disk image */ + + /* set magic and type field in *entry_ptr. While the image_len + * callback shouldn't touch the cache specific fields, it may check + * these fields to ensure that it it has received the expected + * value. + * + * Note that this initialization is repeated below on the off + * chance that we had to re-try the deserialization. + */ + entry = (H5C_cache_entry_t *)thing; + entry->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; + entry->type = type; + + /* verify that compressed and compressed_len are initialized */ + HDassert(compressed == FALSE); + HDassert(compressed_size == 0); + + /* Get the actual image size for the thing */ + if(type->image_len(thing, &new_len, &compressed, &compressed_size) < 0) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, \ + "can't retrieve image length") + + if(new_len == 0) + + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "image length is 0") - if(NULL == (thing = (type->load)(f, dxpl_id, addr, udata))) + HDassert(((type->flags & H5C__CLASS_COMPRESSED_FLAG) != 0) || + ((compressed == FALSE) && (compressed_size == 0))); + HDassert((compressed == TRUE) || (compressed_size == 0)); - HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "unable to load entry") + if(new_len != len) { + + if(type->flags & H5C__CLASS_COMPRESSED_FLAG) { + + /* if new_len != len, then compression must be + * enabled on the entry. In this case, the image_len + * callback should have set compressed to TRUE, set + * new_len equal to the uncompressed size of the + * entry, and compressed_len equal to the compressed + * size -- which must equal len. + * + * We can't verify the uncompressed size, but we can + * verify the rest with the following assertions. + */ + HDassert(compressed); + HDassert(compressed_size == len); + + /* new_len should contain the uncompressed size. Set len + * equal to new_len, so that the cache will use the + * uncompressed size for purposes of space allocation, etc. + */ + len = new_len; + } else if (type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG) { + + void *new_image; /* Buffer for disk image */ + + /* compressed must be FALSE, and compressed_size + * must be zero. + */ + HDassert(!compressed); + HDassert(compressed_size == 0); + + /* Adjust the size of the image to match new_len */ + if(NULL == (new_image = H5MM_realloc(image, + new_len + H5C_IMAGE_EXTRA_SPACE))) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, \ + "image null after H5MM_realloc()") + + image = new_image; + +#if H5C_DO_MEMORY_SANITY_CHECKS + + HDmemcpy(((uint8_t *)image) + new_len, + H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); + +#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ + + /* If the thing's image needs to be bigger for a speculatively + * loaded thing, free the thing and retry with new length + */ + if (new_len > len) { + + /* Release previous (possibly partially initialized) + * thing. Note that we must set entry->magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC and set one or + * two other fields before the call to free_icr + * so as to avoid sanity check failures. + */ + entry->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC; + + entry->addr = addr; + + if ( type->free_icr(thing) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, NULL, \ + "free_icr callback failed") + + /* Go get the on-disk image again */ + if(H5F_block_read(f, type->mem_type, addr, + new_len, dxpl_id, image) < 0) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, \ + "Can't read image") + + /* Deserialize on-disk image into native memory + * form again + */ + if(NULL == (thing = type->deserialize(image, new_len, + udata, &dirty))) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, \ + "Can't deserialize image") + +#ifndef NDEBUG + { + /* new_compressed and new_compressed_size must be + * initialize to FALSE / 0 respectively, as clients + * that don't use compression may ignore these two + * parameters. + */ + hbool_t new_compressed = FALSE; + size_t new_compressed_size = 0; + size_t new_new_len; + + /* Get the actual image size for the thing again. Note + * that since this is a new thing, we have to set + * the magic and type fields again so as to avoid + * failing sanity checks. + */ + entry = (H5C_cache_entry_t *)thing; + entry->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; + entry->type = type; + + type->image_len(thing, &new_new_len, &new_compressed, &new_compressed_size); + HDassert(new_new_len == new_len); + HDassert(!new_compressed); + HDassert(new_compressed_size == 0); + } +#endif /* NDEBUG */ + } /* end if (new_len > len) */ + + /* Retain adjusted size */ + len = new_len; + + } else { /* throw an error */ + + HGOTO_ERROR(H5E_CACHE, H5E_UNSUPPORTED, NULL, \ + "size of non-speculative, non-compressed object changed") + } + } /* end if (new_len != len) */ + } /* end if */ entry = (H5C_cache_entry_t *)thing; @@ -8663,35 +9981,39 @@ H5C_load_entry(H5F_t * f, * * However, when this code is used in the metadata cache, it is * possible that object headers will be dirty at this point, as - * the load function will alter object headers if necessary to + * the deserialize function will alter object headers if necessary to * fix an old bug. * - * To support this bug fix, I have replace the old assert: + * In the following assert: * - * HDassert( entry->is_dirty == FALSE ); + * HDassert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6 ) ); * - * with: - * - * HDassert( ( entry->is_dirty == FALSE ) || ( type->id == 5 ) ); - * - * Note that type id 5 is associated with object headers in the metadata - * cache. + * note that type ids 5 & 6 are associated with object headers in the + * metadata cache. * * When we get to using H5C for other purposes, we may wish to * tighten up the assert so that the loophole only applies to the * metadata cache. */ - HDassert( ( entry->is_dirty == FALSE ) || ( type->id == 5 ) ); -#ifndef NDEBUG + HDassert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6) ); + entry->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; -#endif /* NDEBUG */ entry->cache_ptr = f->shared->cache; entry->addr = addr; + entry->size = len; + HDassert(entry->size < H5C_MAX_ENTRY_SIZE); + entry->compressed = compressed; + entry->compressed_size = compressed_size; + entry->image_ptr = image; + entry->image_up_to_date = TRUE; entry->type = type; + entry->is_dirty = dirty; + entry->dirtied = FALSE; entry->is_protected = FALSE; entry->is_read_only = FALSE; entry->ro_ref_count = 0; + entry->is_pinned = FALSE; entry->in_slist = FALSE; entry->flush_marker = FALSE; #ifdef H5_HAVE_PARALLEL @@ -8700,13 +10022,6 @@ H5C_load_entry(H5F_t * f, #endif /* H5_HAVE_PARALLEL */ entry->flush_in_progress = FALSE; entry->destroy_in_progress = FALSE; - entry->free_file_space_on_destroy = FALSE; - - if((type->size)(f, thing, &(entry->size)) < 0) - - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, NULL, "Can't get size of thing") - - HDassert( entry->size < H5C_MAX_ENTRY_SIZE ); /* Initialize flush dependency height fields */ entry->flush_dep_parent = NULL; @@ -8727,6 +10042,18 @@ H5C_load_entry(H5F_t * f, ret_value = thing; done: + /* Cleanup on error */ + if(NULL == ret_value) { + + /* Release resources */ + if ( thing && type->free_icr(thing) < 0 ) + + HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, NULL, \ + "free_icr callback failed") + + if(image) + image = H5MM_xfree(image); + } /* end if */ FUNC_LEAVE_NOAPI(ret_value) } /* H5C_load_entry() */ @@ -8765,36 +10092,45 @@ done: * * Programmer: John Mainzer, 5/14/04 * - * JRM -- 11/13/08 - * Modified function to always observe the min_clean_size - * whether we are maintaining the clean and dirt LRU lists - * or not. To do this, we had to add the new clean_index_size - * and dirty_index_size fields to H5C_t, and supporting code - * as needed throughout the cache. + * Changes: Modified function to skip over entries with the + * flush_in_progress flag set. If this is not done, + * an infinite recursion is possible if the cache is + * full, and the pre-serialize or serialize routine + * attempts to load another entry. * - * The purpose of this modification is to avoid "metadata - * blizzards" in the write only case. In such instances, - * the cache was allowed to fill with dirty metadata. When - * we finally needed to evict an entry to make space, we had - * to flush out a whole cache full of metadata -- which has - * interesting performance effects. We hope to avoid (or - * perhaps more accurately hide) this effect by maintaining - * the min_clean_size, which should force us to start flushing - * entries long before we actually have to evict something - * to make space. + * This error was exposed by a re-factor of the + * H5C_flush_single_entry() routine. However, it was + * a potential bug from the moment that entries were + * allowed to load other entries on flush. + * + * In passing, note that the primary and secondary dxpls + * mentioned in the comment above have been replaced by + * a single dxpl at some point, and thus the discussion + * above is somewhat obsolete. Date of this change is + * unkown. + * + * JRM -- 12/26/14 + * + * Modified function to detect deletions of entries + * during a scan of the LRU, and where appropriate, + * restart the scan to avoid proceeding with a next + * entry that is no longer in the cache. + * + * Note the absence of checks after flushes of clean + * entries. As a second entry can only be removed by + * by a call to the pre_serialize or serialize callback + * of the first, and as these callbacks will not be called + * on clean entries, no checks are needed. + * + * JRM -- 4/6/15 * - * MAM -- 01/06/09 - * Added code to maintain clean_entries_skipped and total_entries - * scanned statistics. *------------------------------------------------------------------------- */ static herr_t H5C_make_space_in_cache(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, size_t space_needed, - hbool_t write_permitted, - hbool_t * first_flush_ptr) + hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; herr_t result; @@ -8807,6 +10143,7 @@ H5C_make_space_in_cache(H5F_t * f, size_t empty_space; hbool_t prev_is_dirty = FALSE; hbool_t didnt_flush_entry = FALSE; + hbool_t restart_scan; H5C_cache_entry_t * entry_ptr; H5C_cache_entry_t * prev_ptr; H5C_cache_entry_t * next_ptr; @@ -8817,13 +10154,12 @@ H5C_make_space_in_cache(H5F_t * f, HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( first_flush_ptr != NULL ); - HDassert( ( *first_flush_ptr == TRUE ) || ( *first_flush_ptr == FALSE ) ); HDassert( cache_ptr->index_size == (cache_ptr->clean_index_size + cache_ptr->dirty_index_size) ); if ( write_permitted ) { + restart_scan = FALSE; initial_list_len = cache_ptr->LRU_list_len; entry_ptr = cache_ptr->LRU_tail_ptr; @@ -8854,6 +10190,7 @@ H5C_make_space_in_cache(H5F_t * f, ( entry_ptr != NULL ) ) { + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert( ! (entry_ptr->is_protected) ); HDassert( ! (entry_ptr->is_read_only) ); HDassert( (entry_ptr->ro_ref_count) == 0 ); @@ -8866,7 +10203,8 @@ H5C_make_space_in_cache(H5F_t * f, prev_is_dirty = prev_ptr->is_dirty; } - if ( (entry_ptr->type)->id != H5C__EPOCH_MARKER_TYPE ) { + if ( ( (entry_ptr->type)->id != H5C__EPOCH_MARKER_TYPE ) && + ( ! entry_ptr->flush_in_progress ) ) { didnt_flush_entry = FALSE; @@ -8881,14 +10219,29 @@ H5C_make_space_in_cache(H5F_t * f, } #endif /* H5C_COLLECT_CACHE_STATS */ + /* reset entries_removed_counter and + * last_entry_removed_ptr prior to the call to + * H5C_flush_single_entry() so that we can spot + * unexpected removals of entries from the cache, + * and set the restart_scan flag if proceeding + * would be likely to cause us to scan an entry + * that is no longer in the cache. + */ + cache_ptr->entries_removed_counter = 0; + cache_ptr->last_entry_removed_ptr = NULL; + result = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - entry_ptr->type, + dxpl_id, entry_ptr->addr, H5C__NO_FLAGS_SET, - first_flush_ptr, - FALSE); + FALSE, + NULL); + + if ( ( cache_ptr->entries_removed_counter > 1 ) || + ( cache_ptr->last_entry_removed_ptr == prev_ptr ) ) + + restart_scan = TRUE; + } else if ( (cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size ) { @@ -8897,13 +10250,12 @@ H5C_make_space_in_cache(H5F_t * f, #endif /* H5C_COLLECT_CACHE_STATS */ result = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - entry_ptr->type, + dxpl_id, entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, - first_flush_ptr, - TRUE); + TRUE, + NULL); + } else { /* We have enough space so don't flush clean entry. @@ -8924,7 +10276,8 @@ H5C_make_space_in_cache(H5F_t * f, } else { - /* Skip epoch markers. Set result to SUCCEED to avoid + /* Skip epoch markers and entries that are in the process + * of being flushed. Set result to SUCCEED to avoid * triggering the error code below. */ didnt_flush_entry = TRUE; @@ -8938,26 +10291,20 @@ H5C_make_space_in_cache(H5F_t * f, } if ( prev_ptr != NULL ) { -#ifndef NDEBUG - if ( prev_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) { - /* something horrible has happened to *prev_ptr -- - * scream and die. - */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "*prev_ptr corrupt 1") - - } -#endif /* NDEBUG */ if ( didnt_flush_entry ) { - /* epoch markers don't get flushed, so the sanity checks - * on normal entries will fail -- thus just set entry_ptr - * to prev_ptr and go on. + /* epoch markers don't get flushed, and we don't touch + * entries that are in the process of being flushed. + * Hence no need for sanity checks, as we haven't + * flushed anything. Thus just set entry_ptr to prev_ptr + * and go on. */ entry_ptr = prev_ptr; - } else if ( ( prev_ptr->is_dirty != prev_is_dirty ) + } else if ( ( restart_scan ) + || + ( prev_ptr->is_dirty != prev_is_dirty ) || ( prev_ptr->next != next_ptr ) || @@ -8968,7 +10315,9 @@ H5C_make_space_in_cache(H5F_t * f, /* something has happened to the LRU -- start over * from the tail. */ + restart_scan = FALSE; entry_ptr = cache_ptr->LRU_tail_ptr; + H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) } else { @@ -9056,13 +10405,11 @@ H5C_make_space_in_cache(H5F_t * f, prev_ptr = entry_ptr->aux_prev; result = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - entry_ptr->type, + dxpl_id, entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, - first_flush_ptr, - TRUE); + TRUE, + NULL); if ( result < 0 ) { @@ -9070,6 +10417,12 @@ H5C_make_space_in_cache(H5F_t * f, "unable to flush entry") } + /* we are scanning the clean LRU, so the serialize function + * will not be called on any entry -- thus there is no + * concern about the list being modified out from under + * this function. + */ + entry_ptr = prev_ptr; entries_examined++; } @@ -9482,6 +10835,66 @@ done: /*------------------------------------------------------------------------- * + * Function: H5C_entry_in_skip_list + * + * Purpose: Debugging function that scans skip list to see if it + * is in present. We need this, as it is possible for + * an entry to be in the skip list twice. + * + * Return: FALSE if the entry is not in the skip list, and TRUE + * if it is. + * + * Programmer: John Mainzer, 11/1/14 + * + * Changes: + * + * None. + * + *------------------------------------------------------------------------- + */ +#if H5C_DO_SLIST_SANITY_CHECKS + +static hbool_t +H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr) +{ + hbool_t in_slist = FALSE; + H5SL_node_t * node_ptr = NULL; + H5C_cache_entry_t * entry_ptr = NULL; + + HDassert( cache_ptr ); + HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + HDassert( cache_ptr->slist_ptr ); + + node_ptr = H5SL_first(cache_ptr->slist_ptr); + + while ( ( node_ptr != NULL ) && ( ! in_slist ) ) + { + entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); + + HDassert( entry_ptr ); + HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); + HDassert( entry_ptr->is_dirty ); + HDassert( entry_ptr->in_slist ); + + if ( entry_ptr == target_ptr ) { + + in_slist = TRUE; + + } else { + + node_ptr = H5SL_next(node_ptr); + } + } + + return(in_slist); + +} /* H5C_entry_in_skip_list() */ + +#endif /* H5C_DO_SLIST_SANITY_CHECKS */ + + +/*------------------------------------------------------------------------- + * * Function: H5C_get_entry_ptr_from_addr() * * Purpose: Debugging function that attempts to look up an entry in the @@ -9784,7 +11197,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C_flush_tagged_entries(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, H5C_t * cache_ptr, haddr_t tag) +H5C_flush_tagged_entries(H5F_t * f, hid_t dxpl_id, H5C_t * cache_ptr, haddr_t tag) { herr_t ret_value = SUCCEED; @@ -9800,7 +11213,7 @@ H5C_flush_tagged_entries(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't mark tagged entries") /* Flush all marked entries */ - if(H5C_flush_marked_entries(f, primary_dxpl_id, secondary_dxpl_id, cache_ptr) < 0) + if(H5C_flush_marked_entries(f, dxpl_id, cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush marked entries") done: @@ -9873,7 +11286,7 @@ H5C_mark_tagged_entries(H5C_t * cache_ptr, haddr_t tag) *------------------------------------------------------------------------- */ static herr_t -H5C_flush_marked_entries(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, H5C_t * cache_ptr) +H5C_flush_marked_entries(H5F_t * f, hid_t dxpl_id, H5C_t * cache_ptr) { herr_t ret_value = SUCCEED; @@ -9885,8 +11298,7 @@ H5C_flush_marked_entries(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); /* Flush all marked entries */ - if(H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, - H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0) + if(H5C_flush_cache(f, dxpl_id, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache") done: @@ -9929,7 +11341,7 @@ H5C_verify_tag(int id, haddr_t tag) * constraints are met. */ /* Superblock */ - if(id == H5AC_SUPERBLOCK_ID) { + if((id == H5AC_SUPERBLOCK_ID) || (id == H5AC_DRVRINFO_ID)) { if(tag != H5AC__SUPERBLOCK_TAG) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "superblock not tagged with H5AC__SUPERBLOCK_TAG") } @@ -10001,10 +11413,9 @@ H5C_retag_copied_metadata(H5C_t * cache_ptr, haddr_t metadata_tag) next_entry_ptr = cache_ptr->index[u]; while(next_entry_ptr != NULL) { - if(cache_ptr->index[u] != NULL) { + if(cache_ptr->index[u] != NULL) if((cache_ptr->index[u])->tag == H5AC__COPIED_TAG) (cache_ptr->index[u])->tag = metadata_tag; - } /* end if */ next_entry_ptr = next_entry_ptr->ht_next; } /* end while */ diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 5df84cd..988dfff 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -60,7 +60,7 @@ /* 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__MAX_NUM_TYPE_IDS 28 #define H5C__PREFIX_LEN 32 /**************************************************************************** @@ -573,6 +573,15 @@ if ( ( (entry_ptr) == NULL ) || \ #define H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) \ ((cache_ptr)->unpins)[(entry_ptr)->type->id]++; +#define H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) \ + ((cache_ptr)->slist_scan_restarts)++; + +#define H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) \ + ((cache_ptr)->LRU_scan_restarts)++; + +#define H5C__UPDATE_STATS_FOR_HASH_BUCKET_SCAN_RESTART(cache_ptr) \ + ((cache_ptr)->hash_bucket_scan_restarts)++; + #if H5C_COLLECT_CACHE_ENTRY_STATS #define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) \ @@ -599,9 +608,12 @@ if ( ( (entry_ptr) == NULL ) || \ ((entry_ptr)->flushes)++; \ } -#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \ -{ \ - (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; \ +#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr, take_ownership) \ +{ \ + if ( take_ownership ) \ + (((cache_ptr)->take_ownerships)[(entry_ptr)->type->id])++; \ + else \ + (((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] = \ @@ -709,8 +721,13 @@ if ( ( (entry_ptr) == NULL ) || \ (((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_EVICTION(cache_ptr, entry_ptr, take_ownership) \ +{ \ + if ( take_ownership ) \ + (((cache_ptr)->take_ownerships)[(entry_ptr)->type->id])++; \ + else \ + (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; \ +} #define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \ { \ @@ -780,10 +797,13 @@ if ( ( (entry_ptr) == NULL ) || \ #define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) #define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) #define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr, take_ownership) #define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) #define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) #define H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) +#define H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) +#define H5C__UPDATE_STATS_FOR_HASH_BUCKET_SCAN_RESTART(cache_ptr) #endif /* H5C_COLLECT_CACHE_STATS */ @@ -828,11 +848,25 @@ if ( ( (cache_ptr) == NULL ) || \ ( H5C__HASH_FCN((entry_ptr)->addr) >= H5C__HASH_TABLE_LEN ) || \ ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + \ - (cache_ptr)->dirty_index_size) ) ) { \ + (cache_ptr)->dirty_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ "Pre HT insert SC failed") \ } +#define H5C__POST_HT_INSERT_SC(cache_ptr, fail_val) \ +if ( ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + \ + (cache_ptr)->dirty_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ + "Post HT insert SC failed") \ +} + #define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) \ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ @@ -853,10 +887,28 @@ if ( ( (cache_ptr) == NULL ) || \ ( (entry_ptr)->ht_prev != NULL ) ) || \ ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + \ - (cache_ptr)->dirty_index_size) ) ) { \ + (cache_ptr)->dirty_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Pre HT remove SC failed") \ } +#define H5C__POST_HT_REMOVE_SC(cache_ptr, entry_ptr) \ +if ( ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ + ( (entry_ptr) == NULL ) || \ + ( ! H5F_addr_defined((entry_ptr)->addr) ) || \ + ( (entry_ptr)->size <= 0 ) || \ + ( (entry_ptr)->ht_prev != NULL ) || \ + ( (entry_ptr)->ht_prev != NULL ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + \ + (cache_ptr)->dirty_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Post HT remove SC failed") \ +} + /* (Keep in sync w/H5C_TEST__PRE_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ #define H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) \ if ( ( (cache_ptr) == NULL ) || \ @@ -915,6 +967,8 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + \ (cache_ptr)->dirty_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ ( ( !( was_clean ) || \ ( (cache_ptr)->clean_index_size < (old_size) ) ) && \ ( ( (was_clean) ) || \ @@ -933,6 +987,8 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + \ (cache_ptr)->dirty_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ ( ( !((entry_ptr)->is_dirty ) || \ ( (cache_ptr)->dirty_index_size < (new_size) ) ) && \ ( ( ((entry_ptr)->is_dirty) ) || \ @@ -953,7 +1009,9 @@ if ( \ ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ ( (cache_ptr)->dirty_index_size < (entry_ptr)->size ) || \ ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) ) { \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Pre HT update for entry clean SC failed") \ } @@ -968,21 +1026,27 @@ if ( \ ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ ( (cache_ptr)->clean_index_size < (entry_ptr)->size ) || \ ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) ) { \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Pre HT update for entry dirty SC failed") \ } #define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ -if ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) { \ +if ( ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Post HT update for entry clean SC failed") \ } #define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ -if ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) { \ +if ( ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Post HT update for entry dirty SC failed") \ } @@ -990,7 +1054,9 @@ if ( (cache_ptr)->index_size != \ #else /* H5C_DO_SANITY_CHECKS */ #define H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) +#define H5C__POST_HT_INSERT_SC(cache_ptr, fail_val) #define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) +#define H5C__POST_HT_REMOVE_SC(cache_ptr, entry_ptr) #define H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) #define H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) #define H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) @@ -1026,9 +1092,10 @@ if ( (cache_ptr)->index_size != \ (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); \ + HDassert((cache_ptr)->num_last_entries <= 2); \ } \ H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \ + H5C__POST_HT_INSERT_SC(cache_ptr, fail_val) \ } #define H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) \ @@ -1052,9 +1119,10 @@ if ( (cache_ptr)->index_size != \ (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); \ + HDassert((cache_ptr)->num_last_entries <= 1); \ } \ H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) \ + H5C__POST_HT_REMOVE_SC(cache_ptr, entry_ptr) \ } #define H5C__SEARCH_INDEX(cache_ptr, Addr, entry_ptr, fail_val) \ @@ -1205,9 +1273,20 @@ if ( (cache_ptr)->index_size != \ * able to dirty, resize and/or move entries during the * flush. * + * JRM -- 12/13/14 + * Added code to set cache_ptr->slist_changed to TRUE + * when an entry is inserted in the slist. + * *------------------------------------------------------------------------- */ +#if H5C_DO_SLIST_SANITY_CHECKS +#define ENTRY_IN_SLIST(cache_ptr, entry_ptr) \ + H5C_entry_in_skip_list((cache_ptr), (entry_ptr)) +#else /* H5C_DO_SLIST_SANITY_CHECKS */ +#define ENTRY_IN_SLIST(cache_ptr, entry_ptr) FALSE +#endif /* H5C_DO_SLIST_SANITY_CHECKS */ + #if H5C_DO_SANITY_CHECKS #define H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, fail_val) \ @@ -1218,12 +1297,14 @@ if ( (cache_ptr)->index_size != \ HDassert( (entry_ptr)->size > 0 ); \ HDassert( H5F_addr_defined((entry_ptr)->addr) ); \ HDassert( !((entry_ptr)->in_slist) ); \ + HDassert( !ENTRY_IN_SLIST((cache_ptr), (entry_ptr)) ); \ \ 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") \ \ (entry_ptr)->in_slist = TRUE; \ + (cache_ptr)->slist_changed = TRUE; \ (cache_ptr)->slist_len++; \ (cache_ptr)->slist_size += (entry_ptr)->size; \ (cache_ptr)->slist_len_increase++; \ @@ -1244,12 +1325,14 @@ if ( (cache_ptr)->index_size != \ HDassert( (entry_ptr)->size > 0 ); \ HDassert( H5F_addr_defined((entry_ptr)->addr) ); \ HDassert( !((entry_ptr)->in_slist) ); \ + HDassert( !ENTRY_IN_SLIST((cache_ptr), (entry_ptr)) ); \ \ 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") \ \ (entry_ptr)->in_slist = TRUE; \ + (cache_ptr)->slist_changed = TRUE; \ (cache_ptr)->slist_len++; \ (cache_ptr)->slist_size += (entry_ptr)->size; \ \ @@ -1290,6 +1373,10 @@ if ( (cache_ptr)->index_size != \ * Updated sanity checks for the new is_read_only and * ro_ref_count fields in H5C_cache_entry_t. * + * JRM -- 12/13/14 + * Added code to set cache_ptr->slist_changed to TRUE + * when an entry is removed from the slist. + * *------------------------------------------------------------------------- */ @@ -1311,6 +1398,7 @@ if ( (cache_ptr)->index_size != \ "Can't delete entry from skip list.") \ \ HDassert( (cache_ptr)->slist_len > 0 ); \ + (cache_ptr)->slist_changed = TRUE; \ (cache_ptr)->slist_len--; \ HDassert( (cache_ptr)->slist_size >= (entry_ptr)->size ); \ (cache_ptr)->slist_size -= (entry_ptr)->size; \ @@ -1341,6 +1429,11 @@ if ( (cache_ptr)->index_size != \ * able to dirty, resize and/or move entries during the * flush. * + * JRM -- 12/13/14 + * Note that we do not set cache_ptr->slist_changed to TRUE + * in this case, as the structure of the slist is not + * modified. + * *------------------------------------------------------------------------- */ @@ -2706,6 +2799,10 @@ if ( (cache_ptr)->index_size != \ * the max_cache_size limit until the next time the cache * attempts to load or insert an entry. * + * d) When the evictions_enabled field is false (see below), + * the cache size will increase without limit until the + * field is set to true. + * * 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 @@ -2756,7 +2853,7 @@ if ( (cache_ptr)->index_size != \ * 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 + * index_size by three should yield a conservative estimate * of the cache's memory footprint. * * clean_index_size: Number of bytes of clean entries currently stored in @@ -2767,12 +2864,7 @@ if ( (cache_ptr)->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 + * 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) @@ -2784,13 +2876,6 @@ if ( (cache_ptr)->index_size != \ * 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. @@ -2806,6 +2891,37 @@ if ( (cache_ptr)->index_size != \ * 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 the take ownership flag, it is possible that + * an entry may be removed from the cache as the result of the flush of + * a second entry. In general, this causes little trouble, but it is + * possible that the entry removed may be the next entry in the scan of + * a list. In this case, we must be able to detect the fact that the + * entry has been removed, so that the scan doesn't attempt to proceed with + * an entry that is no longer in the cache. + * + * The following fields are maintained to facilitate this. + * + * entries_removed_counter: Counter that is incremented each time an + * entry is removed from the cache by any means (eviction, + * expungement, or take ownership at this point in time). + * Functions that perform scans on lists may set this field + * to zero prior to calling H5C_flush_single_entry(). + * Unexpected changes to the counter indicate that an entry + * was removed from the cache as a side effect of the flush. + * + * last_entry_removed_ptr: Pointer to the instance of H5C_cache_entry_t + * which contained the last entry to be removed from the cache, + * or NULL if there either is no such entry, or if a function + * performing a scan of a list has set this field to NULL prior + * to calling H5C_flush_single_entry(). + * + * WARNING!!! This field must NEVER be dereferenced. It is + * maintained to allow functions that perform scans of lists + * to compare this pointer with their pointers to next, thus + * allowing them to avoid unnecessary restarts of scans if the + * pointers don't match, and if entries_removed_counter is + * one. + * * * With the addition of cache entry tagging, it is possible that * an entry may be inserted into the cache without a tag during testing @@ -2825,6 +2941,21 @@ if ( (cache_ptr)->index_size != \ * are flushed. (this has been changed -- dirty entries are now removed from * the skip list as they are flushed. JRM - 10/25/05) * + * slist_changed: Boolean flag used to indicate whether the contents of + * the slist has changed since the last time this flag was + * reset. This is used in the cache flush code to detect + * conditions in which pre-serialize or serialize callbacks + * have modified the slist -- which obliges us to restart + * the scan of the slist from the beginning. + * + * slist_change_in_pre_serialize: Boolean flag used to indicate that + * a pre_serialize call has modified the slist since the + * last time this flag was reset. + * + * slist_change_in_serialize: Boolean flag used to indicate that + * a serialize call has modified the slist since the + * last time this flag was reset. + * * slist_len: Number of entries currently in the skip list * used to maintain a sorted list of dirty entries in the * cache. @@ -2855,6 +2986,11 @@ if ( (cache_ptr)->index_size != \ * explicit tests for that case should be added when said * HDasserts are removed. * + * Update: There are now two possible last entries + * (superblock and file driver info message). This + * number will probably increase as we add superblock + * messages. JRM -- 11/18/14 + * * 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 @@ -2863,10 +2999,11 @@ if ( (cache_ptr)->index_size != \ * * slist_len_increase: Number of entries that have been added to the * slist since the last time this field was set to zero. + * Note that this value can be negative. * * 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. + * zero. Note that this value can be negative. * * * When a cache entry is protected, it must be removed from the LRU @@ -2905,9 +3042,9 @@ if ( (cache_ptr)->index_size != \ * 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. + * This places an additional burden on the associated pre-serialize + * and serialize callbacks, which must ensure the the entry is in + * a consistant state before creating an image of it. * * 3) A pinned entry can be marked as dirty (and possibly * change size) while it is unprotected. @@ -2965,7 +3102,8 @@ if ( (cache_ptr)->index_size != \ * 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. + * clean and dirty LRU lists to the usual LRU list. In general, these + * lists are only exist in parallel builds. * * The clean LRU list is simply the regular LRU list with all dirty cache * entries removed. @@ -2982,7 +3120,7 @@ if ( (cache_ptr)->index_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 + * cache must grow temporarily. At the next sync point, 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. @@ -2992,14 +3130,14 @@ if ( (cache_ptr)->index_size != \ * * LRU_list_len: Number of cache entries currently on the LRU list. * - * Observe that LRU_list_len + pl_len must always equal - * index_len. + * Observe that LRU_list_len + pl_len + pel_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. + * Observe that LRU_list_size + pl_size + pel_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. @@ -3244,6 +3382,11 @@ if ( (cache_ptr)->index_size != \ * equal to the array index has been evicted from the cache in * the current epoch. * + * take_ownerships: 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 removed from the + * cache via the H5C__TAKE_OWNERSHIP_FLAG 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 @@ -3252,7 +3395,7 @@ if ( (cache_ptr)->index_size != \ * 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. + * during its pre-serialize 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 @@ -3297,7 +3440,8 @@ if ( (cache_ptr)->index_size != \ * 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. + * array index has changed size while in its pre-serialize + * callback. * * cache_flush_size_changes: Array of int64 of length * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record @@ -3370,7 +3514,33 @@ if ( (cache_ptr)->index_size != \ * * entries_scanned_to_make_space: Number of entries scanned only when looking * for entries to evict in order to make space in cache. - + * + * + * As entries are now capable of moving, loading, dirtying, and deleting + * other entries in their pre_serialize and serialize callbacks, it has + * been necessary to insert code to restart scans of lists so as to avoid + * improper behavior if the next entry in the list is the target of one on + * these operations. + * + * The following fields are use to count such occurances. They are used + * both in tests (to verify that the scan has been restarted), and to + * obtain estimates of how frequently these restarts occur. + * + * slist_scan_restarts: Number of times a scan of the slist (that contains + * calls to H5C_flush_single_entry()) has been restarted to + * avoid potential issues with change of status of the next + * entry in the scan. + * + * LRU_scan_restarts: Number of times a scan of the LRU list (that contains + * calls to H5C_flush_single_entry()) has been restarted to + * avoid potential issues with change of status of the next + * entry in the scan. + * + * hash_bucket_scan_restarts: Number of times a scan of a hash bucket list + * (that contains calls to H5C_flush_single_entry()) has been + * restarted to avoid potential issues with change of status + * of the next entry in the scan. + * * The remaining stats are collected only when both H5C_COLLECT_CACHE_STATS * and H5C_COLLECT_CACHE_ENTRY_STATS are true. * @@ -3438,9 +3608,17 @@ struct H5C_t { size_t dirty_index_size; H5C_cache_entry_t * (index[H5C__HASH_TABLE_LEN]); + /* Fields to detect entries removed during scans */ + int64_t entries_removed_counter; + H5C_cache_entry_t * last_entry_removed_ptr; + /* Field to disable tag validation */ hbool_t ignore_tags; + /* Fields for maintaining list of in-order entries, for flushing */ + hbool_t slist_changed; + hbool_t slist_change_in_pre_serialize; + hbool_t slist_change_in_serialize; int32_t slist_len; size_t slist_size; H5SL_t * slist_ptr; @@ -3515,6 +3693,7 @@ struct H5C_t { 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 take_ownerships[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]; @@ -3559,6 +3738,11 @@ struct H5C_t { int32_t max_entries_skipped_in_msic; int32_t max_entries_scanned_in_msic; int64_t entries_scanned_to_make_space; + + /* Fields for tracking skip list scan restarts */ + int64_t slist_scan_restarts; + int64_t LRU_scan_restarts; + int64_t hash_bucket_scan_restarts; #if H5C_COLLECT_CACHE_ENTRY_STATS int32_t max_accesses[H5C__MAX_NUM_TYPE_IDS + 1]; diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 3413381..a9ffb70 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -40,9 +40,30 @@ /* Library Private Macros */ /**************************/ -#define H5C_DO_SANITY_CHECKS 0 +#ifndef NDEBUG +#define H5C_DO_SANITY_CHECKS 1 +#define H5C_DO_SLIST_SANITY_CHECKS 0 #define H5C_DO_TAGGING_SANITY_CHECKS 1 #define H5C_DO_EXTREME_SANITY_CHECKS 0 +#else /* NDEBUG */ +/* With rare execptions, the following defines should be set + * to 0 if NDEBUG is defined + */ +#define H5C_DO_SANITY_CHECKS 0 +#define H5C_DO_SLIST_SANITY_CHECKS 0 +#define H5C_DO_TAGGING_SANITY_CHECKS 0 +#define H5C_DO_EXTREME_SANITY_CHECKS 0 +#endif /* NDEBUG */ + +/* Note: The memory sanity checks aren't going to work until I/O filters are + * changed to call a particular alloc/free routine for their buffers, + * because the H5AC__SERIALIZE_RESIZED_FLAG set by the fractal heap + * direct block serialize callback calls H5Z_pipeline(). When the I/O + * filters are changed, then we should implement "cache image alloc/free" + * routines that the fractal heap direct block (and global heap) serialize + * calls can use when resizing (and re-allocating) their image in the + * cache. -QAK */ +#define H5C_DO_MEMORY_SANITY_CHECKS 0 /* This sanity checking constant was picked out of the air. Increase * or decrease it if appropriate. Its purposes is to detect corrupt @@ -53,9 +74,15 @@ #define H5C_MAX_ENTRY_SIZE ((size_t)(32 * 1024 * 1024)) /* H5C_COLLECT_CACHE_STATS controls overall collection of statistics - * on cache activity. In general, this #define should be set to 0. + * on cache activity. In general, this #define should be set to 1 in + * debug mode, and 0 in production mode.. */ + +#ifndef NDEBUG +#define H5C_COLLECT_CACHE_STATS 1 +#else /* NDEBUG */ #define H5C_COLLECT_CACHE_STATS 0 +#endif /* NDEBUG */ /* H5C_COLLECT_CACHE_ENTRY_STATS controls collection of statistics * in individual cache entries. @@ -82,10 +109,20 @@ #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 +/* Flags for cache client class behavior */ +#define H5C__CLASS_NO_FLAGS_SET ((unsigned)0x0) +#define H5C__CLASS_SPECULATIVE_LOAD_FLAG ((unsigned)0x1) +#define H5C__CLASS_COMPRESSED_FLAG ((unsigned)0x2) +/* The following flags may only appear in test code */ +#define H5C__CLASS_NO_IO_FLAG ((unsigned)0x4) +#define H5C__CLASS_SKIP_READS ((unsigned)0x8) +#define H5C__CLASS_SKIP_WRITES ((unsigned)0x10) + +/* Flags for pre-serialize callback */ +#define H5C__SERIALIZE_NO_FLAGS_SET ((unsigned)0) +#define H5C__SERIALIZE_RESIZED_FLAG ((unsigned)0x1) +#define H5C__SERIALIZE_MOVED_FLAG ((unsigned)0x2) +#define H5C__SERIALIZE_COMPRESSED_FLAG ((unsigned)0x4) /* Upper and lower limits on cache size. These limits are picked * out of a hat -- you should be able to change them as necessary. @@ -112,11 +149,9 @@ */ #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 @@ -169,9 +204,13 @@ * These flags apply to H5C_insert_entry(): * H5C__SET_FLUSH_MARKER_FLAG * H5C__PIN_ENTRY_FLAG + * H5C__FLUSH_LAST_FLAG ; super block only + * H5C__FLUSH_COLLECTIVELY_FLAG ; super block only * * These flags apply to H5C_protect() * H5C__READ_ONLY_FLAG + * H5C__FLUSH_LAST_FLAG ; super block only + * H5C__FLUSH_COLLECTIVELY_FLAG ; super block only * * These flags apply to H5C_unprotect(): * H5C__SET_FLUSH_MARKER_FLAG @@ -223,63 +262,842 @@ typedef struct H5C_t H5C_t; -/* - * Class methods pertaining to caching. Each type of cached object will - * have a constant variable with permanent life-span that describes how - * to cache the object. That variable will be of type H5C_class_t and - * have the following required fields... +/*************************************************************************** + * + * Struct H5C_class_t + * + * Instances of H5C_class_t are used to specify the callback functions + * used by the metadata cache for each class of metadata cache entry. + * The fields of the structure are discussed below: + * + * id: Integer field containing the unique ID of the class of metadata + * cache entries. + * + * name: Pointer to a string containing the name of the class of metadata + * cache entries. + * + * mem_type: Instance of H5FD_mem_t, that is used to supply the + * mem type passed into H5F_block_read(). + * + * flags: Flags indicating class-specific behavior. + * + * Whoever created the flags field neglected to document the meanings + * of the flags he created. Hence the following discussion of the + * H5C__CLASS_SPECULATIVE_LOAD_FLAG and (to a lesser extent) + * H5C__CLASS_COMPRESSED_FLAG should be viewed with suspicion, + * as the meanings are divined from the source code, and thus may be + * inaccurate. Please correct any errors you find. + * + * Possible flags are: + * + * H5C__CLASS_NO_FLAGS_SET: No special processing. + * + * H5C__CLASS_SPECULATIVE_LOAD_FLAG: This flag appears to be used + * only in H5C_load_entry(). When it is set, entries are + * permitted to change their sizes on the first attempt + * to load. + * + * If the new size is larger than the old, the read buffer + * is reallocated to the new size, loaded from file, and the + * deserialize routine is called a second time on the + * new buffer. The entry returned by the first call to + * the deserialize routine is discarded (via the free_icr + * call) after the new size is retrieved (via the image_len + * call). Note that the new size is used as the size of the + * entry in the cache. + * + * If the new size is smaller than the old, no new loads + * or desearializes are performed, but the new size becomes + * the size of the entry in the cache. + * + * When this flag is set, an attempt to read past the + * end of file is pemitted. In this case, if the size + * returned get_load_size callback would result in a + * read past the end of file, the size is trunkated to + * avoid this, and processing proceeds as normal. * - * LOAD: Loads an object from disk to memory. The function - * should allocate some data structure and return it. + * H5C__CLASS_COMPRESSED_FLAG: This flags indicates that the entry + * may be compressed -- i.e. its on disk image is run through + * filters on the way to and from disk. Thus the uncompressed + * (or unfiltered) size of the entry may be different from the + * size of the entry in file. * - * FLUSH: Writes some data structure back to disk. It would be - * wise for the data structure to include dirty flags to - * indicate whether it really needs to be written. This - * function is also responsible for freeing memory allocated - * by the LOAD method if the DEST argument is non-zero (by - * calling the DEST method). + * This has the following implications: * - * DEST: Just frees memory allocated by the LOAD method. + * On load, uncompressed size and load size may be different. + * Presumably, load size will be smaller than uncompressed + * size, but there is no requirement for this in the code + * (but note that I have inserted an assertion to this effect, + * which has not been triggered to date). * - * CLEAR: Just marks object as non-dirty. + * On insertion, compressed (AKA filtered, AKA on disk) size + * is unknown, as the entry has yet to be run through filters. + * Compressed size is computed whenever the entry is + * written (or the image is updated -- not relevant until + * journaling is brought back). * - * NOTIFY: Notify client that an action on an entry has taken/will take - * place + * On dirty (of a clean entry), compressed (AKA filtered, + * AKA on disk) size becomes unknown. Thus, compressed size + * must be computed by the pre-serialize callback before the + * entry may be written. * - * SIZE: Report the size (on disk) of the specified cache object. - * Note that the space allocated on disk may not be contiguous. - */ + * Once the compressed size becomes unknown, it remains so + * until the on disk image is constructed. + * + * Observe that the cache needs to know the size of the entry + * for space allocation purposes. Since the compressed size + * can change or become unknown, it uses the uncompressed + * size which may change, but which should always be known. + * The compressed size is used only for journaling and disk I/O. + * + * While there is no logical reason why they could not be + * combined, due to absence of need and for simplicity of code, + * the cache does not permit both the the + * H5C__CLASS_COMPRESSED_FLAG and the + * H5C__CLASS_SPECULATIVE_LOAD_FLAG to be set in the same + * instance of H5C_class_t. + * + * The following flags may only appear in test code. + * + * H5C__CLASS_NO_IO_FLAG: This flag is intended only for use in test + * code. When it is set, any attempt to load an entry of + * the type with this flag set will trigger an assertion + * failure, and any flush of an entry with this flag set + * will not result in any write to file. + * + * H5C__CLASS_SKIP_READS: This flags is intended only for use in test + * code. When it is set, reads on load will be skipped, + * and an uninitialize buffer will be passed to the + * deserialize function. + * + * H5C__CLASS_SKIP_WRITES: This flags is intended only for use in test + * code. When it is set, writes of buffers prepared by the + * serialize callback will be skipped. + * + * GET_LOAD_SIZE: Pointer to the 'get load size' function. + * + * This function must be able to determine the size of the disk image of + * a metadata cache entry, given the 'udata' that will be passed to the + * 'deserialize' callback. + * + * Note that if either the H5C__CLASS_SPECULATIVE_LOAD_FLAG or + * the H5C__CLASS_COMPRESSED_FLAG is set, the disk image size + * returned by this callback is either a first guess (if the + * H5C__CLASS_SPECULATIVE_LOAD_FLAG is set) or (if the + * H5C__CLASS_COMPRESSED_FLAG is set), the exact on disk size + * of the entry whether it has been run through filters or not. + * In all other cases, the value returned should be the correct + * uncompressed size of the entry. + * + * The typedef for the deserialize callback is as follows: + * + * typedef herr_t (*H5C_get_load_size_func_t)(void *udata_ptr, + * size_t *image_len_ptr); + * + * The parameters of the deserialize callback are as follows: + * + * udata_ptr: Pointer to user data provided in the protect call, which + * will also be passed through to the deserialize callback. + * + * image_len_ptr: Pointer to the location in which the length in bytes + * of the in file image to be deserialized is to be returned. + * + * This value is used by the cache to determine the size of + * the disk image for the metadata, in order to read the disk + * image from the file. + * + * Processing in the get_load_size function should proceed as follows: + * + * If successful, the function will place the length of the on disk + * image associated with supplied user data in *image_len_ptr, and + * then return SUCCEED. + * + * On failure, the function must return FAIL and push error information + * onto the error stack with the error API routines, without modifying + * the value pointed to by the image_len_ptr. + * + * + * DESERIALIZE: Pointer to the deserialize function. + * + * This function must be able to read a buffer containing the on disk + * image of a metadata cache entry, allocate and load the equivalent + * in core representation, and return a pointer to that representation. + * + * The typedef for the deserialize callback is as follows: + * + * typedef void *(*H5C_deserialize_func_t)(const void * image_ptr, + * size_t len, + * void * udata_ptr, + * boolean * dirty_ptr); + * + * The parameters of the deserialize callback are as follows: + * + * image_ptr: Pointer to a buffer of length len containing the + * contents of the file starting at addr and continuing + * for len bytes. + * + * len: Length in bytes of the in file image to be deserialized. + * + * This parameter is supplied mainly for sanity checking. + * Sanity checks should be performed when compiled in debug + * mode, but the parameter may be unused when compiled in + * production mode. + * + * udata_ptr: Pointer to user data provided in the protect call, which + * must be passed through to the deserialize callback. + * + * dirty_ptr: Pointer to boolean which the deserialize function + * must use to mark the entry dirty if it has to modify + * the entry to clean up file corruption left over from + * an old bug in the HDF5 library. + * + * Processing in the deserialize function should proceed as follows: + * + * If the image contains valid data, and is of the correct length, + * the deserialize function must allocate space for an in core + * representation of that data, load the contents of the image into + * the space allocated for the in core representation, and return + * a pointer to the in core representation. Observe that an + * instance of H5C_cache_entry_t must be the first item in this + * representation. The cache will initialize it after the callback + * returns. + * + * Note that the structure of the in core representation is otherwise + * up to the cache client. All that is required is that the pointer + * returned be sufficient for the clients purposes when it is returned + * on a protect call. + * + * If the deserialize function has to clean up file corruption + * left over from an old bug in the HDF5 library, it must set + * *dirty_ptr to TRUE. If it doesn't, no action is needed as + * *dirty_ptr will be set to FALSE before the deserialize call. + * + * If the operation fails for any reason (i.e. bad data in buffer, bad + * buffer length, malloc failure, etc.) the function must return NULL and + * push error information on the error stack with the error API routines. + * + * Exceptions to the above: + * + * If the H5C__CLASS_SPECULATIVE_LOAD_FLAG is set, the buffer supplied + * to the function need not be currect on the first invocation of the + * callback in any single attempt to load the entry. + * + * In this case, if the buffer is larger than necessary, the function + * should load the entry as described above and not flag an error due + * to the oversized buffer. The cache will correct its mis-apprehension + * of the entry size with a subsequent call to the image_len callback. + * + * If the buffer is too small, and this is the first deserialize call + * in the entry load operation, the function should not flag an error. + * Instead, it must compute the correct size of the entry, allocate an + * in core representation and initialize it to the extent that an + * immediate call to the image len callback will return the correct + * image size. + * + * In this case, when the deserialize callback returns, the cache will + * call the image length callback, realize that the supplied buffer was + * too small, discard the returned in core representation, allocate + * and load a new buffer of the correct size from file, and then call + * the deserialize callback again. + * + * If the H5C__CLASS_COMPRESSED_FLAG is set, exceptions are as per the + * H5C__CLASS_SPECULATIVE_LOAD_FLAG, save that only oversized buffers + * are permitted. + * + * + * IMAGE_LEN: Pointer to the image length callback. + * + * This callback exists primarily to support + * H5C__CLASS_SPECULATIVE_LOAD_FLAG and H5C__CLASS_COMPRESSED_FLAG + * discussed above, although it is also used to obtain the size of + * newly inserted entries. + * + * In the case of the H5C__CLASS_SPECULATIVE_LOAD_FLAG, it is used to + * allow the client to change the size of an entry in the deserialize + * callback. + * + * For the H5C__CLASS_COMPRESSED_FLAG, it is used to allow the client + * to indicate whether the entry is compressed (i.e. whether entries + * are run through filters) and if so, to report both the uncompressed + * and the compressed entry size (i.e. the actual on disk size after + * the entry has been run through filters) if that value is known. + * + * The callback is also used in H5C_insert_entry() to obtain the + * size of the newly inserted entry. + * + * The typedef for the image_len callback is as follows: + * + * typedef herr_t (*H5C_image_len_func_t)(void *thing, + * size_t *image_len_ptr, + * hbool_t *compressed_ptr, + * size_t *compressed_image_len_ptr); + * + * The parameters of the image_len callback are as follows: + * + * thing: Pointer to the in core representation of the entry. + * + * image_len_ptr: Pointer to size_t in which the callback will return + * the length (in bytes) of the cache entry. + * + * If the H5C__CLASS_COMPRESSED_FLAG is not set in the + * associated instance of H5C_class_t, or if the flag is + * set, and the callback sets *compressed_ptr to FALSE, + * this size is the actual size of the entry on disk. + * + * Otherwise, this size is the uncompressed size of the + * entry -- which the cache will use for all purposes OTHER + * than journal writes and disk I/O. + * + * compressed_ptr: Pointer to a boolean flag indicating whether + * the cache entry will be compressed / uncompressed on + * disk writes / reads. + * + * If the H5C__CLASS_COMPRESSED_FLAG is not set in the + * associated instance of H5C_class_t, *compressed_ptr + * must be set to FALSE. + * + * If the H5C__CLASS_COMPRESSED_FLAG is set in the + * associated instance of H5C_class_t, and filters are + * not enabled, *compressed_ptr must be set to FALSE. + * + * If the H5C__CLASS_COMPRESSED_FLAG is set in the + * associated instance of H5C_class_t, and filters are + * enabled, the callback must set *compressed_ptr to TRUE. + * + * Note that *compressed_ptr will always be set to FALSE + * by the caller prior to invocation of the callback. Thus + * callbacks for clients that don't set the + * H5C__CLASS_COMPRESSED_FLAG can ignore this parameter. + * + * compressed_image_len_ptr: Pointer to size_t in which the callback + * may return the length (in bytes) of the compressed on + * disk image of the entry, or the uncompressed size if the + * compressed size has not yet been calculated. + * + * Since computing the compressed image len is expensive, + * the callback should only report the most recently computed + * value -- which will typically be incorrect if the entry + * is dirty. + * + * If *compressed_ptr is set to FALSE, *compressed_image_len_ptr + * should be set to zero. However, as *compressed_image_len_ptr + * will be initialize to zero prior to the call, the callback + * need not modify it if the H5C__CLASS_COMPRESSED_FLAG is + * not set. + * + * If the H5C__CLASS_COMPRESSED_FLAG is not set in the associated + * instance of H5C_class_t, processing in the image_len function + * should proceed as follows: + * + * If successful, the function will place the length of the on disk + * image associated with the in core representation provided in the + * thing parameter in *image_len_ptr, and then return SUCCEED. Since + * *compressed_ptr and *compressed_image_len_ptr will be initialized to + * FALSE and zero respectively before the call, the callback need not + * modify these values, and may declare the associated parameters as + * UNUSED. + * + * If the H5C__CLASS_COMPRESSED_FLAG is set in the associated + * instance of H5C_class_t, processing in the image_len function + * should proceed as follows: + * + * If successful, the function will place the uncompressed length of + * the on disk image associated with the in core representation + * provided in the thing parameter in *image_len_ptr. If filters + * are not enabled for the entry, it will set *compressed_ptr to FALSE, + * and *compressed_image_len_ptr to zero. If filters are enabled, + * it will set *compressed_ptr to TRUE. In this case, it must set + * *compressed_image_len_ptr equal to the last computed compressed + * if the compressed size, or to the uncompressed size if that value + * is yet to be computed. In all cases, it will return SUCCEED if + * successful. + * + * In either case, if the function fails, it must return FAIL and + * push error information onto the error stack with the error API + * routines, and return without modifying the values pointed to by + * the image_len_ptr, compressed_ptr, and compressed_image_len_ptr + * parameters. + * + * PRE_SERIALIZE: Pointer to the pre-serialize callback. + * + * The pre-serialize callback is invoked by the metadata cache before + * it needs a current on-disk image of the metadata entry for purposes + * either constructing a journal or flushing the entry to disk. + * + * If the client needs to change the address or compressed or + * uncompressed length of the entry prior to flush, the pre-serialize + * callback is responsible for these actions, so that the actual + * serialize callback (described below) is only responsible for + * serializing the data structure, not moving it on disk or resizing it. + * + * In addition, the client may use the pre-serialize callback to + * ensure that the entry is ready to be flushed -- in particular, + * if the entry contains references to other entries that are in + * temporary file space, the pre-serialize callback must move those + * entries into real file space so that the serialzed entry will + * contain no invalid data. + * + * One would think that the base address and length of + * the length of the entry's image on disk would be well known. + * However, that need not be the case as free space section info + * entries will change size (and possibly location) depending on the + * number of blocks of free space being manages, and fractal heap + * direct blocks can change compressed size (and possibly location) + * on serialization if compression is enabled. Similarly, it may + * be necessary to move entries from temporary to real file space. + * + * The pre-serialize callback must report any such changes to the + * cache, which must then update its internal structures as needed. + * + * The typedef for the pre-serialize callback is as follows: + * + * typedef herr_t (*H5C_pre_serialize_func_t)(const H5F_t *f, + * hid_t dxpl_id, + * void * thing, + * haddr_t addr, + * size_t len, + * size_t compressed_len, + * haddr_t * new_addr_ptr, + * size_t * new_len_ptr, + * size_t * new_compressed_len_ptr, + * unsigned * flags_ptr); + * + * The parameters of the pre-serialize callback are as follows: + * + * f: File pointer -- needed if other metadata cache entries + * must be modified in the process of serializing the + * target entry. + * + * dxpl_id: dxpl_id passed with the file pointer to the cache, and + * passed on to the callback. Necessary as some callbacks + * revise the size and location of the target entry, or + * possibly other entries on pre-serialize. + * + * thing: Pointer to void containing the address of the in core + * representation of the target metadata cache entry. + * This is the same pointer returned by a protect of the + * addr and len given above. + * + * addr: Base address in file of the entry to be serialized. + * + * This parameter is supplied mainly for sanity checking. + * Sanity checks should be performed when compiled in debug + * mode, but the parameter may be unused when compiled in + * production mode. + * + * len: Length in bytes of the in file image of the entry to be + * serialized. Also the size the image passed to the + * serialize callback (discussed below) unless either that + * value is altered by this function, or the entry will be + * compressed. In the latter case, the compressed size + * of the entry will be reported in *new_compressed_len_ptr. + * + * This parameter is supplied mainly for sanity checking. + * Sanity checks should be performed when compiled in debug + * mode, but the parameter may be unused when compiled in + * production mode. + * + * compressed_len: If the entry is to be compressed (i.e. run through + * filters) prior to flush, Length in bytes of the last know + * compressed size of the entry -- or the uncompressed size + * if no such value exists (i.e. the entry has been inserted, + * but never flushed). This parameter should be set to zero + * in all other cases. + * + * This parameter is supplied mainly for sanity checking. + * Sanity checks should be performed when compiled in debug + * mode, but the parameter may be unused when compiled in + * production mode. + * + * new_addr_ptr: Pointer to haddr_t. If the entry is moved by + * the serialize function, the new on disk base address must + * be stored in *new_addr_ptr, and the appropriate flag set + * in *flags_ptr. + * + * If the entry is not moved by the serialize function, + * *new_addr_ptr is undefined on pre-serialize callback + * return. + * + * new_len_ptr: Pointer to size_t. If the entry is resized by the + * serialize function, the new length of the on disk image + * must be stored in *new_len_ptr, and the appropriate flag set + * in *flags_ptr. + * + * If the entry is not resized by the pre-serialize function, + * *new_len_ptr is undefined on pre-serialize callback + * return. + * + * new_compressed_len_ptr: Pointer to size_t. If the image will be + * compressed (i.e. run through filters) prior to being + * written to disk, the compressed size (in bytes) of the + * on disk image must be stored in *new_compressed_len_ptr, + * and the appropriate flag set in *flags_ptr. + * + * flags_ptr: Pointer to an unsigned integer used to return flags + * indicating whether the preserialize function resized or moved + * the entry, or computed its compressed size. If the entry was + * neither resized or moved, nor will be compressed, + * the serialize function must set *flags_ptr to zero. + * H5C__SERIALIZE_RESIZED_FLAG, H5C__SERIALIZE_MOVED_FLAG + * and H5C__SERIALIZE_COMPRESSED_FLAG must be set to indicate + * a resize, a move, or compression respectively. + * + * If the H5C__SERIALIZE_RESIZED_FLAG is set, the new length + * must be stored in *new_len_ptr. + * + * If the H5C__SERIALIZE_MOVED_FLAG flag is set, the + * new image base address must be stored in *new_addr_ptr. + * + * If the H5C__SERIALIZE_COMPRESSED_FLAG is set, the + * compressed size of the new image must be stored in + * *new_compressed_len_ptr. + * + * Processing in the pre-serialize function should proceed as follows: + * + * The pre-serialize function must examine the in core representation + * indicated by the thing parameter, if the pre-serialize function does + * not need to change the size or location of the on-disk image, or + * compute its compress size, it must set *flags_ptr to zero. + * + * If the (uncompressed) size of the on-disk image must be changed, + * the pre-serialize function must load the length of the new image + * into *new_len_ptr, and set the H5C__SERIALIZE_RESIZED_FLAG in + * *flags_ptr. + * + * If the base address of the on disk image must be changed, the + * pre-serialize function must set *new_addr_ptr to the new base address, + * and set the H5C__SERIALIZE_MOVED_FLAG in *flags_ptr. + * + * If the H5C__CLASS_COMPRESSED_FLAG is set in the assocated instance + * of H5C_class_t, and filters (i.e. compression) are enabled, the + * pre-serialize function must compute the compressed size of the + * on disk image, and if it has changed, load this value into + * *new_compressed_len_ptr, and set H5C__SERIALIZE_COMPRESSED_FLAG in + * *flags_ptr. + * + * Note that to do this, the preserialize function will typically have + * to serialize the entry, and run it through the filters to obtain + * the compressed size. For efficiency, the compressed image may + * be stored to be copied into the supplied buffer by the + * serialize callback. Needless to say this is awkward. We may + * want to re-work the API for cache clients to simplify this. + * + * In addition, the pre-serialize callback may perform any other + * processing required before the entry is written to disk + * + * If it is successful, the function must return SUCCEED. + * + * If it fails for any reason, the function must return FAIL and + * push error information on the error stack with the error API + * routines. + * + * + * SERIALIZE: Pointer to the serialize callback. + * + * The serialize callback is invoked by the metadata cache whenever + * it needs a current on disk image of the metadata entry for purposes + * either constructing a journal entry or flushing the entry to disk. + * + * At this point, the base address and length of the entry's image on + * disk must be well known and not change during the serialization + * process. + * + * While any size and/or location changes must have been handled + * by a pre-serialize call, the client may elect to handle any other + * changes to the entry required to place it in correct form for + * writing to disk in this call. + * + * The typedef for the serialize callback is as follows: + * + * typedef herr_t (*H5C_serialize_func_t)(const H5F_t *f, + * void * image_ptr, + * size_t len, + * void * thing); + * + * The parameters of the serialize callback are as follows: + * + * f: File pointer -- needed if other metadata cache entries + * must be modified in the process of serializing the + * target entry. + * + * image_ptr: Pointer to a buffer of length len bytes into which a + * serialized image of the target metadata cache entry is + * to be written. + * + * Note that this buffer will not in general be initialized + * to any particular value. Thus the serialize function may + * not assume any initial value and must set each byte in + * the buffer. + * + * len: Length in bytes of the in file image of the entry to be + * serialized. Also the size of *image_ptr (below). If + * compression is not enabled, this value is simply the + * uncompressed size of the entry's image on disk. If + * compression is enabled, this value is the size of the + * compressed image. + * + * This parameter is supplied mainly for sanity checking. + * Sanity checks should be performed when compiled in debug + * mode, but the parameter may be unused when compiled in + * production mode. + * + * thing: Pointer to void containing the address of the in core + * representation of the target metadata cache entry. + * This is the same pointer returned by a protect of the + * addr and len given above. + * + * Processing in the serialize function should proceed as follows: + * + * If there are any remaining changes to the entry required before + * write to disk, they must be dealt with first. + * + * The serialize function must then examine the in core + * representation indicated by the thing parameter, and write a + * serialized (and possibly compressed) image of its contents into + * the provided buffer. + * + * If it is successful, the function must return SUCCEED. + * + * If it fails for any reason, the function must return FAIL and + * push error information on the error stack with the error API + * routines. + * + * + * NOTIFY: Pointer to the notify callback. + * + * The notify callback is invoked by the metadata cache when a cache + * action on an entry has taken/will take place and the client indicates + * it wishes to be notified about the action. + * + * The typedef for the notify callback is as follows: + * + * typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action, + * void *thing); + * + * The parameters of the notify callback are as follows: + * + * action: An enum indicating the metadata cache action that has taken/ + * will take place. + * + * thing: Pointer to void containing the address of the in core + * representation of the target metadata cache entry. This + * is the same pointer that would be returned by a protect + * of the addr and len of the entry. + * + * Processing in the notify function should proceed as follows: + * + * The notify function may perform any action it would like, including + * metadata cache calls. + * + * If the function is successful, it must return SUCCEED. + * + * If it fails for any reason, the function must return FAIL and + * push error information on the error stack with the error API + * routines. + * + * + * FREE_ICR: Pointer to the free ICR callback. + * + * The free ICR callback is invoked by the metadata cache when it + * wishes to evict an entry, and needs the client to free the memory + * allocated for the in core representation. + * + * The typedef for the free ICR callback is as follows: + * + * typedef herr_t (*H5C_free_icr_func_t)(void * thing)); + * + * The parameters of the free ICR callback are as follows: + * + * thing: Pointer to void containing the address of the in core + * representation of the target metadata cache entry. This + * is the same pointer that would be returned by a protect + * of the addr and len of the entry. + * + * Processing in the free ICR function should proceed as follows: + * + * The free ICR function must free all memory allocated to the + * in core representation. + * + * If the function is successful, it must return SUCCEED. + * + * If it fails for any reason, the function must return FAIL and + * push error information on the error stack with the error API + * routines. + * + * At least when compiled with debug, it would be useful if the + * free ICR call would fail if the in core representation has been + * modified since the last serialize of clear callback. + * + * CLEAR: Pointer to the clear callback. + * + * In principle, there should be no need for the clear callback, + * as the dirty flag should be maintained by the metadata cache. + *. + * However, some clients maintain dirty bits on internal data, + * and we need some way of keeping these dirty bits in sync with + * those maintained by the metadata cache. This callback exists + * to serve this purpose. If defined, it is called whenever the + * cache marks dirty entry clean, or when the cache is about to + * discard a dirty entry without writing it to disk (This + * happens as the result of an unprotect call with the + * H5AC__DELETED_FLAG set, and the H5C__TAKE_OWNERSHIP_FLAG not + * set.) + * + * Arguably, this functionality should be in the NOTIFY callback. + * However, this callback is specific to only a few clients, and + * it will be called relatively frequently. Hence it is made its + * own callback to minimize overhead. + * + * The typedef for the clear callback is as follows: + * + * typedef herr_t (*H5C_clear_func_t)(const H5F_t *f, + * void * thing, + * hbool_t about_to_destroy); + * + * The parameters of the clear callback are as follows: + * + * f: File pointer. + * + * thing: Pointer to void containing the address of the in core + * representation of the target metadata cache entry. This + * is the same pointer that would be returned by a protect() + * call of the associated addr and len. + * + * about_to_destroy: Boolean flag used to indicate whether the + * metadata cache is about to destroy the target metadata + * cache entry. The callback may use this flag to omit + * operations that are irrelevant it the entry is about + * to be destroyed. + * + * Processing in the clear function should proceed as follows: + * + * Reset all internal dirty bits in the target metadata cache entry. + * + * If the about_to_destroy flag is TRUE, the clear function may + * ommit any dirty bit that will not trigger a sanity check failure + * or otherwise cause problems in the subsequent free icr call. + * In particular, the call must ensure that the free icr call will + * not fail due to changes prior to this call, and after the + * last serialize or clear call. + * + * If the function is successful, it must return SUCCEED. + * + * If it fails for any reason, the function must return FAIL and + * push error information on the error stack with the error API + * routines. + * + * GET_FSF_SIZE: Pointer to the get file space free size callback. + * + * In principle, there is no need for the get file space free size + * callback. However, as an optimization, it is sometimes convenient + * to allocate and free file space for a number of cache entries + * simultaneously in a single contiguous block of file space. + * + * File space allocation is done by the client, so the metadata cache + * need not be involved. However, since the metadata cache typically + * handles file space release when an entry is destroyed, some + * adjustment on the part of the metadata cache is required for this + * operation. + * + * The get file space free size callback exists to support this + * operation. + * + * If a group of cache entries that were allocated as a group are to + * be discarded and their file space released, the type of the first + * (i.e. lowest address) entry in the group must implement the + * get free file space size callback. + * + * To free the file space of all entries in the group in a single + * operation, first expunge all entries other than the first without + * the free file space flag. + * + * Then, to complete the operation, unprotect or expunge the first + * entry in the block with the free file space flag set. Since + * the get free file space callback is implemented, the metadata + * cache will use this callback to get the size of the block to be + * freed, instead of using the size of the entry as is done otherwise. + * + * At present this callback is used only by the H5FA and H5EA dblock + * and dblock page client classes. + * + * The typedef for the clear callback is as follows: + * + * typedef herr_t (*H5C_get_fsf_size_t)(const void * thing, + * size_t *fsf_size_ptr); + * + * The parameters of the clear callback are as follows: + * + * thing: Pointer to void containing the address of the in core + * representation of the target metadata cache entry. This + * is the same pointer that would be returned by a protect() + * call of the associated addr and len. + * + * fs_size_ptr: Pointer to size_t in which the callback will return + * the size of the piece of file space to be freed. Note + * that the space to be freed is presumed to have the same + * base address as the cache entry. + * + * The function simply returns the size of the block of file space + * to be freed in *fsf_size_ptr. + * + * If the function is successful, it must return SUCCEED. + * + * If it fails for any reason, the function must return FAIL and + * push error information on the error stack with the error API + * routines. + * + ***************************************************************************/ /* 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 */ - /* (could be loaded from file with - * 'protect' call, or inserted - * with 'set' call) + H5C_NOTIFY_ACTION_AFTER_INSERT, /* Entry has been added to the cache + * via the insert call + */ + H5C_NOTIFY_ACTION_AFTER_LOAD, /* Entry has been loaded into the + * from file via the protect call + */ + H5C_NOTIFY_ACTION_AFTER_FLUSH, /* Entry has just been flushed to + * file. + */ + H5C_NOTIFY_ACTION_BEFORE_EVICT /* Entry is about to be evicted + * from cache. */ - H5C_NOTIFY_ACTION_BEFORE_EVICT /* Entry is about to be evicted from cache */ } H5C_notify_action_t; /* 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_get_load_size_func_t)(const void *udata_ptr, + size_t *image_len_ptr); +typedef void *(*H5C_deserialize_func_t)(const void *image_ptr, + size_t len, void *udata_ptr, hbool_t *dirty_ptr); +typedef herr_t (*H5C_image_len_func_t)(const void *thing, + size_t *image_len_ptr, hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +typedef herr_t (*H5C_pre_serialize_func_t)(const H5F_t *f, hid_t dxpl_id, + void *thing, haddr_t addr, size_t len, size_t compressed_len, + haddr_t *new_addr_ptr, size_t *new_len_ptr, size_t *new_compressed_len_ptr, + unsigned *flags_ptr); +typedef herr_t (*H5C_serialize_func_t)(const H5F_t *f, void *image_ptr, + size_t len, void *thing); 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); +typedef herr_t (*H5C_free_icr_func_t)(void *thing); +typedef herr_t (*H5C_clear_func_t)(const H5F_t *f, void * thing, + hbool_t about_to_destroy); +typedef herr_t (*H5C_get_fsf_size_t)(const void * thing, size_t *fsf_size_ptr); /* Metadata cache client class definition */ typedef struct H5C_class_t { - int id; - H5C_load_func_t load; - H5C_flush_func_t flush; - H5C_dest_func_t dest; - H5C_clear_func_t clear; - H5C_notify_func_t notify; - H5C_size_func_t size; + int id; + const char * name; + H5FD_mem_t mem_type; + unsigned flags; + H5C_get_load_size_func_t get_load_size; + H5C_deserialize_func_t deserialize; + H5C_image_len_func_t image_len; + H5C_pre_serialize_func_t pre_serialize; + H5C_serialize_func_t serialize; + H5C_notify_func_t notify; + H5C_free_icr_func_t free_icr; + H5C_clear_func_t clear; + H5C_get_fsf_size_t fsf_size; } H5C_class_t; /* Type defintions of callback functions used by the cache as a whole */ @@ -312,7 +1130,7 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, * just before the entry is freed. * * This is necessary, as the LRU list can be changed out - * from under H5C_make_space_in_cache() by the flush + * from under H5C_make_space_in_cache() by the serialize * callback which may change the size of an existing entry, * and/or load a new entry while serializing the target entry. * @@ -325,18 +1143,66 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, * detect this case, and re-start its scan from the bottom * of the LRU when this situation occurs. * - * This field is only compiled in debug mode. + * cache_ptr: Pointer to the cache that this entry is contained within. * * addr: Base address of the cache entry on disk. * - * size: Length of the cache entry on disk. Note that unlike normal - * caches, the entries in this cache are of variable length. - * The entries should never overlap, and when we do writebacks, - * we will want to writeback adjacent entries where possible. + * size: Length of the cache entry on disk in bytes(exception: if + * the entry is compressed on disk, this field contains the + * uncompressed size of the entry -- see discussion of + * compressed entries below). Note that unlike normal + * caches, the entries in this cache are of arbitrary size. + * + * With the exception of compressed entries, the file space + * allocations for cache entries implied by the addr and size + * fields must be disjoint. For compressed entries, + * the size field contains the uncompressed size -- thus in + * in this case, substitution of compressed size for size + * must result in disjoint file space allocations. However, + * as discussed below, the compressed size may not be know. + * + * Any entry whose associated instance of H5C_class_t has the + * H5C__CLASS_COMPRESSED_FLAG set may be compressed. When + * an entry is compressed (that is, when filters are enabled + * on it), the compressed flag (see below) must be set, and + * the compressed size (if known), must be stored in + * the compressed_size field. + * + * Since the compressed size will be unknown unless the + * entry is clean, or has an up to date image (see the + * image_ptr and image_up_to_date fields below), we use the + * uncompressed size for all purposes other than disk I/O. + * + * compressed: Boolean flag that is set iff the instance of H5C_class_t + * associated with the entry has the H5C__CLASS_COMPRESSED_FLAG + * set, and filters are enabled on the entry. + * + * compressed_size: If compressed is TRUE, this field contains the actual + * compressed size of the entry in bytes, which is also its + * true size on disk -- or the uncompressed size if the + * compressed size is unknown (i.e. the entry has been + * inserted in the cache, but it has not been compressed yet). + * Note that this value will usually be incorrect if the + * entry is dirty. + * + * Since this value is frequently out of date and expensive to + * compute, it is used only for disk I/O. The uncompressed + * size of the entry (stored in the size field above) is used + * for all other purposes (i.e. computing the sum of the sizes + * of all entries in the cache, etc.). + * + * If compressed is FALSE, this field should contain 0. + * + * image_ptr: Pointer to void. When not NULL, this field points to a + * dynamically allocated block of size bytes in which the + * on disk image of the metadata cache entry is stored. + * + * If the entry is dirty, the pre-serialize and serialize + * callbacks must be used to update this image before it is + * written to disk * - * NB: At present, entries need not be contiguous on disk. Until - * we fix this, we can't do much with writing back adjacent - * entries. + * image_up_to_date: Boolean flag that is set to TRUE when *image_ptr + * is up to date, and set to false when the entry is dirtied. * * type: Pointer to the instance of H5C_class_t containing pointers * to the methods for cache entries of the current type. This @@ -366,6 +1232,9 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, * modules using the cache. These still clear the * is_dirty field as before. -- JRM 7/5/05 * + * Update: Management of the is_dirty field is now entirely + * in the cache. -- JRM 7/5/07 + * * dirtied: Boolean flag used to indicate that the entry has been * dirtied while protected. * @@ -422,9 +1291,10 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, * policy code (LRU at present). * * 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 does not flush the entry. + * This places an extra burden on the pre-serialize and + * serialize callbacks, which must ensure that a pinned + * entry is consistant and ready to write to disk before + * generating an image. * * 3) A pinned entry can be marked as dirty (and possibly * change size) while it is unprotected. @@ -466,6 +1336,11 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, * will need to be expanded and tested appropriately if that * functionality is desired. * + * Update: There are now two possible last entries + * (superblock and file driver info message). This + * number will probably increase as we add superblock + * messages. JRM -- 11/18/14 + * * clear_on_unprotect: Boolean flag used only in PHDF5. When H5C is used * to implement the metadata cache In the parallel case, only * the cache with mpi rank 0 is allowed to actually write to @@ -493,11 +1368,6 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, * destroy_in_progress: Boolean flag that is set to true iff the entry * is in the process of being flushed and destroyed. * - * free_file_space_on_destroy: Boolean flag that is set to true iff the entry - * is in the process of being flushed and destroyed and the file - * space used by the object should be freed by the cache client's - * 'dest' callback routine. - * * * Fields supporting the 'flush dependency' feature: * @@ -581,63 +1451,43 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, * The use of the replacement policy fields under the Modified LRU policy * is discussed below: * - * next: Next pointer in either the LRU or the protected list, - * depending on the current value of protected. If there - * is no next entry on the list, this field should be set - * to NULL. + * next: Next pointer in either the LRU, the protected list, or + * the pinned list depending on the current values of + * is_protected and is_pinned. If there is no next entry + * on the list, this field should be set to NULL. * - * prev: Prev pointer in either the LRU or the protected list, - * depending on the current value of protected. If there - * is no previous entry on the list, this field should be - * set to NULL. + * prev: Prev pointer in either the LRU, the protected list, + * or the pinned list depending on the current values of + * is_protected and is_pinned. If there is no previous + * entry on the list, this field should be set to NULL. * * aux_next: Next pointer on either the clean or dirty LRU lists. - * This entry should be NULL when protected is true. When - * protected is false, and dirty is true, it should point - * to the next item on the dirty LRU list. When protected - * is false, and dirty is false, it should point to the - * next item on the clean LRU list. In either case, when - * there is no next item, it should be NULL. + * This entry should be NULL when either is_protected or + * is_pinned is true. + * + * When is_protected and is_pinned are false, and is_dirty is + * true, it should point to the next item on the dirty LRU + * list. + * + * When is_protected and is_pinned are false, and is_dirty is + * false, it should point to the next item on the clean LRU + * list. In either case, when there is no next item, it + * should be NULL. * * aux_prev: Previous pointer on either the clean or dirty LRU lists. - * This entry should be NULL when protected is true. When - * protected is false, and dirty is true, it should point - * to the previous item on the dirty LRU list. When protected - * is false, and dirty is false, it should point to the - * previous item on the clean LRU list. In either case, when - * there is no previous item, it should be NULL. - * - * - * Fields supporting metadata journaling: - * - * last_trans: unit64_t containing the ID of the last transaction in - * which this entry was dirtied. If journaling is disabled, - * or if the entry has never been dirtied in a transaction, - * this field should be set to zero. Once we notice that - * the specified transaction has made it to disk, we will - * reset this field to zero as well. - * - * We must maintain this field, as to avoid messages from - * the future, we must not flush a dirty entry to disk - * until the last transaction in which it was dirtied - * has made it to disk in the journal file. - * - * trans_next: Next pointer in the entries modified in the current - * transaction list. This field should always be null - * unless journaling is enabled, the entry is dirty, - * and last_trans field contains the current transaction - * number. Even if all these conditions are fulfilled, - * the field will still be NULL if this is the last - * entry on the list. - * - * trans_prev: Previous pointer in the entries modified in the current - * transaction list. This field should always be null - * unless journaling is enabled, the entry is dirty, - * and last_trans field contains the current transaction - * number. Even if all these conditions are fulfilled, - * the field will still be NULL if this is the first - * entry on the list. + * This entry should be NULL when either is_protected or + * is_pinned is true. + * + * When is_protected and is_pinned are false, and is_dirty is + * true, it should point to the previous item on the dirty + * LRU list. + * + * When is_protected and is_pinned are false, and is_dirty + * is false, it should point to the previous item on the + * clean LRU list. * + * In either case, when there is no previous item, it should + * be NULL. * * Cache entry stats collection fields: * @@ -659,12 +1509,14 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, * ****************************************************************************/ typedef struct H5C_cache_entry_t { -#ifndef NDEBUG uint32_t magic; -#endif /* NDEBUG */ H5C_t * cache_ptr; haddr_t addr; size_t size; + hbool_t compressed; + size_t compressed_size; + void * image_ptr; + hbool_t image_up_to_date; const H5C_class_t * type; haddr_t tag; hbool_t is_dirty; @@ -683,7 +1535,6 @@ typedef struct H5C_cache_entry_t { #endif /* H5_HAVE_PARALLEL */ hbool_t flush_in_progress; hbool_t destroy_in_progress; - hbool_t free_file_space_on_destroy; /* fields supporting the 'flush dependency' feature: */ struct H5C_cache_entry_t * flush_dep_parent; @@ -1012,12 +1863,11 @@ 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, +H5_DLL herr_t H5C_dest(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5C_expunge_entry(H5F_t *f, hid_t 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_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags); +H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f, hid_t 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, @@ -1031,17 +1881,17 @@ H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, haddr_t addr, 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_insert_entry(H5F_t *f, hid_t 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 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_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 void * H5C_protect(H5F_t *f, hid_t 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, @@ -1055,17 +1905,17 @@ 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_unprotect(H5F_t *f, hid_t 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_apply_candidate_list(H5F_t *f, hid_t 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 */ diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index d7d7b88..01898f2 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -253,7 +253,7 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create EFL file name heap") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(file, dxpl_id, efl->heap_addr, H5AC_WRITE))) + if(NULL == (heap = H5HL_protect(file, dxpl_id, efl->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPROTECT, FAIL, "unable to protect EFL file name heap") /* Insert "empty" name first */ diff --git a/src/H5EA.c b/src/H5EA.c index 37682e7..d96f9c2 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -148,7 +148,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array info") /* Lock the array header into memory */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC_WRITE))) + if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Point extensible array wrapper at header and bump it's ref count */ @@ -209,7 +209,7 @@ H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) #ifdef QAK HDfprintf(stderr, "%s: ea_addr = %a\n", FUNC, ea_addr); #endif /* QAK */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC_READ))) + if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header, address = %llu", (unsigned long long)ea_addr) /* Check for pending array deletion */ @@ -333,7 +333,7 @@ END_FUNC(PRIV) /* end H5EA_get_addr() */ */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, H5AC_protect_t thing_acc, +H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, unsigned thing_acc, void **thing, uint8_t **thing_elmt_buf, hsize_t *thing_elmt_idx, H5EA__unprotect_func_t *thing_unprot_func)) @@ -362,6 +362,9 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); HDassert(thing_elmt_buf); HDassert(thing_unprot_func); + /* only the H5AC__READ_ONLY_FLAG may be set in thing_acc */ + HDassert((thing_acc & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* Set the shared array header's file context for this operation */ hdr->f = ea->f; @@ -377,7 +380,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); HDfprintf(stderr, "%s: Index block address not defined!\n", FUNC, idx); #endif /* QAK */ /* Check if we are allowed to create the thing */ - if(H5AC_WRITE == thing_acc) { + if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */ /* Create the index block */ hdr->idx_blk_addr = H5EA__iblock_create(hdr, dxpl_id, &stats_changed); if(!H5F_addr_defined(hdr->idx_blk_addr)) @@ -435,7 +438,7 @@ HDfprintf(stderr, "%s: dblk_idx = %u, iblock->ndblk_addrs = %Zu\n", FUNC, dblk_i /* Check if the data block has been allocated on disk yet */ if(!H5F_addr_defined(iblock->dblk_addrs[dblk_idx])) { /* Check if we are allowed to create the thing */ - if(H5AC_WRITE == thing_acc) { + if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */ haddr_t dblk_addr; /* Address of data block created */ hsize_t dblk_off; /* Offset of data block in array */ @@ -475,7 +478,7 @@ HDfprintf(stderr, "%s: dblk_idx = %u, iblock->ndblk_addrs = %Zu\n", FUNC, dblk_i /* Check if the super block has been allocated on disk yet */ if(!H5F_addr_defined(iblock->sblk_addrs[sblk_off])) { /* Check if we are allowed to create the thing */ - if(H5AC_WRITE == thing_acc) { + if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */ haddr_t sblk_addr; /* Address of data block created */ /* Create super block */ @@ -508,7 +511,7 @@ HDfprintf(stderr, "%s: dblk_idx = %u, sblock->ndblks = %Zu\n", FUNC, dblk_idx, s /* Check if the data block has been allocated on disk yet */ if(!H5F_addr_defined(sblock->dblk_addrs[dblk_idx])) { /* Check if we are allowed to create the thing */ - if(H5AC_WRITE == thing_acc) { + if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */ haddr_t dblk_addr; /* Address of data block created */ hsize_t dblk_off; /* Offset of data block in array */ @@ -568,7 +571,7 @@ HDfprintf(stderr, "%s: sblock->dblk_page_size = %Zu\n", FUNC, sblock->dblk_page_ /* Check if page has been initialized yet */ if(!H5VM_bit_get(sblock->page_init, page_init_idx)) { /* Check if we are allowed to create the thing */ - if(H5AC_WRITE == thing_acc) { + if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */ /* Create the data block page */ if(H5EA__dblk_page_create(hdr, dxpl_id, sblock, dblk_page_addr) < 0) H5E_THROW(H5E_CANTCREATE, "unable to create data block page") @@ -677,7 +680,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); hdr->f = ea->f; /* Look up the array metadata containing the element we want to set */ - if(H5EA__lookup_elmt(ea, dxpl_id, idx, H5AC_WRITE, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) + if(H5EA__lookup_elmt(ea, dxpl_id, idx, H5AC__NO_FLAGS_SET, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) H5E_THROW(H5E_CANTPROTECT, "unable to protect array metadata") /* Sanity check */ @@ -762,7 +765,7 @@ HDfprintf(stderr, "%s: Index block address is: %a\n", FUNC, hdr->idx_blk_addr); hdr->f = ea->f; /* Look up the array metadata containing the element we want to set */ - if(H5EA__lookup_elmt(ea, dxpl_id, idx, H5AC_READ, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) + if(H5EA__lookup_elmt(ea, dxpl_id, idx, H5AC__READ_ONLY_FLAG, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) H5E_THROW(H5E_CANTPROTECT, "unable to protect array metadata") /* Check if the thing holding the element has been created yet */ @@ -905,7 +908,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); HDassert(ea); /* Look up the array metadata containing the element we want to set */ - if(H5EA__lookup_elmt(ea, dxpl_id, idx, H5AC_WRITE, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) + if(H5EA__lookup_elmt(ea, dxpl_id, idx, H5AC__NO_FLAGS_SET, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) H5E_THROW(H5E_CANTPROTECT, "unable to protect array metadata") /* Sanity check */ @@ -960,7 +963,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); HDassert(ea); /* Look up the array metadata containing the element we want to set */ - if(H5EA__lookup_elmt(ea, dxpl_id, idx, H5AC_READ, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) + if(H5EA__lookup_elmt(ea, dxpl_id, idx, H5AC__READ_ONLY_FLAG, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) H5E_THROW(H5E_CANTPROTECT, "unable to protect array metadata") /* Sanity check */ @@ -1048,7 +1051,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Lock the array header into memory */ /* (OK to pass in NULL for callback context, since we know the header must be in the cache) */ - if(NULL == (hdr = H5EA__hdr_protect(ea->f, dxpl_id, ea_addr, NULL, H5AC_WRITE))) + if(NULL == (hdr = H5EA__hdr_protect(ea->f, dxpl_id, ea_addr, NULL, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTLOAD, "unable to load extensible array header") /* Set the shared array header's file context for this operation */ @@ -1112,7 +1115,7 @@ H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) #ifdef QAK HDfprintf(stderr, "%s: ea_addr = %a\n", FUNC, ea_addr); #endif /* QAK */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC_WRITE))) + if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array header, address = %llu", (unsigned long long)ea_addr) /* Check for files using shared array header */ diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 70686fb..0d83fb3 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -57,13 +57,6 @@ #define H5EA_SBLOCK_VERSION 0 /* Super block */ #define H5EA_DBLOCK_VERSION 0 /* Data block */ -/* Size of stack buffer for serialization buffers */ -#define H5EA_HDR_BUF_SIZE 512 -#define H5EA_IBLOCK_BUF_SIZE 512 -#define H5EA_SBLOCK_BUF_SIZE 512 -#define H5EA_DBLOCK_BUF_SIZE 512 -#define H5EA_DBLK_PAGE_BUF_SIZE 512 - /******************/ /* Local Typedefs */ @@ -80,35 +73,59 @@ /********************/ /* Metadata cache (H5AC) callbacks */ -static H5EA_hdr_t *H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5EA__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5EA_hdr_t *hdr, unsigned * flags_ptr); -static herr_t H5EA__cache_hdr_clear(H5F_t *f, H5EA_hdr_t *hdr, hbool_t destroy); -static herr_t H5EA__cache_hdr_size(const H5F_t *f, const H5EA_hdr_t *hdr, size_t *size_ptr); -static herr_t H5EA__cache_hdr_dest(H5F_t *f, H5EA_hdr_t *hdr); -static H5EA_iblock_t *H5EA__cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5EA__cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5EA_iblock_t *iblock, unsigned * flags_ptr); -static herr_t H5EA__cache_iblock_clear(H5F_t *f, H5EA_iblock_t *iblock, hbool_t destroy); -static herr_t H5EA__cache_iblock_notify(H5AC_notify_action_t action, H5EA_iblock_t *iblock); -static herr_t H5EA__cache_iblock_size(const H5F_t *f, const H5EA_iblock_t *iblock, size_t *size_ptr); -static herr_t H5EA__cache_iblock_dest(H5F_t *f, H5EA_iblock_t *iblock); -static H5EA_sblock_t *H5EA__cache_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5EA__cache_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5EA_sblock_t *sblock, unsigned * flags_ptr); -static herr_t H5EA__cache_sblock_clear(H5F_t *f, H5EA_sblock_t *sblock, hbool_t destroy); -static herr_t H5EA__cache_sblock_size(const H5F_t *f, const H5EA_sblock_t *sblock, size_t *size_ptr); -static herr_t H5EA__cache_sblock_notify(H5AC_notify_action_t action, H5EA_sblock_t *sblock); -static herr_t H5EA__cache_sblock_dest(H5F_t *f, H5EA_sblock_t *sblock); -static H5EA_dblock_t *H5EA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5EA__cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5EA_dblock_t *dblock, unsigned * flags_ptr); -static herr_t H5EA__cache_dblock_clear(H5F_t *f, H5EA_dblock_t *dblock, hbool_t destroy); -static herr_t H5EA__cache_dblock_size(const H5F_t *f, const H5EA_dblock_t *dblock, size_t *size_ptr); -static herr_t H5EA__cache_dblock_notify(H5AC_notify_action_t action, H5EA_dblock_t *dblock); -static herr_t H5EA__cache_dblock_dest(H5F_t *f, H5EA_dblock_t *dblock); -static H5EA_dblk_page_t *H5EA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5EA__cache_dblk_page_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5EA_dblk_page_t *dblk_page, unsigned * flags_ptr); -static herr_t H5EA__cache_dblk_page_clear(H5F_t *f, H5EA_dblk_page_t *dblk_page, hbool_t destroy); -static herr_t H5EA__cache_dblk_page_size(const H5F_t *f, const H5EA_dblk_page_t *dblk_page, size_t *size_ptr); -static herr_t H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, H5EA_dblk_page_t *dblk_page); -static herr_t H5EA__cache_dblk_page_dest(H5F_t *f, H5EA_dblk_page_t *dblk_page); +static herr_t H5EA__cache_hdr_get_load_size(const void *udata, size_t *image_len); +static void *H5EA__cache_hdr_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5EA__cache_hdr_image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5EA__cache_hdr_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5EA__cache_hdr_free_icr(void *thing); + +static herr_t H5EA__cache_iblock_get_load_size(const void *udata, size_t *image_len); +static void *H5EA__cache_iblock_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5EA__cache_iblock_image_len(const void *thing, + size_t *image_len, hbool_t *compressed_ptr, + size_t *compressed_image_len_ptr); +static herr_t H5EA__cache_iblock_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5EA__cache_iblock_notify(H5AC_notify_action_t action, void *thing); +static herr_t H5EA__cache_iblock_free_icr(void *thing); + +static herr_t H5EA__cache_sblock_get_load_size(const void *udata, size_t *image_len); +static void *H5EA__cache_sblock_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5EA__cache_sblock_image_len(const void *thing, + size_t *image_len, hbool_t *compressed_ptr, + size_t *compressed_image_len_ptr); +static herr_t H5EA__cache_sblock_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5EA__cache_sblock_notify(H5AC_notify_action_t action, void *thing); +static herr_t H5EA__cache_sblock_free_icr(void *thing); + +static herr_t H5EA__cache_dblock_get_load_size(const void *udata, size_t *image_len); +static void *H5EA__cache_dblock_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5EA__cache_dblock_image_len(const void *thing, + size_t *image_len, hbool_t *compressed_ptr, + size_t *compressed_image_len_ptr); +static herr_t H5EA__cache_dblock_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5EA__cache_dblock_notify(H5AC_notify_action_t action, void *thing); +static herr_t H5EA__cache_dblock_free_icr(void *thing); +static herr_t H5EA__cache_dblock_fsf_size(const void *thing, size_t *fsf_size); + +static herr_t H5EA__cache_dblk_page_get_load_size(const void *udata, size_t *image_len); +static void *H5EA__cache_dblk_page_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5EA__cache_dblk_page_image_len(const void *thing, + size_t *image_len, hbool_t *compressed_ptr, + size_t *compressed_image_len_ptr); +static herr_t H5EA__cache_dblk_page_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, void *thing); +static herr_t H5EA__cache_dblk_page_free_icr(void *thing); /*********************/ @@ -117,57 +134,87 @@ static herr_t H5EA__cache_dblk_page_dest(H5F_t *f, H5EA_dblk_page_t *dblk_page); /* H5EA header inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_EARRAY_HDR[1] = {{ - H5AC_EARRAY_HDR_ID, - (H5AC_load_func_t)H5EA__cache_hdr_load, - (H5AC_flush_func_t)H5EA__cache_hdr_flush, - (H5AC_dest_func_t)H5EA__cache_hdr_dest, - (H5AC_clear_func_t)H5EA__cache_hdr_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5EA__cache_hdr_size, + H5AC_EARRAY_HDR_ID, /* Metadata client ID */ + "Extensible Array Header", /* Metadata client name (for debugging) */ + H5FD_MEM_EARRAY_HDR, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5EA__cache_hdr_get_load_size, /* 'get_load_size' callback */ + H5EA__cache_hdr_deserialize, /* 'deserialize' callback */ + H5EA__cache_hdr_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5EA__cache_hdr_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5EA__cache_hdr_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; /* H5EA index block inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_EARRAY_IBLOCK[1] = {{ - H5AC_EARRAY_IBLOCK_ID, - (H5AC_load_func_t)H5EA__cache_iblock_load, - (H5AC_flush_func_t)H5EA__cache_iblock_flush, - (H5AC_dest_func_t)H5EA__cache_iblock_dest, - (H5AC_clear_func_t)H5EA__cache_iblock_clear, - (H5AC_notify_func_t)H5EA__cache_iblock_notify, - (H5AC_size_func_t)H5EA__cache_iblock_size, + H5AC_EARRAY_IBLOCK_ID, /* Metadata client ID */ + "Extensible Array Index Block", /* Metadata client name (for debugging) */ + H5FD_MEM_EARRAY_IBLOCK, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5EA__cache_iblock_get_load_size, /* 'get_load_size' callback */ + H5EA__cache_iblock_deserialize, /* 'deserialize' callback */ + H5EA__cache_iblock_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5EA__cache_iblock_serialize, /* 'serialize' callback */ + H5EA__cache_iblock_notify, /* 'notify' callback */ + H5EA__cache_iblock_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; /* H5EA super block inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_EARRAY_SBLOCK[1] = {{ - H5AC_EARRAY_SBLOCK_ID, - (H5AC_load_func_t)H5EA__cache_sblock_load, - (H5AC_flush_func_t)H5EA__cache_sblock_flush, - (H5AC_dest_func_t)H5EA__cache_sblock_dest, - (H5AC_clear_func_t)H5EA__cache_sblock_clear, - (H5AC_notify_func_t)H5EA__cache_sblock_notify, - (H5AC_size_func_t)H5EA__cache_sblock_size, + H5AC_EARRAY_SBLOCK_ID, /* Metadata client ID */ + "Extensible Array Super Block", /* Metadata client name (for debugging) */ + H5FD_MEM_EARRAY_SBLOCK, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5EA__cache_sblock_get_load_size, /* 'get_load_size' callback */ + H5EA__cache_sblock_deserialize, /* 'deserialize' callback */ + H5EA__cache_sblock_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5EA__cache_sblock_serialize, /* 'serialize' callback */ + H5EA__cache_sblock_notify, /* 'notify' callback */ + H5EA__cache_sblock_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; /* H5EA data block inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_EARRAY_DBLOCK[1] = {{ - H5AC_EARRAY_DBLOCK_ID, - (H5AC_load_func_t)H5EA__cache_dblock_load, - (H5AC_flush_func_t)H5EA__cache_dblock_flush, - (H5AC_dest_func_t)H5EA__cache_dblock_dest, - (H5AC_clear_func_t)H5EA__cache_dblock_clear, - (H5AC_notify_func_t)H5EA__cache_dblock_notify, - (H5AC_size_func_t)H5EA__cache_dblock_size, + H5AC_EARRAY_DBLOCK_ID, /* Metadata client ID */ + "Extensible Array Data Block", /* Metadata client name (for debugging) */ + H5FD_MEM_EARRAY_DBLOCK, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5EA__cache_dblock_get_load_size, /* 'get_load_size' callback */ + H5EA__cache_dblock_deserialize, /* 'deserialize' callback */ + H5EA__cache_dblock_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5EA__cache_dblock_serialize, /* 'serialize' callback */ + H5EA__cache_dblock_notify, /* 'notify' callback */ + H5EA__cache_dblock_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + H5EA__cache_dblock_fsf_size, /* 'fsf_size' callback */ }}; /* H5EA data block page inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1] = {{ - H5AC_EARRAY_DBLK_PAGE_ID, - (H5AC_load_func_t)H5EA__cache_dblk_page_load, - (H5AC_flush_func_t)H5EA__cache_dblk_page_flush, - (H5AC_dest_func_t)H5EA__cache_dblk_page_dest, - (H5AC_clear_func_t)H5EA__cache_dblk_page_clear, - (H5AC_notify_func_t)H5EA__cache_dblk_page_notify, - (H5AC_size_func_t)H5EA__cache_dblk_page_size, + H5AC_EARRAY_DBLK_PAGE_ID, /* Metadata client ID */ + "Extensible Array Data Block Page", /* Metadata client name (for debugging) */ + H5FD_MEM_EARRAY_DBLK_PAGE, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5EA__cache_dblk_page_get_load_size, /* 'get_load_size' callback */ + H5EA__cache_dblk_page_deserialize, /* 'deserialize' callback */ + H5EA__cache_dblk_page_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5EA__cache_dblk_page_serialize, /* 'serialize' callback */ + H5EA__cache_dblk_page_notify, /* 'notify' callback */ + H5EA__cache_dblk_page_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; @@ -183,97 +230,111 @@ const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1] = {{ /*------------------------------------------------------------------------- - * Function: H5EA__cache_hdr_load + * Function: H5EA__cache_hdr_get_load_size + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 16, 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5EA__cache_hdr_get_load_size(const void *_udata, size_t *image_len)) + + /* Local variables */ + const H5EA_hdr_cache_ud_t *udata = (const H5EA_hdr_cache_ud_t *)_udata; /* User data for callback */ + + /* Check arguments */ + HDassert(udata); + HDassert(udata->f); + HDassert(H5F_addr_defined(udata->addr)); + HDassert(image_len); + + /* Set the image length size */ + *image_len = (size_t)H5EA_HEADER_SIZE_FILE(udata->f); + +END_FUNC(STATIC) /* end H5EA__cache_hdr_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5EA__cache_hdr_deserialize * - * Purpose: Loads an extensible array header from the disk. + * Purpose: Loads a data structure from the disk. * - * Return: Success: Pointer to a new extensible array + * Return: Success: Pointer to a new B-tree. * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Aug 26 2008 + * koziol@hdfgroup.org + * July 16, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, -H5EA_hdr_t *, NULL, NULL, -H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)) +void *, NULL, NULL, +H5EA__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, + hbool_t H5_ATTR_UNUSED *dirty)) /* Local variables */ H5EA_cls_id_t id; /* ID of extensible array class, as found in file */ H5EA_hdr_t *hdr = NULL; /* Extensible array info */ - size_t size; /* Header size */ - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5EA_HDR_BUF_SIZE]; /* Buffer for header */ - uint8_t *buf; /* Pointer to header buffer */ - const uint8_t *p; /* Pointer into raw data buffer */ + H5EA_hdr_cache_ud_t *udata = (H5EA_hdr_cache_ud_t *)_udata; + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); + HDassert(udata); + HDassert(udata->f); + HDassert(H5F_addr_defined(udata->addr)); /* Allocate space for the extensible array data structure */ - if(NULL == (hdr = H5EA__hdr_alloc(f))) + if(NULL == (hdr = H5EA__hdr_alloc(udata->f))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array shared header") /* Set the extensible array header's address */ - hdr->addr = addr; - - /* Wrap the local buffer for serialized info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - H5E_THROW(H5E_CANTINIT, "can't wrap buffer") - - /* Compute the 'base' size of the extensible array header on disk */ - 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))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") - - /* Read header from disk */ - if(H5F_block_read(f, H5FD_MEM_EARRAY_HDR, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_READERROR, "can't read extensible array header") - - /* Get temporary pointer to serialized header */ - p = buf; + hdr->addr = udata->addr; /* Magic number */ - if(HDmemcmp(p, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(image, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) H5E_THROW(H5E_BADVALUE, "wrong extensible array header signature") - p += H5_SIZEOF_MAGIC; + image += H5_SIZEOF_MAGIC; /* Version */ - if(*p++ != H5EA_HDR_VERSION) + if(*image++ != H5EA_HDR_VERSION) H5E_THROW(H5E_VERSION, "wrong extensible array header version") /* Extensible array class */ - id = (H5EA_cls_id_t)*p++; + id = (H5EA_cls_id_t)*image++; if(id >= H5EA_NUM_CLS_ID) H5E_THROW(H5E_BADTYPE, "incorrect extensible array class") hdr->cparam.cls = H5EA_client_class_g[id]; /* General array creation/configuration information */ - hdr->cparam.raw_elmt_size = *p++; /* Element size in file (in bytes) */ - hdr->cparam.max_nelmts_bits = *p++; /* Log2(Max. # of elements in array) - i.e. # of bits needed to store max. # of elements */ - hdr->cparam.idx_blk_elmts = *p++; /* # of elements to store in index block */ - hdr->cparam.data_blk_min_elmts = *p++; /* Min. # of elements per data block */ - hdr->cparam.sup_blk_min_data_ptrs = *p++; /* Min. # of data block pointers for a super block */ - hdr->cparam.max_dblk_page_nelmts_bits = *p++; /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */ + hdr->cparam.raw_elmt_size = *image++; /* Element size in file (in bytes) */ + hdr->cparam.max_nelmts_bits = *image++; /* Log2(Max. # of elements in array) - i.e. # of bits needed to store max. # of elements */ + hdr->cparam.idx_blk_elmts = *image++; /* # of elements to store in index block */ + hdr->cparam.data_blk_min_elmts = *image++; /* Min. # of elements per data block */ + hdr->cparam.sup_blk_min_data_ptrs = *image++; /* Min. # of data block pointers for a super block */ + hdr->cparam.max_dblk_page_nelmts_bits = *image++; /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */ /* Array statistics */ - hdr->stats.computed.hdr_size = size; /* Size of header in file */ - H5F_DECODE_LENGTH(f, p, hdr->stats.stored.nsuper_blks); /* Number of super blocks created */ - H5F_DECODE_LENGTH(f, p, hdr->stats.stored.super_blk_size); /* Size of super blocks created */ - H5F_DECODE_LENGTH(f, p, hdr->stats.stored.ndata_blks); /* Number of data blocks created */ - H5F_DECODE_LENGTH(f, p, hdr->stats.stored.data_blk_size); /* Size of data blocks created */ - H5F_DECODE_LENGTH(f, p, hdr->stats.stored.max_idx_set); /* Max. index set (+1) */ - H5F_DECODE_LENGTH(f, p, hdr->stats.stored.nelmts); /* Number of elements 'realized' */ + hdr->stats.computed.hdr_size = len; /* Size of header in file */ + H5F_DECODE_LENGTH(udata->f, image, hdr->stats.stored.nsuper_blks); /* Number of super blocks created */ + H5F_DECODE_LENGTH(udata->f, image, hdr->stats.stored.super_blk_size); /* Size of super blocks created */ + H5F_DECODE_LENGTH(udata->f, image, hdr->stats.stored.ndata_blks); /* Number of data blocks created */ + H5F_DECODE_LENGTH(udata->f, image, hdr->stats.stored.data_blk_size); /* Size of data blocks created */ + H5F_DECODE_LENGTH(udata->f, image, hdr->stats.stored.max_idx_set); /* Max. index set (+1) */ + H5F_DECODE_LENGTH(udata->f, image, hdr->stats.stored.nelmts); /* Number of elements 'realized' */ /* Internal information */ - H5F_addr_decode(f, &p, &hdr->idx_blk_addr); /* Address of index block */ + H5F_addr_decode(udata->f, &image, &hdr->idx_blk_addr); /* Address of index block */ /* Index block statistics */ if(H5F_addr_defined(hdr->idx_blk_addr)) { @@ -298,26 +359,26 @@ H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)) /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(p - buf) == (size - H5EA_SIZEOF_CHKSUM)); + HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); /* Compute checksum on entire header */ /* (including the filter information, if present) */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); + computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (const uint8_t *)_image), 0); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); - - /* Sanity check */ - HDassert((size_t)(p - buf) == size); + UINT32DECODE(image, stored_chksum); /* Verify checksum */ if(stored_chksum != computed_chksum) H5E_THROW(H5E_BADVALUE, "incorrect metadata checksum for extensible array header") + /* Sanity check */ + HDassert((size_t)(image - (const uint8_t *)_image) == len); + /* Finish initializing extensible array header */ - if(H5EA__hdr_init(hdr, udata) < 0) + if(H5EA__hdr_init(hdr, udata->ctx_udata) < 0) H5E_THROW(H5E_CANTINIT, "initialization failed for extensible array header") - HDassert(hdr->size == size); + HDassert(hdr->size == len); /* Set return value */ ret_value = hdr; @@ -325,263 +386,211 @@ H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)) CATCH /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") if(!ret_value) if(hdr && H5EA__hdr_dest(hdr) < 0) H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array header") -END_FUNC(STATIC) /* end H5EA__cache_hdr_load() */ +END_FUNC(STATIC) /* end H5EA__cache_hdr_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_hdr_flush + * Function: H5EA__cache_hdr_image_len * - * Purpose: Flushes a dirty extensible array header to disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Aug 26 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 16, 2013 * *------------------------------------------------------------------------- */ -BEGIN_FUNC(STATIC, ERR, -herr_t, SUCCEED, FAIL, -H5EA__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5EA_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr)) +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5EA__cache_hdr_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)) - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5EA_HDR_BUF_SIZE]; /* Buffer for header */ + /* Local variables */ + const H5EA_hdr_t *hdr = (const H5EA_hdr_t *)_thing; /* Pointer to the object */ - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(hdr); + HDassert(image_len); - if(hdr->cache_info.is_dirty) { - uint8_t *buf; /* Temporary raw data buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - size_t size; /* Header size on disk */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ + /* Set the image length size */ + *image_len = hdr->size; - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - H5E_THROW(H5E_CANTINIT, "can't wrap buffer") +END_FUNC(STATIC) /* end H5EA__cache_hdr_image_len() */ - /* Compute the size of the array header on disk */ - size = hdr->size; - - /* Get a pointer to a buffer that's large enough for serialized header */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") - - /* Get temporary pointer to serialized header */ - p = buf; - - /* Magic number */ - HDmemcpy(p, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; - - /* Version # */ - *p++ = H5EA_HDR_VERSION; + +/*------------------------------------------------------------------------- + * Function: H5EA__cache_hdr_serialize + * + * Purpose: Flushes a dirty object to disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 16, 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5EA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, + void *_thing)) - /* Extensible array type */ - *p++ = hdr->cparam.cls->id; + /* Local variables */ + H5EA_hdr_t *hdr = (H5EA_hdr_t *)_thing; /* Pointer to the extensible array header */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ - /* General array creation/configuration information */ - *p++ = hdr->cparam.raw_elmt_size; /* Element size in file (in bytes) */ - *p++ = hdr->cparam.max_nelmts_bits; /* Log2(Max. # of elements in array) - i.e. # of bits needed to store max. # of elements */ - *p++ = hdr->cparam.idx_blk_elmts; /* # of elements to store in index block */ - *p++ = hdr->cparam.data_blk_min_elmts; /* Min. # of elements per data block */ - *p++ = hdr->cparam.sup_blk_min_data_ptrs; /* Min. # of data block pointers for a super block */ - *p++ = hdr->cparam.max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */ + /* check arguments */ + HDassert(f); + HDassert(image); + HDassert(hdr); - /* Array statistics */ - H5F_ENCODE_LENGTH(f, p, hdr->stats.stored.nsuper_blks); /* Number of super blocks created */ - H5F_ENCODE_LENGTH(f, p, hdr->stats.stored.super_blk_size); /* Size of super blocks created */ - H5F_ENCODE_LENGTH(f, p, hdr->stats.stored.ndata_blks); /* Number of data blocks created */ - H5F_ENCODE_LENGTH(f, p, hdr->stats.stored.data_blk_size); /* Size of data blocks created */ - H5F_ENCODE_LENGTH(f, p, hdr->stats.stored.max_idx_set); /* Max. index set (+1) */ - H5F_ENCODE_LENGTH(f, p, hdr->stats.stored.nelmts); /* Number of elements 'realized' */ + /* Magic number */ + HDmemcpy(image, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; - /* Internal information */ - H5F_addr_encode(f, &p, hdr->idx_blk_addr); /* Address of index block */ + /* Version # */ + *image++ = H5EA_HDR_VERSION; - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); + /* Extensible array type */ + *image++ = hdr->cparam.cls->id; - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); + /* General array creation/configuration information */ + *image++ = hdr->cparam.raw_elmt_size; /* Element size in file (in bytes) */ + *image++ = hdr->cparam.max_nelmts_bits; /* Log2(Max. # of elements in array) - i.e. # of bits needed to store max. # of elements */ + *image++ = hdr->cparam.idx_blk_elmts; /* # of elements to store in index block */ + *image++ = hdr->cparam.data_blk_min_elmts; /* Min. # of elements per data block */ + *image++ = hdr->cparam.sup_blk_min_data_ptrs; /* Min. # of data block pointers for a super block */ + *image++ = hdr->cparam.max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */ - /* Write the array header. */ - HDassert((size_t)(p - buf) == size); - if(H5F_block_write(f, H5FD_MEM_EARRAY_HDR, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_WRITEERROR, "unable to save extensible array header to disk") + /* Array statistics */ + H5F_ENCODE_LENGTH(f, image, hdr->stats.stored.nsuper_blks); /* Number of super blocks created */ + H5F_ENCODE_LENGTH(f, image, hdr->stats.stored.super_blk_size); /* Size of super blocks created */ + H5F_ENCODE_LENGTH(f, image, hdr->stats.stored.ndata_blks); /* Number of data blocks created */ + H5F_ENCODE_LENGTH(f, image, hdr->stats.stored.data_blk_size); /* Size of data blocks created */ + H5F_ENCODE_LENGTH(f, image, hdr->stats.stored.max_idx_set); /* Max. index set (+1) */ + H5F_ENCODE_LENGTH(f, image, hdr->stats.stored.nelmts); /* Number of elements 'realized' */ - hdr->cache_info.is_dirty = FALSE; - } /* end if */ + /* Internal information */ + H5F_addr_encode(f, &image, hdr->idx_blk_addr); /* Address of index block */ - if(destroy) - if(H5EA__cache_hdr_dest(f, hdr) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array header") + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0); -CATCH + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") + /* Sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) <= len); -END_FUNC(STATIC) /* end H5EA__cache_hdr_flush() */ +END_FUNC(STATIC) /* end H5EA__cache_hdr_serialize() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_hdr_clear + * Function: H5EA__cache_hdr_free_icr * - * Purpose: Mark a extensible array header in memory as non-dirty. + * Purpose: Destroy/release an "in core representation" of a data + * structure * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Aug 26 2008 + * koziol@hdfgroup.org + * July 16, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__cache_hdr_clear(H5F_t *f, H5EA_hdr_t *hdr, hbool_t destroy)) +H5EA__cache_hdr_free_icr(void *thing)) - /* Sanity check */ - HDassert(hdr); - - /* Reset the dirty flag. */ - hdr->cache_info.is_dirty = FALSE; + /* Check arguments */ + HDassert(thing); - if(destroy) - if(H5EA__cache_hdr_dest(f, hdr) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array header") + /* Release the extensible array header */ + if(H5EA__hdr_dest((H5EA_hdr_t *)thing) < 0) + H5E_THROW(H5E_CANTFREE, "can't free extensible array header") CATCH -END_FUNC(STATIC) /* end H5EA__cache_hdr_clear() */ +END_FUNC(STATIC) /* end H5EA__cache_hdr_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_hdr_size + * Function: H5EA__cache_iblock_get_load_size * - * Purpose: Compute the size in bytes of a extensible array header - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Aug 26 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5EA__cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_hdr_t *hdr, - size_t *size_ptr)) - - /* Sanity check */ - HDassert(f); - HDassert(hdr); - HDassert(size_ptr); - - /* Set size value */ - *size_ptr = hdr->size; - -END_FUNC(STATIC) /* end H5EA__cache_hdr_size() */ +H5EA__cache_iblock_get_load_size(const void *_udata, size_t *image_len)) - -/*------------------------------------------------------------------------- - * Function: H5EA__cache_hdr_dest - * - * Purpose: Destroys an extensible array header in memory. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Aug 26 2008 - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -BEGIN_FUNC(STATIC, ERR, -herr_t, SUCCEED, FAIL, -H5EA__cache_hdr_dest(H5F_t *f, H5EA_hdr_t *hdr)) + /* Local variables */ + const H5EA_hdr_t *hdr = (const H5EA_hdr_t *)_udata; /* User data for callback */ + H5EA_iblock_t iblock; /* Fake index block for computing size */ /* Check arguments */ - HDassert(f); HDassert(hdr); + HDassert(image_len); - /* Verify that header is clean */ - HDassert(hdr->cache_info.is_dirty == FALSE); - - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!hdr->cache_info.free_file_space_on_destroy || H5F_addr_defined(hdr->cache_info.addr)); + /* Set up fake index block for computing size on disk */ + HDmemset(&iblock, 0, sizeof(iblock)); + iblock.hdr = (H5EA_hdr_t *)hdr; /* Casting away 'const' OK - QAK */ + iblock.nsblks = H5EA_SBLK_FIRST_IDX(hdr->cparam.sup_blk_min_data_ptrs); + iblock.ndblk_addrs = 2 * ((size_t)hdr->cparam.sup_blk_min_data_ptrs - 1); + iblock.nsblk_addrs = hdr->nsblks - iblock.nsblks; - /* Check for freeing file space for extensible array header */ - if(hdr->cache_info.free_file_space_on_destroy) { - /* Sanity check address */ - HDassert(H5F_addr_eq(hdr->addr, hdr->cache_info.addr)); + /* Set the image length size */ + *image_len = (size_t)H5EA_IBLOCK_SIZE(&iblock); - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_EARRAY_HDR, H5AC_dxpl_id, hdr->cache_info.addr, (hsize_t)hdr->size) < 0) - H5E_THROW(H5E_CANTFREE, "unable to free extensible array header") - } /* end if */ - - /* Release the extensible array header */ - if(H5EA__hdr_dest(hdr) < 0) - H5E_THROW(H5E_CANTFREE, "can't free extensible array header") - -CATCH - -END_FUNC(STATIC) /* end H5EA__cache_hdr_dest() */ +END_FUNC(STATIC) /* end H5EA__cache_iblock_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_iblock_load + * Function: H5EA__cache_iblock_deserialize * - * Purpose: Loads an extensible array index block from the disk. + * Purpose: Loads a data structure from the disk. * - * Return: Success: Pointer to a new extensible array index block + * Return: Success: Pointer to a new B-tree. * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 9 2008 + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, -H5EA_iblock_t *, NULL, NULL, -H5EA__cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) +void *, NULL, NULL, +H5EA__cache_iblock_deserialize(const void *_image, size_t len, + void *_udata, hbool_t H5_ATTR_UNUSED *dirty)) /* Local variables */ - H5EA_hdr_t *hdr = (H5EA_hdr_t *)_udata; /* Shared extensible array information */ H5EA_iblock_t *iblock = NULL; /* Index block info */ - size_t size; /* Index block size */ - H5WB_t *wb = NULL; /* Wrapped buffer for index block data */ - uint8_t iblock_buf[H5EA_IBLOCK_BUF_SIZE]; /* Buffer for index block */ - uint8_t *buf; /* Pointer to index block buffer */ - const uint8_t *p; /* Pointer into raw data buffer */ + H5EA_hdr_t *hdr = (H5EA_hdr_t *)_udata; /* User data for callback */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ haddr_t arr_addr; /* Address of array header in the file */ size_t u; /* Local index variable */ - /* Sanity check */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ + HDassert(image); HDassert(hdr); /* Allocate the extensible array index block */ @@ -589,41 +598,23 @@ H5EA__cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array index block") /* Set the extensible array index block's address */ - iblock->addr = addr; - - /* Wrap the local buffer for serialized info */ - if(NULL == (wb = H5WB_wrap(iblock_buf, sizeof(iblock_buf)))) - H5E_THROW(H5E_CANTINIT, "can't wrap buffer") - - /* Compute the size of the extensible array index block on disk */ - size = H5EA_IBLOCK_SIZE(iblock); - - /* Get a pointer to a buffer that's large enough for serialized info */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") - - /* Read index block from disk */ - if(H5F_block_read(f, H5FD_MEM_EARRAY_IBLOCK, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_READERROR, "can't read extensible array index block") - - /* Get temporary pointer to serialized header */ - p = buf; + iblock->addr = hdr->idx_blk_addr; /* Magic number */ - if(HDmemcmp(p, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(image, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) H5E_THROW(H5E_BADVALUE, "wrong extensible array index block signature") - p += H5_SIZEOF_MAGIC; + image += H5_SIZEOF_MAGIC; /* Version */ - if(*p++ != H5EA_IBLOCK_VERSION) + if(*image++ != H5EA_IBLOCK_VERSION) H5E_THROW(H5E_VERSION, "wrong extensible array index block version") /* Extensible array type */ - if(*p++ != (uint8_t)hdr->cparam.cls->id) + if(*image++ != (uint8_t)hdr->cparam.cls->id) H5E_THROW(H5E_BADTYPE, "incorrect extensible array class") /* Address of header for array that owns this block (just for file integrity checks) */ - H5F_addr_decode(f, &p, &arr_addr); + H5F_addr_decode(hdr->f, &image, &arr_addr); if(H5F_addr_ne(arr_addr, hdr->addr)) H5E_THROW(H5E_BADVALUE, "wrong extensible array header address") @@ -632,40 +623,40 @@ H5EA__cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) /* Decode elements in index block */ if(hdr->cparam.idx_blk_elmts > 0) { /* Convert from raw elements on disk into native elements in memory */ - if((hdr->cparam.cls->decode)(p, iblock->elmts, (size_t)hdr->cparam.idx_blk_elmts, hdr->cb_ctx) < 0) + if((hdr->cparam.cls->decode)(image, iblock->elmts, (size_t)hdr->cparam.idx_blk_elmts, hdr->cb_ctx) < 0) H5E_THROW(H5E_CANTDECODE, "can't decode extensible array index elements") - p += (hdr->cparam.idx_blk_elmts * hdr->cparam.raw_elmt_size); + image += (hdr->cparam.idx_blk_elmts * hdr->cparam.raw_elmt_size); } /* end if */ /* Decode data block addresses in index block */ if(iblock->ndblk_addrs > 0) { /* Decode addresses of data blocks in index block */ for(u = 0; u < iblock->ndblk_addrs; u++) - H5F_addr_decode(f, &p, &iblock->dblk_addrs[u]); + H5F_addr_decode(hdr->f, &image, &iblock->dblk_addrs[u]); } /* end if */ /* Decode super block addresses in index block */ if(iblock->nsblk_addrs > 0) { /* Decode addresses of super blocks in index block */ for(u = 0; u < iblock->nsblk_addrs; u++) - H5F_addr_decode(f, &p, &iblock->sblk_addrs[u]); + H5F_addr_decode(hdr->f, &image, &iblock->sblk_addrs[u]); } /* end if */ /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(p - buf) == (size - H5EA_SIZEOF_CHKSUM)); + HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); /* Save the index block's size */ - iblock->size = size; + iblock->size = len; /* Compute checksum on index block */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); + computed_chksum = H5_checksum_metadata((const uint8_t *)_image, (size_t)(image - (const uint8_t *)_image), 0); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - buf) == iblock->size); + HDassert((size_t)(image - (const uint8_t *)_image) == iblock->size); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -677,161 +668,128 @@ H5EA__cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) CATCH /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") if(!ret_value) if(iblock && H5EA__iblock_dest(iblock) < 0) H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array index block") -END_FUNC(STATIC) /* end H5EA__cache_iblock_load() */ +END_FUNC(STATIC) /* end H5EA__cache_iblock_deserialize() */ + + +/*------------------------------------------------------------------------- + * Function: H5EA__cache_iblock_image_len + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 17, 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5EA__cache_iblock_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)) + + /* Local variables */ + const H5EA_iblock_t *iblock = (const H5EA_iblock_t *)_thing; /* Pointer to the object */ + + /* Check arguments */ + HDassert(iblock); + HDassert(image_len); + + /* Set the image length size */ + *image_len = iblock->size; + +END_FUNC(STATIC) /* end H5EA__cache_iblock_image_len() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_iblock_flush + * Function: H5EA__cache_iblock_serialize * - * Purpose: Flushes a dirty extensible array index block to disk. + * Purpose: Flushes a dirty object to disk. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 9 2008 + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5EA_iblock_t *iblock, unsigned H5_ATTR_UNUSED * flags_ptr)) +H5EA__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, + void *_thing)) /* Local variables */ - H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */ - uint8_t ser_buf[H5EA_IBLOCK_BUF_SIZE]; /* Serialization buffer */ + H5EA_iblock_t *iblock = (H5EA_iblock_t *)_thing; /* Pointer to the object to serialize */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ - /* Sanity check */ + /* check arguments */ HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); HDassert(iblock); HDassert(iblock->hdr); - if(iblock->cache_info.is_dirty) { - uint8_t *buf; /* Temporary raw data buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - size_t size; /* Index block size on disk */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - - /* Wrap the local buffer for serialized info */ - if(NULL == (wb = H5WB_wrap(ser_buf, sizeof(ser_buf)))) - H5E_THROW(H5E_CANTINIT, "can't wrap buffer") - - /* Compute the size of the index block on disk */ - size = iblock->size; - - /* Get a pointer to a buffer that's large enough for serialized info */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") + /* Get temporary pointer to serialized info */ - /* Get temporary pointer to serialized info */ - p = buf; - - /* Magic number */ - HDmemcpy(p, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; - - /* Version # */ - *p++ = H5EA_IBLOCK_VERSION; - - /* Extensible array type */ - *p++ = iblock->hdr->cparam.cls->id; - - /* Address of array header for array which owns this block */ - H5F_addr_encode(f, &p, iblock->hdr->addr); - - /* Internal information */ - - /* Encode elements in index block */ - if(iblock->hdr->cparam.idx_blk_elmts > 0) { - /* Convert from native elements in memory into raw elements on disk */ - if((iblock->hdr->cparam.cls->encode)(p, iblock->elmts, (size_t)iblock->hdr->cparam.idx_blk_elmts, iblock->hdr->cb_ctx) < 0) - H5E_THROW(H5E_CANTENCODE, "can't encode extensible array index elements") - p += (iblock->hdr->cparam.idx_blk_elmts * iblock->hdr->cparam.raw_elmt_size); - } /* end if */ - - /* Encode data block addresses in index block */ - if(iblock->ndblk_addrs > 0) { - size_t u; /* Local index variable */ + /* Magic number */ + HDmemcpy(image, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; - /* Encode addresses of data blocks in index block */ - for(u = 0; u < iblock->ndblk_addrs; u++) - H5F_addr_encode(f, &p, iblock->dblk_addrs[u]); - } /* end if */ + /* Version # */ + *image++ = H5EA_IBLOCK_VERSION; - /* Encode data block addresses in index block */ - if(iblock->nsblk_addrs > 0) { - size_t u; /* Local index variable */ + /* Extensible array type */ + *image++ = iblock->hdr->cparam.cls->id; - /* Encode addresses of super blocks in index block */ - for(u = 0; u < iblock->nsblk_addrs; u++) - H5F_addr_encode(f, &p, iblock->sblk_addrs[u]); - } /* end if */ + /* Address of array header for array which owns this block */ + H5F_addr_encode(f, &image, iblock->hdr->addr); - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); + /* Internal information */ - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); + /* Encode elements in index block */ + if(iblock->hdr->cparam.idx_blk_elmts > 0) { + /* Convert from native elements in memory into raw elements on disk */ + if((iblock->hdr->cparam.cls->encode)(image, iblock->elmts, (size_t)iblock->hdr->cparam.idx_blk_elmts, iblock->hdr->cb_ctx) < 0) + H5E_THROW(H5E_CANTENCODE, "can't encode extensible array index elements") + image += (iblock->hdr->cparam.idx_blk_elmts * iblock->hdr->cparam.raw_elmt_size); + } /* end if */ - /* Write the index block */ - HDassert((size_t)(p - buf) == size); - if(H5F_block_write(f, H5FD_MEM_EARRAY_IBLOCK, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_WRITEERROR, "unable to save extensible array index block to disk") + /* Encode data block addresses in index block */ + if(iblock->ndblk_addrs > 0) { + size_t u; /* Local index variable */ - iblock->cache_info.is_dirty = FALSE; + /* Encode addresses of data blocks in index block */ + for(u = 0; u < iblock->ndblk_addrs; u++) + H5F_addr_encode(f, &image, iblock->dblk_addrs[u]); } /* end if */ - if(destroy) - if(H5EA__cache_iblock_dest(f, iblock) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array index block") - -CATCH + /* Encode data block addresses in index block */ + if(iblock->nsblk_addrs > 0) { + size_t u; /* Local index variable */ - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") + /* Encode addresses of super blocks in index block */ + for(u = 0; u < iblock->nsblk_addrs; u++) + H5F_addr_encode(f, &image, iblock->sblk_addrs[u]); + } /* end if */ -END_FUNC(STATIC) /* end H5EA__cache_iblock_flush() */ + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0); - -/*------------------------------------------------------------------------- - * Function: H5EA__cache_iblock_clear - * - * Purpose: Mark a extensible array index block in memory as non-dirty. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sept 9 2008 - * - *------------------------------------------------------------------------- - */ -BEGIN_FUNC(STATIC, ERR, -herr_t, SUCCEED, FAIL, -H5EA__cache_iblock_clear(H5F_t *f, H5EA_iblock_t *iblock, hbool_t destroy)) + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert(iblock); - - /* Reset the dirty flag */ - iblock->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5EA__cache_iblock_dest(f, iblock) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array index block") + HDassert((size_t)(image - (uint8_t *)_image) <= len); CATCH -END_FUNC(STATIC) /* end H5EA__cache_iblock_clear() */ +END_FUNC(STATIC) /* end H5EA__cache_iblock_serialize() */ /*------------------------------------------------------------------------- @@ -843,13 +801,16 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_clear() */ * * Programmer: Quincey Koziol * koziol@hdfgroup.org - * Mar 31 2009 + * July 17, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__cache_iblock_notify(H5AC_notify_action_t action, H5EA_iblock_t *iblock)) +H5EA__cache_iblock_notify(H5AC_notify_action_t action, void *_thing)) + + /* Local variables */ + H5EA_iblock_t *iblock = (H5EA_iblock_t *)_thing; /* Pointer to the object */ /* Sanity check */ HDassert(iblock); @@ -857,11 +818,16 @@ H5EA__cache_iblock_notify(H5AC_notify_action_t action, H5EA_iblock_t *iblock)) /* Determine which action to take */ switch(action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: + case H5AC_NOTIFY_ACTION_AFTER_LOAD: /* Create flush dependency on extensible array header */ if(H5EA__create_flush_depend((H5AC_info_t *)iblock->hdr, (H5AC_info_t *)iblock) < 0) H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency between index block and header, address = %llu", (unsigned long long)iblock->addr) break; + case H5AC_NOTIFY_ACTION_AFTER_FLUSH: + /* do nothing */ + break; + case H5AC_NOTIFY_ACTION_BEFORE_EVICT: /* Destroy flush dependency on extensible array header */ if(H5EA__destroy_flush_depend((H5AC_info_t *)iblock->hdr, (H5AC_info_t *)iblock) < 0) @@ -878,165 +844,155 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_notify() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_iblock_size + * Function: H5EA__cache_iblock_free_icr * - * Purpose: Compute the size in bytes of a extensible array index block - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Destroy/release an "in core representation" of a data + * structure * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sept 9 2008 + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ -BEGIN_FUNC(STATIC, NOERR, -herr_t, SUCCEED, -, -H5EA__cache_iblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_iblock_t *iblock, - size_t *size_ptr)) +BEGIN_FUNC(STATIC, ERR, +herr_t, SUCCEED, FAIL, +H5EA__cache_iblock_free_icr(void *thing)) - /* Sanity check */ - HDassert(f); - HDassert(iblock); - HDassert(size_ptr); + /* Check arguments */ + HDassert(thing); + + /* Release the extensible array index block */ + if(H5EA__iblock_dest((H5EA_iblock_t *)thing) < 0) + H5E_THROW(H5E_CANTFREE, "can't free extensible array index block") - /* Set size value */ - *size_ptr = iblock->size; +CATCH -END_FUNC(STATIC) /* end H5EA__cache_iblock_size() */ +END_FUNC(STATIC) /* end H5EA__cache_iblock_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_iblock_dest + * Function: H5EA__cache_sblock_get_load_size * - * Purpose: Destroys an extensible array index block in memory. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 9 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ -BEGIN_FUNC(STATIC, ERR, -herr_t, SUCCEED, FAIL, -H5EA__cache_iblock_dest(H5F_t *f, H5EA_iblock_t *iblock)) - - /* Sanity check */ - HDassert(f); - HDassert(iblock); - - /* Verify that index block is clean */ - HDassert(iblock->cache_info.is_dirty == FALSE); - - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!iblock->cache_info.free_file_space_on_destroy || H5F_addr_defined(iblock->cache_info.addr)); +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5EA__cache_sblock_get_load_size(const void *_udata, size_t *image_len)) - /* Check for freeing file space for extensible array index block */ - if(iblock->cache_info.free_file_space_on_destroy) { - /* Sanity check address */ - HDassert(H5F_addr_eq(iblock->addr, iblock->cache_info.addr)); + /* Local variables */ + const H5EA_sblock_cache_ud_t *udata = (const H5EA_sblock_cache_ud_t *)_udata; /* User data */ + H5EA_sblock_t sblock; /* Fake super block for computing size */ - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_EARRAY_IBLOCK, H5AC_dxpl_id, iblock->cache_info.addr, (hsize_t)iblock->size) < 0) - H5E_THROW(H5E_CANTFREE, "unable to free extensible array index block") + /* Check arguments */ + HDassert(udata); + HDassert(udata->hdr); + HDassert(udata->parent); + HDassert(udata->sblk_idx > 0); + HDassert(H5F_addr_defined(udata->sblk_addr)); + HDassert(image_len); + + /* Set up fake super block for computing size on disk */ + /* (Note: extracted from H5EA__sblock_alloc) */ + HDmemset(&sblock, 0, sizeof(sblock)); + sblock.hdr = udata->hdr; + sblock.ndblks = udata->hdr->sblk_info[udata->sblk_idx].ndblks; + sblock.dblk_nelmts = udata->hdr->sblk_info[udata->sblk_idx].dblk_nelmts; + + /* Check if # of elements in data blocks requires paging */ + if(sblock.dblk_nelmts > udata->hdr->dblk_page_nelmts) { + /* Compute # of pages in each data block from this super block */ + sblock.dblk_npages = sblock.dblk_nelmts / udata->hdr->dblk_page_nelmts; + + /* Sanity check that we have at least 2 pages in data block */ + HDassert(sblock.dblk_npages > 1); + + /* Sanity check for integer truncation */ + HDassert((sblock.dblk_npages * udata->hdr->dblk_page_nelmts) == sblock.dblk_nelmts); + + /* Compute size of buffer for each data block's 'page init' bitmask */ + sblock.dblk_page_init_size = ((sblock.dblk_npages) + 7) / 8; + HDassert(sblock.dblk_page_init_size > 0); } /* end if */ - /* Release the index block */ - if(H5EA__iblock_dest(iblock) < 0) - H5E_THROW(H5E_CANTFREE, "can't free extensible array index block") - -CATCH + /* Set the image length size */ + *image_len = (size_t)H5EA_SBLOCK_SIZE(&sblock); -END_FUNC(STATIC) /* end H5EA__cache_iblock_dest() */ +END_FUNC(STATIC) /* end H5EA__cache_sblock_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_sblock_load + * Function: H5EA__cache_sblock_deserialize * - * Purpose: Loads an extensible array super block from the disk. + * Purpose: Loads a data structure from the disk. * - * Return: Success: Pointer to a new extensible array super block + * Return: Success: Pointer to a new B-tree. * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 30 2008 + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, -H5EA_sblock_t *, NULL, NULL, -H5EA__cache_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) +void *, NULL, NULL, +H5EA__cache_sblock_deserialize(const void *_image, size_t len, + void *_udata, hbool_t H5_ATTR_UNUSED *dirty)) /* Local variables */ H5EA_sblock_t *sblock = NULL; /* Super block info */ - H5EA_sblock_cache_ud_t *udata = (H5EA_sblock_cache_ud_t *)_udata; /* User data for loading super block */ - size_t size; /* Super block size */ - H5WB_t *wb = NULL; /* Wrapped buffer for super block data */ - uint8_t sblock_buf[H5EA_IBLOCK_BUF_SIZE]; /* Buffer for super block */ - uint8_t *buf; /* Pointer to super block buffer */ - const uint8_t *p; /* Pointer into raw data buffer */ + H5EA_sblock_cache_ud_t *udata = (H5EA_sblock_cache_ud_t *)_udata; /* User data */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ haddr_t arr_addr; /* Address of array header in the file */ size_t u; /* Local index variable */ /* Sanity check */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(udata && udata->hdr && udata->parent && udata->sblk_idx > 0); + HDassert(udata); + HDassert(udata->hdr); + HDassert(udata->parent); + HDassert(udata->sblk_idx > 0); + HDassert(H5F_addr_defined(udata->sblk_addr)); /* Allocate the extensible array super block */ if(NULL == (sblock = H5EA__sblock_alloc(udata->hdr, udata->parent, udata->sblk_idx))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array super block") /* Set the extensible array super block's address */ - sblock->addr = addr; - - /* Wrap the local buffer for serialized info */ - if(NULL == (wb = H5WB_wrap(sblock_buf, sizeof(sblock_buf)))) - H5E_THROW(H5E_CANTINIT, "can't wrap buffer") - - /* Compute the size of the extensible array super block on disk */ - size = H5EA_SBLOCK_SIZE(sblock); - - /* Get a pointer to a buffer that's large enough for serialized info */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") - - /* Read super block from disk */ - if(H5F_block_read(f, H5FD_MEM_EARRAY_SBLOCK, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_READERROR, "can't read extensible array super block") - - /* Get temporary pointer to serialized header */ - p = buf; + sblock->addr = udata->sblk_addr; /* Magic number */ - if(HDmemcmp(p, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(image, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) H5E_THROW(H5E_BADVALUE, "wrong extensible array super block signature") - p += H5_SIZEOF_MAGIC; + image += H5_SIZEOF_MAGIC; /* Version */ - if(*p++ != H5EA_SBLOCK_VERSION) + if(*image++ != H5EA_SBLOCK_VERSION) H5E_THROW(H5E_VERSION, "wrong extensible array super block version") /* Extensible array type */ - if(*p++ != (uint8_t)udata->hdr->cparam.cls->id) + if(*image++ != (uint8_t)udata->hdr->cparam.cls->id) H5E_THROW(H5E_BADTYPE, "incorrect extensible array class") /* Address of header for array that owns this block (just for file integrity checks) */ - H5F_addr_decode(f, &p, &arr_addr); + H5F_addr_decode(udata->hdr->f, &image, &arr_addr); if(H5F_addr_ne(arr_addr, udata->hdr->addr)) H5E_THROW(H5E_BADVALUE, "wrong extensible array header address") /* Offset of block within the array's address space */ - UINT64DECODE_VAR(p, sblock->block_off, udata->hdr->arr_off_size); + UINT64DECODE_VAR(image, sblock->block_off, udata->hdr->arr_off_size); /* Internal information */ @@ -1045,29 +1001,29 @@ H5EA__cache_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) size_t tot_page_init_size = sblock->ndblks * sblock->dblk_page_init_size; /* Compute total size of 'page init' buffer */ /* Retrieve the 'page init' bitmasks */ - HDmemcpy(sblock->page_init, p, tot_page_init_size); - p += tot_page_init_size; + HDmemcpy(sblock->page_init, image, tot_page_init_size); + image += tot_page_init_size; } /* end if */ /* Decode data block addresses */ for(u = 0; u < sblock->ndblks; u++) - H5F_addr_decode(f, &p, &sblock->dblk_addrs[u]); + H5F_addr_decode(udata->hdr->f, &image, &sblock->dblk_addrs[u]); /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(p - buf) == (size - H5EA_SIZEOF_CHKSUM)); + HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); /* Save the super block's size */ - sblock->size = size; + sblock->size = len; /* Compute checksum on super block */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); + computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (const uint8_t *)_image), 0); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - buf) == sblock->size); + HDassert((size_t)(image - (const uint8_t *)_image) == sblock->size); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -1079,183 +1035,115 @@ H5EA__cache_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) CATCH /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") if(!ret_value) if(sblock && H5EA__sblock_dest(sblock) < 0) H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array super block") -END_FUNC(STATIC) /* end H5EA__cache_sblock_load() */ +END_FUNC(STATIC) /* end H5EA__cache_sblock_deserialize() */ + + +/*------------------------------------------------------------------------- + * Function: H5EA__cache_sblock_image_len + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 17, 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5EA__cache_sblock_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)) + + /* Local variables */ + const H5EA_sblock_t *sblock = (const H5EA_sblock_t *)_thing; /* Pointer to the object */ + + /* Check arguments */ + HDassert(sblock); + HDassert(image_len); + + /* Set the image length size */ + *image_len = sblock->size; + +END_FUNC(STATIC) /* end H5EA__cache_sblock_image_len() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_sblock_flush + * Function: H5EA__cache_sblock_serialize * - * Purpose: Flushes a dirty extensible array super block to disk. + * Purpose: Flushes a dirty object to disk. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 30 2008 + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ -BEGIN_FUNC(STATIC, ERR, -herr_t, SUCCEED, FAIL, -H5EA__cache_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5EA_sblock_t *sblock, unsigned H5_ATTR_UNUSED * flags_ptr)) +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5EA__cache_sblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, + void *_thing)) /* Local variables */ - H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */ - uint8_t ser_buf[H5EA_SBLOCK_BUF_SIZE]; /* Serialization buffer */ + H5EA_sblock_t *sblock = (H5EA_sblock_t *)_thing; /* Pointer to the object to serialize */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ + size_t u; /* Local index variable */ - /* Sanity check */ + /* check arguments */ HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); HDassert(sblock); HDassert(sblock->hdr); - if(sblock->cache_info.is_dirty) { - uint8_t *buf; /* Temporary raw data buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - size_t size; /* Index block size on disk */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - size_t u; /* Local index variable */ - - /* Wrap the local buffer for serialized info */ - if(NULL == (wb = H5WB_wrap(ser_buf, sizeof(ser_buf)))) - H5E_THROW(H5E_CANTINIT, "can't wrap buffer") + /* Magic number */ + HDmemcpy(image, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; - /* Compute the size of the super block on disk */ - size = sblock->size; + /* Version # */ + *image++ = H5EA_SBLOCK_VERSION; - /* Get a pointer to a buffer that's large enough for serialized info */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") + /* Extensible array type */ + *image++ = sblock->hdr->cparam.cls->id; - /* Get temporary pointer to serialized info */ - p = buf; + /* Address of array header for array which owns this block */ + H5F_addr_encode(f, &image, sblock->hdr->addr); - /* Magic number */ - HDmemcpy(p, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; + /* Offset of block in array */ + UINT64ENCODE_VAR(image, sblock->block_off, sblock->hdr->arr_off_size); - /* Version # */ - *p++ = H5EA_SBLOCK_VERSION; + /* Internal information */ - /* Extensible array type */ - *p++ = sblock->hdr->cparam.cls->id; - - /* Address of array header for array which owns this block */ - H5F_addr_encode(f, &p, sblock->hdr->addr); - - /* Offset of block in array */ - UINT64ENCODE_VAR(p, sblock->block_off, sblock->hdr->arr_off_size); - - /* Internal information */ - - /* Check for 'page init' bitmasks for this super block */ - if(sblock->dblk_npages > 0) { - size_t tot_page_init_size = sblock->ndblks * sblock->dblk_page_init_size; /* Compute total size of 'page init' buffer */ - - /* Store the 'page init' bitmasks */ - HDmemcpy(p, sblock->page_init, tot_page_init_size); - p += tot_page_init_size; - } /* end if */ - - /* Encode addresses of data blocks in super block */ - for(u = 0; u < sblock->ndblks; u++) - H5F_addr_encode(f, &p, sblock->dblk_addrs[u]); - - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); - - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); - - /* Write the super block */ - HDassert((size_t)(p - buf) == size); - if(H5F_block_write(f, H5FD_MEM_EARRAY_SBLOCK, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_WRITEERROR, "unable to save extensible array super block to disk") + /* Check for 'page init' bitmasks for this super block */ + if(sblock->dblk_npages > 0) { + size_t tot_page_init_size = sblock->ndblks * sblock->dblk_page_init_size; /* Compute total size of 'page init' buffer */ - sblock->cache_info.is_dirty = FALSE; + /* Store the 'page init' bitmasks */ + HDmemcpy(image, sblock->page_init, tot_page_init_size); + image += tot_page_init_size; } /* end if */ - if(destroy) - if(H5EA__cache_sblock_dest(f, sblock) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array super block") - -CATCH - - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") - -END_FUNC(STATIC) /* end H5EA__cache_sblock_flush() */ - - -/*------------------------------------------------------------------------- - * Function: H5EA__cache_sblock_clear - * - * Purpose: Mark a extensible array super block in memory as non-dirty. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sept 30 2008 - * - *------------------------------------------------------------------------- - */ -BEGIN_FUNC(STATIC, ERR, -herr_t, SUCCEED, FAIL, -H5EA__cache_sblock_clear(H5F_t *f, H5EA_sblock_t *sblock, hbool_t destroy)) - - /* Sanity check */ - HDassert(sblock); - - /* Reset the dirty flag */ - sblock->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5EA__cache_sblock_dest(f, sblock) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array super block") - -CATCH + /* Encode addresses of data blocks in super block */ + for(u = 0; u < sblock->ndblks; u++) + H5F_addr_encode(f, &image, sblock->dblk_addrs[u]); -END_FUNC(STATIC) /* end H5EA__cache_sblock_clear() */ + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0); - -/*------------------------------------------------------------------------- - * Function: H5EA__cache_sblock_size - * - * Purpose: Compute the size in bytes of a extensible array super block - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sept 30 2008 - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -BEGIN_FUNC(STATIC, NOERR, -herr_t, SUCCEED, -, -H5EA__cache_sblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_sblock_t *sblock, - size_t *size_ptr)) + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert(sblock); - HDassert(size_ptr); + HDassert((size_t)(image - (uint8_t *)_image) <= len); - /* Set size value */ - *size_ptr = sblock->size; - -END_FUNC(STATIC) /* end H5EA__cache_sblock_size() */ +END_FUNC(STATIC) /* end H5EA__cache_sblock_serialize() */ /*------------------------------------------------------------------------- @@ -1273,7 +1161,10 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_size() */ */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__cache_sblock_notify(H5AC_notify_action_t action, H5EA_sblock_t *sblock)) +H5EA__cache_sblock_notify(H5AC_notify_action_t action, void *_thing)) + + /* Local variables */ + H5EA_sblock_t *sblock = (H5EA_sblock_t *)_thing; /* Pointer to the object */ /* Sanity check */ HDassert(sblock); @@ -1281,11 +1172,16 @@ H5EA__cache_sblock_notify(H5AC_notify_action_t action, H5EA_sblock_t *sblock)) /* Determine which action to take */ switch(action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: + case H5AC_NOTIFY_ACTION_AFTER_LOAD: /* Create flush dependency on index block */ if(H5EA__create_flush_depend((H5AC_info_t *)sblock->parent, (H5AC_info_t *)sblock) < 0) H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency between super block and index block, address = %llu", (unsigned long long)sblock->addr) break; + case H5AC_NOTIFY_ACTION_AFTER_FLUSH: + /* do nothing */ + break; + case H5AC_NOTIFY_ACTION_BEFORE_EVICT: /* Destroy flush dependency on index block */ if(H5EA__destroy_flush_depend((H5AC_info_t *)sblock->parent, (H5AC_info_t *)sblock) < 0) @@ -1302,135 +1198,158 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_notify() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_sblock_dest + * Function: H5EA__cache_sblock_free_icr * - * Purpose: Destroys an extensible array super block in memory. + * Purpose: Destroy/release an "in core representation" of a data + * structure * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 30 2008 + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__cache_sblock_dest(H5F_t *f, H5EA_sblock_t *sblock)) +H5EA__cache_sblock_free_icr(void *thing)) - /* Sanity check */ - HDassert(f); - HDassert(sblock); + /* Check arguments */ + HDassert(thing); - /* Verify that super block is clean */ - HDassert(sblock->cache_info.is_dirty == FALSE); + /* Release the extensible array super block */ + if(H5EA__sblock_dest((H5EA_sblock_t *)thing) < 0) + H5E_THROW(H5E_CANTFREE, "can't free extensible array super block") - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!sblock->cache_info.free_file_space_on_destroy || H5F_addr_defined(sblock->cache_info.addr)); +CATCH - /* Check for freeing file space for extensible array super block */ - if(sblock->cache_info.free_file_space_on_destroy) { - /* Sanity check address */ - HDassert(H5F_addr_eq(sblock->addr, sblock->cache_info.addr)); +END_FUNC(STATIC) /* end H5EA__cache_sblock_free_icr() */ - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_EARRAY_SBLOCK, H5AC_dxpl_id, sblock->cache_info.addr, (hsize_t)sblock->size) < 0) - H5E_THROW(H5E_CANTFREE, "unable to free extensible array super block") - } /* end if */ + +/*------------------------------------------------------------------------- + * Function: H5EA__cache_dblock_get_load_size + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 17, 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5EA__cache_dblock_get_load_size(const void *_udata, size_t *image_len)) - /* Release the super block */ - if(H5EA__sblock_dest(sblock) < 0) - H5E_THROW(H5E_CANTFREE, "can't free extensible array super block") + /* Local variables */ + const H5EA_dblock_cache_ud_t *udata = (const H5EA_dblock_cache_ud_t *)_udata; /* User data */ + H5EA_dblock_t dblock; /* Fake data block for computing size */ -CATCH + /* Check arguments */ + HDassert(udata); + HDassert(udata->hdr); + HDassert(udata->parent); + HDassert(udata->nelmts > 0); + HDassert(image_len); + + /* Set up fake data block for computing size on disk */ + /* (Note: extracted from H5EA__dblock_alloc) */ + HDmemset(&dblock, 0, sizeof(dblock)); + + /* need to set: + * + * dblock.hdr + * dblock.npages + * dblock.nelmts + * + * before we invoke either H5EA_DBLOCK_PREFIX_SIZE() or + * H5EA_DBLOCK_SIZE(). + */ + dblock.hdr = udata->hdr; + dblock.nelmts = udata->nelmts; + + if(udata->nelmts > udata->hdr->dblk_page_nelmts) { + /* Set the # of pages in the direct block */ + dblock.npages = udata->nelmts / udata->hdr->dblk_page_nelmts; + HDassert(udata->nelmts==(dblock.npages * udata->hdr->dblk_page_nelmts)); + } /* end if */ -END_FUNC(STATIC) /* end H5EA__cache_sblock_dest() */ + /* Set the image length size */ + if(!dblock.npages) + *image_len = H5EA_DBLOCK_SIZE(&dblock); + else + *image_len = H5EA_DBLOCK_PREFIX_SIZE(&dblock); + +END_FUNC(STATIC) /* end H5EA__cache_dblock_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_dblock_load + * Function: H5EA__cache_dblock_deserialize * - * Purpose: Loads an extensible array data block from the disk. + * Purpose: Loads a data structure from the disk. * - * Return: Success: Pointer to a new extensible array data block + * Return: Success: Pointer to a new B-tree. * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 16 2008 + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, -H5EA_dblock_t *, NULL, NULL, -H5EA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) +void *, NULL, NULL, +H5EA__cache_dblock_deserialize(const void *_image, size_t len, + void *_udata, hbool_t H5_ATTR_UNUSED *dirty)) /* Local variables */ H5EA_dblock_t *dblock = NULL; /* Data block info */ - H5EA_dblock_cache_ud_t *udata = (H5EA_dblock_cache_ud_t *)_udata; /* User data for loading data block */ - size_t size; /* Data block size */ - H5WB_t *wb = NULL; /* Wrapped buffer for data block data */ - uint8_t dblock_buf[H5EA_DBLOCK_BUF_SIZE]; /* Buffer for data block */ - uint8_t *buf; /* Pointer to data block buffer */ - const uint8_t *p; /* Pointer into raw data buffer */ + H5EA_dblock_cache_ud_t *udata = (H5EA_dblock_cache_ud_t *)_udata; /* User data */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ haddr_t arr_addr; /* Address of array header in the file */ - /* Sanity check */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(udata && udata->hdr && udata->parent && udata->nelmts > 0); + /* Check arguments */ + HDassert(udata); + HDassert(udata->hdr); + HDassert(udata->parent); + HDassert(udata->nelmts > 0); + HDassert(H5F_addr_defined(udata->dblk_addr)); /* Allocate the extensible array data block */ if(NULL == (dblock = H5EA__dblock_alloc(udata->hdr, udata->parent, udata->nelmts))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array data block") - /* Set the extensible array data block's information */ - dblock->addr = addr; - - /* Wrap the local buffer for serialized info */ - if(NULL == (wb = H5WB_wrap(dblock_buf, sizeof(dblock_buf)))) - H5E_THROW(H5E_CANTINIT, "can't wrap buffer") + HDassert(((!dblock->npages) && (len == H5EA_DBLOCK_SIZE(dblock))) || + (len == H5EA_DBLOCK_PREFIX_SIZE(dblock))); - /* Compute the size of the extensible array data block on disk */ - if(!dblock->npages) - size = H5EA_DBLOCK_SIZE(dblock); - else - size = H5EA_DBLOCK_PREFIX_SIZE(dblock); - - /* Get a pointer to a buffer that's large enough for serialized info */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") - - /* Read data block from disk */ - if(H5F_block_read(f, H5FD_MEM_EARRAY_DBLOCK, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_READERROR, "can't read extensible array data block") - - /* Get temporary pointer to serialized header */ - p = buf; + /* Set the extensible array data block's information */ + dblock->addr = udata->dblk_addr; /* Magic number */ - if(HDmemcmp(p, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(image, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) H5E_THROW(H5E_BADVALUE, "wrong extensible array data block signature") - p += H5_SIZEOF_MAGIC; + image += H5_SIZEOF_MAGIC; /* Version */ - if(*p++ != H5EA_DBLOCK_VERSION) + if(*image++ != H5EA_DBLOCK_VERSION) H5E_THROW(H5E_VERSION, "wrong extensible array data block version") /* Extensible array type */ - if(*p++ != (uint8_t)udata->hdr->cparam.cls->id) + if(*image++ != (uint8_t)udata->hdr->cparam.cls->id) H5E_THROW(H5E_BADTYPE, "incorrect extensible array class") /* Address of header for array that owns this block (just for file integrity checks) */ - H5F_addr_decode(f, &p, &arr_addr); + H5F_addr_decode(udata->hdr->f, &image, &arr_addr); if(H5F_addr_ne(arr_addr, udata->hdr->addr)) H5E_THROW(H5E_BADVALUE, "wrong extensible array header address") /* Offset of block within the array's address space */ - UINT64DECODE_VAR(p, dblock->block_off, udata->hdr->arr_off_size); + UINT64DECODE_VAR(image, dblock->block_off, udata->hdr->arr_off_size); /* Internal information */ @@ -1438,26 +1357,27 @@ H5EA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) if(!dblock->npages) { /* Decode elements in data block */ /* Convert from raw elements on disk into native elements in memory */ - if((udata->hdr->cparam.cls->decode)(p, dblock->elmts, udata->nelmts, udata->hdr->cb_ctx) < 0) + if((udata->hdr->cparam.cls->decode)(image, dblock->elmts, udata->nelmts, udata->hdr->cb_ctx) < 0) H5E_THROW(H5E_CANTDECODE, "can't decode extensible array data elements") - p += (udata->nelmts * udata->hdr->cparam.raw_elmt_size); + image += (udata->nelmts * udata->hdr->cparam.raw_elmt_size); } /* end if */ /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(p - buf) == (size - H5EA_SIZEOF_CHKSUM)); + HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); /* Set the data block's size */ + /* (Note: This is not the same as the image length, for paged data blocks) */ dblock->size = H5EA_DBLOCK_SIZE(dblock); /* Compute checksum on data block */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); + computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (const uint8_t *)_image), 0); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - buf) == size); + HDassert((size_t)(image - (const uint8_t *)_image) == len); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -1469,151 +1389,116 @@ H5EA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) CATCH /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") if(!ret_value) if(dblock && H5EA__dblock_dest(dblock) < 0) H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array data block") -END_FUNC(STATIC) /* end H5EA__cache_dblock_load() */ +END_FUNC(STATIC) /* end H5EA__cache_dblock_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_dblock_flush + * Function: H5EA__cache_dblock_image_len * - * Purpose: Flushes a dirty extensible array data block to disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 18 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ -BEGIN_FUNC(STATIC, ERR, -herr_t, SUCCEED, FAIL, -H5EA__cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5EA_dblock_t *dblock, unsigned H5_ATTR_UNUSED * flags_ptr)) +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5EA__cache_dblock_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)) /* Local variables */ - H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */ - uint8_t ser_buf[H5EA_DBLOCK_BUF_SIZE]; /* Serialization buffer */ + const H5EA_dblock_t *dblock = (const H5EA_dblock_t *)_thing; /* Pointer to the object */ - /* Sanity check */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(dblock); - HDassert(dblock->hdr); - - if(dblock->cache_info.is_dirty) { - uint8_t *buf; /* Temporary raw data buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - size_t size; /* Index block size on disk */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - - /* Wrap the local buffer for serialized info */ - if(NULL == (wb = H5WB_wrap(ser_buf, sizeof(ser_buf)))) - H5E_THROW(H5E_CANTINIT, "can't wrap buffer") - - /* Compute the size of the data block on disk */ - if(!dblock->npages) - size = dblock->size; - else - size = H5EA_DBLOCK_PREFIX_SIZE(dblock); + HDassert(image_len); - /* Get a pointer to a buffer that's large enough for serialized info */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") - - /* Get temporary pointer to serialized info */ - p = buf; - - /* Magic number */ - HDmemcpy(p, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; - - /* Version # */ - *p++ = H5EA_DBLOCK_VERSION; - - /* Extensible array type */ - *p++ = dblock->hdr->cparam.cls->id; - - /* Address of array header for array which owns this block */ - H5F_addr_encode(f, &p, dblock->hdr->addr); - - /* Offset of block in array */ - UINT64ENCODE_VAR(p, dblock->block_off, dblock->hdr->arr_off_size); - - /* Internal information */ - - /* Only encode elements if the data block is not paged */ - if(!dblock->npages) { - /* Encode elements in data block */ - - /* Convert from native elements in memory into raw elements on disk */ - if((dblock->hdr->cparam.cls->encode)(p, dblock->elmts, dblock->nelmts, dblock->hdr->cb_ctx) < 0) - H5E_THROW(H5E_CANTENCODE, "can't encode extensible array data elements") - p += (dblock->nelmts * dblock->hdr->cparam.raw_elmt_size); - } /* end if */ - - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); - - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); - - /* Write the data block */ - HDassert((size_t)(p - buf) == size); - if(H5F_block_write(f, H5FD_MEM_EARRAY_DBLOCK, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_WRITEERROR, "unable to save extensible array data block to disk") - - dblock->cache_info.is_dirty = FALSE; - } /* end if */ - - if(destroy) - if(H5EA__cache_dblock_dest(f, dblock) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array data block") - -CATCH - - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") + /* Set the image length size */ + if(!dblock->npages) + *image_len = dblock->size; + else + *image_len = (size_t)H5EA_DBLOCK_PREFIX_SIZE(dblock); -END_FUNC(STATIC) /* end H5EA__cache_dblock_flush() */ +END_FUNC(STATIC) /* end H5EA__cache_dblock_image_len() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_dblock_clear + * Function: H5EA__cache_dblock_serialize * - * Purpose: Mark a extensible array data block in memory as non-dirty. + * Purpose: Flushes a dirty object to disk. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sept 18 2008 + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__cache_dblock_clear(H5F_t *f, H5EA_dblock_t *dblock, hbool_t destroy)) +H5EA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, + void *_thing)) - /* Sanity check */ + /* Local variables */ + H5EA_dblock_t *dblock = (H5EA_dblock_t *)_thing; /* Pointer to the object to serialize */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ + + /* check arguments */ + HDassert(f); + HDassert(image); HDassert(dblock); + HDassert(dblock->hdr); - /* Reset the dirty flag */ - dblock->cache_info.is_dirty = FALSE; + /* Magic number */ + HDmemcpy(image, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; - if(destroy) - if(H5EA__cache_dblock_dest(f, dblock) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array data block") + /* Version # */ + *image++ = H5EA_DBLOCK_VERSION; + + /* Extensible array type */ + *image++ = dblock->hdr->cparam.cls->id; + + /* Address of array header for array which owns this block */ + H5F_addr_encode(f, &image, dblock->hdr->addr); + + /* Offset of block in array */ + UINT64ENCODE_VAR(image, dblock->block_off, dblock->hdr->arr_off_size); + + /* Internal information */ + + /* Only encode elements if the data block is not paged */ + if(!dblock->npages) { + /* Encode elements in data block */ + + /* Convert from native elements in memory into raw elements on disk */ + if((dblock->hdr->cparam.cls->encode)(image, dblock->elmts, dblock->nelmts, dblock->hdr->cb_ctx) < 0) + H5E_THROW(H5E_CANTENCODE, "can't encode extensible array data elements") + image += (dblock->nelmts * dblock->hdr->cparam.raw_elmt_size); + } /* end if */ + + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0); + + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); + + /* Sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) <= len); CATCH -END_FUNC(STATIC) /* end H5EA__cache_dblock_clear() */ +END_FUNC(STATIC) /* end H5EA__cache_dblock_serialize() */ /*------------------------------------------------------------------------- @@ -1631,19 +1516,27 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_clear() */ */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__cache_dblock_notify(H5AC_notify_action_t action, H5EA_dblock_t *dblock)) +H5EA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing)) - /* Sanity check */ + /* Local variables */ + H5EA_dblock_t *dblock = (H5EA_dblock_t *)_thing; /* Pointer to the object */ + + /* Check arguments */ HDassert(dblock); /* Determine which action to take */ switch(action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: + case H5AC_NOTIFY_ACTION_AFTER_LOAD: /* Create flush dependency on parent */ if(H5EA__create_flush_depend((H5AC_info_t *)dblock->parent, (H5AC_info_t *)dblock) < 0) H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency between data block and parent, address = %llu", (unsigned long long)dblock->addr) break; + case H5AC_NOTIFY_ACTION_AFTER_FLUSH: + /* do nothing */ + break; + case H5AC_NOTIFY_ACTION_BEFORE_EVICT: /* Destroy flush dependency on parent */ if(H5EA__destroy_flush_depend((H5AC_info_t *)dblock->parent, (H5AC_info_t *)dblock) < 0) @@ -1660,171 +1553,175 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_notify() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_dblock_size + * Function: H5EA__cache_dblock_free_icr * - * Purpose: Compute the size in bytes of a extensible array data block - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Destroy/release an "in core representation" of a data + * structure * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sept 18 2008 + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ -BEGIN_FUNC(STATIC, NOERR, -herr_t, SUCCEED, -, -H5EA__cache_dblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_dblock_t *dblock, - size_t *size_ptr)) +BEGIN_FUNC(STATIC, ERR, +herr_t, SUCCEED, FAIL, +H5EA__cache_dblock_free_icr(void *thing)) - /* Sanity check */ - HDassert(f); - HDassert(dblock); - HDassert(size_ptr); + /* Check arguments */ + HDassert(thing); - /* Set size value */ - if(!dblock->npages) - *size_ptr = dblock->size; - else - *size_ptr = H5EA_DBLOCK_PREFIX_SIZE(dblock); + /* Release the extensible array data block */ + if(H5EA__dblock_dest((H5EA_dblock_t *)thing) < 0) + H5E_THROW(H5E_CANTFREE, "can't free extensible array data block") + +CATCH -END_FUNC(STATIC) /* end H5EA__cache_dblock_size() */ +END_FUNC(STATIC) /* end H5EA__cache_dblock_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_dblock_dest + * Function: H5EA__cache_dblock_fsf_size * - * Purpose: Destroys an extensible array data block in memory. + * Purpose: Tell the metadata cache the actual amount of file space + * to free when a dblock entry is destroyed with the free + * file space block set. * - * Return: Non-negative on success/Negative on failure + * This function is needed when the data block is paged, as + * the datablock header and all its pages are allocted as a + * single contiguous chunk of file space, and must be + * deallocated the same way. * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 18 2008 + * The size of the chunk of memory in which the dblock + * header and all its pages is stored in the size field, + * so we simply pass that value back to the cache. + * + * If the datablock is not paged, then the size field of + * the cache_info contains the correct size. However this + * value will be the same as the size field, so we return + * the contents of the size field to the cache in this case + * as well. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: John Mainzer + * 12/5/14 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ -BEGIN_FUNC(STATIC, ERR, -herr_t, SUCCEED, FAIL, -H5EA__cache_dblock_dest(H5F_t *f, H5EA_dblock_t *dblock)) +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5EA__cache_dblock_fsf_size(const void *_thing, size_t *fsf_size)) - /* Sanity check */ - HDassert(f); + /* Local variables */ + const H5EA_dblock_t *dblock = (const H5EA_dblock_t *)_thing; /* Pointer to the object */ + + /* Check arguments */ HDassert(dblock); + HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(dblock->cache_info.type == H5AC_EARRAY_DBLOCK); + HDassert(fsf_size); - /* Verify that data block is clean */ - HDassert(dblock->cache_info.is_dirty == FALSE); + *fsf_size = dblock->size; - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!dblock->cache_info.free_file_space_on_destroy || H5F_addr_defined(dblock->cache_info.addr)); +END_FUNC(STATIC) /* end H5EA__cache_dblock_fsf_size() */ - /* Check for freeing file space for extensible array data block */ - if(dblock->cache_info.free_file_space_on_destroy) { - /* Sanity check address */ - HDassert(H5F_addr_eq(dblock->addr, dblock->cache_info.addr)); + +/*------------------------------------------------------------------------- + * Function: H5EA__cache_dblk_page_get_load_size + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 17, 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5EA__cache_dblk_page_get_load_size(const void *_udata, size_t *image_len)) - /* Release the space on disk */ - /* (Includes space for pages!) */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_EARRAY_DBLOCK, H5AC_dxpl_id, dblock->cache_info.addr, (hsize_t)dblock->size) < 0) - H5E_THROW(H5E_CANTFREE, "unable to free extensible array data block") - } /* end if */ + /* Local variables */ + const H5EA_dblk_page_cache_ud_t *udata = (const H5EA_dblk_page_cache_ud_t *)_udata; /* User data */ - /* Release the data block */ - if(H5EA__dblock_dest(dblock) < 0) - H5E_THROW(H5E_CANTFREE, "can't free extensible array data block") + /* Check arguments */ + HDassert(udata); + HDassert(udata->hdr); + HDassert(udata->parent); + HDassert(image_len); -CATCH + *image_len = (size_t)H5EA_DBLK_PAGE_SIZE(udata->hdr); -END_FUNC(STATIC) /* end H5EA__cache_dblock_dest() */ +END_FUNC(STATIC) /* end H5EA__cache_dblk_page_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_dblk_page_load + * Function: H5EA__cache_dblk_page_deserialize * - * Purpose: Loads an extensible array data block page from the disk. + * Purpose: Loads a data structure from the disk. * - * Return: Success: Pointer to a new extensible array data block page + * Return: Success: Pointer to a new B-tree. * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Nov 20 2008 + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, -H5EA_dblk_page_t *, NULL, NULL, -H5EA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) +void *, NULL, NULL, +H5EA__cache_dblk_page_deserialize(const void *_image, size_t len, + void *_udata, hbool_t H5_ATTR_UNUSED *dirty)) /* Local variables */ H5EA_dblk_page_t *dblk_page = NULL; /* Data block page info */ H5EA_dblk_page_cache_ud_t *udata = (H5EA_dblk_page_cache_ud_t *)_udata; /* User data for loading data block page */ - size_t size; /* Data block page size */ - H5WB_t *wb = NULL; /* Wrapped buffer for data block page data */ - uint8_t dblk_page_buf[H5EA_DBLK_PAGE_BUF_SIZE]; /* Buffer for data block page */ - uint8_t *buf; /* Pointer to data block page buffer */ - const uint8_t *p; /* Pointer into raw data buffer */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ /* Sanity check */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(udata && udata->hdr && udata->parent); + HDassert(udata); + HDassert(udata->hdr); + HDassert(udata->parent); + HDassert(H5F_addr_defined(udata->dblk_page_addr)); /* Allocate the extensible array data block page */ if(NULL == (dblk_page = H5EA__dblk_page_alloc(udata->hdr, udata->parent))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array data block page") - /* Set the extensible array data block's information */ - dblk_page->addr = addr; - - /* Wrap the local buffer for serialized info */ - if(NULL == (wb = H5WB_wrap(dblk_page_buf, sizeof(dblk_page_buf)))) - 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(udata->hdr); - - /* Get a pointer to a buffer that's large enough for serialized info */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") - - /* Read data block page from disk */ - if(H5F_block_read(f, H5FD_MEM_EARRAY_DBLK_PAGE, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_READERROR, "can't read extensible array data block page") - - /* Get temporary pointer to serialized header */ - p = buf; + /* Set the extensible array data block page's information */ + dblk_page->addr = udata->dblk_page_addr; /* Internal information */ /* Decode elements in data block page */ /* Convert from raw elements on disk into native elements in memory */ - if((udata->hdr->cparam.cls->decode)(p, dblk_page->elmts, udata->hdr->dblk_page_nelmts, udata->hdr->cb_ctx) < 0) + if((udata->hdr->cparam.cls->decode)(image, dblk_page->elmts, udata->hdr->dblk_page_nelmts, udata->hdr->cb_ctx) < 0) H5E_THROW(H5E_CANTDECODE, "can't decode extensible array data elements") - p += (udata->hdr->dblk_page_nelmts * udata->hdr->cparam.raw_elmt_size); + image += (udata->hdr->dblk_page_nelmts * udata->hdr->cparam.raw_elmt_size); /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(p - buf) == (size - H5EA_SIZEOF_CHKSUM)); + HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); /* Set the data block page's size */ - dblk_page->size = size; + dblk_page->size = len; - /* Compute checksum on data block */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); + /* Compute checksum on data block page */ + computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (const uint8_t *)_image), 0); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - buf) == dblk_page->size); + HDassert((size_t)(image - (const uint8_t *)_image) == dblk_page->size); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -1836,129 +1733,94 @@ H5EA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) CATCH /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") if(!ret_value) if(dblk_page && H5EA__dblk_page_dest(dblk_page) < 0) H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array data block page") -END_FUNC(STATIC) /* end H5EA__cache_dblk_page_load() */ +END_FUNC(STATIC) /* end H5EA__cache_dblk_page_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_dblk_page_flush + * Function: H5EA__cache_dblk_page_image_len * - * Purpose: Flushes a dirty extensible array data block page to disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Nov 20 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ -BEGIN_FUNC(STATIC, ERR, -herr_t, SUCCEED, FAIL, -H5EA__cache_dblk_page_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5EA_dblk_page_t *dblk_page, unsigned H5_ATTR_UNUSED * flags_ptr)) +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5EA__cache_dblk_page_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)) /* Local variables */ - H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */ - uint8_t ser_buf[H5EA_DBLK_PAGE_BUF_SIZE]; /* Serialization buffer */ + const H5EA_dblk_page_t *dblk_page = (const H5EA_dblk_page_t *)_thing; /* Pointer to the object */ - /* Sanity check */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(dblk_page); - HDassert(dblk_page->hdr); - - if(dblk_page->cache_info.is_dirty) { - uint8_t *buf; /* Temporary raw data buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - size_t size; /* Index block size on disk */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - - /* Wrap the local buffer for serialized info */ - if(NULL == (wb = H5WB_wrap(ser_buf, sizeof(ser_buf)))) - H5E_THROW(H5E_CANTINIT, "can't wrap buffer") - - /* Compute the size of the data block on disk */ - size = dblk_page->size; - - /* Get a pointer to a buffer that's large enough for serialized info */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") - - /* Get temporary pointer to serialized info */ - p = buf; - - /* Internal information */ - - /* Encode elements in data block page */ - - /* Convert from native elements in memory into raw elements on disk */ - if((dblk_page->hdr->cparam.cls->encode)(p, dblk_page->elmts, dblk_page->hdr->dblk_page_nelmts, dblk_page->hdr->cb_ctx) < 0) - H5E_THROW(H5E_CANTENCODE, "can't encode extensible array data elements") - p += (dblk_page->hdr->dblk_page_nelmts * dblk_page->hdr->cparam.raw_elmt_size); - - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); + HDassert(image_len); - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); + /* Set the image length size */ + *image_len = dblk_page->size; - /* Write the data block */ - HDassert((size_t)(p - buf) == size); - if(H5F_block_write(f, H5FD_MEM_EARRAY_DBLK_PAGE, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_WRITEERROR, "unable to save extensible array data block page to disk") - - dblk_page->cache_info.is_dirty = FALSE; - } /* end if */ - - if(destroy) - if(H5EA__cache_dblk_page_dest(f, dblk_page) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array data block page") - -CATCH - - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") - -END_FUNC(STATIC) /* end H5EA__cache_dblk_page_flush() */ +END_FUNC(STATIC) /* end H5EA__cache_dblk_page_image_len() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_dblk_page_clear + * Function: H5EA__cache_dblk_page_serialize * - * Purpose: Mark a extensible array data block page in memory as non-dirty. + * Purpose: Flushes a dirty object to disk. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Nov 20 2008 + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__cache_dblk_page_clear(H5F_t *f, H5EA_dblk_page_t *dblk_page, hbool_t destroy)) +H5EA__cache_dblk_page_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, + void *_thing)) - /* Sanity check */ + /* Local variables */ + H5EA_dblk_page_t *dblk_page = (H5EA_dblk_page_t *)_thing; /* Pointer to the object to serialize */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ + + /* Check arguments */ + HDassert(f); + HDassert(image); HDassert(dblk_page); + HDassert(dblk_page->hdr); - /* Reset the dirty flag */ - dblk_page->cache_info.is_dirty = FALSE; + /* Internal information */ - if(destroy) - if(H5EA__cache_dblk_page_dest(f, dblk_page) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array data block page") + /* Encode elements in data block page */ + + /* Convert from native elements in memory into raw elements on disk */ + if((dblk_page->hdr->cparam.cls->encode)(image, dblk_page->elmts, dblk_page->hdr->dblk_page_nelmts, dblk_page->hdr->cb_ctx) < 0) + H5E_THROW(H5E_CANTENCODE, "can't encode extensible array data elements") + image += (dblk_page->hdr->dblk_page_nelmts * dblk_page->hdr->cparam.raw_elmt_size); + + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0); + + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); + + /* Sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) <= len); CATCH -END_FUNC(STATIC) /* end H5EA__cache_dblk_page_clear() */ +END_FUNC(STATIC) /* end H5EA__cache_dblk_page_serialize() */ /*------------------------------------------------------------------------- @@ -1976,7 +1838,10 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_clear() */ */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, H5EA_dblk_page_t *dblk_page)) +H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing)) + + /* Local variables */ + H5EA_dblk_page_t *dblk_page = (H5EA_dblk_page_t *)_thing; /* Pointer to the object */ /* Sanity check */ HDassert(dblk_page); @@ -1984,11 +1849,16 @@ H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, H5EA_dblk_page_t *dblk /* Determine which action to take */ switch(action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: + case H5AC_NOTIFY_ACTION_AFTER_LOAD: /* Create flush dependency on parent */ if(H5EA__create_flush_depend((H5AC_info_t *)dblk_page->parent, (H5AC_info_t *)dblk_page) < 0) H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency between data block page and parent, address = %llu", (unsigned long long)dblk_page->addr) break; + case H5AC_NOTIFY_ACTION_AFTER_FLUSH: + /* do nothing */ + break; + case H5AC_NOTIFY_ACTION_BEFORE_EVICT: /* Destroy flush dependency on parent */ if(H5EA__destroy_flush_depend((H5AC_info_t *)dblk_page->parent, (H5AC_info_t *)dblk_page) < 0) @@ -2005,70 +1875,31 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_notify() */ /*------------------------------------------------------------------------- - * Function: H5EA__cache_dblk_page_size - * - * Purpose: Compute the size in bytes of a extensible array data block page - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Nov 20 2008 - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -BEGIN_FUNC(STATIC, NOERR, -herr_t, SUCCEED, -, -H5EA__cache_dblk_page_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_dblk_page_t *dblk_page, - size_t *size_ptr)) - - /* Sanity check */ - HDassert(f); - HDassert(dblk_page); - HDassert(size_ptr); - - /* Set size value */ - *size_ptr = dblk_page->size; - -END_FUNC(STATIC) /* end H5EA__cache_dblk_page_size() */ - - -/*------------------------------------------------------------------------- - * Function: H5EA__cache_dblk_page_dest - * - * Purpose: Destroys an extensible array data block page in memory. + * Function: H5EA__cache_dblk_page_free_icr * - * Note: Does _not_ free the space for the page on disk, that is - * handled through the data block that "owns" the page. + * Purpose: Destroy/release an "in core representation" of a data + * structure * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Nov 20 2008 + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__cache_dblk_page_dest(H5F_t H5_ATTR_UNUSED *f, H5EA_dblk_page_t *dblk_page)) +H5EA__cache_dblk_page_free_icr(void *thing)) - /* Sanity check */ - HDassert(f); - HDassert(dblk_page); - - /* Verify that data block page is clean */ - HDassert(dblk_page->cache_info.is_dirty == FALSE); + /* Check arguments */ + HDassert(thing); - /* Release the data block page */ - if(H5EA__dblk_page_dest(dblk_page) < 0) + /* Release the extensible array data block page */ + if(H5EA__dblk_page_dest((H5EA_dblk_page_t *)thing) < 0) H5E_THROW(H5E_CANTFREE, "can't free extensible array data block page") CATCH -END_FUNC(STATIC) /* end H5EA__cache_dblk_page_dest() */ +END_FUNC(STATIC) /* end H5EA__cache_dblk_page_free_icr() */ diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index ff55722..9c3ce6d 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -119,7 +119,7 @@ H5EA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, addr, dbg_ctx, H5AC_READ))) + if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Print opening message */ @@ -218,14 +218,14 @@ H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *s } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC_READ))) + if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Sanity check */ HDassert(H5F_addr_eq(hdr->idx_blk_addr, addr)); /* Protect index block */ - if(NULL == (iblock = H5EA__iblock_protect(hdr, dxpl_id, H5AC_READ))) + if(NULL == (iblock = H5EA__iblock_protect(hdr, dxpl_id, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) /* Print opening message */ @@ -343,12 +343,12 @@ H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC_READ))) + if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Protect super block */ /* (Note: setting parent of super block to 'hdr' for this operation should be OK -QAK) */ - if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, (H5EA_iblock_t *)hdr, addr, sblk_idx, H5AC_READ))) + if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, (H5EA_iblock_t *)hdr, addr, sblk_idx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)addr) /* Print opening message */ @@ -437,12 +437,12 @@ H5EA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC_READ))) + if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Protect data block */ /* (Note: setting parent of data block to 'hdr' for this operation should be OK -QAK) */ - if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, hdr, addr, dblk_nelmts, H5AC_READ))) + if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, hdr, addr, dblk_nelmts, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)addr) /* Print opening message */ diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c index 37fd68b..5d188c2 100644 --- a/src/H5EAdblkpage.c +++ b/src/H5EAdblkpage.c @@ -210,7 +210,7 @@ END_FUNC(PKG) /* end H5EA__dblk_page_create() */ BEGIN_FUNC(PKG, ERR, H5EA_dblk_page_t *, NULL, NULL, H5EA__dblk_page_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_sblock_t *parent, - haddr_t dblk_page_addr, H5AC_protect_t rw)) + haddr_t dblk_page_addr, unsigned flags)) /* Local variables */ H5EA_dblk_page_cache_ud_t udata; /* Information needed for loading data block page */ @@ -223,12 +223,16 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(hdr); HDassert(H5F_addr_defined(dblk_page_addr)); + /* only the H5AC__READ_ONLY_FLAG may be set */ + HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* Set up user data */ udata.hdr = hdr; udata.parent = parent; + udata.dblk_page_addr = dblk_page_addr; /* Protect the data block page */ - if(NULL == (ret_value = (H5EA_dblk_page_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_DBLK_PAGE, dblk_page_addr, &udata, rw))) + if(NULL == (ret_value = (H5EA_dblk_page_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_DBLK_PAGE, dblk_page_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block page, address = %llu", (unsigned long long)dblk_page_addr) CATCH diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c index dd1e7b0..24be87a 100644 --- a/src/H5EAdblock.c +++ b/src/H5EAdblock.c @@ -304,7 +304,7 @@ END_FUNC(PKG) /* end H5EA__dblock_sblk_idx() */ BEGIN_FUNC(PKG, ERR, H5EA_dblock_t *, NULL, NULL, H5EA__dblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, - haddr_t dblk_addr, size_t dblk_nelmts, H5AC_protect_t rw)) + haddr_t dblk_addr, size_t dblk_nelmts, unsigned flags)) /* Local variables */ H5EA_dblock_cache_ud_t udata; /* Information needed for loading data block */ @@ -318,13 +318,17 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(H5F_addr_defined(dblk_addr)); HDassert(dblk_nelmts); + /* only the H5AC__READ_ONLY_FLAG may be set */ + HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* Set up user data */ udata.hdr = hdr; udata.parent = parent; udata.nelmts = dblk_nelmts; + udata.dblk_addr = dblk_addr; /* Protect the data block */ - if(NULL == (ret_value = (H5EA_dblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_DBLOCK, dblk_addr, &udata, rw))) + if(NULL == (ret_value = (H5EA_dblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_DBLOCK, dblk_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)dblk_addr) CATCH @@ -399,7 +403,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(dblk_nelmts > 0); /* Protect data block */ - if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, parent, dblk_addr, dblk_nelmts, H5AC_WRITE))) + if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, parent, dblk_addr, dblk_nelmts, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)dblk_addr) /* Check if this is a paged data block */ diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 76ea6d8..e30bbac 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -627,16 +627,25 @@ END_FUNC(PKG) /* end H5EA__hdr_modified() */ BEGIN_FUNC(PKG, ERR, H5EA_hdr_t *, NULL, NULL, H5EA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata, - H5AC_protect_t rw)) + unsigned flags)) /* Local variables */ + H5EA_hdr_cache_ud_t udata; /* User data for cache callbacks */ /* Sanity check */ HDassert(f); HDassert(H5F_addr_defined(ea_addr)); + /* only the H5AC__READ_ONLY_FLAG may appear in flags */ + HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + + /* Set up user data for cache callbacks */ + udata.f = f; + udata.addr = ea_addr; + udata.ctx_udata = ctx_udata; + /* Protect the header */ - if(NULL == (ret_value = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, ctx_udata, rw))) + if(NULL == (ret_value = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array header, address = %llu", (unsigned long long)ea_addr) CATCH diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c index 3c2894a..364b443 100644 --- a/src/H5EAiblock.c +++ b/src/H5EAiblock.c @@ -279,7 +279,7 @@ END_FUNC(PKG) /* end H5EA__iblock_create() */ */ BEGIN_FUNC(PKG, ERR, H5EA_iblock_t *, NULL, NULL, -H5EA__iblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, H5AC_protect_t rw)) +H5EA__iblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, unsigned flags)) #ifdef QAK HDfprintf(stderr, "%s: Called\n", FUNC); @@ -288,8 +288,11 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Sanity check */ HDassert(hdr); + /* only the H5AC__READ_ONLY_FLAG may be set */ + HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* Protect the index block */ - if(NULL == (ret_value = (H5EA_iblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_IBLOCK, hdr->idx_blk_addr, hdr, rw))) + if(NULL == (ret_value = (H5EA_iblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_IBLOCK, hdr->idx_blk_addr, hdr, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) CATCH @@ -361,7 +364,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(H5F_addr_defined(hdr->idx_blk_addr)); /* Protect index block */ - if(NULL == (iblock = H5EA__iblock_protect(hdr, dxpl_id, H5AC_WRITE))) + if(NULL == (iblock = H5EA__iblock_protect(hdr, dxpl_id, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) /* Check for index block having data block pointers */ @@ -436,7 +439,6 @@ H5EA__iblock_dest(H5EA_iblock_t *iblock)) /* Sanity check */ HDassert(iblock); - HDassert(iblock->rc == 0); /* Check if shared header field has been initialized */ if(iblock->hdr) { diff --git a/src/H5EApkg.h b/src/H5EApkg.h index 5382eac..d328c05 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -229,7 +229,6 @@ typedef struct H5EA_iblock_t { haddr_t *sblk_addrs; /* Buffer for addresses of super blocks in index block */ /* Internal array information (not stored) */ - size_t rc; /* Reference count of objects using this block */ H5EA_hdr_t *hdr; /* Shared array header info */ haddr_t addr; /* Address of this index block on disk */ size_t size; /* Size of index block on disk */ @@ -251,7 +250,6 @@ typedef struct H5EA_sblock_t { uint8_t *page_init; /* Bitmap of whether a data block page is initialized */ /* Internal array information (not stored) */ - size_t rc; /* Reference count of objects using this block */ H5EA_hdr_t *hdr; /* Shared array header info */ H5EA_iblock_t *parent; /* Parent object for super block (index block) */ haddr_t addr; /* Address of this index block on disk */ @@ -312,11 +310,19 @@ struct H5EA_t { /* Metadata cache callback user data types */ +/* Info needed for loading header */ +typedef struct H5EA_hdr_cache_ud_t { + H5F_t *f; /* Pointer to file for extensible array */ + haddr_t addr; /* Address of header on disk */ + void *ctx_udata; /* User context for class */ +} H5EA_hdr_cache_ud_t; + /* Info needed for loading super block */ typedef struct H5EA_sblock_cache_ud_t { H5EA_hdr_t *hdr; /* Shared extensible array information */ H5EA_iblock_t *parent; /* Pointer to parent object for super block (index block) */ unsigned sblk_idx; /* Index of super block */ + haddr_t sblk_addr; /* Address of super block */ } H5EA_sblock_cache_ud_t; /* Info needed for loading data block */ @@ -324,12 +330,14 @@ typedef struct H5EA_dblock_cache_ud_t { H5EA_hdr_t *hdr; /* Shared extensible array information */ void *parent; /* Pointer to parent object for data block (index or super block) */ size_t nelmts; /* Number of elements in data block */ + haddr_t dblk_addr; /* Address of data block */ } H5EA_dblock_cache_ud_t; /* Info needed for loading data block page */ typedef struct H5EA_dblk_page_cache_ud_t { H5EA_hdr_t *hdr; /* Shared extensible array information */ H5EA_sblock_t *parent; /* Pointer to parent object for data block page (super block) */ + haddr_t dblk_page_addr; /* Address of data block page */ } H5EA_dblk_page_cache_ud_t; #ifdef H5EA_TESTING @@ -388,7 +396,7 @@ H5_DLL herr_t H5EA__hdr_fuse_incr(H5EA_hdr_t *hdr); H5_DLL size_t H5EA__hdr_fuse_decr(H5EA_hdr_t *hdr); H5_DLL herr_t H5EA__hdr_modified(H5EA_hdr_t *hdr); H5_DLL H5EA_hdr_t *H5EA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, - void *ctx_udata, H5AC_protect_t rw); + void *ctx_udata, unsigned flags); H5_DLL herr_t H5EA__hdr_unprotect(H5EA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags); H5_DLL herr_t H5EA__hdr_delete(H5EA_hdr_t *hdr, hid_t dxpl_id); H5_DLL herr_t H5EA__hdr_dest(H5EA_hdr_t *hdr); @@ -398,7 +406,7 @@ H5_DLL H5EA_iblock_t *H5EA__iblock_alloc(H5EA_hdr_t *hdr); H5_DLL haddr_t H5EA__iblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, hbool_t *stats_changed); H5_DLL H5EA_iblock_t *H5EA__iblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, - H5AC_protect_t rw); + unsigned flags); H5_DLL herr_t H5EA__iblock_unprotect(H5EA_iblock_t *iblock, hid_t dxpl_id, unsigned cache_flags); H5_DLL herr_t H5EA__iblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id); @@ -410,7 +418,8 @@ H5_DLL H5EA_sblock_t *H5EA__sblock_alloc(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, H5_DLL haddr_t H5EA__sblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, hbool_t *stats_changed, unsigned sblk_idx); H5_DLL H5EA_sblock_t *H5EA__sblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, - H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx, H5AC_protect_t rw); + H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx, + unsigned flags); H5_DLL herr_t H5EA__sblock_unprotect(H5EA_sblock_t *sblock, hid_t dxpl_id, unsigned cache_flags); H5_DLL herr_t H5EA__sblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, @@ -424,7 +433,7 @@ H5_DLL haddr_t H5EA__dblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, hbool_t *stats_changed, hsize_t dblk_off, size_t nelmts); H5_DLL unsigned H5EA__dblock_sblk_idx(const H5EA_hdr_t *hdr, hsize_t idx); H5_DLL H5EA_dblock_t *H5EA__dblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, - void *parent, haddr_t dblk_addr, size_t dblk_nelmts, H5AC_protect_t rw); + void *parent, haddr_t dblk_addr, size_t dblk_nelmts, unsigned flags); H5_DLL herr_t H5EA__dblock_unprotect(H5EA_dblock_t *dblock, hid_t dxpl_id, unsigned cache_flags); H5_DLL herr_t H5EA__dblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, @@ -436,7 +445,7 @@ H5_DLL H5EA_dblk_page_t *H5EA__dblk_page_alloc(H5EA_hdr_t *hdr, H5EA_sblock_t *p H5_DLL herr_t H5EA__dblk_page_create(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_sblock_t *parent, haddr_t addr); H5_DLL H5EA_dblk_page_t *H5EA__dblk_page_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, - H5EA_sblock_t *parent, haddr_t dblk_page_addr, H5AC_protect_t rw); + H5EA_sblock_t *parent, haddr_t dblk_page_addr, unsigned flags); H5_DLL herr_t H5EA__dblk_page_unprotect(H5EA_dblk_page_t *dblk_page, hid_t dxpl_id, unsigned cache_flags); H5_DLL herr_t H5EA__dblk_page_dest(H5EA_dblk_page_t *dblk_page); diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c index 1cc8bd9..33f34c9 100644 --- a/src/H5EAsblock.c +++ b/src/H5EAsblock.c @@ -276,7 +276,7 @@ END_FUNC(PKG) /* end H5EA__sblock_create() */ BEGIN_FUNC(PKG, ERR, H5EA_sblock_t *, NULL, NULL, H5EA__sblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, - haddr_t sblk_addr, unsigned sblk_idx, H5AC_protect_t rw)) + haddr_t sblk_addr, unsigned sblk_idx, unsigned flags)) /* Local variables */ H5EA_sblock_cache_ud_t udata; /* Information needed for loading super block */ @@ -290,13 +290,17 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(hdr); HDassert(H5F_addr_defined(sblk_addr)); + /* only the H5AC__READ_ONLY_FLAG may be set */ + HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* Set up user data */ udata.hdr = hdr; udata.parent = parent; udata.sblk_idx = sblk_idx; + udata.sblk_addr = sblk_addr; /* Protect the super block */ - if(NULL == (ret_value = (H5EA_sblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_SBLOCK, sblk_addr, &udata, rw))) + if(NULL == (ret_value = (H5EA_sblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_SBLOCK, sblk_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)sblk_addr) CATCH @@ -370,7 +374,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(H5F_addr_defined(sblk_addr)); /* Protect super block */ - if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, parent, sblk_addr, sblk_idx, H5AC_WRITE))) + if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, parent, sblk_addr, sblk_idx, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)sblk_addr) /* Iterate over data blocks */ @@ -412,7 +416,6 @@ H5EA__sblock_dest(H5EA_sblock_t *sblock)) /* Sanity check */ HDassert(sblock); - HDassert(sblock->rc == 0); #ifdef QAK HDfprintf(stderr, "%s: sblock->hdr->dblk_page_nelmts = %Zu, sblock->ndblks = %Zu, sblock->dblk_nelmts = %Zu\n", FUNC, sblock->hdr->dblk_page_nelmts, sblock->ndblks, sblock->dblk_nelmts); #endif /* QAK */ diff --git a/src/H5FA.c b/src/H5FA.c index 1acb10b..bfb2a00 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -141,7 +141,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array info") /* Lock the array header into memory */ - if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC_WRITE))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Point fixed array wrapper at header and bump it's ref count */ @@ -201,7 +201,7 @@ H5FA_open(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) #ifdef H5FA_DEBUG HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr); #endif /* H5FA_DEBUG */ - if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC_READ))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header, address = %llu", (unsigned long long)fa_addr) /* Check for pending array deletion */ @@ -359,7 +359,7 @@ HDfprintf(stderr, "%s: fixed array data block address not defined!\n", FUNC, idx HDassert(idx < hdr->cparam.nelmts); /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, H5AC_WRITE))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)hdr->dblk_addr) /* Check for paging data block */ @@ -400,7 +400,7 @@ HDfprintf(stderr, "%s: fixed array data block address not defined!\n", FUNC, idx } /* end if */ /* Protect the data block page */ - if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts, H5AC_WRITE))) + if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu", (unsigned long long)dblk_page_addr) /* Set the element in the data block page */ @@ -467,7 +467,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); else { /* Get the data block */ HDassert(H5F_addr_defined(hdr->dblk_addr)); - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, H5AC_READ))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)hdr->dblk_addr) /* Check for paged data block */ @@ -507,7 +507,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); dblk_page_nelmts = dblock->dblk_page_nelmts; /* Protect the data block page */ - if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts, H5AC_READ))) + if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu", (unsigned long long)dblk_page_addr) /* Retrieve element from data block */ @@ -592,7 +592,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Lock the array header into memory */ /* (OK to pass in NULL for callback context, since we know the header must be in the cache) */ - if(NULL == (hdr = H5FA__hdr_protect(fa->f, dxpl_id, fa_addr, NULL, H5AC_WRITE))) + if(NULL == (hdr = H5FA__hdr_protect(fa->f, dxpl_id, fa_addr, NULL, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTLOAD, "unable to load fixed array header") /* Set the shared array header's file context for this operation */ @@ -655,7 +655,7 @@ H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) #ifdef H5FA_DEBUG HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr); #endif /* H5FA_DEBUG */ - if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC_WRITE))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu", (unsigned long long)fa_addr) /* Check for files using shared array header */ diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 9a1fc57..298eb56 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -55,11 +55,6 @@ #define H5FA_HDR_VERSION 0 /* Header */ #define H5FA_DBLOCK_VERSION 0 /* Data block */ -/* Size of stack buffer for serialization buffers */ -#define H5FA_HDR_BUF_SIZE 512 -#define H5FA_DBLOCK_BUF_SIZE 512 -#define H5FA_DBLK_PAGE_BUF_SIZE 512 - /******************/ /* Local Typedefs */ @@ -76,23 +71,35 @@ /********************/ /* Metadata cache (H5AC) callbacks */ -static H5FA_hdr_t *H5FA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5FA__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FA_hdr_t *hdr, unsigned * flags_ptr); -static herr_t H5FA__cache_hdr_clear(H5F_t *f, H5FA_hdr_t *hdr, hbool_t destroy); -static herr_t H5FA__cache_hdr_size(const H5F_t *f, const H5FA_hdr_t *hdr, size_t *size_ptr); -static herr_t H5FA__cache_hdr_dest(H5F_t *f, H5FA_hdr_t *hdr); - -static H5FA_dblock_t *H5FA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5FA__cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FA_dblock_t *dblock, unsigned * flags_ptr); -static herr_t H5FA__cache_dblock_clear(H5F_t *f, H5FA_dblock_t *dblock, hbool_t destroy); -static herr_t H5FA__cache_dblock_size(const H5F_t *f, const H5FA_dblock_t *dblock, size_t *size_ptr); -static herr_t H5FA__cache_dblock_dest(H5F_t *f, H5FA_dblock_t *dblock); - -static H5FA_dblk_page_t *H5FA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5FA__cache_dblk_page_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FA_dblk_page_t *dblk_page, unsigned * flags_ptr); -static herr_t H5FA__cache_dblk_page_clear(H5F_t *f, H5FA_dblk_page_t *dblk_page, hbool_t destroy); -static herr_t H5FA__cache_dblk_page_size(const H5F_t *f, const H5FA_dblk_page_t *dblk_page, size_t *size_ptr); -static herr_t H5FA__cache_dblk_page_dest(H5F_t *f, H5FA_dblk_page_t *dblk_page); +static herr_t H5FA__cache_hdr_get_load_size(const void *udata, size_t *image_len); +static void *H5FA__cache_hdr_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5FA__cache_hdr_image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5FA__cache_hdr_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5FA__cache_hdr_free_icr(void *thing); + +static herr_t H5FA__cache_dblock_get_load_size(const void *udata, size_t *image_len); +static void *H5FA__cache_dblock_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5FA__cache_dblock_image_len(const void *thing, + size_t *image_len, hbool_t *compressed_ptr, + size_t *compressed_image_len_ptr); +static herr_t H5FA__cache_dblock_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5FA__cache_dblock_free_icr(void *thing); +static herr_t H5FA__cache_dblock_fsf_size(const void *thing, size_t *fsf_size); + +static herr_t H5FA__cache_dblk_page_get_load_size(const void *udata, size_t *image_len); +static void *H5FA__cache_dblk_page_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5FA__cache_dblk_page_image_len(const void *thing, + size_t *image_len, hbool_t *compressed_ptr, + size_t *compressed_image_len_ptr); +static herr_t H5FA__cache_dblk_page_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5FA__cache_dblk_page_free_icr(void *thing); /*********************/ @@ -101,36 +108,53 @@ static herr_t H5FA__cache_dblk_page_dest(H5F_t *f, H5FA_dblk_page_t *dblk_page); /* H5FA header inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_FARRAY_HDR[1] = {{ - H5AC_FARRAY_HDR_ID, - (H5AC_load_func_t)H5FA__cache_hdr_load, - (H5AC_flush_func_t)H5FA__cache_hdr_flush, - (H5AC_dest_func_t)H5FA__cache_hdr_dest, - (H5AC_clear_func_t)H5FA__cache_hdr_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5FA__cache_hdr_size, + H5AC_FARRAY_HDR_ID, /* Metadata client ID */ + "Fixed-array Header", /* Metadata client name (for debugging) */ + H5FD_MEM_FARRAY_HDR, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5FA__cache_hdr_get_load_size, /* 'get_load_size' callback */ + H5FA__cache_hdr_deserialize, /* 'deserialize' callback */ + H5FA__cache_hdr_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5FA__cache_hdr_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5FA__cache_hdr_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; - /* H5FA data block inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_FARRAY_DBLOCK[1] = {{ - H5AC_FARRAY_DBLOCK_ID, - (H5AC_load_func_t)H5FA__cache_dblock_load, - (H5AC_flush_func_t)H5FA__cache_dblock_flush, - (H5AC_dest_func_t)H5FA__cache_dblock_dest, - (H5AC_clear_func_t)H5FA__cache_dblock_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5FA__cache_dblock_size, + H5AC_FARRAY_DBLOCK_ID, /* Metadata client ID */ + "Fixed Array Data Block", /* Metadata client name (for debugging) */ + H5FD_MEM_FARRAY_DBLOCK, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5FA__cache_dblock_get_load_size, /* 'get_load_size' callback */ + H5FA__cache_dblock_deserialize, /* 'deserialize' callback */ + H5FA__cache_dblock_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5FA__cache_dblock_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5FA__cache_dblock_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + H5FA__cache_dblock_fsf_size, /* 'fsf_size' callback */ }}; /* H5FA data block page inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1] = {{ - H5AC_FARRAY_DBLK_PAGE_ID, - (H5AC_load_func_t)H5FA__cache_dblk_page_load, - (H5AC_flush_func_t)H5FA__cache_dblk_page_flush, - (H5AC_dest_func_t)H5FA__cache_dblk_page_dest, - (H5AC_clear_func_t)H5FA__cache_dblk_page_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5FA__cache_dblk_page_size, + H5AC_FARRAY_DBLK_PAGE_ID, /* Metadata client ID */ + "Fixed Array Data Block Page", /* Metadata client name (for debugging) */ + H5FD_MEM_FARRAY_DBLK_PAGE, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5FA__cache_dblk_page_get_load_size, /* 'get_load_size' callback */ + H5FA__cache_dblk_page_deserialize, /* 'deserialize' callback */ + H5FA__cache_dblk_page_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5FA__cache_dblk_page_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5FA__cache_dblk_page_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; @@ -146,88 +170,101 @@ const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1] = {{ /*------------------------------------------------------------------------- - * Function: H5FA__cache_hdr_load + * Function: H5FA__cache_hdr_get_load_size + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 31, 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5FA__cache_hdr_get_load_size(const void *_udata, size_t *image_len)) + + /* Local variables */ + const H5FA_hdr_cache_ud_t *udata = (const H5FA_hdr_cache_ud_t *)_udata; /* User data for callback */ + + /* Check arguments */ + HDassert(udata); + HDassert(udata->f); + HDassert(image_len); + + /* Set the image length size */ + *image_len = (size_t)H5FA_HEADER_SIZE_FILE(udata->f); + +END_FUNC(STATIC) /* end H5FA__cache_hdr_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5FA__cache_hdr_deserialize * - * Purpose: Loads a fixed array header from the disk. + * Purpose: Loads a data structure from the disk. * - * Return: Success: Pointer to a new fixed array + * Return: Success: Pointer to a new B-tree. * Failure: NULL * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 12, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, -H5FA_hdr_t *, NULL, NULL, -H5FA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)) +void *, NULL, NULL, +H5FA__cache_hdr_deserialize(const void *_image, size_t len, + void *_udata, hbool_t H5_ATTR_UNUSED *dirty)) /* Local variables */ H5FA_cls_id_t id; /* ID of fixed array class, as found in file */ H5FA_hdr_t *hdr = NULL; /* Fixed array info */ - size_t size; /* Header size */ - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5FA_HDR_BUF_SIZE]; /* Buffer for header */ - uint8_t *buf; /* Pointer to header buffer */ - const uint8_t *p; /* Pointer into raw data buffer */ + H5FA_hdr_cache_ud_t *udata = (H5FA_hdr_cache_ud_t *)_udata; + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(udata); + HDassert(udata->f); + HDassert(H5F_addr_defined(udata->addr)); /* Allocate space for the fixed array data structure */ - if(NULL == (hdr = H5FA__hdr_alloc(f))) + if(NULL == (hdr = H5FA__hdr_alloc(udata->f))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array shared header") /* Set the fixed array header's address */ - hdr->addr = addr; - - /* Wrap the local buffer for serialized info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - H5E_THROW(H5E_CANTINIT, "can't wrap buffer") - - /* Compute the 'base' size of the fixed array header on disk */ - 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))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") - - /* Read header from disk */ - if(H5F_block_read(f, H5FD_MEM_FARRAY_HDR, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_READERROR, "can't read fixed array header") - - /* Get temporary pointer to serialized header */ - p = buf; + hdr->addr = udata->addr; /* Magic number */ - if(HDmemcmp(p, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) H5E_THROW(H5E_BADVALUE, "wrong fixed array header signature") - p += H5_SIZEOF_MAGIC; + image += H5_SIZEOF_MAGIC; /* Version */ - if(*p++ != H5FA_HDR_VERSION) + if(*image++ != H5FA_HDR_VERSION) H5E_THROW(H5E_VERSION, "wrong fixed array header version") /* Fixed array class */ - id = (H5FA_cls_id_t)*p++; + id = (H5FA_cls_id_t)*image++; if(id >= H5FA_NUM_CLS_ID) H5E_THROW(H5E_BADTYPE, "incorrect fixed array class") hdr->cparam.cls = H5FA_client_class_g[id]; /* General array creation/configuration information */ - hdr->cparam.raw_elmt_size = *p++; /* Element size in file (in bytes) */ - hdr->cparam.max_dblk_page_nelmts_bits = *p++; /* Log2(Max. # of elements in data block page) - - i.e. # of bits needed to store max. # of - elements in data block page. */ + hdr->cparam.raw_elmt_size = *image++; /* Element size in file (in bytes) */ + hdr->cparam.max_dblk_page_nelmts_bits = *image++; /* Log2(Max. # of elements in data block page) - + i.e. # of bits needed to store max. # of + elements in data block page. */ /* Array statistics */ - H5F_DECODE_LENGTH(f, p, hdr->cparam.nelmts); /* Number of elements */ + H5F_DECODE_LENGTH(udata->f, image, hdr->cparam.nelmts); /* Number of elements */ /* Internal information */ - H5F_addr_decode(f, &p, &hdr->dblk_addr); /* Address of index block */ + H5F_addr_decode(udata->f, &image, &hdr->dblk_addr); /* Address of index block */ /* Check for data block */ if(H5F_addr_defined(hdr->dblk_addr)) { @@ -250,26 +287,26 @@ H5FA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)) /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(p - buf) == (size - H5FA_SIZEOF_CHKSUM)); + HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); /* Compute checksum on entire header */ /* (including the filter information, if present) */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); + computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (const uint8_t *)_image), 0); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - buf) == size); + HDassert((size_t)(image - (const uint8_t *)_image) == len); /* Verify checksum */ if(stored_chksum != computed_chksum) H5E_THROW(H5E_BADVALUE, "incorrect metadata checksum for fixed array header") /* Finish initializing fixed array header */ - if(H5FA__hdr_init(hdr, udata) < 0) + if(H5FA__hdr_init(hdr, udata->ctx_udata) < 0) H5E_THROW(H5E_CANTINIT, "initialization failed for fixed array header") - HDassert(hdr->size == size); + HDassert(hdr->size == len); /* Set return value */ ret_value = hdr; @@ -277,326 +314,277 @@ H5FA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)) CATCH /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") if(!ret_value) if(hdr && H5FA__hdr_dest(hdr) < 0) H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array header") -END_FUNC(STATIC) /* end H5FA__cache_hdr_load() */ +END_FUNC(STATIC) /* end H5FA__cache_hdr_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5FA__cache_hdr_flush + * Function: H5FA__cache_hdr_image_len * - * Purpose: Flushes a dirty fixed array header to disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 12, 2013 * *------------------------------------------------------------------------- */ -BEGIN_FUNC(STATIC, ERR, -herr_t, SUCCEED, FAIL, -H5FA__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5FA_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr)) +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5FA__cache_hdr_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)) - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5FA_HDR_BUF_SIZE]; /* Buffer for header */ + /* Local variables */ + const H5FA_hdr_t *hdr = (const H5FA_hdr_t *)_thing; /* Pointer to the object */ - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(hdr); + HDassert(image_len); - if(hdr->cache_info.is_dirty) { - uint8_t *buf; /* Temporary raw data buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - size_t size; /* Header size on disk */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - H5E_THROW(H5E_CANTINIT, "can't wrap buffer") - - /* Compute the size of the array header on disk */ - size = hdr->size; - - /* Get a pointer to a buffer that's large enough for serialized header */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") - - /* Get temporary pointer to serialized header */ - p = buf; + /* Set the image length size */ + *image_len = hdr->size; - /* Magic number */ - HDmemcpy(p, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; +END_FUNC(STATIC) /* end H5FA__cache_hdr_image_len() */ - /* Version # */ - *p++ = H5FA_HDR_VERSION; + +/*------------------------------------------------------------------------- + * Function: H5FA__cache_hdr_serialize + * + * Purpose: Flushes a dirty object to disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 12, 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5FA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, + void *_thing)) - /* Fixed array type */ - *p++ = hdr->cparam.cls->id; + /* Local variables */ + H5FA_hdr_t *hdr = (H5FA_hdr_t *)_thing; /* Pointer to the fixed array header */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ - /* General array creation/configuration information */ - *p++ = hdr->cparam.raw_elmt_size; /* Element size in file (in bytes) */ - *p++ = hdr->cparam.max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */ + /* check arguments */ + HDassert(f); + HDassert(image); + HDassert(hdr); - /* Array statistics */ - H5F_ENCODE_LENGTH(f, p, hdr->stats.nelmts); /* Number of elements for the fixed array */ + /* Magic number */ + HDmemcpy(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; - /* Internal information */ - H5F_addr_encode(f, &p, hdr->dblk_addr); /* Address of fixed array data block */ + /* Version # */ + *image++ = H5FA_HDR_VERSION; - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); + /* Fixed array type */ + *image++ = hdr->cparam.cls->id; - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); + /* General array creation/configuration information */ + *image++ = hdr->cparam.raw_elmt_size; /* Element size in file (in bytes) */ + *image++ = hdr->cparam.max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */ - /* Write the array header. */ - HDassert((size_t)(p - buf) == size); - if(H5F_block_write(f, H5FD_MEM_FARRAY_HDR, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_WRITEERROR, "unable to save fixed array header to disk") + /* Array statistics */ + H5F_ENCODE_LENGTH(f, image, hdr->stats.nelmts); /* Number of elements for the fixed array */ - hdr->cache_info.is_dirty = FALSE; - } /* end if */ + /* Internal information */ + H5F_addr_encode(f, &image, hdr->dblk_addr); /* Address of fixed array data block */ - if(destroy) - if(H5FA__cache_hdr_dest(f, hdr) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array header") + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0); -CATCH + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") + /* Sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) <= len); -END_FUNC(STATIC) /* end H5FA__cache_hdr_flush() */ +END_FUNC(STATIC) /* end H5FA__cache_hdr_serialize() */ /*------------------------------------------------------------------------- - * Function: H5FA__cache_hdr_clear + * Function: H5FA__cache_hdr_free_icr * - * Purpose: Mark a fixed array header in memory as non-dirty. + * Purpose: Destroy/release an "in core representation" of a data + * structure * * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 12, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5FA__cache_hdr_clear(H5F_t *f, H5FA_hdr_t *hdr, hbool_t destroy)) - - /* Sanity check */ - HDassert(hdr); +H5FA__cache_hdr_free_icr(void *thing)) - /* Reset the dirty flag. */ - hdr->cache_info.is_dirty = FALSE; + /* Check arguments */ + HDassert(thing); - if(destroy) - if(H5FA__cache_hdr_dest(f, hdr) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array header") + /* Release the extensible array header */ + if(H5FA__hdr_dest((H5FA_hdr_t *)thing) < 0) + H5E_THROW(H5E_CANTFREE, "can't free fixed array header") CATCH -END_FUNC(STATIC) /* end H5FA__cache_hdr_clear() */ +END_FUNC(STATIC) /* end H5FA__cache_hdr_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5FA__cache_hdr_size + * Function: H5FA__cache_dblock_get_load_size * - * Purpose: Compute the size in bytes of a fixed array header - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 12, 2013 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5FA__cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5FA_hdr_t *hdr, - size_t *size_ptr)) - - /* Sanity check */ - HDassert(f); - HDassert(hdr); - HDassert(size_ptr); - - /* Set size value */ - *size_ptr = hdr->size; - -END_FUNC(STATIC) /* end H5FA__cache_hdr_size() */ +H5FA__cache_dblock_get_load_size(const void *_udata, size_t *image_len)) - -/*------------------------------------------------------------------------- - * Function: H5FA__cache_hdr_dest - * - * Purpose: Destroys a fixed array header in memory. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -BEGIN_FUNC(STATIC, ERR, -herr_t, SUCCEED, FAIL, -H5FA__cache_hdr_dest(H5F_t *f, H5FA_hdr_t *hdr)) + /* Local variables */ + const H5FA_dblock_cache_ud_t *udata = (const H5FA_dblock_cache_ud_t *)_udata; /* User data */ + H5FA_dblock_t dblock; /* Fake data block for computing size */ + size_t dblk_page_nelmts; /* # of elements per data block page */ /* Check arguments */ - HDassert(f); - HDassert(hdr); - - /* Verify that header is clean */ - HDassert(hdr->cache_info.is_dirty == FALSE); - - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!hdr->cache_info.free_file_space_on_destroy || H5F_addr_defined(hdr->cache_info.addr)); - - /* Check for freeing file space for fixed array header */ - if(hdr->cache_info.free_file_space_on_destroy) { - /* Sanity check address */ - HDassert(H5F_addr_eq(hdr->addr, hdr->cache_info.addr)); - - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_FARRAY_HDR, H5AC_dxpl_id, hdr->cache_info.addr, (hsize_t)hdr->size) < 0) - H5E_THROW(H5E_CANTFREE, "unable to free fixed array header") + HDassert(udata); + HDassert(udata->hdr); + HDassert(image_len); + + /* Set up fake data block for computing size on disk */ + /* (Note: extracted from H5FA__dblock_alloc) */ + HDmemset(&dblock, 0, sizeof(dblock)); + + /* Set up fake data block for computing size on disk + * + * need: dblock->hdr + * dblock->npages + * dblock->dblk_page_init_size + */ + + dblock.hdr = udata->hdr; + dblk_page_nelmts = (size_t)1 << udata->hdr->cparam.max_dblk_page_nelmts_bits; + if(udata->hdr->cparam.nelmts > dblk_page_nelmts) { + dblock.npages = (size_t)(((udata->hdr->cparam.nelmts + dblk_page_nelmts) - 1) / dblk_page_nelmts); + dblock.dblk_page_init_size = (dblock.npages + 7) / 8; } /* end if */ - /* Release the fixed array header */ - if(H5FA__hdr_dest(hdr) < 0) - H5E_THROW(H5E_CANTFREE, "can't free fixed array header") - -CATCH + /* Set the image length size */ + if(!dblock.npages) + *image_len = (size_t)H5FA_DBLOCK_SIZE(&dblock); + else + *image_len = (size_t)H5FA_DBLOCK_PREFIX_SIZE(&dblock); -END_FUNC(STATIC) /* end H5FA__cache_hdr_dest() */ +END_FUNC(STATIC) /* end H5FA__cache_dblock_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5FA__cache_dblock_load + * Function: H5FA__cache_dblock_deserialize * - * Purpose: Loads a fixed array data block from the disk. + * Purpose: Loads a data structure from the disk. * - * Return: Success: Pointer to a new fixed array data block + * Return: Success: Pointer to a new B-tree. * Failure: NULL * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 14, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, -H5FA_dblock_t *, NULL, NULL, -H5FA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) +void *, NULL, NULL, +H5FA__cache_dblock_deserialize(const void *_image, size_t len, + void *_udata, hbool_t H5_ATTR_UNUSED *dirty)) /* Local variables */ H5FA_dblock_t *dblock = NULL; /* Data block info */ H5FA_dblock_cache_ud_t *udata = (H5FA_dblock_cache_ud_t *)_udata; /* User data for loading data block */ - size_t size; /* Data block size */ - H5WB_t *wb = NULL; /* Wrapped buffer for data block data */ - uint8_t dblock_buf[H5FA_DBLOCK_BUF_SIZE]; /* Buffer for data block */ - uint8_t *buf; /* Pointer to data block buffer */ - const uint8_t *p; /* Pointer into raw data buffer */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ haddr_t arr_addr; /* Address of array header in the file */ /* Sanity check */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(udata && udata->hdr); + HDassert(udata); + HDassert(udata->hdr); /* Allocate the fixed array data block */ if(NULL == (dblock = H5FA__dblock_alloc(udata->hdr))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block") - /* Set the fixed array data block's information */ - dblock->addr = addr; - - /* Wrap the local buffer for serialized info */ - if(NULL == (wb = H5WB_wrap(dblock_buf, sizeof(dblock_buf)))) - H5E_THROW(H5E_CANTINIT, "can't wrap buffer") - - /* Compute the size of the fixed array data block on disk */ - if(!dblock->npages) - size = (size_t)H5FA_DBLOCK_SIZE(dblock); - else - size = H5FA_DBLOCK_PREFIX_SIZE(dblock); - - /* Get a pointer to a buffer that's large enough for serialized info */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") + HDassert(((!dblock->npages) && (len == (size_t)H5FA_DBLOCK_SIZE(dblock))) + || (len == (size_t)H5FA_DBLOCK_PREFIX_SIZE(dblock))); - /* Read data block from disk */ - if(H5F_block_read(f, H5FD_MEM_FARRAY_DBLOCK, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_READERROR, "can't read fixed array data block") - - /* Get temporary pointer to serialized header */ - p = buf; + /* Set the fixed array data block's information */ + dblock->addr = udata->dblk_addr; /* Magic number */ - if(HDmemcmp(p, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) H5E_THROW(H5E_BADVALUE, "wrong fixed array data block signature") - p += H5_SIZEOF_MAGIC; + image += H5_SIZEOF_MAGIC; /* Version */ - if(*p++ != H5FA_DBLOCK_VERSION) + if(*image++ != H5FA_DBLOCK_VERSION) H5E_THROW(H5E_VERSION, "wrong fixed array data block version") /* Fixed array type */ - if(*p++ != (uint8_t)udata->hdr->cparam.cls->id) + if(*image++ != (uint8_t)udata->hdr->cparam.cls->id) H5E_THROW(H5E_BADTYPE, "incorrect fixed array class") /* Address of header for array that owns this block (just for file integrity checks) */ - H5F_addr_decode(f, &p, &arr_addr); + H5F_addr_decode(udata->hdr->f, &image, &arr_addr); if(H5F_addr_ne(arr_addr, udata->hdr->addr)) H5E_THROW(H5E_BADVALUE, "wrong fixed array header address") /* Page initialization flags */ if(dblock->npages > 0) { - HDmemcpy(dblock->dblk_page_init, p, dblock->dblk_page_init_size); - p += dblock->dblk_page_init_size; + HDmemcpy(dblock->dblk_page_init, image, dblock->dblk_page_init_size); + image += dblock->dblk_page_init_size; } /* end if */ /* Only decode elements if the data block is not paged */ if(!dblock->npages) { /* Decode elements in data block */ /* Convert from raw elements on disk into native elements in memory */ - if((udata->hdr->cparam.cls->decode)(p, dblock->elmts, (size_t)udata->hdr->stats.nelmts, udata->hdr->cb_ctx) < 0) + if((udata->hdr->cparam.cls->decode)(image, dblock->elmts, (size_t)udata->hdr->cparam.nelmts, udata->hdr->cb_ctx) < 0) H5E_THROW(H5E_CANTDECODE, "can't decode fixed array data elements") - p += (udata->hdr->stats.nelmts * udata->hdr->cparam.raw_elmt_size); + image += (udata->hdr->cparam.nelmts * udata->hdr->cparam.raw_elmt_size); } /* end if */ /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(p - buf) == (size - H5FA_SIZEOF_CHKSUM)); + HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); /* Set the data block's size */ dblock->size = H5FA_DBLOCK_SIZE(dblock); /* Compute checksum on data block */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); + computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (const uint8_t *)_image), 0); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - buf) == size); + HDassert((size_t)(image - (const uint8_t *)_image) == len); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -608,317 +596,292 @@ H5FA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) CATCH /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") if(!ret_value) if(dblock && H5FA__dblock_dest(dblock) < 0) H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array data block") -END_FUNC(STATIC) /* end H5FA__cache_dblock_load() */ +END_FUNC(STATIC) /* end H5FA__cache_dblock_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5FA__cache_dblock_flush + * Function: H5FA__cache_dblock_image_len * - * Purpose: Flushes a dirty fixed array data block to disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 14, 2013 * *------------------------------------------------------------------------- */ -BEGIN_FUNC(STATIC, ERR, -herr_t, SUCCEED, FAIL, -H5FA__cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5FA_dblock_t *dblock, unsigned H5_ATTR_UNUSED * flags_ptr)) +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5FA__cache_dblock_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)) /* Local variables */ - H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */ - uint8_t ser_buf[H5FA_DBLOCK_BUF_SIZE]; /* Serialization buffer */ + const H5FA_dblock_t *dblock = (const H5FA_dblock_t *)_thing; /* Pointer to the object */ - /* Sanity check */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(dblock); - HDassert(dblock->hdr); - - if(dblock->cache_info.is_dirty) { - uint8_t *buf; /* Temporary raw data buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - size_t size; /* Index block size on disk */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ + HDassert(image_len); - /* Wrap the local buffer for serialized info */ - if(NULL == (wb = H5WB_wrap(ser_buf, sizeof(ser_buf)))) - H5E_THROW(H5E_CANTINIT, "can't wrap buffer") - - /* Compute the size of the data block on disk */ - if(!dblock->npages) - size = (size_t)dblock->size; - else - size = H5FA_DBLOCK_PREFIX_SIZE(dblock); + /* Set the image length size */ + if(!dblock->npages) + *image_len = (size_t)dblock->size; + else + *image_len = H5FA_DBLOCK_PREFIX_SIZE(dblock); - /* Get a pointer to a buffer that's large enough for serialized info */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") +END_FUNC(STATIC) /* end H5FA__cache_dblock_image_len() */ - /* Get temporary pointer to serialized info */ - p = buf; + +/*------------------------------------------------------------------------- + * Function: H5FA__cache_dblock_serialize + * + * Purpose: Flushes a dirty object to disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 14, 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(STATIC, ERR, +herr_t, SUCCEED, FAIL, +H5FA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, + void *_thing)) - /* Magic number */ - HDmemcpy(p, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; + /* Local variables */ + H5FA_dblock_t *dblock = (H5FA_dblock_t *)_thing; /* Pointer to the object to serialize */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ - /* Version # */ - *p++ = H5FA_DBLOCK_VERSION; + /* Check arguments */ + HDassert(f); + HDassert(image); + HDassert(dblock); + HDassert(dblock->hdr); - /* Fixed array type */ - *p++ = dblock->hdr->cparam.cls->id; + /* Magic number */ + HDmemcpy(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; - /* Address of array header for array which owns this block */ - H5F_addr_encode(f, &p, dblock->hdr->addr); + /* Version # */ + *image++ = H5FA_DBLOCK_VERSION; - /* Page init flags */ - if(dblock->npages > 0) { - /* Store the 'page init' bitmasks */ - HDmemcpy(p, dblock->dblk_page_init, dblock->dblk_page_init_size); - p += dblock->dblk_page_init_size; - } /* end if */ + /* Fixed array type */ + *image++ = dblock->hdr->cparam.cls->id; - /* Only encode elements if the data block is not paged */ - if(!dblock->npages) { - /* Encode elements in data block */ + /* Address of array header for array which owns this block */ + H5F_addr_encode(f, &image, dblock->hdr->addr); - /* Convert from native elements in memory into raw elements on disk */ - H5_CHECK_OVERFLOW(dblock->hdr->cparam.nelmts, /* From: */hsize_t, /* To: */size_t); - if((dblock->hdr->cparam.cls->encode)(p, dblock->elmts, (size_t)dblock->hdr->cparam.nelmts, dblock->hdr->cb_ctx) < 0) - H5E_THROW(H5E_CANTENCODE, "can't encode fixed array data elements") - p += (dblock->hdr->cparam.nelmts * dblock->hdr->cparam.raw_elmt_size); - } /* end if */ + /* Page init flags */ + if(dblock->npages > 0) { + /* Store the 'page init' bitmasks */ + HDmemcpy(image, dblock->dblk_page_init, dblock->dblk_page_init_size); + image += dblock->dblk_page_init_size; + } /* end if */ - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); + /* Only encode elements if the data block is not paged */ + if(!dblock->npages) { + /* Encode elements in data block */ - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); + /* Convert from native elements in memory into raw elements on disk */ + H5_CHECK_OVERFLOW(dblock->hdr->cparam.nelmts, /* From: */hsize_t, /* To: */size_t); + if((dblock->hdr->cparam.cls->encode)(image, dblock->elmts, (size_t)dblock->hdr->cparam.nelmts, dblock->hdr->cb_ctx) < 0) + H5E_THROW(H5E_CANTENCODE, "can't encode fixed array data elements") + image += (dblock->hdr->cparam.nelmts * dblock->hdr->cparam.raw_elmt_size); + } /* end if */ - /* Write the data block */ - HDassert((size_t)(p - buf) == size); - if(H5F_block_write(f, H5FD_MEM_FARRAY_DBLOCK, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_WRITEERROR, "unable to save fixed array data block to disk") + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0); - dblock->cache_info.is_dirty = FALSE; - } /* end if */ + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); - if(destroy) - if(H5FA__cache_dblock_dest(f, dblock) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array data block") + /* Sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) <= len); CATCH - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") - -END_FUNC(STATIC) /* end H5FA__cache_dblock_flush() */ +END_FUNC(STATIC) /* end H5FA__cache_dblock_serialize() */ /*------------------------------------------------------------------------- - * Function: H5FA__cache_dblock_clear + * Function: H5FA__cache_dblock_free_icr * - * Purpose: Mark a fixed array data block in memory as non-dirty. + * Purpose: Destroy/release an "in core representation" of a data + * structure * * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 14, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5FA__cache_dblock_clear(H5F_t *f, H5FA_dblock_t *dblock, hbool_t destroy)) +H5FA__cache_dblock_free_icr(void *_thing)) - /* Sanity check */ - HDassert(dblock); + H5FA_dblock_t *dblock = (H5FA_dblock_t *)_thing; /* Pointer to the object */ - /* Reset the dirty flag */ - dblock->cache_info.is_dirty = FALSE; + /* Check arguments */ + HDassert(dblock); - if(destroy) - if(H5FA__cache_dblock_dest(f, dblock) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array data block") + /* Release the fixed array data block */ + if(H5FA__dblock_dest(dblock) < 0) + H5E_THROW(H5E_CANTFREE, "can't free fixed array data block") CATCH -END_FUNC(STATIC) /* end H5FA__cache_dblock_clear() */ +END_FUNC(STATIC) /* end H5FA__cache_dblock_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5FA__cache_dblock_size - * - * Purpose: Compute the size in bytes of a fixed array data block - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. - * + * Function: H5FA__cache_dblock_fsf_size + * + * Purpose: Tell the metadata cache the actual amount of file space + * to free when a dblock entry is destroyed with the free + * file space block set. + * + * This function is needed when the data block is paged, as + * the datablock header and all its pages are allocted as a + * single contiguous chunk of file space, and must be + * deallocated the same way. + * + * The size of the chunk of memory in which the dblock + * header and all its pages is stored in the size field, + * so we simply pass that value back to the cache. + * + * If the datablock is not paged, then the size field of + * the cache_info contains the correct size. However this + * value will be the same as the size field, so we return + * the contents of the size field to the cache in this case + * as well. + * * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 + * Programmer: John Mainzer + * 12/5/14 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5FA__cache_dblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5FA_dblock_t *dblock, - size_t *size_ptr)) +H5FA__cache_dblock_fsf_size(const void *_thing, size_t *fsf_size)) - /* Sanity check */ - HDassert(f); + const H5FA_dblock_t *dblock = (const H5FA_dblock_t *)_thing; /* Pointer to the object */ + + /* Check arguments */ HDassert(dblock); - HDassert(size_ptr); + HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(dblock->cache_info.type == H5AC_FARRAY_DBLOCK); + HDassert(fsf_size); - /* Set size value */ - if(!dblock->npages) - *size_ptr = (size_t)dblock->size; - else - *size_ptr = H5FA_DBLOCK_PREFIX_SIZE(dblock); + *fsf_size = dblock->size; -END_FUNC(STATIC) /* end H5FA__cache_dblock_size() */ +END_FUNC(STATIC) /* end H5FA__cache_dblock_fsf_size() */ /*------------------------------------------------------------------------- - * Function: H5FA__cache_dblock_dest + * Function: H5FA__cache_dblk_page_get_load_size * - * Purpose: Destroys a fixed array data block in memory. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 14, 2013 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ -BEGIN_FUNC(STATIC, ERR, -herr_t, SUCCEED, FAIL, -H5FA__cache_dblock_dest(H5F_t *f, H5FA_dblock_t *dblock)) - - /* Sanity check */ - HDassert(f); - HDassert(dblock); - - /* Verify that data block is clean */ - HDassert(dblock->cache_info.is_dirty == FALSE); - - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!dblock->cache_info.free_file_space_on_destroy || H5F_addr_defined(dblock->cache_info.addr)); - - /* Check for freeing file space for fixed array data block */ - if(dblock->cache_info.free_file_space_on_destroy) { - /* Sanity check address */ - HDassert(H5F_addr_eq(dblock->addr, dblock->cache_info.addr)); +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5FA__cache_dblk_page_get_load_size(const void *_udata, size_t *image_len)) - /* Release the space on disk */ - /* (Includes space for pages!) */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_FARRAY_DBLOCK, H5AC_dxpl_id, dblock->cache_info.addr, (hsize_t)dblock->size) < 0) - H5E_THROW(H5E_CANTFREE, "unable to free fixed array data block") - } /* end if */ + /* Local variables */ + const H5FA_dblk_page_cache_ud_t *udata = (const H5FA_dblk_page_cache_ud_t *)_udata; /* User data */ - /* Release the data block */ - if(H5FA__dblock_dest(dblock) < 0) - H5E_THROW(H5E_CANTFREE, "can't free fixed array data block") + /* Check arguments */ + HDassert(udata); + HDassert(udata->hdr); + HDassert(udata->nelmts > 0); + HDassert(image_len); -CATCH + *image_len = (size_t)H5FA_DBLK_PAGE_SIZE(udata->hdr, udata->nelmts); -END_FUNC(STATIC) /* end H5FA__cache_dblock_dest() */ +END_FUNC(STATIC) /* end H5FA__cache_dblk_page_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5FA__cache_dblk_page_load + * Function: H5FA__cache_dblk_page_deserialize * - * Purpose: Loads a fixed array data block page from the disk. + * Purpose: Loads a data structure from the disk. * - * Return: Success: Pointer to a new fixed array data block page + * Return: Success: Pointer to a new B-tree. * Failure: NULL * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 14, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, -H5FA_dblk_page_t *, NULL, NULL, -H5FA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) +void *, NULL, NULL, +H5FA__cache_dblk_page_deserialize(const void *_image, size_t len, + void *_udata, hbool_t H5_ATTR_UNUSED *dirty)) /* Local variables */ H5FA_dblk_page_t *dblk_page = NULL; /* Data block page info */ H5FA_dblk_page_cache_ud_t *udata = (H5FA_dblk_page_cache_ud_t *)_udata; /* User data for loading data block page */ - size_t size; /* Data block page size */ - H5WB_t *wb = NULL; /* Wrapped buffer for data block page data */ - uint8_t dblk_page_buf[H5FA_DBLK_PAGE_BUF_SIZE]; /* Buffer for data block page */ - uint8_t *buf; /* Pointer to data block page buffer */ - const uint8_t *p; /* Pointer into raw data buffer */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ /* Sanity check */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(udata && udata->hdr && udata->nelmts > 0); + HDassert(udata); + HDassert(udata->hdr); + HDassert(udata->nelmts > 0); + HDassert(H5F_addr_defined(udata->dblk_page_addr)); /* Allocate the fixed array data block page */ if(NULL == (dblk_page = H5FA__dblk_page_alloc(udata->hdr, udata->nelmts))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block page") /* Set the fixed array data block's information */ - dblk_page->addr = addr; - - /* Wrap the local buffer for serialized info */ - if(NULL == (wb = H5WB_wrap(dblk_page_buf, sizeof(dblk_page_buf)))) - 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(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))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") - - /* Read data block page from disk */ - if(H5F_block_read(f, H5FD_MEM_FARRAY_DBLK_PAGE, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_READERROR, "can't read fixed array data block page") - - /* Get temporary pointer to serialized header */ - p = buf; + dblk_page->addr = udata->dblk_page_addr; /* Internal information */ /* Decode elements in data block page */ /* Convert from raw elements on disk into native elements in memory */ - if((udata->hdr->cparam.cls->decode)(p, dblk_page->elmts, udata->nelmts, udata->hdr->cb_ctx) < 0) + if((udata->hdr->cparam.cls->decode)(image, dblk_page->elmts, udata->nelmts, udata->hdr->cb_ctx) < 0) H5E_THROW(H5E_CANTDECODE, "can't decode fixed array data elements") - p += (udata->nelmts * udata->hdr->cparam.raw_elmt_size); + image += (udata->nelmts * udata->hdr->cparam.raw_elmt_size); /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(p - buf) == (size - H5FA_SIZEOF_CHKSUM)); + HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); /* Set the data block page's size */ - dblk_page->size = size; + dblk_page->size = len; /* Compute checksum on data block */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); + computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (const uint8_t *)_image), 0); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - buf) == dblk_page->size); + HDassert((size_t)(image - (const uint8_t *)_image) == dblk_page->size); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -930,192 +893,122 @@ H5FA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) CATCH /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") if(!ret_value) if(dblk_page && H5FA__dblk_page_dest(dblk_page) < 0) H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array data block page") -END_FUNC(STATIC) /* end H5FA__cache_dblk_page_load() */ +END_FUNC(STATIC) /* end H5FA__cache_dblk_page_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5FA__cache_dblk_page_flush + * Function: H5FA__cache_dblk_page_image_len * - * Purpose: Flushes a dirty fixed array data block page to disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 14, 2013 * *------------------------------------------------------------------------- */ -BEGIN_FUNC(STATIC, ERR, -herr_t, SUCCEED, FAIL, -H5FA__cache_dblk_page_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5FA_dblk_page_t *dblk_page, unsigned H5_ATTR_UNUSED * flags_ptr)) +BEGIN_FUNC(STATIC, NOERR, +herr_t, SUCCEED, -, +H5FA__cache_dblk_page_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)) /* Local variables */ - H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */ - uint8_t ser_buf[H5FA_DBLK_PAGE_BUF_SIZE]; /* Serialization buffer */ + const H5FA_dblk_page_t *dblk_page = (const H5FA_dblk_page_t *)_thing; /* Pointer to the object */ - /* Sanity check */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(dblk_page); - HDassert(dblk_page->hdr); - - if(dblk_page->cache_info.is_dirty) { - uint8_t *buf; /* Temporary raw data buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - size_t size; /* Index block size on disk */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - - /* Wrap the local buffer for serialized info */ - if(NULL == (wb = H5WB_wrap(ser_buf, sizeof(ser_buf)))) - H5E_THROW(H5E_CANTINIT, "can't wrap buffer") - - /* Compute the size of the data block on disk */ - size = dblk_page->size; - - /* Get a pointer to a buffer that's large enough for serialized info */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - H5E_THROW(H5E_CANTGET, "can't get actual buffer") - - /* Get temporary pointer to serialized info */ - p = buf; - - /* Internal information */ - - /* Encode elements in data block page */ - - /* Convert from native elements in memory into raw elements on disk */ - if((dblk_page->hdr->cparam.cls->encode)(p, dblk_page->elmts, dblk_page->nelmts, dblk_page->hdr->cb_ctx) < 0) - H5E_THROW(H5E_CANTENCODE, "can't encode fixed array data elements") - p += (dblk_page->nelmts * dblk_page->hdr->cparam.raw_elmt_size); - - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); - - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); - - /* Write the data block */ - HDassert((size_t)(p - buf) == size); - if(H5F_block_write(f, H5FD_MEM_FARRAY_DBLK_PAGE, addr, size, dxpl_id, buf) < 0) - H5E_THROW(H5E_WRITEERROR, "unable to save fixed array data block page to disk") - - dblk_page->cache_info.is_dirty = FALSE; - } /* end if */ - - if(destroy) - if(H5FA__cache_dblk_page_dest(f, dblk_page) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array data block page") + HDassert(image_len); -CATCH - - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - H5E_THROW(H5E_CLOSEERROR, "can't close wrapped buffer") + /* Set the image length size */ + *image_len = dblk_page->size; -END_FUNC(STATIC) /* end H5FA__cache_dblk_page_flush() */ +END_FUNC(STATIC) /* end H5FA__cache_dblk_page_image_len() */ /*------------------------------------------------------------------------- - * Function: H5FA__cache_dblk_page_clear + * Function: H5FA__cache_dblk_page_serialize * - * Purpose: Mark a fixed array data block page in memory as non-dirty. + * Purpose: Flushes a dirty object to disk. * * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 14, 2013 * *------------------------------------------------------------------------- */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5FA__cache_dblk_page_clear(H5F_t *f, H5FA_dblk_page_t *dblk_page, hbool_t destroy)) +H5FA__cache_dblk_page_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, + void *_thing)) + + /* Local variables */ + H5FA_dblk_page_t *dblk_page = (H5FA_dblk_page_t *)_thing; /* Pointer to the object to serialize */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ /* Sanity check */ + HDassert(f); + HDassert(image); HDassert(dblk_page); + HDassert(dblk_page->hdr); - /* Reset the dirty flag */ - dblk_page->cache_info.is_dirty = FALSE; + /* Internal information */ - if(destroy) - if(H5FA__cache_dblk_page_dest(f, dblk_page) < 0) - H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array data block page") + /* Encode elements in data block page */ -CATCH + /* Convert from native elements in memory into raw elements on disk */ + if((dblk_page->hdr->cparam.cls->encode)(image, dblk_page->elmts, dblk_page->nelmts, dblk_page->hdr->cb_ctx) < 0) + H5E_THROW(H5E_CANTENCODE, "can't encode fixed array data elements") + image += (dblk_page->nelmts * dblk_page->hdr->cparam.raw_elmt_size); -END_FUNC(STATIC) /* end H5FA__cache_dblk_page_clear() */ + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0); - -/*------------------------------------------------------------------------- - * Function: H5FA__cache_dblk_page_size - * - * Purpose: Compute the size in bytes of a fixed array data block page - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -BEGIN_FUNC(STATIC, NOERR, -herr_t, SUCCEED, -, -H5FA__cache_dblk_page_size(const H5F_t H5_ATTR_UNUSED *f, const H5FA_dblk_page_t *dblk_page, - size_t *size_ptr)) + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert(f); - HDassert(dblk_page); - HDassert(size_ptr); + HDassert((size_t)(image - (uint8_t *)_image) <= len); - /* Set size value */ - *size_ptr = dblk_page->size; +CATCH -END_FUNC(STATIC) /* end H5FA__cache_dblk_page_size() */ +END_FUNC(STATIC) /* end H5FA__cache_dblk_page_serialize() */ /*------------------------------------------------------------------------- - * Function: H5FA__cache_dblk_page_dest - * - * Purpose: Destroys a fixed array data block page in memory. + * Function: H5FA__cache_dblk_page_free_icr * - * Note: Does _not_ free the space for the page on disk, that is - * handled through the data block that "owns" the page. + * Purpose: Destroy/release an "in core representation" of a data + * structure * * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi - * Thursday, April 30, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 14, 2013 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5FA__cache_dblk_page_dest(H5F_t H5_ATTR_UNUSED *f, H5FA_dblk_page_t *dblk_page)) +H5FA__cache_dblk_page_free_icr(void *thing)) - /* Sanity check */ - HDassert(f); - HDassert(dblk_page); - - /* Verify that data block page is clean */ - HDassert(dblk_page->cache_info.is_dirty == FALSE); + /* Check arguments */ + HDassert(thing); - /* Release the data block page */ - if(H5FA__dblk_page_dest(dblk_page) < 0) + /* Release the fixed array data block page */ + if(H5FA__dblk_page_dest((H5FA_dblk_page_t *)thing) < 0) H5E_THROW(H5E_CANTFREE, "can't free fixed array data block page") CATCH -END_FUNC(STATIC) /* end H5FA__cache_dblk_page_dest() */ +END_FUNC(STATIC) /* end H5FA__cache_dblk_page_free_icr() */ diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index d5239d3..6a84fc9 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -117,7 +117,7 @@ H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } /* end if */ /* Load the fixed array header */ - if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, addr, dbg_ctx, H5AC_READ))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Print opening message */ @@ -198,11 +198,11 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde } /* end if */ /* Load the fixed array header */ - if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC_READ))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, addr, H5AC_READ))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, addr, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)addr) /* Print opening message */ @@ -246,7 +246,7 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde if(((page_idx + 1) == dblock->npages) && (nelmts_left = hdr->cparam.nelmts % dblock->dblk_page_nelmts)) dblk_page_nelmts = (size_t)nelmts_left; - if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts, H5AC_READ))) + if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu", (unsigned long long)dblk_page_addr) HDfprintf(stream, "%*sElements in page %Zu:\n", indent, "", page_idx); diff --git a/src/H5FAdblkpage.c b/src/H5FAdblkpage.c index 1f6b706..e1ea3ac 100644 --- a/src/H5FAdblkpage.c +++ b/src/H5FAdblkpage.c @@ -207,7 +207,7 @@ END_FUNC(PKG) /* end H5FA__dblk_page_create() */ BEGIN_FUNC(PKG, ERR, H5FA_dblk_page_t *, NULL, NULL, H5FA__dblk_page_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_page_addr, - size_t dblk_page_nelmts, H5AC_protect_t rw)) + size_t dblk_page_nelmts, unsigned flags)) /* Local variables */ H5FA_dblk_page_cache_ud_t udata; /* Information needed for loading data block page */ @@ -220,12 +220,16 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(hdr); HDassert(H5F_addr_defined(dblk_page_addr)); + /* only the H5AC__READ_ONLY_FLAG is permitted */ + HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* Set up user data */ udata.hdr = hdr; udata.nelmts = dblk_page_nelmts; + udata.dblk_page_addr = dblk_page_addr; /* Protect the data block page */ - if(NULL == (ret_value = (H5FA_dblk_page_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FARRAY_DBLK_PAGE, dblk_page_addr, &udata, rw))) + if(NULL == (ret_value = (H5FA_dblk_page_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FARRAY_DBLK_PAGE, dblk_page_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu", (unsigned long long)dblk_page_addr) CATCH diff --git a/src/H5FAdblock.c b/src/H5FAdblock.c index e6e0e74..42dafeb 100644 --- a/src/H5FAdblock.c +++ b/src/H5FAdblock.c @@ -263,7 +263,7 @@ END_FUNC(PKG) /* end H5FA__dblock_create() */ BEGIN_FUNC(PKG, ERR, H5FA_dblock_t *, NULL, NULL, H5FA__dblock_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr, - H5AC_protect_t rw)) + unsigned flags)) /* Local variables */ H5FA_dblock_cache_ud_t udata; /* Information needed for loading data block */ @@ -276,11 +276,15 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(hdr); HDassert(H5F_addr_defined(dblk_addr)); + /* only the H5AC__READ_ONLY_FLAG flag is permitted */ + HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* Set up user data */ udata.hdr = hdr; + udata.dblk_addr = dblk_addr; /* Protect the data block */ - if(NULL == (ret_value = (H5FA_dblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FARRAY_DBLOCK, dblk_addr, &udata, rw))) + if(NULL == (ret_value = (H5FA_dblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FARRAY_DBLOCK, dblk_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)dblk_addr) CATCH @@ -350,7 +354,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(H5F_addr_defined(dblk_addr)); /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, dblk_addr, H5AC_WRITE))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, dblk_addr, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)dblk_addr) /* Check if data block is paged */ diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 23c20bc..9083a52 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -408,16 +408,25 @@ END_FUNC(PKG) /* end H5FA__hdr_modified() */ BEGIN_FUNC(PKG, ERR, H5FA_hdr_t *, NULL, NULL, H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata, - H5AC_protect_t rw)) + unsigned flags)) /* Local variables */ + H5FA_hdr_cache_ud_t udata; /* User data for cache callbacks */ /* Sanity check */ HDassert(f); HDassert(H5F_addr_defined(fa_addr)); + /* only the H5AC__READ_ONLY_FLAG is permitted */ + HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + + /* Set up user data for cache callbacks */ + udata.f = f; + udata.addr = fa_addr; + udata.ctx_udata = ctx_udata; + /* Protect the header */ - if(NULL == (ret_value = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, ctx_udata, rw))) + if(NULL == (ret_value = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu", (unsigned long long)fa_addr) CATCH diff --git a/src/H5FApkg.h b/src/H5FApkg.h index e7993a6..bed9c83 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -206,15 +206,24 @@ struct H5FA_t { /* Metadata cache callback user data types */ +/* Info needed for loading header */ +typedef struct H5FA_hdr_cache_ud_t { + H5F_t *f; /* Pointer to file for fixed array */ + haddr_t addr; /* Address of header on disk */ + void *ctx_udata; /* User context for class */ +} H5FA_hdr_cache_ud_t; + /* Info needed for loading data block */ typedef struct H5FA_dblock_cache_ud_t { H5FA_hdr_t *hdr; /* Shared fixed array information */ + haddr_t dblk_addr; /* Address of data block on disk */ } H5FA_dblock_cache_ud_t; /* Info needed for loading data block page */ typedef struct H5FA_dblk_page_cache_ud_t { H5FA_hdr_t *hdr; /* Shared fixed array information */ size_t nelmts; /* Number of elements in data block page */ + haddr_t dblk_page_addr; /* Address of data block page on disk */ } H5FA_dblk_page_cache_ud_t; @@ -254,7 +263,7 @@ H5_DLL herr_t H5FA__hdr_fuse_incr(H5FA_hdr_t *hdr); H5_DLL size_t H5FA__hdr_fuse_decr(H5FA_hdr_t *hdr); H5_DLL herr_t H5FA__hdr_modified(H5FA_hdr_t *hdr); H5_DLL H5FA_hdr_t *H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, - void *ctx_udata, H5AC_protect_t rw); + void *ctx_udata, unsigned flags); H5_DLL herr_t H5FA__hdr_unprotect(H5FA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags); H5_DLL herr_t H5FA__hdr_delete(H5FA_hdr_t *hdr, hid_t dxpl_id); H5_DLL herr_t H5FA__hdr_dest(H5FA_hdr_t *hdr); @@ -264,7 +273,7 @@ H5_DLL H5FA_dblock_t *H5FA__dblock_alloc(H5FA_hdr_t *hdr); H5_DLL haddr_t H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty); H5_DLL unsigned H5FA__dblock_sblk_idx(const H5FA_hdr_t *hdr, hsize_t idx); H5_DLL H5FA_dblock_t *H5FA__dblock_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, - haddr_t dblk_addr, H5AC_protect_t rw); + haddr_t dblk_addr, unsigned flags); H5_DLL herr_t H5FA__dblock_unprotect(H5FA_dblock_t *dblock, hid_t dxpl_id, unsigned cache_flags); H5_DLL herr_t H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, @@ -276,7 +285,7 @@ H5_DLL herr_t H5FA__dblk_page_create(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, size_t nelmts); H5_DLL H5FA_dblk_page_t *H5FA__dblk_page_alloc(H5FA_hdr_t *hdr, size_t nelmts); H5_DLL H5FA_dblk_page_t *H5FA__dblk_page_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, - haddr_t dblk_page_addr, size_t dblk_page_nelmts, H5AC_protect_t rw); + haddr_t dblk_page_addr, size_t dblk_page_nelmts, unsigned flags); H5_DLL herr_t H5FA__dblk_page_unprotect(H5FA_dblk_page_t *dblk_page, hid_t dxpl_id, unsigned cache_flags); H5_DLL herr_t H5FA__dblk_page_dest(H5FA_dblk_page_t *dblk_page); diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index d993ad0..9edbc72 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -905,7 +905,7 @@ H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */) /* Check for flags that are set by h5repart */ if(file && file->repart_members) - *flags |= H5FD_FEAT_DIRTY_SBLK_LOAD; /* Mark the superblock dirty when it is loaded (so the family member sizes are rewritten) */ + *flags |= H5FD_FEAT_DIRTY_DRVRINFO_LOAD; /* Mark the superblock dirty when it is loaded (so the family member sizes are rewritten) */ } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index df5d5cf..58066cc 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -198,12 +198,12 @@ typedef enum H5F_mem_t H5FD_mem_t; */ #define H5FD_FEAT_IGNORE_DRVRINFO 0x00000020 /* - * Defining the H5FD_FEAT_DIRTY_SBLK_LOAD for a VFL driver means that - * the library will mark the superblock dirty when the file is opened + * Defining the H5FD_FEAT_DIRTY_DRVRINFO_LOAD for a VFL driver means that + * the library will mark the driver info dirty when the file is opened * R/W. This will cause the driver info to be re-encoded when the file * is flushed/closed. */ -#define H5FD_FEAT_DIRTY_SBLK_LOAD 0x00000040 +#define H5FD_FEAT_DIRTY_DRVRINFO_LOAD 0x00000040 /* * Defining the H5FD_FEAT_POSIX_COMPAT_HANDLE for a VFL driver means that * the handle for the VFD (returned with the 'get_handle' callback) is diff --git a/src/H5FS.c b/src/H5FS.c index 42ea070..182ac05 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -216,7 +216,7 @@ HDfprintf(stderr, "%s: Opening free space manager, fs_addr = %a, nclasses = %Zu\ cache_udata.addr = fs_addr; /* Protect the free space header */ - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC_READ))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, NULL, "unable to load free space header") #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: fspace->sect_addr = %a\n", FUNC, fspace->sect_addr); @@ -329,7 +329,7 @@ HDfprintf(stderr, "%s: Deleting free space manager, fs_addr = %a\n", FUNC, fs_ad #endif /* H5FS_DEBUG */ /* Protect the free space header */ - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC_WRITE))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to protect free space header") /* Sanity check */ @@ -361,8 +361,19 @@ HDfprintf(stderr, "%s: Expunging free space section info from cache\n", FUNC); #endif /* H5FS_DEBUG */ /* Evict the free space section info from the metadata cache */ /* (Free file space) */ - if(H5AC_expunge_entry(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, H5AC__FREE_FILE_SPACE_FLAG) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "unable to remove free space section info from cache") + { + unsigned cache_flags = H5AC__NO_FLAGS_SET; + + /* if the indirect block is in real file space, tell + * the cache to free its file space. + */ + if (!H5F_IS_TMP_ADDR(f, fspace->sect_addr)) + cache_flags |= H5AC__FREE_FILE_SPACE_FLAG; + + if(H5AC_expunge_entry(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, cache_flags) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "unable to remove free space section info from cache") + } + #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: Done expunging free space section info from cache\n", FUNC); #endif /* H5FS_DEBUG */ @@ -938,7 +949,7 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id) cache_udata.f = f; cache_udata.dxpl_id = dxpl_id; cache_udata.fspace = fspace; - if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, &cache_udata, H5AC_READ))) + if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to protect free space section info") /* Unload and release ownership of the free-space manager section info */ @@ -979,7 +990,7 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id) cache_udata.nclasses = 0; cache_udata.classes = NULL; cache_udata.cls_init_udata = NULL; - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fspace->addr, &cache_udata, H5AC_READ))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fspace->addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to protect free space section info") /* Unpin the free-space manager header */ diff --git a/src/H5FScache.c b/src/H5FScache.c index 461af99..25a9c5e 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -49,9 +49,6 @@ #define H5FS_HDR_VERSION 0 /* Header */ #define H5FS_SINFO_VERSION 0 /* Serialized sections */ -/* Size of stack buffer for serialized headers */ -#define H5FS_HDR_BUF_SIZE 256 - /******************/ /* Local Typedefs */ @@ -60,7 +57,7 @@ /* User data for skip list iterator callback for iterating over section size nodes when syncing */ typedef struct { H5FS_sinfo_t *sinfo; /* Free space section info */ - uint8_t **p; /* Pointer to address of buffer pointer to serialize with */ + uint8_t **image; /* Pointer to address of buffer pointer to serialize with */ unsigned sect_cnt_size; /* # of bytes to encode section size counts in */ } H5FS_iter_ud_t; @@ -75,20 +72,35 @@ typedef struct { /********************/ /* Section info routines */ -static herr_t H5FS_sinfo_serialize_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata); -static herr_t H5FS_sinfo_serialize_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata); +static herr_t H5FS__sinfo_serialize_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata); +static herr_t H5FS__sinfo_serialize_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata); /* Metadata cache callbacks */ -static H5FS_t *H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_t *fspace, unsigned H5_ATTR_UNUSED * flags_ptr); -static herr_t H5FS_cache_hdr_dest(H5F_t *f, H5FS_t *fspace); -static herr_t H5FS_cache_hdr_clear(H5F_t *f, H5FS_t *fspace, hbool_t destroy); -static herr_t H5FS_cache_hdr_size(const H5F_t *f, const H5FS_t *fspace, size_t *size_ptr); -static H5FS_sinfo_t *H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_sinfo_t *sinfo, unsigned H5_ATTR_UNUSED * flags_ptr); -static herr_t H5FS_cache_sinfo_dest(H5F_t *f, H5FS_sinfo_t *sinfo); -static herr_t H5FS_cache_sinfo_clear(H5F_t *f, H5FS_sinfo_t *sinfo, hbool_t destroy); -static herr_t H5FS_cache_sinfo_size(const H5F_t *f, const H5FS_sinfo_t *sinfo, size_t *size_ptr); +static herr_t H5FS__cache_hdr_get_load_size(const void *udata, size_t *image_len); +static void *H5FS__cache_hdr_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5FS__cache_hdr_image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5FS__cache_hdr_pre_serialize(const H5F_t *f, hid_t dxpl_id, + void *thing, haddr_t addr, size_t len, size_t compressed_len, + haddr_t *new_addr, size_t *new_len, size_t *new_compressed_len, + unsigned *flags); +static herr_t H5FS__cache_hdr_serialize(const H5F_t *f, void *image, + size_t len, void *thing); +static herr_t H5FS__cache_hdr_free_icr(void *thing); + +static herr_t H5FS__cache_sinfo_get_load_size(const void *udata, size_t *image_len); +static void *H5FS__cache_sinfo_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5FS__cache_sinfo_image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5FS__cache_sinfo_pre_serialize(const H5F_t *f, hid_t dxpl_id, + void *thing, haddr_t addr, size_t len, size_t compressed_len, + haddr_t *new_addr, size_t *new_len, size_t *new_compressed_len, + unsigned *flags); +static herr_t H5FS__cache_sinfo_serialize(const H5F_t *f, void *image, + size_t len, void *thing); +static herr_t H5FS__cache_sinfo_free_icr(void *thing); /*********************/ @@ -97,24 +109,36 @@ static herr_t H5FS_cache_sinfo_size(const H5F_t *f, const H5FS_sinfo_t *sinfo, s /* H5FS header inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_FSPACE_HDR[1] = {{ - H5AC_FSPACE_HDR_ID, - (H5AC_load_func_t)H5FS_cache_hdr_load, - (H5AC_flush_func_t)H5FS_cache_hdr_flush, - (H5AC_dest_func_t)H5FS_cache_hdr_dest, - (H5AC_clear_func_t)H5FS_cache_hdr_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5FS_cache_hdr_size, + H5AC_FSPACE_HDR_ID, /* Metadata client ID */ + "Free Space Header", /* Metadata client name (for debugging) */ + H5FD_MEM_FSPACE_HDR, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5FS__cache_hdr_get_load_size, /* 'get_load_size' callback */ + H5FS__cache_hdr_deserialize, /* 'deserialize' callback */ + H5FS__cache_hdr_image_len, /* 'image_len' callback */ + H5FS__cache_hdr_pre_serialize, /* 'pre_serialize' callback */ + H5FS__cache_hdr_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5FS__cache_hdr_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; -/* H5FS serialized sections inherit cache-like properties from H5AC */ +/* H5FS section info inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_FSPACE_SINFO[1] = {{ - H5AC_FSPACE_SINFO_ID, - (H5AC_load_func_t)H5FS_cache_sinfo_load, - (H5AC_flush_func_t)H5FS_cache_sinfo_flush, - (H5AC_dest_func_t)H5FS_cache_sinfo_dest, - (H5AC_clear_func_t)H5FS_cache_sinfo_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5FS_cache_sinfo_size, + H5AC_FSPACE_SINFO_ID, /* Metadata client ID */ + "Free Space Section Info", /* Metadata client name (for debugging) */ + H5FD_MEM_FSPACE_SINFO, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5FS__cache_sinfo_get_load_size, /* 'get_load_size' callback */ + H5FS__cache_sinfo_deserialize, /* 'deserialize' callback */ + H5FS__cache_sinfo_image_len, /* 'image_len' callback */ + H5FS__cache_sinfo_pre_serialize, /* 'pre_serialize' callback */ + H5FS__cache_sinfo_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5FS__cache_sinfo_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; @@ -127,44 +151,73 @@ const H5AC_class_t H5AC_FSPACE_SINFO[1] = {{ /* Local Variables */ /*******************/ -/* Declare a free list to manage free space section data to/from disk */ -H5FL_BLK_DEFINE_STATIC(sect_block); - /*------------------------------------------------------------------------- - * Function: H5FS_cache_hdr_load + * Function: H5FS__cache_hdr_get_load_size * - * Purpose: Loads a free space manager header from the disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Success: Pointer to a new free space header - * Failure: NULL + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * May 2 2006 + * koziol@hdfgroup.org + * August 14, 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5FS__cache_hdr_get_load_size(const void *_udata, size_t *image_len) +{ + const H5FS_hdr_cache_ud_t *udata = (const H5FS_hdr_cache_ud_t *)_udata; /* User-data for metadata cache callback */ + + FUNC_ENTER_STATIC_NOERR + + /* Check arguments */ + HDassert(image_len); + + /* Set the image length size */ + *image_len = (size_t)H5FS_HEADER_SIZE(udata->f); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5FS__cache_hdr_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5FS__cache_hdr_deserialize + * + * Purpose: Given a buffer containing the on disk image of the free space + * manager section info, allocate an instance of H5FS_t, load + * it with the data contained in the image, and return a pointer + * to the new instance. + * + * Return: Success: Pointer to new object + * Failure: NULL + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 18 2013 * *------------------------------------------------------------------------- */ -static H5FS_t * -H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5FS__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, + hbool_t H5_ATTR_UNUSED *dirty) { H5FS_t *fspace = NULL; /* Free space header info */ - H5FS_hdr_cache_ud_t *udata = (H5FS_hdr_cache_ud_t *)_udata; /* user data for callback */ - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5FS_HDR_BUF_SIZE]; /* Buffer for header */ - uint8_t *hdr; /* Pointer to header buffer */ - const uint8_t *p; /* Pointer into raw data buffer */ + H5FS_hdr_cache_ud_t *udata = (H5FS_hdr_cache_ud_t *)_udata; /* User data for callback */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ unsigned nclasses; /* Number of section classes */ H5FS_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ - HDassert(f); + HDassert(image); HDassert(udata); + HDassert(udata->f); /* Allocate a new free space manager */ if(NULL == (fspace = H5FS__new(udata->f, udata->nclasses, udata->classes, udata->cls_init_udata))) @@ -173,80 +226,69 @@ H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Set free space manager's internal information */ fspace->addr = udata->addr; - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, NULL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for header */ - if(NULL == (hdr = (uint8_t *)H5WB_actual(wb, fspace->hdr_size))) - HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read header from disk */ - if(H5F_block_read(f, H5FD_MEM_FSPACE_HDR, addr, fspace->hdr_size, dxpl_id, hdr) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_READERROR, NULL, "can't read free space header") - - p = hdr; - /* Magic number */ - if(HDmemcmp(p, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(image, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space header signature") - p += H5_SIZEOF_MAGIC; + image += H5_SIZEOF_MAGIC; /* Version */ - if(*p++ != H5FS_HDR_VERSION) + if(*image++ != H5FS_HDR_VERSION) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space header version") /* Client ID */ - fspace->client = (H5FS_client_t)*p++; + fspace->client = (H5FS_client_t)*image++; if(fspace->client >= H5FS_NUM_CLIENT_ID) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "unknown client ID in free space header") /* Total space tracked */ - H5F_DECODE_LENGTH(udata->f, p, fspace->tot_space); + H5F_DECODE_LENGTH(udata->f, image, fspace->tot_space); /* Total # of free space sections tracked */ - H5F_DECODE_LENGTH(udata->f, p, fspace->tot_sect_count); + H5F_DECODE_LENGTH(udata->f, image, fspace->tot_sect_count); /* # of serializable free space sections tracked */ - H5F_DECODE_LENGTH(udata->f, p, fspace->serial_sect_count); + H5F_DECODE_LENGTH(udata->f, image, fspace->serial_sect_count); /* # of ghost free space sections tracked */ - H5F_DECODE_LENGTH(udata->f, p, fspace->ghost_sect_count); + H5F_DECODE_LENGTH(udata->f, image, fspace->ghost_sect_count); /* # of section classes */ /* (only check if we actually have some classes) */ - UINT16DECODE(p, nclasses); + UINT16DECODE(image, nclasses); if(fspace->nclasses > 0 && fspace->nclasses != nclasses) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "section class count mismatch") /* Shrink percent */ - UINT16DECODE(p, fspace->shrink_percent); + UINT16DECODE(image, fspace->shrink_percent); /* Expand percent */ - UINT16DECODE(p, fspace->expand_percent); + UINT16DECODE(image, fspace->expand_percent); - /* Size of address space free space sections are within (log2 of actual value) */ - UINT16DECODE(p, fspace->max_sect_addr); + /* Size of address space free space sections are within + * (log2 of actual value) + */ + UINT16DECODE(image, fspace->max_sect_addr); /* Max. size of section to track */ - H5F_DECODE_LENGTH(udata->f, p, fspace->max_sect_size); + H5F_DECODE_LENGTH(udata->f, image, fspace->max_sect_size); /* Address of serialized free space sections */ - H5F_addr_decode(udata->f, &p, &fspace->sect_addr); + H5F_addr_decode(udata->f, &image, &fspace->sect_addr); /* Size of serialized free space sections */ - H5F_DECODE_LENGTH(udata->f, p, fspace->sect_size); + H5F_DECODE_LENGTH(udata->f, image, fspace->sect_size); /* Allocated size of serialized free space sections */ - H5F_DECODE_LENGTH(udata->f, p, fspace->alloc_sect_size); + H5F_DECODE_LENGTH(udata->f, image, fspace->alloc_sect_size); /* Compute checksum on indirect block */ - computed_chksum = H5_checksum_metadata(hdr, (size_t)(p - (const uint8_t *)hdr), 0); + computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (const uint8_t *)_image), 0); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); - HDassert((size_t)(p - (const uint8_t *)hdr) == fspace->hdr_size); + /* Sanity check */ + HDassert((size_t)(image - (const uint8_t *)_image) <= len); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -257,177 +299,432 @@ H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) done: /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_FSPACE, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value && fspace) if(H5FS__hdr_dest(fspace) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTFREE, NULL, "unable to destroy free space header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_cache_hdr_load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* end H5FS__cache_hdr_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5FS_cache_hdr_flush + * Function: H5FS__cache_hdr_image_len * - * Purpose: Flushes a dirty free space header to disk. + * Purpose: Compute the size of the data structure on disk and return + * it in *image_len. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * May 2 2006 + * koziol@hdfgroup.org + * August 14, 2013 * *------------------------------------------------------------------------- */ static herr_t -H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_t *fspace, unsigned H5_ATTR_UNUSED * flags_ptr) +H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5FS_HDR_BUF_SIZE]; /* Buffer for header */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5FS_t *fspace = (const H5FS_t *)_thing; /* Pointer to the object */ + + FUNC_ENTER_STATIC_NOERR + + /* Check arguments */ + HDassert(fspace); + HDassert(fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); + HDassert(image_len); + + /* Set the image length size */ + *image_len = fspace->hdr_size; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5FS__cache_hdr_image_len() */ + + +/*------------------------------------------------------------------------- + * Function: H5FS__cache_hdf_pre_serialize + * + * Purpose: The free space manager header contains the address, size, and + * allocation size of the free space manager section info. However, + * since it is possible for the section info to either not be allocated + * at all, or be allocated in temporary (AKA imaginary) files space, + * it is possible for the above mentioned fields to contain giberish + * when the free space manager header is serialized. + * + * This function exists to prevent this problem. It does so by + * forcing allocation of real file space for the section information. + * + * Note that in the Version 2 cache, this problem was dealt with by + * simply flushing the section info before flushing the header. This + * was possible, since the clients handled file I/O directly. As + * this responsibility has moved to the cache in Version 3, this + * solution is no longer directly applicable. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5FS__cache_hdr_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing, + haddr_t addr, size_t H5_ATTR_UNUSED len, size_t H5_ATTR_UNUSED compressed_len, + haddr_t *new_addr, size_t *new_len, size_t H5_ATTR_UNUSED *new_compressed_len, + unsigned *flags) +{ + H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to the object */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) - /* check arguments */ + /* Sanity check */ HDassert(f); - HDassert(H5F_addr_defined(addr)); HDassert(fspace); - HDassert(H5F_addr_defined(fspace->addr)); + HDassert(fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); + HDassert(H5F_addr_defined(addr)); + HDassert(new_addr); + HDassert(new_len); + HDassert(flags); - /* Check if the header "owns" the section info */ if(fspace->sinfo) { - /* Sanity check - should not be trying to destroy header if it still - * "owns" section info + /* This implies that the header "owns" the section info. + * + * Unfortunately, the comments in the code are not clear as to + * what this means, but from reviewing the code (most particularly + * H5FS_close(), H5FS_sinfo_lock, and H5FS_sinfo_unlock()), I + * gather that it means that the header is maintaining a pointer to + * an instance of H5FS_sinfo_t in which free space data is + * maintained, and either: + * + * 1) The instance of H5FS_sinfo_t is not in the metadata cache. + * + * This will be TRUE iff H5F_addr_defined(fspace->sect_addr) + * is FALSE, and fspace->sinfo is not NULL. This is sometimes + * referred to as "floating" section info in the comments. + * + * If the section info structure contains free space data + * that must be placed on disk eventually, then + * + * fspace->serial_sect_count > 0 + * + * and + * + * H5F_addr_defined(fspace->addr) + * + * will both be TRUE. If this contition does not hold, then + * either the free space info is not persistant + * (!H5F_addr_defined(fspace->addr)???) or the section info + * contains no free space data that must be written to file + * ( fspace->serial_sect_count == 0 ). + * + * 2) The instance of H5FS_sinfo_t is in the metadata cache with + * address in temporary file space (AKA imaginary file space). + * The entry may or may not be protected, and if protected, it + * may be protected either RW or RO (as indicated by + * fspace->sinfo_protected and fspace->sinfo_accmod). + * + * 3) The instance of H5FS_sinfo_t is in the metadata cache with + * address in real file space. As in case 2) above, the entry + * may or may not be protected, and if protected, it + * may be protected either RW or RO (as indicated by + * fspace->sinfo_protected and fspace->sinfo_accmod). + * + * Observe that fspace->serial_sect_count > 0 must be TRUE in + * cases 2) and 3), as the section info should not be stored on + * disk if it doesn't exist. Similarly, since the section info + * will not be stored to disk unless the header is, + * H5F_addr_defined(fspace->addr) must hold as well. + * + * As the objective is to touch up the free space manager header + * so that it contains sensical data on the size and location of + * the section information, we have to handle each of the above + * cases differently. + * + * Case 1) If either fspace->serial_sect_count == 0 or + * ! H5F_addr_defined(fspace->addr) do nothing as either + * the free space manager data is not persistant, or the + * section info is empty. + * + * Otherwise, allocate space for the section info in real + * file space, insert the section info at this location, and + * set fspace->sect_addr, fspace->sect_size, and + * fspace->alloc_sect_size to reflect the new location + * of the section info. Note that it is not necessary to + * force a write of the section info. + * + * Case 2) Allocate space for the section info in real file space, + * and tell the metadata cache to relocate the entry. + * Update fspace->sect_addr, fspace->sect_size, and + * fspace->alloc_sect_size to reflect the new location. + * + * Case 3) Nothing to be done in this case, although it is useful + * to perform sanity checks. + * + * Note that while we may alter the contents of the free space + * header in cases 1) and 2), there is no need to mark the header + * as dirty, as the metadata cache would not be attempting to + * serialize the header if it though it was clean. */ - HDassert(!destroy); - - /* Check if the section info is dirty */ - if(fspace->sinfo->dirty) { - if(fspace->serial_sect_count > 0) { - /* Check if we need to allocate space for section info */ - if(H5F_IS_TMP_ADDR(f, fspace->sect_addr) || !H5F_addr_defined(fspace->sect_addr)) { - /* Sanity check */ - HDassert(fspace->sect_size > 0); - - /* Allocate space for the section info in file */ - if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) - HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") - fspace->alloc_sect_size = (size_t)fspace->sect_size; - - /* Mark header dirty */ - /* (don't use cache API, since we're in a callback) */ - fspace->cache_info.is_dirty = TRUE; - } /* end if */ - - /* Write section info to file */ - if(H5FS_cache_sinfo_flush(f, dxpl_id, FALSE, fspace->sect_addr, fspace->sinfo, NULL) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFLUSH, FAIL, "unable to save free space section info to disk") + if(fspace->serial_sect_count > 0 && H5F_addr_defined(fspace->addr)) { + /* Sanity check */ + HDassert(fspace->sect_size > 0); + + if(!H5F_addr_defined(fspace->sect_addr)) { /* case 1 */ + /* allocate file space for the section info, and insert it + * into the metadata cache. + */ + if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") + + fspace->alloc_sect_size = (size_t)fspace->sect_size; + if(H5AC_insert_entry((H5F_t *)f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space sections to cache") + + HDassert(fspace->sinfo->cache_info.size == fspace->alloc_sect_size); + + /* the metadata cache is now managing the section info, + * so set fspace->sinfo to NULL. + */ + fspace->sinfo = NULL; } /* end if */ - - /* Mark section info clean */ - fspace->sinfo->dirty = FALSE; - } /* end if */ + else if(H5F_IS_TMP_ADDR(f, fspace->sect_addr)) { /* case 2 */ + haddr_t new_sect_addr; + + /* move the section info from temporary (AKA imaginary) file + * space to real file space. + */ + + /* if my reading of the code is correct, this should always + * be the case. If not, we will have to add code to resize + * file space allocation for section info as well as moving it. + */ + HDassert(fspace->sect_size > 0); + HDassert(fspace->alloc_sect_size == (size_t)fspace->sect_size); + + /* Allocate space for the section info in file */ + if(HADDR_UNDEF == (new_sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") + + fspace->alloc_sect_size = (size_t)fspace->sect_size; + HDassert(fspace->sinfo->cache_info.size == fspace->alloc_sect_size); + + /* Let the metadata cache know the section info moved */ + if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, fspace->sect_addr, new_sect_addr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move section info") + + fspace->sect_addr = new_sect_addr; + } /* end else-if */ + else { /* case 3 -- nothing to do but sanity checking */ + /* if my reading of the code is correct, this should always + * be the case. If not, we will have to add code to resize + * file space allocation for section info. + */ + HDassert(fspace->sect_size > 0); + HDassert(fspace->alloc_sect_size == (size_t)fspace->sect_size); + } /* end else */ + } /* end else */ + else { + /* for one reason or another (see comment above) there should + * not be any file space allocated for the section info. + */ + HDassert(!H5F_addr_defined(fspace->sect_addr)); + } /* end else */ } /* end if */ - else if(fspace->serial_sect_count > 0) - /* Sanity check that section info has address */ - HDassert(H5F_addr_defined(fspace->sect_addr)); + else if(H5F_addr_defined(fspace->sect_addr)) { + /* Here the metadata cache is managing the section info. + * + * Do some sanity checks, and then test to see if the section + * info is in real file space. If it isn't relocate it into + * real file space lest the header be written to file with + * a nonsense section info address. + */ + HDassert(fspace->serial_sect_count > 0); + HDassert(fspace->sect_size > 0); + HDassert(fspace->alloc_sect_size == (size_t)fspace->sect_size); + + if(H5F_IS_TMP_ADDR(f, fspace->sect_addr)) { + unsigned sect_status = 0; + haddr_t new_sect_addr; + + /* we have work to do -- must relocate section info into + * real file space. + * + * Since the section info address is in temporary space (AKA + * imaginary space), it follows that the entry must be in + * cache. Further, since fspace->sinfo is NULL, it must be + * unprotected and un-pinned. Start by verifying this. + */ + if(H5AC_get_entry_status(f, fspace->sect_addr, §_status) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info status") + + HDassert(sect_status & H5AC_ES__IN_CACHE); + HDassert((sect_status & H5AC_ES__IS_PROTECTED) == 0); + HDassert((sect_status & H5AC_ES__IS_PINNED) == 0); - if(fspace->cache_info.is_dirty) { - uint8_t *hdr; /* Pointer to header buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ + /* Allocate space for the section info in file */ + if(HADDR_UNDEF == (new_sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't wrap buffer") + fspace->alloc_sect_size = (size_t)fspace->sect_size; - /* Get a pointer to a buffer that's large enough for header */ - if(NULL == (hdr = (uint8_t *)H5WB_actual(wb, fspace->hdr_size))) - HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "can't get actual buffer") + /* Sanity check */ + HDassert(!H5F_addr_eq(fspace->sect_addr, new_sect_addr)); - /* Get temporary pointer to header */ - p = hdr; + /* Let the metadata cache know the section info moved */ + if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, fspace->sect_addr, new_sect_addr) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTMOVE, FAIL, "unable to move section info") - /* Magic number */ - HDmemcpy(p, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; + /* Update the internal address for the section info */ + fspace->sect_addr = new_sect_addr; - /* Version # */ - *p++ = H5FS_HDR_VERSION; + /* No need to mark the header dirty, as we are about to + * serialize it. + */ + } /* end if */ + } /* end else-if */ + else { /* there is no section info at present */ + /* do some sanity checks */ + HDassert(fspace->serial_sect_count == 0); + HDassert(fspace->tot_sect_count == fspace->ghost_sect_count); + } /* end else */ - /* Client ID */ - *p++ = fspace->client; + /* what ever happened above, set *flags to 0 */ + *flags = 0; - /* Total space tracked */ - H5F_ENCODE_LENGTH(f, p, fspace->tot_space); +done: + FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) +} /* end H5FS__cache_hdr_pre_serialize() */ - /* Total # of free space sections tracked */ - H5F_ENCODE_LENGTH(f, p, fspace->tot_sect_count); + +/*------------------------------------------------------------------------- + * Function: H5FS__cache_hdr_serialize + * + * Purpose: Given an instance of H5FS_t and a suitably sized buffer, + * serialize the contents of the instance of H5FS_t and write + * its contents to the buffer. This buffer will be used to + * write the image of the instance to file. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t len, + void *_thing) +{ + H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to the object */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ + herr_t ret_value = SUCCEED; /* Return value */ - /* # of serializable free space sections tracked */ - H5F_ENCODE_LENGTH(f, p, fspace->serial_sect_count); + FUNC_ENTER_STATIC_NOERR - /* # of ghost free space sections tracked */ - H5F_ENCODE_LENGTH(f, p, fspace->ghost_sect_count); + /* Check arguments */ + HDassert(f); + HDassert(image); + HDassert(fspace); + HDassert(fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); + HDassert(fspace->hdr_size == len); + + /* The section information does not always exits, and if it does, + * it is not always in the cache. To make matters more interesting, + * even if it is in the cache, it may not be in real file space. + * + * The pre-serialize function should have moved the section info + * into real file space if necessary before this function was called. + * The following asserts are a cursory check on this. + */ + HDassert((! H5F_addr_defined(fspace->sect_addr)) || (! H5F_IS_TMP_ADDR(f, fspace->sect_addr))); + HDassert((! H5F_addr_defined(fspace->sect_addr)) || + ((fspace->serial_sect_count > 0) && + (fspace->sect_size > 0) && + (fspace->alloc_sect_size == (size_t)fspace->sect_size))); - /* # of section classes */ - UINT16ENCODE(p, fspace->nclasses); + /* Magic number */ + HDmemcpy(image, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; - /* Shrink percent */ - UINT16ENCODE(p, fspace->shrink_percent); + /* Version # */ + *image++ = H5FS_HDR_VERSION; - /* Expand percent */ - UINT16ENCODE(p, fspace->expand_percent); + /* Client ID */ + *image++ = fspace->client; - /* Size of address space free space sections are within (log2 of actual value) */ - UINT16ENCODE(p, fspace->max_sect_addr); + /* Total space tracked */ + H5F_ENCODE_LENGTH(f, image, fspace->tot_space); - /* Max. size of section to track */ - H5F_ENCODE_LENGTH(f, p, fspace->max_sect_size); + /* Total # of free space sections tracked */ + H5F_ENCODE_LENGTH(f, image, fspace->tot_sect_count); - /* Address of serialized free space sections */ - H5F_addr_encode(f, &p, fspace->sect_addr); + /* # of serializable free space sections tracked */ + H5F_ENCODE_LENGTH(f, image, fspace->serial_sect_count); - /* Size of serialized free space sections */ - H5F_ENCODE_LENGTH(f, p, fspace->sect_size); + /* # of ghost free space sections tracked */ + H5F_ENCODE_LENGTH(f, image, fspace->ghost_sect_count); - /* Allocated size of serialized free space sections */ - H5F_ENCODE_LENGTH(f, p, fspace->alloc_sect_size); + /* # of section classes */ + UINT16ENCODE(image, fspace->nclasses); - /* Compute checksum */ - metadata_chksum = H5_checksum_metadata(hdr, (size_t)(p - (uint8_t *)hdr), 0); + /* Shrink percent */ + UINT16ENCODE(image, fspace->shrink_percent); - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); + /* Expand percent */ + UINT16ENCODE(image, fspace->expand_percent); - /* Write the free space header. */ - HDassert((size_t)(p - hdr) == fspace->hdr_size); - if(H5F_block_write(f, H5FD_MEM_FSPACE_HDR, addr, fspace->hdr_size, dxpl_id, hdr) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFLUSH, FAIL, "unable to save free space header to disk") + /* Size of address space free space sections are within (log2 of + * actual value) + */ + UINT16ENCODE(image, fspace->max_sect_addr); - fspace->cache_info.is_dirty = FALSE; - } /* end if */ + /* Max. size of section to track */ + H5F_ENCODE_LENGTH(f, image, fspace->max_sect_size); - if(destroy) - if(H5FS_cache_hdr_dest(f, fspace) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space header") + /* Address of serialized free space sections */ + H5F_addr_encode(f, &image, fspace->sect_addr); -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_FSPACE, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") + /* Size of serialized free space sections */ + H5F_ENCODE_LENGTH(f, image, fspace->sect_size); + + /* Allocated size of serialized free space sections */ + H5F_ENCODE_LENGTH(f, image, fspace->alloc_sect_size); + + /* Compute checksum */ + metadata_chksum = H5_checksum_metadata((uint8_t *)_image, (size_t)(image - (uint8_t *)_image), 0); + + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); + + /* sanity checks */ + HDassert((size_t)(image - (uint8_t *)_image) == fspace->hdr_size); FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_cache_hdr_flush() */ +} /* H5FS__cache_hdr_serialize() */ + +/***************************************/ +/* no H5FS__cache_hdr_notify() function */ +/***************************************/ /*------------------------------------------------------------------------- - * Function: H5FS_cache_hdr_dest + * Function: H5FS__cache_hdr_free_icr * * Purpose: Destroys a free space header in memory. * - * Return: Non-negative on success/Negative on failure + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). + * + * Return: Success: SUCCEED + * Failure: FAIL * * Programmer: Quincey Koziol * koziol@ncsa.uiuc.edu @@ -436,175 +733,133 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_cache_hdr_dest(H5F_t *f, H5FS_t *fspace) +H5FS__cache_hdr_free_icr(void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to the object */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* Check arguments */ + /* Sanity checks */ HDassert(fspace); + HDassert(fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); /* We should not still be holding on to the free space section info */ HDassert(!fspace->sinfo); - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!fspace->cache_info.free_file_space_on_destroy || H5F_addr_defined(fspace->cache_info.addr)); - - /* Check for freeing file space for free space header */ - if(fspace->cache_info.free_file_space_on_destroy) { - /* Sanity check */ - HDassert(H5F_addr_defined(fspace->addr)); - - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_FSPACE_HDR, H5AC_dxpl_id, fspace->cache_info.addr, (hsize_t)fspace->hdr_size) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to free free space header") - } /* end if */ - /* Destroy free space header */ if(H5FS__hdr_dest(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space header") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_cache_hdr_dest() */ +} /* end H5FS__cache_hdr_free_icr() */ - -/*------------------------------------------------------------------------- - * Function: H5FS_cache_hdr_clear - * - * Purpose: Mark a free space header in memory as non-dirty. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * May 2 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5FS_cache_hdr_clear(H5F_t *f, H5FS_t *fspace, hbool_t destroy) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* - * Check arguments. - */ - HDassert(fspace); - - /* Reset the dirty flag. */ - fspace->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5FS_cache_hdr_dest(f, fspace) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space header") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_cache_hdr_clear() */ +/********************************************************/ +/* metadata cache callback definitions for section info */ +/********************************************************/ /*------------------------------------------------------------------------- - * Function: H5FS_cache_hdr_size + * Function: H5FS__cache_sinfo_get_load_size() * - * Purpose: Compute the size in bytes of a free space header - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Compute the size of the on disk image of the free space + * manager section info, and place this value in *image_len. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * May 2 2006 + * Programmer: John Mainzer + * 7/7/14 * *------------------------------------------------------------------------- */ -static herr_t -H5FS_cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5FS_t *fspace, size_t *size_ptr) +static herr_t +H5FS__cache_sinfo_get_load_size(const void *_udata, size_t *image_len) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + const H5FS_t *fspace; /* free space manager */ + const H5FS_sinfo_cache_ud_t *udata = (const H5FS_sinfo_cache_ud_t *)_udata; /* User data for callback */ - /* check arguments */ - HDassert(f); + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ + HDassert(udata); + fspace = udata->fspace; HDassert(fspace); - HDassert(size_ptr); + HDassert(fspace->sect_size > 0); + HDassert(image_len); - /* Set size value */ - *size_ptr = fspace->hdr_size; + *image_len = (size_t)(fspace->sect_size); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5FS_cache_hdr_size() */ +} /* end H5FS__cache_sinfo_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5FS_cache_sinfo_load + * Function: H5FS__cache_sinfo_deserialize * - * Purpose: Loads free space sections from the disk. + * Purpose: Given a buffer containing the on disk image of the free space + * manager section info, allocate an instance of H5FS_sinfo_t, load + * it with the data contained in the image, and return a pointer to + * the new instance. * - * Return: Success: Pointer to a new free space section info - * Failure: NULL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * July 31 2006 + * Return: Success: Pointer to in core representation + * Failure: NULL + * + * Programmer: John Mainzer + * 7/7/14 * *------------------------------------------------------------------------- */ -static H5FS_sinfo_t * -H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, void *_udata) +static void * +H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata, + hbool_t *dirty) { - H5FS_sinfo_t *sinfo = NULL; /* Free space section info */ - H5FS_sinfo_cache_ud_t *udata = (H5FS_sinfo_cache_ud_t *)_udata; /* user data for callback */ - haddr_t fs_addr; /* Free space header address */ - size_t old_sect_size; /* Old section size */ - uint8_t *buf = NULL; /* Temporary buffer */ - const uint8_t *p; /* Pointer into raw data buffer */ - uint32_t stored_chksum; /* Stored metadata checksum value */ - uint32_t computed_chksum; /* Computed metadata checksum value */ - H5FS_sinfo_t *ret_value; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Check arguments */ - HDassert(f); + H5FS_sinfo_cache_ud_t *udata = (H5FS_sinfo_cache_ud_t *)_udata; /* User data for callback */ + H5FS_t *fspace; /* free space manager */ + H5FS_sinfo_t *sinfo = NULL; /* Free space section info */ + haddr_t fs_addr; /* Free space header address */ + size_t old_sect_size; /* Old section size */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ + uint32_t stored_chksum; /* Stored metadata checksum */ + uint32_t computed_chksum; /* Computed metadata checksum */ + void * ret_value; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity checks */ + HDassert(image); HDassert(udata); + fspace = udata->fspace; + HDassert(fspace); + HDassert(fspace->sect_size == len); + HDassert(dirty); /* Allocate a new free space section info */ - if(NULL == (sinfo = H5FS_sinfo_new(udata->f, udata->fspace))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - - /* Allocate space for the buffer to serialize the sections into */ - H5_CHECKED_ASSIGN(old_sect_size, size_t, udata->fspace->sect_size, hsize_t); - if(NULL == (buf = H5FL_BLK_MALLOC(sect_block, (size_t)udata->fspace->sect_size))) + if(NULL == (sinfo = H5FS_sinfo_new(udata->f, fspace))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - /* Read buffer from disk */ - if(H5F_block_read(f, H5FD_MEM_FSPACE_SINFO, udata->fspace->sect_addr, (size_t)udata->fspace->sect_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_READERROR, NULL, "can't read free space sections") - - /* Deserialize free sections from buffer available */ - p = buf; + /* initialize old_sect_size */ + H5_CHECKED_ASSIGN(old_sect_size, size_t, udata->fspace->sect_size, hsize_t); /* Magic number */ - if(HDmemcmp(p, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC)) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space sections signature") - p += H5_SIZEOF_MAGIC; + if(HDmemcmp(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space sections signature") + image += H5_SIZEOF_MAGIC; /* Version */ - if(*p++ != H5FS_SINFO_VERSION) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space sections version") + if(*image++ != H5FS_SINFO_VERSION) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space sections version") /* Address of free space header for these sections */ - H5F_addr_decode(udata->f, &p, &fs_addr); + H5F_addr_decode(udata->f, &image, &fs_addr); if(H5F_addr_ne(fs_addr, udata->fspace->addr)) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "incorrect header address for free space sections") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "incorrect header address for free space sections") /* Check for any serialized sections */ - if(udata->fspace->serial_sect_count > 0) { + if(fspace->serial_sect_count > 0) { hsize_t old_tot_sect_count; /* Total section count from header */ hsize_t old_serial_sect_count; /* Total serializable section count from header */ hsize_t old_ghost_sect_count; /* Total ghost section count from header */ @@ -615,27 +870,27 @@ H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, void sect_cnt_size = H5VM_limit_enc_size((uint64_t)udata->fspace->serial_sect_count); /* Reset the section count, the "add" routine will update it */ - old_tot_sect_count = udata->fspace->tot_sect_count; - old_serial_sect_count = udata->fspace->serial_sect_count; - old_ghost_sect_count = udata->fspace->ghost_sect_count; - old_tot_space = udata->fspace->tot_space; - udata->fspace->tot_sect_count = 0; - udata->fspace->serial_sect_count = 0; - udata->fspace->ghost_sect_count = 0; - udata->fspace->tot_space = 0; - - /* Walk through the buffer, deserializing sections */ + old_tot_sect_count = fspace->tot_sect_count; + old_serial_sect_count = fspace->serial_sect_count; + old_ghost_sect_count = fspace->ghost_sect_count; + old_tot_space = fspace->tot_space; + fspace->tot_sect_count = 0; + fspace->serial_sect_count = 0; + fspace->ghost_sect_count = 0; + fspace->tot_space = 0; + + /* Walk through the image, deserializing sections */ do { hsize_t sect_size; /* Current section size */ size_t node_count; /* # of sections of this size */ size_t u; /* Local index variable */ /* The number of sections of this node's size */ - UINT64DECODE_VAR(p, node_count, sect_cnt_size); + UINT64DECODE_VAR(image, node_count, sect_cnt_size); HDassert(node_count); /* The size of the sections for this node */ - UINT64DECODE_VAR(p, sect_size, sinfo->sect_len_size); + UINT64DECODE_VAR(image, sect_size, sinfo->sect_len_size); HDassert(sect_size); /* Loop over nodes of this size */ @@ -646,324 +901,306 @@ H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, void unsigned des_flags; /* Flags from deserialize callback */ /* The address of the section */ - UINT64DECODE_VAR(p, sect_addr, sinfo->sect_off_size); + UINT64DECODE_VAR(image, sect_addr, sinfo->sect_off_size); /* The type of this section */ - sect_type = *p++; + sect_type = *image++; /* Call 'deserialize' callback for this section */ des_flags = 0; HDassert(udata->fspace->sect_cls[sect_type].deserialize); - if(NULL == (new_sect = (*udata->fspace->sect_cls[sect_type].deserialize)(&udata->fspace->sect_cls[sect_type], udata->dxpl_id, p, sect_addr, sect_size, &des_flags))) + if(NULL == (new_sect = (*fspace->sect_cls[sect_type].deserialize) (&fspace->sect_cls[sect_type], udata->dxpl_id, image, sect_addr, sect_size, &des_flags))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTDECODE, NULL, "can't deserialize section") - /* Update offset in serialization buffer */ - p += udata->fspace->sect_cls[sect_type].serial_size; + /* Update offset in serialization image */ + image += udata->fspace->sect_cls[sect_type].serial_size; /* Insert section in free space manager, unless requested not to */ if(!(des_flags & H5FS_DESERIALIZE_NO_ADD)) if(H5FS_sect_add(udata->f, udata->dxpl_id, udata->fspace, new_sect, H5FS_ADD_DESERIALIZING, NULL) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, NULL, "can't add section to free space manager") } /* end for */ - } while(p < ((buf + old_sect_size) - H5FS_SIZEOF_CHKSUM)); + } while(image < (((const uint8_t *)_image + old_sect_size) - H5FS_SIZEOF_CHKSUM)); /* Sanity check */ - HDassert((size_t)(p - buf) == (old_sect_size - H5FS_SIZEOF_CHKSUM)); - HDassert(old_sect_size == udata->fspace->sect_size); - HDassert(old_tot_sect_count == udata->fspace->tot_sect_count); - HDassert(old_serial_sect_count == udata->fspace->serial_sect_count); - HDassert(old_ghost_sect_count == udata->fspace->ghost_sect_count); - HDassert(old_tot_space == udata->fspace->tot_space); + HDassert((size_t)(image - (const uint8_t *)_image) == (old_sect_size - H5FS_SIZEOF_CHKSUM)); + HDassert(old_sect_size == fspace->sect_size); + HDassert(old_tot_sect_count == fspace->tot_sect_count); + HDassert(old_serial_sect_count == fspace->serial_sect_count); + HDassert(old_ghost_sect_count == fspace->ghost_sect_count); + HDassert(old_tot_space == fspace->tot_space); } /* end if */ /* Compute checksum on indirect block */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - (const uint8_t *)buf), 0); + computed_chksum = H5_checksum_metadata((const uint8_t *)_image, (size_t)(image - (const uint8_t *)_image), 0); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Verify checksum */ if(stored_chksum != computed_chksum) - HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, NULL, "incorrect metadata checksum for fractal heap indirect block") + HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, NULL, "incorrect metadata checksum for fractal heap indirect block") /* Sanity check */ - HDassert((size_t)(p - (const uint8_t *)buf) == old_sect_size); + HDassert((size_t)(image - (const uint8_t *)_image) == old_sect_size); /* Set return value */ ret_value = sinfo; done: - if(buf) - buf = H5FL_BLK_FREE(sect_block, buf); if(!ret_value && sinfo) if(H5FS_sinfo_dest(sinfo) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTFREE, NULL, "unable to destroy free space info") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_cache_sinfo_load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* end H5FS__cache_sinfo_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5FS_sinfo_serialize_sect_cb + * Function: H5FS__cache_sinfo_image_len * - * Purpose: Skip list iterator callback to serialize free space sections - * of a particular size + * Purpose: Compute the size of the data structure on disk and return + * it in *image_len. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Monday, May 8, 2006 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * August 14, 2013 * *------------------------------------------------------------------------- */ static herr_t -H5FS_sinfo_serialize_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) +H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - H5FS_section_class_t *sect_cls; /* Class of section */ - H5FS_section_info_t *sect= (H5FS_section_info_t *)_item; /* Free space section to work on */ - H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Check arguments. */ - HDassert(sect); - HDassert(udata->sinfo); - HDassert(udata->p); + const H5FS_sinfo_t *sinfo = (const H5FS_sinfo_t *)_thing; /* Pointer to the object */ + const H5FS_t *fspace; /* Free space header */ - /* Get section's class */ - sect_cls = &udata->sinfo->fspace->sect_cls[sect->type]; - - /* Check if this section should be serialized (i.e. is not a ghost section) */ - if(!(sect_cls->flags & H5FS_CLS_GHOST_OBJ)) { - /* The address of the section */ - UINT64ENCODE_VAR(*udata->p, sect->addr, udata->sinfo->sect_off_size); - - /* The type of this section */ - *(*udata->p)++ = (uint8_t)sect->type; + FUNC_ENTER_STATIC_NOERR - /* Call 'serialize' callback for this section */ - if(sect_cls->serialize) { - if((*sect_cls->serialize)(sect_cls, sect, *udata->p) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTSERIALIZE, FAIL, "can't syncronize section") + /* Sanity checks */ + HDassert(sinfo); + HDassert(sinfo->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); + fspace = sinfo->fspace; + HDassert(fspace); + HDassert(fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); + HDassert(image_len); - /* Update offset in serialization buffer */ - (*udata->p) += sect_cls->serial_size; - } /* end if */ - else - HDassert(sect_cls->serial_size == 0); - } /* end if */ + /* Set the image length size */ + H5_CHECKED_ASSIGN(*image_len, size_t, sinfo->fspace->alloc_sect_size, hsize_t); -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sinfo_serialize_sect_cb() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5FS__cache_sinfo_image_len() */ /*------------------------------------------------------------------------- - * Function: H5FS_sinfo_serialize_node_cb + * Function: H5FS__cache_sinfo_pre_serialize * - * Purpose: Skip list iterator callback to serialize free space sections - * in a bin + * Purpose: The objective of this function is to test to see if file space + * for the section info is located in temporary (AKA imaginary) file + * space. If it is, relocate file space for the section info to + * regular file space. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * Monday, May 8, 2006 + * Programmer: John Mainzer + * 7/7/14 * *------------------------------------------------------------------------- */ -static herr_t -H5FS_sinfo_serialize_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) +static herr_t +H5FS__cache_sinfo_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing, + haddr_t addr, size_t len, size_t H5_ATTR_UNUSED compressed_len, haddr_t *new_addr, + size_t *new_len, size_t H5_ATTR_UNUSED *new_compressed_len, unsigned *flags) { - H5FS_node_t *fspace_node = (H5FS_node_t *)_item; /* Free space size node to work on */ - H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ - herr_t ret_value = SUCCEED; /* Return value */ + H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */ + H5FS_t *fspace; /* Free space header */ + haddr_t sinfo_addr; /* Address for section info */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* Check arguments. */ - HDassert(fspace_node); - HDassert(udata->sinfo); - HDassert(udata->p); + /* Sanity checks */ + HDassert(f); + HDassert(sinfo); + HDassert(sinfo->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); + fspace = sinfo->fspace; + HDassert(fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); + HDassert(fspace->cache_info.is_pinned); + HDassert(H5F_addr_defined(addr)); + HDassert(H5F_addr_eq(fspace->sect_addr, addr)); + HDassert(fspace->sect_size == len); + HDassert(new_addr); + HDassert(new_len); + HDassert(flags); - /* Check if this node has any serializable sections */ - if(fspace_node->serial_count > 0) { - /* The number of serializable sections of this node's size */ - UINT64ENCODE_VAR(*udata->p, fspace_node->serial_count, udata->sect_cnt_size); + /* we shouldn't be called if the section info is empty */ + HDassert(fspace->serial_sect_count > 0); - /* The size of the sections for this node */ - UINT64ENCODE_VAR(*udata->p, fspace_node->sect_size, udata->sinfo->sect_len_size); + sinfo_addr = addr; /* this will change if we relocate the section data */ - /* Iterate through all the sections of this size */ - HDassert(fspace_node->sect_list); - if(H5SL_iterate(fspace_node->sect_list, H5FS_sinfo_serialize_sect_cb, udata) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section nodes") + /* Check for section info at temporary address */ + if(H5F_IS_TMP_ADDR(f, fspace->sect_addr)) { + /* Sanity check */ + HDassert(fspace->sect_size > 0); + HDassert(H5F_addr_eq(fspace->sect_addr, addr)); + + /* Allocate space for the section info in file */ + if(HADDR_UNDEF == (sinfo_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") + + fspace->alloc_sect_size = (size_t)fspace->sect_size; + + /* Sanity check */ + HDassert(!H5F_addr_eq(sinfo->fspace->sect_addr, sinfo_addr)); + + /* Let the metadata cache know the section info moved */ + if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, sinfo->fspace->sect_addr, sinfo_addr) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTMOVE, FAIL, "unable to move section info") + + /* Update the internal address for the section info */ + sinfo->fspace->sect_addr = sinfo_addr; + + /* Mark free space header as dirty */ + if(H5AC_mark_entry_dirty(fspace) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") + } /* end if */ + + if(!H5F_addr_eq(addr, sinfo_addr)) { + *new_addr = sinfo_addr; + *flags = H5C__SERIALIZE_MOVED_FLAG; } /* end if */ + else + *flags = 0; done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_sinfo_serialize_node_cb() */ +} /* end H5FS__cache_sinfo_pre_serialize() */ /*------------------------------------------------------------------------- - * Function: H5FS_cache_sinfo_flush + * Function: H5FS__cache_sinfo_serialize * - * Purpose: Flushes a dirty free space section info to disk. + * Purpose: Given an instance of H5FS_sinfo_t and a suitably sized buffer, + * serialize the contents of the instance of H5FS_sinfo_t and write + * its contents to the buffer. This buffer will be used to write + * the image of the instance to file. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * July 31 2006 + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ -static herr_t -H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_sinfo_t *sinfo, unsigned H5_ATTR_UNUSED * flags_ptr) +static herr_t +H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len, + void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */ + H5FS_t *fspace; /* Free space header */ + H5FS_iter_ud_t udata; /* User data for callbacks */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ + unsigned bin; /* Current bin we are on */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* check arguments */ + /* Sanity checks */ HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); HDassert(sinfo); - HDassert(sinfo->fspace); - HDassert(sinfo->fspace->sect_cls); - - if(sinfo->cache_info.is_dirty || sinfo->dirty) { - H5FS_iter_ud_t udata; /* User data for callbacks */ - uint8_t *buf = NULL; /* Temporary raw data buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - unsigned bin; /* Current bin we are on */ - - /* Sanity check address */ - if(H5F_addr_ne(addr, sinfo->fspace->sect_addr)) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, FAIL, "incorrect address for free space sections") + HDassert(sinfo->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); + fspace = sinfo->fspace; + HDassert(fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); + HDassert(fspace->cache_info.is_pinned); + HDassert(fspace->sect_size == len); + HDassert(fspace->sect_cls); - /* Allocate temporary buffer */ - if((buf = H5FL_BLK_MALLOC(sect_block, (size_t)sinfo->fspace->sect_size)) == NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - p = buf; - - /* Magic number */ - HDmemcpy(p, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; - - /* Version # */ - *p++ = H5FS_SINFO_VERSION; - - /* Address of free space header for these sections */ - H5F_addr_encode(f, &p, sinfo->fspace->addr); - - /* Set up user data for iterator */ - udata.sinfo = sinfo; - udata.p = &p; - udata.sect_cnt_size = H5VM_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); - - /* Iterate over all the bins */ - for(bin = 0; bin < sinfo->nbins; bin++) - /* Check if there are any sections in this bin */ - if(sinfo->bins[bin].bin_list) - /* Iterate over list of section size nodes for bin */ - if(H5SL_iterate(sinfo->bins[bin].bin_list, H5FS_sinfo_serialize_node_cb, &udata) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section size nodes") - - /* Compute checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); - - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); - - /* Sanity check */ - HDassert((size_t)(p - buf) == sinfo->fspace->sect_size); - HDassert(sinfo->fspace->sect_size <= sinfo->fspace->alloc_sect_size); - - /* Check for section info at temporary address */ - if(H5F_IS_TMP_ADDR(f, sinfo->fspace->sect_addr)) { - /* Sanity check */ - HDassert(sinfo->fspace->sect_size > 0); - HDassert(H5F_addr_eq(sinfo->fspace->sect_addr, addr)); - - /* Allocate space for the section info in file */ - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, sinfo->fspace->sect_size))) - HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") - sinfo->fspace->alloc_sect_size = (size_t)sinfo->fspace->sect_size; + /* Magic number */ + HDmemcpy(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; - /* Sanity check */ - HDassert(!H5F_addr_eq(sinfo->fspace->sect_addr, addr)); + /* Version # */ + *image++ = H5FS_SINFO_VERSION; - /* Let the metadata cache know the section info moved */ - if(H5AC_move_entry(f, H5AC_FSPACE_SINFO, sinfo->fspace->sect_addr, addr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move indirect block") + /* Address of free space header for these sections */ + H5F_addr_encode(f, &image, sinfo->fspace->addr); - /* Update the internal address for the section info */ - sinfo->fspace->sect_addr = addr; + /* Set up user data for iterator */ + udata.sinfo = sinfo; + udata.image = ℑ + udata.sect_cnt_size = H5VM_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); - /* Mark free space header as dirty */ - if(H5AC_mark_entry_dirty(sinfo->fspace) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") - } /* end if */ + /* Iterate over all the bins */ + for(bin = 0; bin < sinfo->nbins; bin++) + /* Check if there are any sections in this bin */ + if(sinfo->bins[bin].bin_list) + /* Iterate over list of section size nodes for bin */ + if(H5SL_iterate(sinfo->bins[bin].bin_list, H5FS__sinfo_serialize_node_cb, &udata) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section size nodes") - /* Write buffer to disk */ - if(H5F_block_write(f, H5FD_MEM_FSPACE_SINFO, sinfo->fspace->sect_addr, (size_t)sinfo->fspace->sect_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFLUSH, FAIL, "unable to save free space sections to disk") - buf = H5FL_BLK_FREE(sect_block, buf); + /* Compute checksum */ + metadata_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0); - sinfo->cache_info.is_dirty = FALSE; - sinfo->dirty = FALSE; - } /* end if */ + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); - if(destroy) - if(H5FS_cache_sinfo_dest(f, sinfo) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space section info") + /* Sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) == sinfo->fspace->sect_size); + HDassert(sinfo->fspace->sect_size <= sinfo->fspace->alloc_sect_size); done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_cache_sinfo_flush() */ +} /* end H5FS__cache_sinfo_serialize() */ /*------------------------------------------------------------------------- - * Function: H5FS_cache_sinfo_dest + * Function: H5FS__cache_sinfo_free_icr * - * Purpose: Destroys a free space section info in memory. + * Purpose: Free the memory used for the in core representation of the + * free space manager section info. * - * Return: Non-negative on success/Negative on failure + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * July 31 2006 + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ -static herr_t -H5FS_cache_sinfo_dest(H5F_t *f, H5FS_sinfo_t *sinfo) +static herr_t +H5FS__cache_sinfo_free_icr(void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */ + H5FS_t *fspace; /* Free space header */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* Check arguments */ + /* Sanity checks */ HDassert(sinfo); - - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!sinfo->cache_info.free_file_space_on_destroy || H5F_addr_defined(sinfo->cache_info.addr)); - - /* Check for freeing file space for free space section info */ - if(sinfo->cache_info.free_file_space_on_destroy) { - /* Sanity check */ - HDassert(sinfo->fspace->alloc_sect_size > 0); - - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(!H5F_IS_TMP_ADDR(f, sinfo->cache_info.addr)) - if(H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, H5AC_dxpl_id, sinfo->cache_info.addr, (hsize_t)sinfo->fspace->alloc_sect_size) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to free free space section info") - } /* end if */ + HDassert(sinfo->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); + fspace = sinfo->fspace; + HDassert(fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); + HDassert(fspace->cache_info.is_pinned); /* Destroy free space info */ if(H5FS_sinfo_dest(sinfo) < 0) @@ -971,73 +1208,107 @@ H5FS_cache_sinfo_dest(H5F_t *f, H5FS_sinfo_t *sinfo) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_cache_sinfo_dest() */ +} /* end H5FS__cache_sinfo_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5FS_cache_sinfo_clear + * Function: H5FS__sinfo_serialize_sect_cb * - * Purpose: Mark a free space section info in memory as non-dirty. + * Purpose: Skip list iterator callback to serialize free space sections + * of a particular size * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * July 31 2006 + * Monday, May 8, 2006 * *------------------------------------------------------------------------- */ static herr_t -H5FS_cache_sinfo_clear(H5F_t *f, H5FS_sinfo_t *sinfo, hbool_t destroy) +H5FS__sinfo_serialize_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) { + H5FS_section_class_t *sect_cls; /* Class of section */ + H5FS_section_info_t *sect= (H5FS_section_info_t *)_item; /* Free space section to work on */ + H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* - * Check arguments. - */ - HDassert(sinfo); + /* Check arguments. */ + HDassert(sect); + HDassert(udata->sinfo); + HDassert(udata->image); - /* Reset the dirty flag. */ - sinfo->cache_info.is_dirty = FALSE; + /* Get section's class */ + sect_cls = &udata->sinfo->fspace->sect_cls[sect->type]; - if(destroy) - if(H5FS_cache_sinfo_dest(f, sinfo) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space section info") + /* Check if this section should be serialized (i.e. is not a ghost section) */ + if(!(sect_cls->flags & H5FS_CLS_GHOST_OBJ)) { + /* The address of the section */ + UINT64ENCODE_VAR(*udata->image, sect->addr, udata->sinfo->sect_off_size); + + /* The type of this section */ + *(*udata->image)++ = (uint8_t)sect->type; + + /* Call 'serialize' callback for this section */ + if(sect_cls->serialize) { + if((*sect_cls->serialize)(sect_cls, sect, *udata->image) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTSERIALIZE, FAIL, "can't syncronize section") + + /* Update offset in serialization buffer */ + (*udata->image) += sect_cls->serial_size; + } /* end if */ + else + HDassert(sect_cls->serial_size == 0); + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_cache_sinfo_clear() */ +} /* H5FS__sinfo_serialize_sect_cb() */ /*------------------------------------------------------------------------- - * Function: H5FS_cache_sinfo_size + * Function: H5FS__sinfo_serialize_node_cb * - * Purpose: Compute the size in bytes of a free space section info - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Skip list iterator callback to serialize free space sections + * in a bin * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * July 31 2006 + * Monday, May 8, 2006 * *------------------------------------------------------------------------- */ static herr_t -H5FS_cache_sinfo_size(const H5F_t H5_ATTR_UNUSED *f, const H5FS_sinfo_t *sinfo, size_t *size_ptr) +H5FS__sinfo_serialize_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + H5FS_node_t *fspace_node = (H5FS_node_t *)_item; /* Free space size node to work on */ + H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ + herr_t ret_value = SUCCEED; /* Return value */ - /* check arguments */ - HDassert(sinfo); - HDassert(size_ptr); + FUNC_ENTER_STATIC + + /* Check arguments. */ + HDassert(fspace_node); + HDassert(udata->sinfo); + HDassert(udata->image); - /* Set size value */ - H5_CHECKED_ASSIGN(*size_ptr, size_t, sinfo->fspace->alloc_sect_size, hsize_t); + /* Check if this node has any serializable sections */ + if(fspace_node->serial_count > 0) { + /* The number of serializable sections of this node's size */ + UINT64ENCODE_VAR(*udata->image, fspace_node->serial_count, udata->sect_cnt_size); - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5FS_cache_sinfo_size() */ + /* The size of the sections for this node */ + UINT64ENCODE_VAR(*udata->image, fspace_node->sect_size, udata->sinfo->sect_len_size); + + /* Iterate through all the sections of this size */ + HDassert(fspace_node->sect_list); + if(H5SL_iterate(fspace_node->sect_list, H5FS__sinfo_serialize_sect_cb, udata) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section nodes") + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5FS__sinfo_serialize_node_cb() */ diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index b180efd..de66ebd 100644 --- a/src/H5FSdbg.c +++ b/src/H5FSdbg.c @@ -121,7 +121,7 @@ H5FS_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int /* * Load the free space header. */ - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, addr, &cache_udata, H5AC_READ))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, FAIL, "unable to load free space header") /* Print opening message */ @@ -263,7 +263,7 @@ H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *str /* * Load the free space header. */ - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC_READ))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, FAIL, "unable to load free space header") /* Retrieve the client id */ diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index 78afde8..2c1eba7 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -182,7 +182,9 @@ struct H5FS_t { unsigned sinfo_lock_count; /* # of times the section info has been locked */ hbool_t sinfo_protected; /* Whether the section info was protected when locked */ hbool_t sinfo_modified; /* Whether the section info has been modified while locked */ - H5AC_protect_t sinfo_accmode; /* Access mode for protecting the section info */ + unsigned sinfo_accmode; /* Access mode for protecting the section info */ + /* must be either H5C__NO_FLAGS_SET (i.e r/w) */ + /* or H5AC__READ_ONLY_FLAG (i.e. r/o). */ size_t max_cls_serial_size; /* Max. additional size of serialized form of section */ hsize_t threshold; /* Threshold for alignment */ hsize_t alignment; /* Alignment */ diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 8fe4075..0b47f51 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -204,7 +204,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sinfo_lock(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5AC_protect_t accmode) +H5FS_sinfo_lock(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, unsigned accmode) { H5FS_sinfo_cache_ud_t cache_udata; /* User-data for cache callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -220,14 +220,21 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" HDassert(f); HDassert(fspace); + /* only H5AC__READ_ONLY_FLAG may appear in accmode */ + HDassert((accmode & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* If the free space header doesn't already "own" the section info, load * section info or create it */ if(fspace->sinfo) { /* Check if the section info was protected & we want a different access mode */ + + /* only H5AC__READ_ONLY_FLAG may appear in fspace->sinfo_accmode */ + HDassert(((fspace->sinfo_accmode) & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + if(fspace->sinfo_protected && accmode != fspace->sinfo_accmode) { /* Check if we need to switch from read-only access to read-write */ - if(H5AC_WRITE == accmode) { + if(0 == (accmode & (unsigned)(~H5AC__READ_ONLY_FLAG))) { /* Unprotect the read-only section info */ if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space section info") @@ -236,11 +243,11 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" cache_udata.f = f; cache_udata.dxpl_id = dxpl_id; cache_udata.fspace = fspace; - if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, &cache_udata, H5AC_WRITE))) + if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to load free space sections") /* Switch the access mode we have */ - fspace->sinfo_accmode = H5AC_WRITE; + fspace->sinfo_accmode = H5AC__NO_FLAGS_SET; } /* end if */ } /* end if */ } /* end if */ @@ -331,7 +338,7 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" /* Check if we modified any section */ if(modified) { /* Check if the section info was protected with a different access mode */ - if(fspace->sinfo_protected && fspace->sinfo_accmode != H5AC_WRITE) + if(fspace->sinfo_protected && (0 != ((fspace->sinfo_accmode) & H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTDIRTY, FAIL, "attempt to modify read-only section info") /* If we modified the section info, mark it dirty */ @@ -915,7 +922,7 @@ H5FS_sect_remove(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, HDassert(sect); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC_WRITE) < 0) + if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -1396,7 +1403,7 @@ HDfprintf(stderr, "%s: *sect = {%a, %Hu, %u, %s}\n", FUNC, sect->addr, sect->siz HDassert(sect->size); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC_WRITE) < 0) + if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -1494,7 +1501,7 @@ HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_se H5FS_section_info_t *sect; /* Temporary free space section */ /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC_WRITE) < 0) + if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -1613,7 +1620,7 @@ H5FS_sect_try_merge(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_info_t HDassert(sect->size); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC_WRITE) < 0) + if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; saved_fs_size = sect->size; @@ -1849,7 +1856,7 @@ HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_se #endif /* QAK */ if(fspace->tot_sect_count > 0) { /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC_WRITE) < 0) + if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -1997,7 +2004,7 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_c unsigned bin; /* Current bin we are on */ /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC_READ) < 0) + if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__READ_ONLY_FLAG) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -2089,7 +2096,7 @@ H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, HDassert(new_class < fspace->nclasses); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC_WRITE) < 0) + if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -2403,7 +2410,7 @@ H5FS_sect_try_shrink_eoa(const H5F_t *f, hid_t dxpl_id, const H5FS_t *fspace, vo /* Check arguments. */ HDassert(fspace); - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC_WRITE) < 0) + if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; diff --git a/src/H5Fint.c b/src/H5Fint.c index df8e886..0e77349 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -803,6 +803,14 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") } /* end if */ + /* if it exists, unpin the driver information block cache entry, + * since we're about to destroy the cache + */ + if(f->shared->drvinfo) + if(H5AC_unpin_entry(f->shared->drvinfo) < 0) + /* Push error, but keep going*/ + HDONE_ERROR(H5E_FSPACE, H5E_CANTUNPIN, FAIL, "unable to unpin drvinfo") + /* Unpin the superblock, since we're about to destroy the cache */ if(H5AC_unpin_entry(f->shared->sblock) < 0) /* Push error, but keep going*/ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 9f70e12..175fa88 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -81,6 +81,21 @@ #define H5F_SUPERBLOCK_FIXED_SIZE ( H5F_SIGNATURE_LEN \ + 1) /* superblock version */ +/* The H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE is the minimal amount of super block + * variable length data guarnateed to load the sizeof offsets and the sizeof + * lengths fields in all versions of the superblock. + * + * This is necessary in the V3 cache, as on the initial load, we need to + * get enough of the superblock to determine its version and size so that + * the metadata cache can load the correct amount of data from file to + * allow the second deserialization attempt to succeed. + * + * The value selected will have to be revisited for each new version + * of the super block. Note that the current value is one byte larger + * than it needs to be. + */ +#define H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE 7 + /* Macros for computing variable-size superblock size */ #define H5F_SUPERBLOCK_VARLEN_SIZE_COMMON \ (2 /* freespace, and root group versions */ \ @@ -113,20 +128,38 @@ + (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(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)) +#define H5F_SUPERBLOCK_VARLEN_SIZE(v, sizeof_addr, sizeof_size) ( \ + (v == 0 ? H5F_SUPERBLOCK_VARLEN_SIZE_V0(sizeof_addr, sizeof_size) : 0) \ + + (v == 1 ? H5F_SUPERBLOCK_VARLEN_SIZE_V1(sizeof_addr, sizeof_size) : 0) \ + + (v == 2 ? H5F_SUPERBLOCK_VARLEN_SIZE_V2(sizeof_addr) : 0)) /* Total size of superblock, depends on superblock version */ -#define H5F_SUPERBLOCK_SIZE(v, f) ( H5F_SUPERBLOCK_FIXED_SIZE \ - + H5F_SUPERBLOCK_VARLEN_SIZE(v, f)) +#define H5F_SUPERBLOCK_SIZE(s) ( H5F_SUPERBLOCK_FIXED_SIZE \ + + H5F_SUPERBLOCK_VARLEN_SIZE((s)->super_vers, (s)->sizeof_addr, (s)->sizeof_size)) /* Forward declaration external file cache struct used below (defined in * H5Fefc.c) */ typedef struct H5F_efc_t H5F_efc_t; +/* Structure for passing 'user data' to superblock cache callbacks */ +typedef struct H5F_superblock_cache_ud_t { +/* IN: */ + H5F_t *f; /* Pointer to file */ + hbool_t ignore_drvrinfo; /* Indicate if the driver info should be ignored */ +/* OUT: */ + unsigned sym_leaf_k; /* Symbol table leaf node's 'K' value */ + unsigned btree_k[H5B_NUM_BTREE_ID]; /* B-tree key values for each type */ + haddr_t stored_eof; /* End-of-file in file */ + hbool_t drvrinfo_removed; /* Indicate if the driver info was removed */ +} H5F_superblock_cache_ud_t; + +/* Structure for passing 'user data' to driver info block cache callbacks */ +typedef struct H5F_drvrinfo_cache_ud_t { + H5F_t *f; /* Pointer to file */ + haddr_t driver_addr; /* address of driver info block */ +} H5F_drvrinfo_cache_ud_t; + /* Structure for metadata & "small [raw] data" block aggregation fields */ struct H5F_blk_aggr_t { unsigned long feature_flag; /* Feature flag type */ @@ -176,6 +209,8 @@ typedef struct H5F_mtab_t { typedef struct H5F_super_t { H5AC_info_t cache_info; /* Cache entry information structure */ unsigned super_vers; /* Superblock version */ + uint8_t sizeof_addr; /* Size of addresses in file */ + uint8_t sizeof_size; /* Size of offsets in file */ uint8_t status_flags; /* File status flags */ unsigned sym_leaf_k; /* Size of leaves in symbol tables */ unsigned btree_k[H5B_NUM_BTREE_ID]; /* B-tree key values for each type */ @@ -197,6 +232,13 @@ typedef struct H5F_super_t { struct H5F_file_t { H5FD_t *lf; /* Lower level file handle for I/O */ H5F_super_t *sblock; /* Pointer to (pinned) superblock for file */ + H5O_drvinfo_t *drvinfo; /* Pointer to the (pinned) driver info + * cache entry. This field is only defined + * for older versions of the super block, + * and then only when a driver information + * block is present. At all other times + * it should be NULL. + */ unsigned nrefs; /* Ref count for times file is opened */ unsigned flags; /* Access Permissions for file */ H5F_mtab_t mtab; /* File mount table */ @@ -283,6 +325,7 @@ H5FL_EXTERN(H5F_t); H5FL_EXTERN(H5F_file_t); H5_DLLVAR const H5AC_class_t H5AC_SUPERBLOCK[1]; +H5_DLLVAR const H5AC_class_t H5AC_DRVRINFO[1]; /******************************/ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 166247a..e83330d 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -258,14 +258,21 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id) { H5P_genplist_t *dxpl; /* DXPL object */ H5F_super_t * sblock = NULL; /* Superblock structure */ + H5F_superblock_cache_ud_t udata; /* User data for cache callbacks */ + H5P_genplist_t *c_plist; /* File creation property list */ unsigned sblock_flags = H5AC__NO_FLAGS_SET; /* flags used in superblock unprotect call */ haddr_t super_addr; /* Absolute address of superblock */ - H5AC_protect_t rw; /* Read/write permissions for file */ - hbool_t dirtied = FALSE; /* Bool for sblock protect call */ + haddr_t eof; /* End of file address */ + unsigned rw_flags; /* Read/write permissions for file */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) + /* initialize the drvinfo to NULL -- we will overwrite this if there + * is a driver information block + */ + f->shared->drvinfo = NULL; + /* Get the DXPL plist object for DXPL ID */ if(NULL == (dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") @@ -284,23 +291,358 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id) } /* end if */ /* Determine file intent for superblock protect */ - if(H5F_INTENT(f) & H5F_ACC_RDWR) - rw = H5AC_WRITE; - else - rw = H5AC_READ; + + /* Must tell cache at protect time that the super block is to be + * flushed last (and collectively in the parallel case). + */ + rw_flags = H5AC__FLUSH_LAST_FLAG; +#ifdef H5_HAVE_PARALLEL + rw_flags |= H5C__FLUSH_COLLECTIVELY_FLAG; +#endif /* H5_HAVE_PARALLEL */ + if(!(H5F_INTENT(f) & H5F_ACC_RDWR)) + rw_flags |= H5AC__READ_ONLY_FLAG; + + /* Get the shared file creation property list */ + if(NULL == (c_plist = (H5P_genplist_t *)H5I_object(f->shared->fcpl_id))) + HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "can't get property list") + + /* Make certain we can read the fixed-size portion of the superblock */ + if(H5F__set_eoa(f, H5FD_MEM_SUPER, + H5F_SUPERBLOCK_FIXED_SIZE + H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "set end of space allocation request failed") + + /* Set up the user data for cache callbacks */ + udata.f = f; + udata.ignore_drvrinfo = H5F_HAS_FEATURE(f, H5FD_FEAT_IGNORE_DRVRINFO); + udata.sym_leaf_k = 0; + if(H5P_get(c_plist, H5F_CRT_BTREE_RANK_NAME, udata.btree_k) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get rank for btree internal nodes") + udata.stored_eof = HADDR_UNDEF; + udata.drvrinfo_removed = FALSE; /* Look up the superblock */ - if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, &dirtied, rw))) + if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, &udata, rw_flags))) HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load superblock") - /* Mark the superblock dirty if it was modified during loading or VFD indicated to do so */ - if((H5AC_WRITE == rw) && (dirtied || H5F_HAS_FEATURE(f, H5FD_FEAT_DIRTY_SBLK_LOAD))) - sblock_flags |= H5AC__DIRTIED_FLAG; - /* Pin the superblock in the cache */ if(H5AC_pin_protected_entry(sblock) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTPIN, FAIL, "unable to pin superblock") + /* Mark the superblock dirty if it was modified during loading */ + if(((rw_flags & H5AC__READ_ONLY_FLAG) == 0) && udata.ignore_drvrinfo && udata.drvrinfo_removed) { + HDassert(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2); + sblock_flags |= H5AC__DIRTIED_FLAG; + } /* end if */ + + /* The superblock must be flushed last (and collectively in parallel) */ + sblock_flags |= H5AC__FLUSH_LAST_FLAG; +#ifdef H5_HAVE_PARALLEL + sblock_flags |= H5AC__FLUSH_COLLECTIVELY_FLAG; +#endif /* H5_HAVE_PARALLEL */ + + /* Check if superblock address is different from base address and adjust + * base address and "end of address" address if so. + */ + if(!H5F_addr_eq(super_addr, sblock->base_addr)) { + /* Check if the superblock moved earlier in the file */ + if(H5F_addr_lt(super_addr, sblock->base_addr)) + udata.stored_eof -= (sblock->base_addr - super_addr); + else + /* The superblock moved later in the file */ + udata.stored_eof += (super_addr - sblock->base_addr); + + /* Adjust base address for offsets of the HDF5 data in the file */ + sblock->base_addr = super_addr; + + /* Set the base address for the file in the VFD now */ + if(H5F__set_base_addr(f, sblock->base_addr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "failed to set base address for file driver") + + /* Indicate that the superblock should be marked dirty */ + if((rw_flags & H5AC__READ_ONLY_FLAG) == 0) + sblock_flags |= H5AC__DIRTIED_FLAG; + } /* end if */ + + /* Set information in the file's creation property list */ + if(H5P_set(c_plist, H5F_CRT_SUPER_VERS_NAME, &sblock->super_vers) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set superblock version") + if(H5P_set(c_plist, H5F_CRT_ADDR_BYTE_NUM_NAME, &sblock->sizeof_addr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set byte number in an address") + if(H5P_set(c_plist, H5F_CRT_OBJ_BYTE_NUM_NAME, &sblock->sizeof_size) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set byte number for object size") + + /* Handle the B-tree 'K' values */ + if(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2) { + /* Sanity check */ + HDassert(udata.sym_leaf_k != 0); + + /* Set the symbol table internal node 'K' value */ + if(H5P_set(c_plist, H5F_CRT_SYM_LEAF_NAME, &udata.sym_leaf_k) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set rank for symbol table leaf nodes") + sblock->sym_leaf_k = udata.sym_leaf_k; + + /* Set the B-tree internal node values, etc */ + if(H5P_set(c_plist, H5F_CRT_BTREE_RANK_NAME, udata.btree_k) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set rank for btree internal nodes") + HDmemcpy(sblock->btree_k, udata.btree_k, sizeof(unsigned) * (size_t)H5B_NUM_BTREE_ID); + } /* end if */ + else { + /* Get the (default) B-tree internal node values, etc */ + /* (Note: these may be reset in a superblock extension) */ + if(H5P_get(c_plist, H5F_CRT_BTREE_RANK_NAME, sblock->btree_k) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get rank for btree internal nodes") + if(H5P_get(c_plist, H5F_CRT_SYM_LEAF_NAME, &sblock->sym_leaf_k) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get rank for btree internal nodes") + } /* end else */ + + /* + * The user-defined data is the area of the file before the base + * address. + */ + if(H5P_set(c_plist, H5F_CRT_USER_BLOCK_NAME, &sblock->base_addr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set userblock size") + + /* + * Make sure that the data is not truncated. One case where this is + * possible is if the first file of a family of files was opened + * individually. + */ + if(HADDR_UNDEF == (eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT))) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to determine file size") + + /* (Account for the stored EOA being absolute offset -QAK) */ + if((eof + sblock->base_addr) < udata.stored_eof) + HGOTO_ERROR(H5E_FILE, H5E_TRUNCATED, FAIL, "truncated file: eof = %llu, sblock->base_addr = %llu, stored_eoa = %llu", (unsigned long long)eof, (unsigned long long)sblock->base_addr, (unsigned long long)udata.stored_eof) + + /* + * Tell the file driver how much address space has already been + * allocated so that it knows how to allocate additional memory. + */ + + /* Decode the optional driver information block */ + if(H5F_addr_defined(sblock->driver_addr)) { + H5O_drvinfo_t *drvinfo; /* Driver info */ + H5F_drvrinfo_cache_ud_t drvrinfo_udata; /* User data for metadata callbacks */ + unsigned drvinfo_flags = H5AC__NO_FLAGS_SET; /* Flags used in driver info block unprotect call */ + + /* Sanity check - driver info block should only be defined for + * superblock version < 2. + */ + HDassert(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2); + + /* Set up user data */ + drvrinfo_udata.f = f; + drvrinfo_udata.driver_addr = sblock->driver_addr; + + /* extend EOA so we can read at least the fixed sized + * portion of the driver info block + */ + if(H5FD_set_eoa(f->shared->lf, H5FD_MEM_SUPER, sblock->driver_addr + H5F_DRVINFOBLOCK_HDR_SIZE) < 0) /* will extend eoa later if required */ + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, \ + "set end of space allocation request failed") + + /* Look up the driver info block */ + if(NULL == (drvinfo = (H5O_drvinfo_t *)H5AC_protect(f, dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, &drvrinfo_udata, rw_flags))) + HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load driver info block") + + /* Loading the driver info block is enough to set up the right info */ + + /* Check if we need to rewrite the driver info block info */ + if ( ( (rw_flags & H5AC__READ_ONLY_FLAG) == 0 ) && + ( H5F_HAS_FEATURE(f, H5FD_FEAT_DIRTY_DRVRINFO_LOAD) ) ) { + + drvinfo_flags |= H5AC__DIRTIED_FLAG; + } /* end if */ + + /* set the pin entry flag so that the driver information block + * cache entry will be pinned in the cache. + */ + drvinfo_flags |= H5AC__PIN_ENTRY_FLAG; + + /* Release the driver info block */ + if(H5AC_unprotect(f, dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, drvinfo, drvinfo_flags) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTUNPROTECT, FAIL, "unable to release driver info block") + + /* save a pointer to the driver information cache entry */ + f->shared->drvinfo = drvinfo; + } /* end if */ + + /* (Account for the stored EOA being absolute offset -NAF) */ + if(H5F__set_eoa(f, H5FD_MEM_SUPER, udata.stored_eof - sblock->base_addr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set end-of-address marker for file") + + /* Decode the optional superblock extension info */ + if(H5F_addr_defined(sblock->ext_addr)) { + H5O_loc_t ext_loc; /* "Object location" for superblock extension */ + H5O_btreek_t btreek; /* v1 B-tree 'K' value message from superblock extension */ + H5O_drvinfo_t drvinfo; /* Driver info message from superblock extension */ + size_t u; /* Local index variable */ + htri_t status; /* Status for message existing */ + + /* Sanity check - superblock extension should only be defined for + * superblock version >= 2. + */ + HDassert(sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); + + /* Check for superblock extension being located "outside" the stored + * 'eoa' value, which can occur with the split/multi VFD. + */ + if(H5F_addr_gt(sblock->ext_addr, udata.stored_eof)) { + /* Set the 'eoa' for the object header memory type large enough + * to give some room for a reasonably sized superblock extension. + * (This is _rather_ a kludge -QAK) + */ + if(H5F__set_eoa(f, H5FD_MEM_OHDR, (haddr_t)(sblock->ext_addr + 1024)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set end-of-address marker for file") + } /* end if */ + + /* Open the superblock extension */ + if(H5F_super_ext_open(f, sblock->ext_addr, &ext_loc) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "unable to open file's superblock extension") + + /* Check for the extension having a 'driver info' message */ + if((status = H5O_msg_exists(&ext_loc, H5O_DRVINFO_ID, dxpl_id)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_EXISTS, FAIL, "unable to read object header") + if(status) { + /* Check for ignoring the driver info for this file */ + if(!udata.ignore_drvrinfo) { + + /* Retrieve the 'driver info' structure */ + if(NULL == H5O_msg_read(&ext_loc, H5O_DRVINFO_ID, &drvinfo, dxpl_id)) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "driver info message not present") + + /* Validate and decode driver information */ + if(H5FD_sb_load(f->shared->lf, drvinfo.name, drvinfo.buf) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, FAIL, "unable to decode driver information") + + /* Reset driver info message */ + H5O_msg_reset(H5O_DRVINFO_ID, &drvinfo); + } /* end else */ + } /* end if */ + + /* Read in the shared OH message information if there is any */ + if(H5SM_get_info(&ext_loc, c_plist, dxpl_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to read SOHM table information") + + /* Check for the extension having a 'v1 B-tree "K"' message */ + if((status = H5O_msg_exists(&ext_loc, H5O_BTREEK_ID, dxpl_id)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_EXISTS, FAIL, "unable to read object header") + if(status) { + /* Retrieve the 'v1 B-tree "K"' structure */ + if(NULL == H5O_msg_read(&ext_loc, H5O_BTREEK_ID, &btreek, dxpl_id)) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "v1 B-tree 'K' info message not present") + + /* Set non-default v1 B-tree 'K' value info from file */ + sblock->btree_k[H5B_CHUNK_ID] = btreek.btree_k[H5B_CHUNK_ID]; + sblock->btree_k[H5B_SNODE_ID] = btreek.btree_k[H5B_SNODE_ID]; + sblock->sym_leaf_k = btreek.sym_leaf_k; + + /* Set non-default v1 B-tree 'K' values in the property list */ + if(H5P_set(c_plist, H5F_CRT_BTREE_RANK_NAME, btreek.btree_k) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set rank for btree internal nodes") + if(H5P_set(c_plist, H5F_CRT_SYM_LEAF_NAME, &btreek.sym_leaf_k) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set rank for symbol table leaf nodes") + } /* end if */ + + /* Check for the extension having a 'free-space manager info' message */ + if((status = H5O_msg_exists(&ext_loc, H5O_FSINFO_ID, dxpl_id)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_EXISTS, FAIL, "unable to read object header") + if(status) { + H5O_fsinfo_t fsinfo; /* Free-space manager info message from superblock extension */ + + /* Retrieve the 'free-space manager info' structure */ + if(NULL == H5O_msg_read(&ext_loc, H5O_FSINFO_ID, &fsinfo, dxpl_id)) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get free-space manager info message") + + /* Check for non-default info */ + if(f->shared->fs_strategy != fsinfo.strategy) { + f->shared->fs_strategy = fsinfo.strategy; + + /* Set non-default strategy in the property list */ + if(H5P_set(c_plist, H5F_CRT_FILE_SPACE_STRATEGY_NAME, &fsinfo.strategy) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set file space strategy") + } /* end if */ + if(f->shared->fs_threshold != fsinfo.threshold) { + f->shared->fs_threshold = fsinfo.threshold; + + /* Set non-default threshold in the property list */ + if(H5P_set(c_plist, H5F_CRT_FREE_SPACE_THRESHOLD_NAME, &fsinfo.threshold) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set file space strategy") + } /* end if */ + + /* Set free-space manager addresses */ + f->shared->fs_addr[0] = HADDR_UNDEF; + for(u = 1; u < NELMTS(f->shared->fs_addr); u++) + f->shared->fs_addr[u] = fsinfo.fs_addr[u-1]; + } /* end if */ + + /* Close superblock extension */ + if(H5F_super_ext_close(f, &ext_loc, dxpl_id, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close file's superblock extension") + } /* end if */ + + /* Update the driver info if VFD indicated to do so */ + /* (NOTE: only for later versions of superblock, earlier versions are handled + * earlier in this routine. + */ + if(((rw_flags & H5AC__READ_ONLY_FLAG) == 0) && + sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2 && + H5F_addr_defined(sblock->ext_addr)) { + /* Check for modifying the driver info when opening the file */ + if(H5F_HAS_FEATURE(f, H5FD_FEAT_DIRTY_DRVRINFO_LOAD)) { + size_t driver_size; /* Size of driver info block (bytes) */ + + /* Check for driver info message */ + H5_CHECKED_ASSIGN(driver_size, size_t, H5FD_sb_size(f->shared->lf), hsize_t); + if(driver_size > 0) { + H5O_drvinfo_t drvinfo; /* Driver info */ + uint8_t dbuf[H5F_MAX_DRVINFOBLOCK_SIZE]; /* Driver info block encoding buffer */ + + /* Sanity check */ + HDassert(driver_size <= H5F_MAX_DRVINFOBLOCK_SIZE); + + /* Encode driver-specific data */ + if(H5FD_sb_encode(f->shared->lf, drvinfo.name, dbuf) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode driver information") + + /* Set the driver info information for the superblock extension */ + drvinfo.len = driver_size; + drvinfo.buf = dbuf; + + /* Write driver info information to the superblock extension */ + +#if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ + /* KLUGE ALERT!! + * + * H5F_super_ext_write_msg() expects f->shared->sblock to + * be set -- verify that it is NULL, and then set it. + * Set it back to NULL when we are done. + */ + HDassert(f->shared->sblock == NULL); + f->shared->sblock = sblock; +#endif /* JRM */ + + if(H5F_super_ext_write_msg(f, dxpl_id, &drvinfo, H5O_DRVINFO_ID, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension") + +#if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ + f->shared->sblock = NULL; +#endif /* JRM */ + + } /* end if */ + } /* end if */ + /* Check for eliminating the driver info block */ + else if(H5F_HAS_FEATURE(f, H5FD_FEAT_IGNORE_DRVRINFO)) { + /* Remove the driver info message from the superblock extension */ + if(H5F_super_ext_remove_msg(f, dxpl_id, H5O_DRVINFO_ID) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "error in removing message from superblock extension") + + /* Check if the superblock extension was removed */ + if(!H5F_addr_defined(sblock->ext_addr)) + sblock_flags |= H5AC__DIRTIED_FLAG; + } /* end if */ + } /* end if */ + /* Set the pointer to the pinned superblock */ f->shared->sblock = sblock; @@ -309,6 +651,32 @@ done: if(sblock && H5AC_unprotect(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, sblock, sblock_flags) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTUNPROTECT, FAIL, "unable to close superblock") + /* If we have failed, make sure no entries are left in the + * metadata cache, so that it can be shut down and discarded. + */ + if(ret_value < 0) { + /* Unpin and discard drvinfo cache entry */ + if(f->shared->drvinfo) { + if(H5AC_unpin_entry(f->shared->drvinfo) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTUNPIN, FAIL, "unable to unpin driver info") + + /* Evict the driver info block from the cache */ + if(H5AC_expunge_entry(f, dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTEXPUNGE, FAIL, "unable to expunge driver info block") + } /* end if */ + + /* Unpin & discard superblock */ + if(sblock) { + /* Unpin superblock in cache */ + if(H5AC_unpin_entry(sblock) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTUNPIN, FAIL, "unable to unpin superblock") + + /* Evict the superblock from the cache */ + if(H5AC_expunge_entry(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTEXPUNGE, FAIL, "unable to expunge superblock") + } /* end if */ + } /* end if */ + FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* end H5F__super_read() */ @@ -334,6 +702,8 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) { H5F_super_t *sblock = NULL; /* Superblock cache structure */ hbool_t sblock_in_cache = FALSE; /* Whether the superblock has been inserted into the metadata cache */ + H5O_drvinfo_t *drvinfo = NULL; /* Driver info */ + hbool_t drvinfo_in_cache = FALSE; /* Whether the driver info block has been inserted into the metadata cache */ H5P_genplist_t *plist; /* File creation property list */ hsize_t userblock_size; /* Size of userblock, in bytes */ hsize_t superblock_size; /* Size of superblock, in bytes */ @@ -427,11 +797,13 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) 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 */ + /* Save a local copy of the superblock version number, size of addresses & offsets */ sblock->super_vers = super_vers; + sblock->sizeof_addr = f->shared->sizeof_addr; + sblock->sizeof_size = f->shared->sizeof_size; /* Compute the size of the superblock */ - superblock_size = (hsize_t)H5F_SUPERBLOCK_SIZE(super_vers, f); + superblock_size = (hsize_t)H5F_SUPERBLOCK_SIZE(sblock); /* Compute the size of the driver information block */ H5_CHECKED_ASSIGN(driver_size, size_t, H5FD_sb_size(f->shared->lf), hsize_t); @@ -446,10 +818,10 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) } /* end if */ /* - * Allocate space for the userblock, superblock & driver info blocks. - * We do it with one allocation request because the userblock and - * superblock need to be at the beginning of the file and only the first - * allocation request is required to return memory at format address zero. + * Allocate space for the superblock & driver info block. + * We do it with one allocation request because the superblock needs to be + * at the beginning of the file and only the first allocation request is + * required to return memory at format address zero. */ if(super_vers < HDF5_SUPERBLOCK_VERSION_2) superblock_size += driver_size; @@ -466,6 +838,9 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) /* Keep a copy of the superblock info */ f->shared->sblock = sblock; + /* set the drvinfo filed to NULL -- will overwrite this later if needed */ + f->shared->drvinfo = NULL; + /* * Determine if we will need a superblock extension */ @@ -572,6 +947,33 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update free-space info header message") } /* end if */ } /* end if */ + else { + /* Check for creating an "old-style" driver info block */ + if(driver_size > 0) { + /* Sanity check */ + HDassert(H5F_addr_defined(sblock->driver_addr)); + + /* Allocate space for the driver info */ + if(NULL == (drvinfo = (H5O_drvinfo_t *)H5MM_calloc(sizeof(H5O_drvinfo_t)))) + HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "memory allocation failed for driver info message") + + /* Set up driver info message */ + /* (NOTE: All the actual information (name & driver information) is + * actually based on the VFD info in the file handle and + * will be encoded by the VFD's 'encode' callback, so it + * doesn't need to be set here. -QAK, 7/20/2013 + */ + H5_CHECKED_ASSIGN(drvinfo->len, size_t, H5FD_sb_size(f->shared->lf), hsize_t); + + /* Insert driver info block into cache */ + if(H5AC_insert_entry(f, dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, drvinfo, H5AC__PIN_ENTRY_FLAG | H5AC__FLUSH_LAST_FLAG | H5AC__FLUSH_COLLECTIVELY_FLAG) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINS, FAIL, "can't add driver info block to cache") + drvinfo_in_cache = TRUE; + f->shared->drvinfo = drvinfo; + } /* end if */ + else + HDassert(!H5F_addr_defined(sblock->driver_addr)); + } /* end if */ done: /* Close superblock extension, if it was created */ @@ -580,6 +982,23 @@ done: /* Cleanup on failure */ if(ret_value < 0) { + /* Check if the driver info block has been allocated yet */ + if(drvinfo) { + /* Check if we've cached it already */ + if(drvinfo_in_cache) { + /* Unpin drvinfo in cache */ + if(H5AC_unpin_entry(drvinfo) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTUNPIN, FAIL, "unable to unpin driver info") + + /* Evict the driver info block from the cache */ + if(H5AC_expunge_entry(f, dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTEXPUNGE, FAIL, "unable to expunge driver info block") + } /* end if */ + else + /* Free driver info block */ + H5MM_xfree(drvinfo); + } /* end if */ + /* Check if the superblock has been allocated yet */ if(sblock) { /* Check if we've cached it already */ @@ -635,6 +1054,14 @@ H5F_super_dirty(H5F_t *f) if(H5AC_mark_entry_dirty(f->shared->sblock) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") + /* if the driver information block exists, mark it dirty as well + * so that the change in eoa will be reflected there as well if + * appropriate. + */ + if ( f->shared->drvinfo ) + if(H5AC_mark_entry_dirty(f->shared->drvinfo) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark drvinfo as dirty") + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5F_super_dirty() */ @@ -698,7 +1125,7 @@ H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext /* Set the superblock size */ if(super_size) - *super_size = (hsize_t)H5F_SUPERBLOCK_SIZE(f->shared->sblock->super_vers, f); + *super_size = (hsize_t)H5F_SUPERBLOCK_SIZE(f->shared->sblock); /* Set the superblock extension size */ if(super_ext_size) { diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index ded845d..cf14770 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -51,9 +51,6 @@ /* Local Macros */ /****************/ -/* Maximum size of super-block buffers */ -#define H5F_MAX_SUPERBLOCK_SIZE 134 - /******************/ /* Local Typedefs */ @@ -70,28 +67,70 @@ /********************/ /* Metadata cache (H5AC) callbacks */ -static H5F_super_t *H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5F_super_t *sblock); -static herr_t H5F_sblock_dest(H5F_t *f, H5F_super_t * sblock); -static herr_t H5F_sblock_clear(H5F_t *f, H5F_super_t *sblock, hbool_t destroy); -static herr_t H5F_sblock_size(const H5F_t *f, const H5F_super_t *sblock, size_t *size_ptr); +static herr_t H5F__cache_superblock_get_load_size(const void *udata, size_t *image_len); +static void *H5F__cache_superblock_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5F__cache_superblock_image_len(const void *thing, + size_t *image_len, hbool_t *compressed_ptr, + size_t *compressed_image_len_ptr); +static herr_t H5F__cache_superblock_pre_serialize(const H5F_t *f, + hid_t dxpl_id, void *thing, haddr_t addr, size_t len, + size_t compressed_len, haddr_t *new_addr, size_t *new_len, + size_t *new_compressed_len, unsigned *flags); +static herr_t H5F__cache_superblock_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5F__cache_superblock_free_icr(void *thing); + +static herr_t H5F__cache_drvrinfo_get_load_size(const void *udata, size_t *image_len); +static void *H5F__cache_drvrinfo_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5F__cache_drvrinfo_image_len(const void *thing, + size_t *image_len, hbool_t *compressed_ptr, + size_t *compressed_image_len_ptr); +static herr_t H5F__cache_drvrinfo_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5F__cache_drvrinfo_free_icr(void *thing); /*********************/ /* Package Variables */ /*********************/ -/* H5F inherits cache-like properties from H5AC */ +/* H5F superblock inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_SUPERBLOCK[1] = {{ - H5AC_SUPERBLOCK_ID, - (H5AC_load_func_t)H5F_sblock_load, - (H5AC_flush_func_t)H5F_sblock_flush, - (H5AC_dest_func_t)H5F_sblock_dest, - (H5AC_clear_func_t)H5F_sblock_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5F_sblock_size, + H5AC_SUPERBLOCK_ID, /* Metadata client ID */ + "Superblock", /* Metadata client name (for debugging) */ + H5FD_MEM_SUPER, /* File space memory type for client */ + H5AC__CLASS_SPECULATIVE_LOAD_FLAG, /* Client class behavior flags */ + H5F__cache_superblock_get_load_size,/* 'get_load_size' callback */ + H5F__cache_superblock_deserialize, /* 'deserialize' callback */ + H5F__cache_superblock_image_len, /* 'image_len' callback */ + H5F__cache_superblock_pre_serialize,/* 'pre_serialize' callback */ + H5F__cache_superblock_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5F__cache_superblock_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ +}}; + +/* H5F driver info block inherits cache-like properties from H5AC */ +const H5AC_class_t H5AC_DRVRINFO[1] = {{ + H5AC_DRVRINFO_ID, /* Metadata client ID */ + "Driver info block", /* Metadata client name (for debugging) */ + H5FD_MEM_SUPER, /* File space memory type for client */ + H5AC__CLASS_SPECULATIVE_LOAD_FLAG, /* Client class behavior flags */ + H5F__cache_drvrinfo_get_load_size, /* 'get_load_size' callback */ + H5F__cache_drvrinfo_deserialize, /* 'deserialize' callback */ + H5F__cache_drvrinfo_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5F__cache_drvrinfo_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5F__cache_drvrinfo_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; + /*****************************/ /* Library Private Variables */ /*****************************/ @@ -107,546 +146,470 @@ H5FL_EXTERN(H5F_super_t); /*------------------------------------------------------------------------- - * Function: H5F_sblock_load + * Function: H5F__cache_superblock_get_load_size * - * Purpose: Loads the superblock from the file, and deserializes - * its information into the H5F_super_t structure. + * Purpose: Compute the size of the data structure on disk. * - * Return: Success: SUCCEED - * Failure: NULL + * Return: Non-negative on success/Negative on failure * - * Programmer: Mike McGreevy - * mamcgree@hdfgroup.org - * April 8, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 17, 2013 * *------------------------------------------------------------------------- */ -static H5F_super_t * -H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, void *_udata) +static herr_t +H5F__cache_superblock_get_load_size(const void H5_ATTR_UNUSED *udata, size_t *image_len) { - H5F_super_t *sblock = NULL; /* File's superblock */ - haddr_t base_addr = HADDR_UNDEF; /* Base address of file */ - uint8_t sbuf[H5F_MAX_SUPERBLOCK_SIZE]; /* Buffer for superblock */ - H5P_genplist_t *dxpl; /* DXPL object */ - H5P_genplist_t *c_plist; /* File creation property list */ - H5F_file_t *shared; /* shared part of `file' */ - H5FD_t *lf; /* file driver part of `shared' */ - haddr_t stored_eof; /* stored end-of-file address in file */ - haddr_t eof; /* end of file address */ - uint8_t sizeof_addr; /* Size of offsets in the file (in bytes) */ - uint8_t sizeof_size; /* Size of lengths in the file (in bytes) */ - const size_t fixed_size = H5F_SUPERBLOCK_FIXED_SIZE; /*fixed sizeof superblock */ - size_t variable_size; /*variable sizeof superblock */ - uint8_t *p; /* Temporary pointer into encoding buffer */ - unsigned super_vers; /* Superblock version */ - hbool_t *dirtied = (hbool_t *)_udata; /* Set up dirtied out value */ - H5F_super_t *ret_value; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_eq(addr, 0)); - HDassert(dirtied); + HDassert(image_len); - /* Short cuts */ - shared = f->shared; - lf = shared->lf; + /* Set the initial image length size */ + *image_len = H5F_SUPERBLOCK_FIXED_SIZE + /* Fixed size of superblock */ + H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE; - /* Get the shared file creation property list */ - if(NULL == (c_plist = (H5P_genplist_t *)H5I_object(shared->fcpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "can't get property list") + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5F__cache_superblock_get_load_size() */ - /* Get the base address for the file in the VFD */ - if(HADDR_UNDEF == (base_addr = H5FD_get_base_addr(lf))) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "failed to get base address for file driver") + +/*------------------------------------------------------------------------- + * Function: H5F__cache_superblock_deserialize + * + * Purpose: Loads an object from the disk. + * + * Return: Success: Pointer to new object + * Failure: NULL + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 18 2013 + * + *------------------------------------------------------------------------- + */ +static void * +H5F__cache_superblock_deserialize(const void *_image, size_t len, void *_udata, + hbool_t H5_ATTR_UNUSED *dirty) +{ + H5F_super_t *sblock = NULL; /* File's superblock */ + H5F_superblock_cache_ud_t *udata = (H5F_superblock_cache_ud_t *)_udata; /* User data */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ + size_t variable_size; /* Sariable size of superblock */ + unsigned super_vers; /* Superblock version */ + uint8_t sizeof_addr; /* Size of offsets in the file (in bytes) */ + uint8_t sizeof_size; /* Size of lengths in the file (in bytes) */ + H5F_super_t *ret_value; /* Return value */ + + FUNC_ENTER_STATIC + + /* Check arguments */ + HDassert(image); + HDassert(udata); + HDassert(udata->f); /* Allocate space for the superblock */ if(NULL == (sblock = H5FL_CALLOC(H5F_super_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - /* The superblock must be flushed last (and collectively in parallel) */ - sblock->cache_info.flush_me_last = TRUE; -#ifdef H5_HAVE_PARALLEL - sblock->cache_info.flush_me_collectively = TRUE; -#endif - - /* Get the DXPL plist object for DXPL ID */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "can't get property list") - - /* Read fixed-size portion of the superblock */ - p = sbuf; - H5_CHECK_OVERFLOW(fixed_size, size_t, haddr_t); - if(H5FD_set_eoa(lf, H5FD_MEM_SUPER, (haddr_t)fixed_size) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "set end of space allocation request failed") - if(H5FD_read(lf, dxpl, H5FD_MEM_SUPER, (haddr_t)0, fixed_size, p) < 0) - HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock") - /* Skip over signature (already checked when locating the superblock) */ - p += H5F_SIGNATURE_LEN; + image += H5F_SIGNATURE_LEN; /* Superblock version */ - super_vers = *p++; + super_vers = *image++; if(super_vers > HDF5_SUPERBLOCK_VERSION_LATEST) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad superblock version number") - if(H5P_set(c_plist, H5F_CRT_SUPER_VERS_NAME, &super_vers) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set superblock version") /* Record the superblock version */ sblock->super_vers = super_vers; /* Sanity check */ - HDassert(((size_t)(p - sbuf)) == fixed_size); + HDassert(((size_t)(image - (const uint8_t *)_image)) == H5F_SUPERBLOCK_FIXED_SIZE); + HDassert(len >= H5F_SUPERBLOCK_FIXED_SIZE + 6); + + /* Determine the size of addresses & size of offsets, for computing the + * variable-sized portion of the superblock. + */ + if(super_vers < HDF5_SUPERBLOCK_VERSION_2) { + sizeof_addr = image[4]; + sizeof_size = image[5]; + } /* end if */ + else { + sizeof_addr = image[0]; + sizeof_size = image[1]; + } /* end else */ + if(sizeof_addr != 2 && sizeof_addr != 4 && + sizeof_addr != 8 && sizeof_addr != 16 && sizeof_addr != 32) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad byte number in an address") + if(sizeof_size != 2 && sizeof_size != 4 && + sizeof_size != 8 && sizeof_size != 16 && sizeof_size != 32) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad byte number for object size") + sblock->sizeof_addr = sizeof_addr; + sblock->sizeof_size = sizeof_size; /* Determine the size of the variable-length part of the superblock */ - variable_size = (size_t)H5F_SUPERBLOCK_VARLEN_SIZE(super_vers, f); + variable_size = (size_t)H5F_SUPERBLOCK_VARLEN_SIZE(super_vers, sizeof_addr, sizeof_size); HDassert(variable_size > 0); - HDassert(fixed_size + variable_size <= sizeof(sbuf)); - /* Read in variable-sized portion of superblock */ - if(H5FD_set_eoa(lf, H5FD_MEM_SUPER, (haddr_t)(fixed_size + variable_size)) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "set end of space allocation request failed") - if(H5FD_read(lf, dxpl, H5FD_MEM_SUPER, (haddr_t)fixed_size, variable_size, p) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read superblock") + /* Handle metadata cache retry for variable-sized portion of the superblock */ + if(len != (H5F_SUPERBLOCK_FIXED_SIZE + variable_size)) { + /* Sanity check */ + HDassert(len == (H5F_SUPERBLOCK_FIXED_SIZE + H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE)); - /* Check for older version of superblock format */ - if(super_vers < HDF5_SUPERBLOCK_VERSION_2) { - uint32_t status_flags; /* File status flags */ - unsigned btree_k[H5B_NUM_BTREE_ID]; /* B-tree internal node 'K' values */ - unsigned sym_leaf_k; /* Symbol table leaf node's 'K' value */ - - /* Freespace version (hard-wired) */ - if(HDF5_FREESPACE_VERSION != *p++) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad free space version number") - - /* Root group version number (hard-wired) */ - if(HDF5_OBJECTDIR_VERSION != *p++) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad object directory version number") - - /* Skip over reserved byte */ - p++; - - /* Shared header version number (hard-wired) */ - if(HDF5_SHAREDHEADER_VERSION != *p++) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad shared-header format version number") - - /* Size of file addresses */ - sizeof_addr = *p++; - if(sizeof_addr != 2 && sizeof_addr != 4 && - sizeof_addr != 8 && sizeof_addr != 16 && sizeof_addr != 32) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad byte number in an address") - if(H5P_set(c_plist, H5F_CRT_ADDR_BYTE_NUM_NAME, &sizeof_addr) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set byte number in an address") - shared->sizeof_addr = sizeof_addr; /* Keep a local copy also */ - - /* Size of file sizes */ - sizeof_size = *p++; - if(sizeof_size != 2 && sizeof_size != 4 && - sizeof_size != 8 && sizeof_size != 16 && sizeof_size != 32) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad byte number for object size") - if(H5P_set(c_plist, H5F_CRT_OBJ_BYTE_NUM_NAME, &sizeof_size) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set byte number for object size") - shared->sizeof_size = sizeof_size; /* Keep a local copy also */ - - /* Skip over reserved byte */ - p++; - - /* Various B-tree sizes */ - UINT16DECODE(p, sym_leaf_k); - if(sym_leaf_k == 0) - HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, NULL, "bad symbol table leaf node 1/2 rank") - if(H5P_set(c_plist, H5F_CRT_SYM_LEAF_NAME, &sym_leaf_k) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set rank for symbol table leaf nodes") - sblock->sym_leaf_k = sym_leaf_k; /* Keep a local copy also */ - - /* Need 'get' call to set other array values */ - if(H5P_get(c_plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to get rank for btree internal nodes") - UINT16DECODE(p, btree_k[H5B_SNODE_ID]); - if(btree_k[H5B_SNODE_ID] == 0) - HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, NULL, "bad 1/2 rank for btree internal nodes") - /* - * Delay setting the value in the property list until we've checked - * for the indexed storage B-tree internal 'K' value later. - */ - - /* File status flags (not really used yet) */ - UINT32DECODE(p, status_flags); - HDassert(status_flags <= 255); - sblock->status_flags = (uint8_t)status_flags; - if(sblock->status_flags & ~H5F_SUPER_ALL_FLAGS) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad flag value for superblock") - - /* - * If the superblock version # is greater than 0, read in the indexed - * storage B-tree internal 'K' value - */ - if(super_vers > HDF5_SUPERBLOCK_VERSION_DEF) { - UINT16DECODE(p, btree_k[H5B_CHUNK_ID]); - /* Reserved bytes are present only in version 1 */ - if(super_vers == HDF5_SUPERBLOCK_VERSION_1) - p += 2; /* reserved */ - } /* end if */ - else - btree_k[H5B_CHUNK_ID] = HDF5_BTREE_CHUNK_IK_DEF; + /* Make certain we can read the variabled-sized portion of the superblock */ + if(H5F__set_eoa(udata->f, H5FD_MEM_SUPER, (haddr_t)(H5F_SUPERBLOCK_FIXED_SIZE + variable_size)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "set end of space allocation request failed") + } /* end if */ + else { + /* Check for older version of superblock format */ + if(super_vers < HDF5_SUPERBLOCK_VERSION_2) { + uint32_t status_flags; /* File status flags */ + unsigned sym_leaf_k; /* Symbol table leaf node's 'K' value */ + unsigned snode_btree_k; /* B-tree symbol table internal node 'K' value */ + unsigned chunk_btree_k; /* B-tree chunk internal node 'K' value */ + + /* Freespace version (hard-wired) */ + if(HDF5_FREESPACE_VERSION != *image++) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad free space version number") + + /* Root group version number (hard-wired) */ + if(HDF5_OBJECTDIR_VERSION != *image++) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad object directory version number") + + /* Skip over reserved byte */ + image++; + + /* Shared header version number (hard-wired) */ + if(HDF5_SHAREDHEADER_VERSION != *image++) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad shared-header format version number") + + /* Size of file addresses */ + sizeof_addr = *image++; + if(sizeof_addr != 2 && sizeof_addr != 4 && + sizeof_addr != 8 && sizeof_addr != 16 && sizeof_addr != 32) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad byte number in an address") + sblock->sizeof_addr = sizeof_addr; + udata->f->shared->sizeof_addr = sizeof_addr; /* Keep a local copy also */ + + /* Size of file sizes */ + sizeof_size = *image++; + if(sizeof_size != 2 && sizeof_size != 4 && + sizeof_size != 8 && sizeof_size != 16 && sizeof_size != 32) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad byte number for object size") + sblock->sizeof_size = sizeof_size; + udata->f->shared->sizeof_size = sizeof_size; /* Keep a local copy also */ + + /* Skip over reserved byte */ + image++; + + /* Various B-tree sizes */ + UINT16DECODE(image, sym_leaf_k); + if(sym_leaf_k == 0) + HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, NULL, "bad symbol table leaf node 1/2 rank") + udata->sym_leaf_k = sym_leaf_k; /* Keep a local copy also */ + + /* Need 'get' call to set other array values */ + UINT16DECODE(image, snode_btree_k); + if(snode_btree_k == 0) + HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, NULL, "bad 1/2 rank for btree internal nodes") + udata->btree_k[H5B_SNODE_ID] = snode_btree_k; - /* Set the B-tree internal node values, etc */ - if(H5P_set(c_plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set rank for btree internal nodes") - HDmemcpy(sblock->btree_k, btree_k, sizeof(unsigned) * (size_t)H5B_NUM_BTREE_ID); /* Keep a local copy also */ + /* + * Delay setting the value in the property list until we've checked + * for the indexed storage B-tree internal 'K' value later. + */ - /* Remainder of "variable-sized" portion of superblock */ - H5F_addr_decode(f, (const uint8_t **)&p, &sblock->base_addr/*out*/); - H5F_addr_decode(f, (const uint8_t **)&p, &sblock->ext_addr/*out*/); - H5F_addr_decode(f, (const uint8_t **)&p, &stored_eof/*out*/); - H5F_addr_decode(f, (const uint8_t **)&p, &sblock->driver_addr/*out*/); + /* File status flags (not really used yet) */ + UINT32DECODE(image, status_flags); + HDassert(status_flags <= 255); + sblock->status_flags = (uint8_t)status_flags; + if(sblock->status_flags & ~H5F_SUPER_ALL_FLAGS) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad flag value for superblock") - /* Allocate space for the root group symbol table entry */ - HDassert(!sblock->root_ent); - if(NULL == (sblock->root_ent = (H5G_entry_t *)H5MM_calloc(sizeof(H5G_entry_t)))) - HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, NULL, "can't allocate space for root group symbol table entry") + /* + * If the superblock version # is greater than 0, read in the indexed + * storage B-tree internal 'K' value + */ + if(super_vers > HDF5_SUPERBLOCK_VERSION_DEF) { + UINT16DECODE(image, chunk_btree_k); - /* decode the root group symbol table entry */ - if(H5G_ent_decode(f, (const uint8_t **)&p, sblock->root_ent) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, NULL, "can't decode root group symbol table entry") + /* Reserved bytes are present only in version 1 */ + if(super_vers == HDF5_SUPERBLOCK_VERSION_1) + image += 2; /* reserved */ + } /* end if */ + else + chunk_btree_k = HDF5_BTREE_CHUNK_IK_DEF; + udata->btree_k[H5B_CHUNK_ID] = chunk_btree_k; + + /* Remainder of "variable-sized" portion of superblock */ + H5F_addr_decode(udata->f, (const uint8_t **)&image, &sblock->base_addr/*out*/); + H5F_addr_decode(udata->f, (const uint8_t **)&image, &sblock->ext_addr/*out*/); + H5F_addr_decode(udata->f, (const uint8_t **)&image, &udata->stored_eof/*out*/); + H5F_addr_decode(udata->f, (const uint8_t **)&image, &sblock->driver_addr/*out*/); + + /* Allocate space for the root group symbol table entry */ + HDassert(!sblock->root_ent); + if(NULL == (sblock->root_ent = (H5G_entry_t *)H5MM_calloc(sizeof(H5G_entry_t)))) + HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, NULL, "can't allocate space for root group symbol table entry") + + /* decode the root group symbol table entry */ + if(H5G_ent_decode(udata->f, (const uint8_t **)&image, sblock->root_ent) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, NULL, "can't decode root group symbol table entry") + + /* Set the root group address to the correct value */ + sblock->root_addr = sblock->root_ent->header; + + /* This step is for h5repart tool only. If user wants to change file driver + * from family to sec2 while using h5repart, set the driver address to + * undefined to let the library ignore the family driver information saved + * in the superblock. + */ + if(udata->ignore_drvrinfo && H5F_addr_defined(sblock->driver_addr)) { + /* Eliminate the driver info */ + sblock->driver_addr = HADDR_UNDEF; + udata->drvrinfo_removed = TRUE; + } /* end if */ - /* Set the root group address to the correct value */ - sblock->root_addr = sblock->root_ent->header; + /* NOTE: Driver info block is decoded separately, later */ - /* - * Check if superblock address is different from base address and - * adjust base address and "end of address" address if so. - */ - if(!H5F_addr_eq(base_addr, sblock->base_addr)) { - /* Check if the superblock moved earlier in the file */ - if(H5F_addr_lt(base_addr, sblock->base_addr)) - stored_eof -= (sblock->base_addr - base_addr); - else - /* The superblock moved later in the file */ - stored_eof += (base_addr - sblock->base_addr); + } /* end if */ + else { + uint32_t computed_chksum; /* Computed checksum */ + uint32_t read_chksum; /* Checksum read from file */ + + /* Size of file addresses */ + sizeof_addr = *image++; + if(sizeof_addr != 2 && sizeof_addr != 4 && + sizeof_addr != 8 && sizeof_addr != 16 && sizeof_addr != 32) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad byte number in an address") + sblock->sizeof_addr = sizeof_addr; + udata->f->shared->sizeof_addr = sizeof_addr; /* Keep a local copy also */ + + /* Size of file sizes */ + sizeof_size = *image++; + if(sizeof_size != 2 && sizeof_size != 4 && + sizeof_size != 8 && sizeof_size != 16 && sizeof_size != 32) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad byte number for object size") + sblock->sizeof_size = sizeof_size; + udata->f->shared->sizeof_size = sizeof_size; /* Keep a local copy also */ + + /* File status flags (not really used yet) */ + sblock->status_flags = *image++; + if(sblock->status_flags & ~H5F_SUPER_ALL_FLAGS) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad flag value for superblock") + + /* Base, superblock extension, end of file & root group object header addresses */ + H5F_addr_decode(udata->f, (const uint8_t **)&image, &sblock->base_addr/*out*/); + H5F_addr_decode(udata->f, (const uint8_t **)&image, &sblock->ext_addr/*out*/); + H5F_addr_decode(udata->f, (const uint8_t **)&image, &udata->stored_eof/*out*/); + H5F_addr_decode(udata->f, (const uint8_t **)&image, &sblock->root_addr/*out*/); + + /* Compute checksum for superblock */ + computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (const uint8_t *)_image), 0); + + /* Decode checksum */ + UINT32DECODE(image, read_chksum); + + /* Verify correct checksum */ + if(read_chksum != computed_chksum) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "bad checksum on driver information block") + + /* The Driver Information Block may not appear with the version + * 2 super block. Thus we set the driver_addr field of the in + * core representation of the super block HADDR_UNDEF to prevent + * any attempt to load the Driver Information Block. + */ + sblock->driver_addr = HADDR_UNDEF; + } /* end else */ + } /* end else */ - /* Adjust base address for offsets of the HDF5 data in the file */ - sblock->base_addr = base_addr; + /* Sanity check */ + HDassert((size_t)(image - (const uint8_t *)_image) <= len); - /* Set the base address for the file in the VFD now */ - if(H5FD_set_base_addr(lf, sblock->base_addr) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, NULL, "failed to set base address for file driver") + /* Set return value */ + ret_value = sblock; - /* Indicate that the superblock should be marked dirty */ - *dirtied = TRUE; - } /* end if */ +done: + /* Release the [possibly partially initialized] superblock on error */ + if(!ret_value && sblock) + if(H5F__super_free(sblock) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTFREE, NULL, "unable to destroy superblock data") - /* This step is for h5repart tool only. If user wants to change file driver - * from family to sec2 while using h5repart, set the driver address to - * undefined to let the library ignore the family driver information saved - * in the superblock. - */ - if(H5F_HAS_FEATURE(f, H5FD_FEAT_IGNORE_DRVRINFO)) { - /* Eliminate the driver info */ - sblock->driver_addr = HADDR_UNDEF; + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__cache_superblock_deserialize() */ - /* Indicate that the superblock should be marked dirty */ - *dirtied = TRUE; - } /* end if */ + +/*------------------------------------------------------------------------- + * Function: H5F__cache_superblock_image_len + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 19, 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5F__cache_superblock_image_len(const void *_thing, size_t *image_len, hbool_t *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) +{ + const H5F_super_t *sblock = (const H5F_super_t *)_thing; /* Pointer to the object */ - /* Decode the optional driver information block */ - if(H5F_addr_defined(sblock->driver_addr)) { - uint8_t dbuf[H5F_MAX_DRVINFOBLOCK_SIZE]; /* Buffer for driver info block */ - char drv_name[9]; /* Name of driver */ - unsigned drv_vers; /* Version of driver info block */ - size_t drv_variable_size; /* Size of variable-length portion of driver info block, in bytes */ - - /* Read in fixed-sized portion of driver info block */ - p = dbuf; - if(H5FD_set_eoa(lf, H5FD_MEM_SUPER, sblock->driver_addr + H5F_DRVINFOBLOCK_HDR_SIZE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "set end of space allocation request failed") - if(H5FD_read(lf, dxpl, H5FD_MEM_SUPER, sblock->driver_addr, (size_t)H5F_DRVINFOBLOCK_HDR_SIZE, p) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read driver information block") - - /* Version number */ - drv_vers = *p++; - if(drv_vers != HDF5_DRIVERINFO_VERSION_0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "bad driver information block version number") - - p += 3; /* reserved bytes */ - - /* Driver info size */ - UINT32DECODE(p, drv_variable_size); - - /* Sanity check */ - HDassert(H5F_DRVINFOBLOCK_HDR_SIZE + drv_variable_size <= sizeof(dbuf)); - - /* Driver name and/or version */ - HDstrncpy(drv_name, (const char *)p, (size_t)8); - drv_name[8] = '\0'; - p += 8; /* advance past name/version */ - - /* Read in variable-sized portion of driver info block */ - if(H5FD_set_eoa(lf, H5FD_MEM_SUPER, sblock->driver_addr + H5F_DRVINFOBLOCK_HDR_SIZE + drv_variable_size) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "set end of space allocation request failed") - if(H5FD_read(lf, dxpl, H5FD_MEM_SUPER, sblock->driver_addr + H5F_DRVINFOBLOCK_HDR_SIZE, drv_variable_size, p) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read file driver information") - - /* Decode driver information */ - if(H5FD_sb_load(lf, drv_name, p) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to decode driver information") - } /* end if */ - } /* end if */ - else { - uint32_t computed_chksum; /* Computed checksum */ - uint32_t read_chksum; /* Checksum read from file */ - - /* Size of file addresses */ - sizeof_addr = *p++; - if(sizeof_addr != 2 && sizeof_addr != 4 && - sizeof_addr != 8 && sizeof_addr != 16 && sizeof_addr != 32) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad byte number in an address") - if(H5P_set(c_plist, H5F_CRT_ADDR_BYTE_NUM_NAME, &sizeof_addr) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set byte number in an address") - shared->sizeof_addr = sizeof_addr; /* Keep a local copy also */ - - /* Size of file sizes */ - sizeof_size = *p++; - if(sizeof_size != 2 && sizeof_size != 4 && - sizeof_size != 8 && sizeof_size != 16 && sizeof_size != 32) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad byte number for object size") - if(H5P_set(c_plist, H5F_CRT_OBJ_BYTE_NUM_NAME, &sizeof_size) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set byte number for object size") - shared->sizeof_size = sizeof_size; /* Keep a local copy also */ - - /* File status flags (not really used yet) */ - sblock->status_flags = *p++; - if(sblock->status_flags & ~H5F_SUPER_ALL_FLAGS) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad flag value for superblock") - - /* Base, superblock extension, end of file & root group object header addresses */ - H5F_addr_decode(f, (const uint8_t **)&p, &sblock->base_addr/*out*/); - H5F_addr_decode(f, (const uint8_t **)&p, &sblock->ext_addr/*out*/); - H5F_addr_decode(f, (const uint8_t **)&p, &stored_eof/*out*/); - H5F_addr_decode(f, (const uint8_t **)&p, &sblock->root_addr/*out*/); - - /* Compute checksum for superblock */ - computed_chksum = H5_checksum_metadata(sbuf, (size_t)(p - sbuf), 0); - - /* Decode checksum */ - UINT32DECODE(p, read_chksum); - - /* Verify correct checksum */ - if(read_chksum != computed_chksum) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "bad checksum on driver information block") + FUNC_ENTER_STATIC_NOERR - /* - * Check if superblock address is different from base address and - * adjust base address and "end of address" address if so. - */ - if(!H5F_addr_eq(base_addr, sblock->base_addr)) { - /* Check if the superblock moved earlier in the file */ - if(H5F_addr_lt(base_addr, sblock->base_addr)) - stored_eof -= (sblock->base_addr - base_addr); - else - /* The superblock moved later in the file */ - stored_eof += (base_addr - sblock->base_addr); + /* Check arguments */ + HDassert(sblock); + HDassert(sblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(sblock->cache_info.type == H5AC_SUPERBLOCK); + HDassert(image_len); + HDassert(compressed_ptr); - /* Adjust base address for offsets of the HDF5 data in the file */ - sblock->base_addr = base_addr; + /* Set the image length size */ + *image_len = (size_t)H5F_SUPERBLOCK_SIZE(sblock); - /* Set the base address for the file in the VFD now */ - if(H5FD_set_base_addr(lf, sblock->base_addr) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, NULL, "failed to set base address for file driver") + /* Set *compressed_ptr to FALSE unconditionally */ + *compressed_ptr; - /* Indicate that the superblock should be marked dirty */ - *dirtied = TRUE; - } /* end if */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5F__cache_superblock_image_len() */ - /* Get the B-tree internal node values, etc */ - if(H5P_get(c_plist, H5F_CRT_BTREE_RANK_NAME, sblock->btree_k) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to get rank for btree internal nodes") - if(H5P_get(c_plist, H5F_CRT_SYM_LEAF_NAME, &sblock->sym_leaf_k) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to get rank for btree internal nodes") - } /* end else */ + +/*------------------------------------------------------------------------- + * Function: H5FS__cache_hdf_pre_serialize + * + * Purpose: The current use of this function is a cludge to repair an + * oversight in the conversion of the superblock code to use the + * version 3 cache. + * + * In the V2 metadata cache callbacks, the superblock dirver info + * message was updated in the flush routine. Note that this + * operation only applies to version 2 or later superblocks. + * + * Somehow, this functionality was lost in the conversion to use + * the V3 cache, causing failures with the multi file driver + * (and possibly the family file driver as well). + * + * Performing this operation is impossible in the current + * serialize routine, as the dxpl_id is not available. While + * I am pretty sure that this is not the correct place for this + * functionality, as I can see it causing problems with both + * journaling and possibly parallel HDF5 as well, I am placing + * code for the necessary update in the pre_serialize call for + * now for testing purposes. We will almost certainly want to + * change this. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 10/82/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5F__cache_superblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, + void *_thing, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED len, + size_t H5_ATTR_UNUSED compressed_len, haddr_t H5_ATTR_UNUSED *new_addr, + size_t H5_ATTR_UNUSED *new_len, size_t H5_ATTR_UNUSED *new_compressed_len, + unsigned H5_ATTR_UNUSED *flags) +{ + H5F_super_t *sblock = (H5F_super_t *)_thing; /* Pointer to the super block */ + herr_t ret_value = SUCCEED; /* Return value */ - /* - * The user-defined data is the area of the file before the base - * address. - */ - if(H5P_set(c_plist, H5F_CRT_USER_BLOCK_NAME, &sblock->base_addr) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set userblock size") + FUNC_ENTER_NOAPI_NOINIT - /* - * Make sure that the data is not truncated. One case where this is - * possible is if the first file of a family of files was opened - * individually. - */ - if(HADDR_UNDEF == (eof = H5FD_get_eof(lf, H5FD_MEM_DEFAULT))) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "unable to determine file size") - - /* (Account for the stored EOF being absolute offset -QAK) */ - if((eof + sblock->base_addr) < stored_eof) - HGOTO_ERROR(H5E_FILE, H5E_TRUNCATED, NULL, - "truncated file: eof = %llu, sblock->base_addr = %llu, stored_eof = %llu", - (unsigned long long)eof, (unsigned long long)sblock->base_addr, (unsigned long long)stored_eof) - - /* - * Tell the file driver how much address space has already been - * allocated so that it knows how to allocate additional memory. - */ - /* (Account for the stored EOA being absolute offset -NAF) */ - if(H5FD_set_eoa(lf, H5FD_MEM_SUPER, stored_eof - sblock->base_addr) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to set end-of-address marker for file") - - /* Read the file's superblock extension, if there is one. */ - if(H5F_addr_defined(sblock->ext_addr)) { - H5O_loc_t ext_loc; /* "Object location" for superblock extension */ - H5O_btreek_t btreek; /* v1 B-tree 'K' value message from superblock extension */ - H5O_drvinfo_t drvinfo; /* Driver info message from superblock extension */ - size_t u; /* Local index variable */ - htri_t status; /* Status for message existing */ - - /* Sanity check - superblock extension should only be defined for - * superblock version >= 2. + /* Sanity check */ + HDassert(f); + HDassert(sblock); + HDassert(sblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(sblock->cache_info.type == H5AC_SUPERBLOCK); + HDassert(flags); + + if(sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2) { + /* WARNING: This code almost certainly doesn't belong here. Must + * discuss with Quincey where to put it. Note issues + * for journaling and possibly parallel. + * + * -- JRM */ - HDassert(super_vers >= HDF5_SUPERBLOCK_VERSION_2); - - /* Check for superblock extension being located "outside" the stored - * 'eoa' value, which can occur with the split/multi VFD. + /* Update the driver information message in the superblock extension + * if appropriate. */ - if(H5F_addr_gt(sblock->ext_addr, stored_eof)) { - /* Set the 'eoa' for the object header memory type large enough - * to give some room for a reasonably sized superblock extension. - * (This is _rather_ a kludge -QAK) - */ - if(H5FD_set_eoa(lf, H5FD_MEM_OHDR, (haddr_t)(sblock->ext_addr + 1024)) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to set end-of-address marker for file") - } /* end if */ + if(H5F_addr_defined(sblock->ext_addr)) { + size_t driver_size; /* Size of driver info block (bytes)*/ + H5O_loc_t ext_loc; /* "Object location" for superblock extension */ - /* Open the superblock extension */ - if(H5F_super_ext_open(f, sblock->ext_addr, &ext_loc) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, NULL, "unable to open file's superblock extension") + HDassert(sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); + + /* Open the superblock extension's object header */ + if(H5F_super_ext_open((H5F_t *)f, sblock->ext_addr, &ext_loc) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "unable to open file's superblock extension") - /* Check for the extension having a 'driver info' message */ - if((status = H5O_msg_exists(&ext_loc, H5O_DRVINFO_ID, dxpl_id)) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "unable to read object header") - if(status) { /* Check for ignoring the driver info for this file */ - if(H5F_HAS_FEATURE(f, H5FD_FEAT_IGNORE_DRVRINFO)) { - /* Indicate that the superblock should be marked dirty */ - *dirtied = TRUE; - } /* end if */ - else { - /* Retrieve the 'driver info' structure */ - if(NULL == H5O_msg_read(&ext_loc, H5O_DRVINFO_ID, &drvinfo, dxpl_id)) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "driver info message not present") - - /* Decode driver information */ - if(H5FD_sb_load(lf, drvinfo.name, drvinfo.buf) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to decode driver information") - - /* Reset driver info message */ - H5O_msg_reset(H5O_DRVINFO_ID, &drvinfo); - } /* end else */ - } /* end if */ + if(!H5F_HAS_FEATURE(f, H5FD_FEAT_IGNORE_DRVRINFO)) { + /* Check for driver info message */ + H5_CHECKED_ASSIGN(driver_size, size_t, H5FD_sb_size(f->shared->lf), hsize_t); + if(driver_size > 0) { + H5O_drvinfo_t drvinfo; /* Driver info */ + uint8_t dbuf[H5F_MAX_DRVINFOBLOCK_SIZE]; /* Driver info block encoding buffer */ - /* Read in the shared OH message information if there is any */ - if(H5SM_get_info(&ext_loc, c_plist, dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read SOHM table information") - - /* Check for the extension having a 'v1 B-tree "K"' message */ - if((status = H5O_msg_exists(&ext_loc, H5O_BTREEK_ID, dxpl_id)) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "unable to read object header") - if(status) { - /* Retrieve the 'v1 B-tree "K"' structure */ - if(NULL == H5O_msg_read(&ext_loc, H5O_BTREEK_ID, &btreek, dxpl_id)) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "v1 B-tree 'K' info message not present") - - /* Set non-default v1 B-tree 'K' value info from file */ - sblock->btree_k[H5B_CHUNK_ID] = btreek.btree_k[H5B_CHUNK_ID]; - sblock->btree_k[H5B_SNODE_ID] = btreek.btree_k[H5B_SNODE_ID]; - sblock->sym_leaf_k = btreek.sym_leaf_k; - - /* Set non-default v1 B-tree 'K' values in the property list */ - if(H5P_set(c_plist, H5F_CRT_BTREE_RANK_NAME, btreek.btree_k) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set rank for btree internal nodes") - if(H5P_set(c_plist, H5F_CRT_SYM_LEAF_NAME, &btreek.sym_leaf_k) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set rank for symbol table leaf nodes") - } /* end if */ + /* Sanity check */ + HDassert(driver_size <= H5F_MAX_DRVINFOBLOCK_SIZE); - /* Check for the extension having a 'free-space manager info' message */ - if((status = H5O_msg_exists(&ext_loc, H5O_FSINFO_ID, dxpl_id)) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "unable to check object header") - if(status) { - H5O_fsinfo_t fsinfo; /* Free-space manager info message from superblock extension */ - - /* Retrieve the 'free-space manager info' structure */ - if(NULL == H5O_msg_read(&ext_loc, H5O_FSINFO_ID, &fsinfo, dxpl_id)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to get free-space manager info message") - - if(shared->fs_strategy != fsinfo.strategy) { - shared->fs_strategy = fsinfo.strategy; - - /* Set non-default strategy in the property list */ - if(H5P_set(c_plist, H5F_CRT_FILE_SPACE_STRATEGY_NAME, &fsinfo.strategy) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, NULL, "unable to set file space strategy") - } /* end if */ - if(shared->fs_threshold != fsinfo.threshold) { - shared->fs_threshold = fsinfo.threshold; - - /* Set non-default threshold in the property list */ - if(H5P_set(c_plist, H5F_CRT_FREE_SPACE_THRESHOLD_NAME, &fsinfo.threshold) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, NULL, "unable to set file space strategy") - } /* end if */ - - /* set free-space manager addresses */ - shared->fs_addr[0] = HADDR_UNDEF; - for(u = 1; u < NELMTS(f->shared->fs_addr); u++) - shared->fs_addr[u] = fsinfo.fs_addr[u-1]; - } /* end if */ + /* Encode driver-specific data */ + if(H5FD_sb_encode(f->shared->lf, drvinfo.name, dbuf) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode driver information") - /* Close superblock extension */ - if(H5F_super_ext_close(f, &ext_loc, dxpl_id, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, NULL, "unable to close file's superblock extension") - } /* end if */ + /* Write driver info information to the superblock extension */ + drvinfo.len = driver_size; + drvinfo.buf = dbuf; + if(H5O_msg_write(&ext_loc, H5O_DRVINFO_ID, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &drvinfo, dxpl_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "unable to update driver info header message") + } /* end if */ + } /* end if */ - /* Set return value */ - ret_value = sblock; + /* Close the superblock extension object header */ + if(H5F_super_ext_close((H5F_t *)f, &ext_loc, dxpl_id, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close file's superblock extension") + } /* end if */ + } /* end if */ done: - /* Release the [possibly partially initialized] superblock on errors */ - if(!ret_value && sblock) - if(H5F__super_free(sblock) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTFREE, NULL, "unable to destroy superblock data") - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_sblock_load() */ +} /* end H5FS_cache_superblock_pre_serialize() */ /*------------------------------------------------------------------------- - * Function: H5F_sblock_flush + * Function: H5F__cache_superblock_serialize * - * Purpose: Flushes the superblock. + * Purpose: Flushes a dirty object to disk. * - * Return: Success: SUCCEED - * Failure: NULL + * Return: Non-negative on success/Negative on failure * - * Programmer: Mike McGreevy - * mamcgree@hdfgroup.org - * April 8, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 19 2013 * *------------------------------------------------------------------------- */ static herr_t -H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t H5_ATTR_UNUSED addr, - H5F_super_t *sblock) +H5F__cache_superblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, + void *_thing) { - herr_t ret_value = SUCCEED; + H5F_super_t *sblock = (H5F_super_t *)_thing; /* Pointer to the object */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + haddr_t rel_eof; /* Relative EOF for file */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* check arguments */ + /* Sanity check */ HDassert(f); - HDassert(H5F_addr_eq(addr, 0)); + HDassert(image); HDassert(sblock); - + /* Assert that the superblock is marked as being flushed last (and collectively in parallel) */ /* (We'll rely on the cache to make sure it actually *is* flushed @@ -656,301 +619,403 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t H5_ATTR_UNUSE HDassert(sblock->cache_info.flush_me_collectively); #endif - if(sblock->cache_info.is_dirty) { - H5P_genplist_t *dxpl; /* DXPL object */ - uint8_t buf[H5F_MAX_SUPERBLOCK_SIZE + H5F_MAX_DRVINFOBLOCK_SIZE]; /* Superblock & driver info blockencoding buffer */ - uint8_t *p; /* Ptr into encoding buffer */ - haddr_t rel_eof; /* Relative EOF for file */ - size_t superblock_size; /* Size of superblock, in bytes */ - size_t driver_size; /* Size of driver info block (bytes)*/ + /* Encode the common portion of the file superblock for all versions */ + HDmemcpy(image, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN); + image += H5F_SIGNATURE_LEN; + *image++ = (uint8_t)sblock->super_vers; - /* Encode the common portion of the file superblock for all versions */ - p = buf; - HDmemcpy(p, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN); - p += H5F_SIGNATURE_LEN; - *p++ = (uint8_t)sblock->super_vers; + /* Check for older version of superblock format */ + if(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2) { + *image++ = (uint8_t)HDF5_FREESPACE_VERSION; /* (hard-wired) */ + *image++ = (uint8_t)HDF5_OBJECTDIR_VERSION; /* (hard-wired) */ + *image++ = 0; /* reserved*/ - /* Check for older version of superblock format */ - if(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2) { - *p++ = (uint8_t)HDF5_FREESPACE_VERSION; /* (hard-wired) */ - *p++ = (uint8_t)HDF5_OBJECTDIR_VERSION; /* (hard-wired) */ - *p++ = 0; /* reserved*/ + *image++ = (uint8_t)HDF5_SHAREDHEADER_VERSION; /* (hard-wired) */ + *image++ = sblock->sizeof_addr; + *image++ = sblock->sizeof_size; + *image++ = 0; /* reserved */ - *p++ = (uint8_t)HDF5_SHAREDHEADER_VERSION; /* (hard-wired) */ - *p++ = (uint8_t)H5F_SIZEOF_ADDR(f); - *p++ = (uint8_t)H5F_SIZEOF_SIZE(f); - *p++ = 0; /* reserved */ + UINT16ENCODE(image, sblock->sym_leaf_k); + UINT16ENCODE(image, sblock->btree_k[H5B_SNODE_ID]); + UINT32ENCODE(image, (uint32_t)sblock->status_flags); - UINT16ENCODE(p, sblock->sym_leaf_k); - UINT16ENCODE(p, sblock->btree_k[H5B_SNODE_ID]); - UINT32ENCODE(p, (uint32_t)sblock->status_flags); + /* + * Versions of the superblock >0 have the indexed storage B-tree + * internal 'K' value stored + */ + if(sblock->super_vers > HDF5_SUPERBLOCK_VERSION_DEF) { + UINT16ENCODE(image, sblock->btree_k[H5B_CHUNK_ID]); + *image++ = 0; /*reserved */ + *image++ = 0; /*reserved */ + } /* end if */ - /* - * Versions of the superblock >0 have the indexed storage B-tree - * internal 'K' value stored - */ - if(sblock->super_vers > HDF5_SUPERBLOCK_VERSION_DEF) { - UINT16ENCODE(p, sblock->btree_k[H5B_CHUNK_ID]); - *p++ = 0; /*reserved */ - *p++ = 0; /*reserved */ - } /* end if */ + /* Encode the base address */ + H5F_addr_encode(f, &image, sblock->base_addr); - /* Encode the base address */ - H5F_addr_encode(f, &p, sblock->base_addr); - - /* Encode the address of global free-space index */ - H5F_addr_encode(f, &p, sblock->ext_addr); - - /* Encode the end-of-file address. Note that at this point in time, - * the EOF value itself may not be reflective of the file's size, as - * we will eventually truncate the file to match the EOA value. As - * such, use the EOA value in its place, knowing that the current EOF - * value will ultimately match it. */ - if ((rel_eof = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") - H5F_addr_encode(f, &p, (rel_eof + sblock->base_addr)); - - /* Encode the driver informaton block address */ - H5F_addr_encode(f, &p, sblock->driver_addr); - - /* Encode the root group object entry, including the cached stab info */ - if(H5G_ent_encode(f, &p, sblock->root_ent) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTENCODE, FAIL, "can't encode root group symbol table entry") - - /* Encode the driver information block. */ - H5_CHECKED_ASSIGN(driver_size, size_t, H5FD_sb_size(f->shared->lf), hsize_t); - - /* Checking whether driver block address is defined here is to handle backward - * compatibility. If the file was created with v1.6 library or earlier and no - * driver info block was written in the superblock, we don't write it either even - * though there's some driver info. Otherwise, the driver block extended will - * overwrite the (meta)data right after the superblock. This situation happens to - * the family driver particularly. SLU - 2009/3/24 - */ - if(driver_size > 0 && H5F_addr_defined(sblock->driver_addr)) { - char driver_name[9]; /* Name of driver, for driver info block */ - uint8_t *dbuf = p; /* Pointer to beginning of driver info */ + /* Encode the address of global free-space index */ + H5F_addr_encode(f, &image, sblock->ext_addr); - /* Encode the driver information block */ - *p++ = HDF5_DRIVERINFO_VERSION_0; /* Version */ - *p++ = 0; /* reserved */ - *p++ = 0; /* reserved */ - *p++ = 0; /* reserved */ + /* Encode the end-of-file address. Note that at this point in time, + * the EOF value itself may not be reflective of the file's size, as + * we will eventually truncate the file to match the EOA value. As + * such, use the EOA value in its place, knowing that the current EOF + * value will ultimately match it. */ + if ((rel_eof = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") + H5F_addr_encode(f, &image, (rel_eof + sblock->base_addr)); - /* Driver info size, excluding header */ - UINT32ENCODE(p, driver_size); + /* Encode the driver informaton block address */ + H5F_addr_encode(f, &image, sblock->driver_addr); - /* Encode driver-specific data */ - if(H5FD_sb_encode(f->shared->lf, driver_name, dbuf + H5F_DRVINFOBLOCK_HDR_SIZE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode driver information") + /* Encode the root group object entry, including the cached stab info */ + if(H5G_ent_encode(f, &image, sblock->root_ent) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTENCODE, FAIL, "can't encode root group symbol table entry") - /* Store driver name (set in 'H5FD_sb_encode' call above) */ - HDmemcpy(p, driver_name, (size_t)8); + /* NOTE: Driver info block is handled separately */ - /* Advance buffer pointer past name & variable-sized portion of driver info */ - /* (for later use in computing the superblock size) */ - p += 8 + driver_size; - } /* end if */ - } /* end if */ - else { - uint32_t chksum; /* Checksum temporary variable */ - H5O_loc_t *root_oloc; /* Pointer to root group's object location */ + } /* end if */ + else { /* sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2 */ + uint32_t chksum; /* Checksum temporary variable */ + H5O_loc_t *root_oloc; /* Pointer to root group's object location */ - /* Size of file addresses & offsets, and status flags */ - *p++ = (uint8_t)H5F_SIZEOF_ADDR(f); - *p++ = (uint8_t)H5F_SIZEOF_SIZE(f); - *p++ = sblock->status_flags; + /* Size of file addresses & offsets, and status flags */ + *image++ = sblock->sizeof_addr; + *image++ = sblock->sizeof_size; + *image++ = sblock->status_flags; - /* Encode the base address */ - H5F_addr_encode(f, &p, sblock->base_addr); + /* Encode the base address */ + H5F_addr_encode(f, &image, sblock->base_addr); - /* Encode the address of the superblock extension */ - H5F_addr_encode(f, &p, sblock->ext_addr); + /* Encode the address of the superblock extension */ + H5F_addr_encode(f, &image, sblock->ext_addr); - /* At this point in time, the EOF value itself may - * not be reflective of the file's size, since we'll eventually - * truncate it to match the EOA value. As such, use the EOA value - * in its place, knowing that the current EOF value will - * ultimately match it. */ - if ((rel_eof = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") - H5F_addr_encode(f, &p, (rel_eof + sblock->base_addr)); + /* At this point in time, the EOF value itself may + * not be reflective of the file's size, since we'll eventually + * truncate it to match the EOA value. As such, use the EOA value + * in its place, knowing that the current EOF value will + * ultimately match it. */ + if ((rel_eof = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") + H5F_addr_encode(f, &image, (rel_eof + sblock->base_addr)); - /* Retrieve information for root group */ - if(NULL == (root_oloc = H5G_oloc(f->shared->root_grp))) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to retrieve root group information") + /* Retrieve information for root group */ + if(NULL == (root_oloc = H5G_oloc(f->shared->root_grp))) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to retrieve root group information") - /* Encode address of root group's object header */ - H5F_addr_encode(f, &p, root_oloc->addr); + /* Encode address of root group's object header */ + H5F_addr_encode(f, &image, root_oloc->addr); - /* Compute superblock checksum */ - chksum = H5_checksum_metadata(buf, ((size_t)H5F_SUPERBLOCK_SIZE(sblock->super_vers, f) - H5F_SIZEOF_CHKSUM), 0); + /* Compute superblock checksum */ + chksum = H5_checksum_metadata(_image, ((size_t)H5F_SUPERBLOCK_SIZE(sblock) - H5F_SIZEOF_CHKSUM), 0); - /* Superblock checksum */ - UINT32ENCODE(p, chksum); + /* Superblock checksum */ + UINT32ENCODE(image, chksum); - /* Sanity check */ - HDassert((size_t)(p - buf) == (size_t)H5F_SUPERBLOCK_SIZE(sblock->super_vers, f)); - } /* end else */ + /* Sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) == (size_t)H5F_SUPERBLOCK_SIZE(sblock)); + } /* end else */ - /* Retrieve the total size of the superblock info */ - H5_CHECKED_ASSIGN(superblock_size, size_t, (p - buf), ptrdiff_t); + /* Sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) <= len); - /* Double check we didn't overrun the block (unlikely) */ - HDassert(superblock_size <= sizeof(buf)); +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5F__cache_superblock_serialize() */ - /* Get the DXPL plist object for DXPL ID */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + +/*------------------------------------------------------------------------- + * Function: H5F__cache_superblock_free_icr + * + * Purpose: Destroy/release an "in core representation" of a data + * structure + * + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 20, 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5F__cache_superblock_free_icr(void *_thing) +{ + H5F_super_t *sblock = (H5F_super_t *)_thing; /* Pointer to the object */ + herr_t ret_value = SUCCEED; /* Return value */ - /* Write superblock */ - /* (always at relative address 0) */ - if(H5FD_write(f->shared->lf, dxpl, H5FD_MEM_SUPER, (haddr_t)0, superblock_size, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write superblock") + FUNC_ENTER_STATIC - /* Check for newer version of superblock format & superblock extension */ - if(sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2 && H5F_addr_defined(sblock->ext_addr)) { - H5O_loc_t ext_loc; /* "Object location" for superblock extension */ + /* Sanity check */ + HDassert(sblock); + HDassert(sblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(sblock->cache_info.type == H5AC_SUPERBLOCK); - /* Open the superblock extension's object header */ - if(H5F_super_ext_open(f, sblock->ext_addr, &ext_loc) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "unable to open file's superblock extension") + /* Destroy superblock */ + if(H5F__super_free(sblock) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free superblock") - /* Check for ignoring the driver info for this file */ - if(!H5F_HAS_FEATURE(f, H5FD_FEAT_IGNORE_DRVRINFO)) { - /* Check for driver info message */ - H5_CHECKED_ASSIGN(driver_size, size_t, H5FD_sb_size(f->shared->lf), hsize_t); - if(driver_size > 0) { - H5O_drvinfo_t drvinfo; /* Driver info */ - uint8_t dbuf[H5F_MAX_DRVINFOBLOCK_SIZE]; /* Driver info block encoding buffer */ +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5F__cache_superblock_free_icr() */ - /* Sanity check */ - HDassert(driver_size <= H5F_MAX_DRVINFOBLOCK_SIZE); + +/*------------------------------------------------------------------------- + * Function: H5F__cache_drvrinfo_get_load_size + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 20, 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5F__cache_drvrinfo_get_load_size(const void H5_ATTR_UNUSED *udata, size_t *image_len) +{ + FUNC_ENTER_STATIC_NOERR - /* Encode driver-specific data */ - if(H5FD_sb_encode(f->shared->lf, drvinfo.name, dbuf) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode driver information") + /* Check arguments */ + HDassert(image_len); - /* Write driver info information to the superblock extension */ - drvinfo.len = driver_size; - drvinfo.buf = dbuf; - if(H5O_msg_write(&ext_loc, H5O_DRVINFO_ID, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &drvinfo, dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "unable to update driver info header message") + /* Set the initial image length size */ + *image_len = H5F_DRVINFOBLOCK_HDR_SIZE; /* Fixed size portion of driver info block */ - } /* end if */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5F__cache_drvrinfo_get_load_size() */ - } /* end if */ + +/*------------------------------------------------------------------------- + * Function: H5F__cache_drvrinfo_deserialize + * + * Purpose: Loads an object from the disk. + * + * Return: Success: Pointer to a new B-tree. + * Failure: NULL + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 20 2013 + * + *------------------------------------------------------------------------- + */ +static void * +H5F__cache_drvrinfo_deserialize(const void *_image, size_t len, void *_udata, + hbool_t H5_ATTR_UNUSED *dirty) +{ + H5O_drvinfo_t *drvinfo = NULL; /* Driver info */ + H5F_drvrinfo_cache_ud_t *udata = (H5F_drvrinfo_cache_ud_t *)_udata; /* User data */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ + char drv_name[9]; /* Name of driver */ + unsigned drv_vers; /* Version of driver info block */ + H5O_drvinfo_t *ret_value; /* Return value */ - /* Close the superblock extension object header */ - if(H5F_super_ext_close(f, &ext_loc, dxpl_id, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close file's superblock extension") - } /* end if */ + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(image); + HDassert(len >= H5F_DRVINFOBLOCK_HDR_SIZE); + HDassert(udata); + HDassert(udata->f); + + /* Allocate space for the driver info */ + if(NULL == (drvinfo = (H5O_drvinfo_t *)H5MM_calloc(sizeof(H5O_drvinfo_t)))) + HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, NULL, "memory allocation failed for driver info message") + + /* Version number */ + drv_vers = *image++; + if(drv_vers != HDF5_DRIVERINFO_VERSION_0) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad driver information block version number") + + image += 3; /* reserved bytes */ + + /* Driver info size */ + UINT32DECODE(image, drvinfo->len); + + /* Driver name and/or version */ + HDstrncpy(drv_name, (const char *)image, (size_t)8); + drv_name[8] = '\0'; + image += 8; /* advance past name/version */ + + /* Handle metadata cache retry for variable-sized portion of the driver info block */ + if(len != (H5F_DRVINFOBLOCK_HDR_SIZE + drvinfo->len)) { + /* Sanity check */ + HDassert(len == H5F_DRVINFOBLOCK_HDR_SIZE); + + /* extend the eoa if required so that we can read the complete driver info block */ + { + haddr_t eoa; + haddr_t min_eoa; + + /* get current eoa... */ + if ((eoa = H5FD_get_eoa(udata->f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, NULL, "driver get_eoa request failed") + + /* ... if it is too small, extend it. */ + min_eoa = udata->driver_addr + H5F_DRVINFOBLOCK_HDR_SIZE + drvinfo->len; + + if ( H5F_addr_gt(min_eoa, eoa) ) + if(H5FD_set_eoa(udata->f->shared->lf, H5FD_MEM_SUPER, min_eoa) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, \ + "set end of space allocation request failed") + } - /* Reset the dirty flag. */ - sblock->cache_info.is_dirty = FALSE; + } /* end if */ + else { + /* Validate and decode driver information */ + if(H5FD_sb_load(udata->f->shared->lf, drv_name, image) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, NULL, "unable to decode driver information") } /* end if */ - if(destroy) - if(H5F_sblock_dest(f, sblock) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CLOSEERROR, FAIL, "can't close superblock") + /* Sanity check */ + HDassert((size_t)(image - (const uint8_t *)_image) <= len); + + /* Set return value */ + ret_value = drvinfo; done: + /* Release the [possibly partially initialized] driver info message on error */ + if(!ret_value && drvinfo) + H5MM_xfree(drvinfo); + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_sblock_flush() */ +} /* end H5F__cache_drvrinfo_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5F_sblock_dest + * Function: H5F__cache_drvrinfo_image_len * - * Purpose: Frees memory used by the superblock. + * Purpose: Compute the size of the data structure on disk. * * Return: Non-negative on success/Negative on failure * - * Programmer: Mike McGreevy - * April 8, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 20, 2013 * *------------------------------------------------------------------------- */ static herr_t -H5F_sblock_dest(H5F_t H5_ATTR_UNUSED *f, H5F_super_t* sblock) +H5F__cache_drvrinfo_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + const H5O_drvinfo_t *drvinfo = (const H5O_drvinfo_t *)_thing; /* Pointer to the object */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR - /* Sanity check */ - HDassert(sblock); + /* Check arguments */ + HDassert(drvinfo); + HDassert(drvinfo->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(drvinfo->cache_info.type == H5AC_DRVRINFO); + HDassert(image_len); + HDassert(compressed_ptr); - /* Free superblock */ - if(H5F__super_free(sblock) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "unable to destroy superblock") + /* Set the image length size */ + *image_len = (size_t)(H5F_DRVINFOBLOCK_HDR_SIZE + /* Fixed-size portion of driver info block */ + drvinfo->len); /* Variable-size portion of driver info block */ -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_sblock_dest() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5F__cache_drvrinfo_image_len() */ /*------------------------------------------------------------------------- - * Function: H5F_sblock_clear + * Function: H5F__cache_drvrinfo_serialize * - * Purpose: Mark the superblock as no longer being dirty. + * Purpose: Flushes a dirty object to disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mike McGreevy - * April 8, 2009 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 20 2013 * *------------------------------------------------------------------------- */ static herr_t -H5F_sblock_clear(H5F_t *f, H5F_super_t *sblock, hbool_t destroy) +H5F__cache_drvrinfo_serialize(const H5F_t *f, void *_image, size_t len, + void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5O_drvinfo_t *drvinfo = (H5O_drvinfo_t *)_thing; /* Pointer to the object */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint8_t *dbuf; /* Pointer to beginning of driver info */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* - * Check arguments. - */ - HDassert(sblock); + /* check arguments */ + HDassert(f); + HDassert(image); + HDassert(drvinfo); + HDassert(drvinfo->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(drvinfo->cache_info.type == H5AC_DRVRINFO); + HDassert(len == (size_t)(H5F_DRVINFOBLOCK_HDR_SIZE + drvinfo->len)); + + /* Save pointer to beginning of driver info */ + dbuf = image; + + /* Encode the driver information block */ + *image++ = HDF5_DRIVERINFO_VERSION_0; /* Version */ + *image++ = 0; /* reserved */ + *image++ = 0; /* reserved */ + *image++ = 0; /* reserved */ + + /* Driver info size, excluding header */ + UINT32ENCODE(image, drvinfo->len); - /* Reset the dirty flag. */ - sblock->cache_info.is_dirty = FALSE; + /* Encode driver-specific data */ + if(H5FD_sb_encode(f->shared->lf, (char *)image, dbuf + H5F_DRVINFOBLOCK_HDR_SIZE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode driver information") - if(destroy) - if(H5F_sblock_dest(f, sblock) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "unable to delete superblock") + /* Advance buffer pointer past name & variable-sized portion of driver info */ + image += 8 + drvinfo->len; + + /* Sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) <= len); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_sblock_clear() */ +} /* H5F__cache_drvrinfo_serialize() */ /*------------------------------------------------------------------------- - * Function: H5F_sblock_size + * Function: H5F__cache_drvrinfo_free_icr * - * Purpose: Returns the size of the superblock encoded on disk. + * Purpose: Destroy/release an "in core representation" of a data + * structure * - * Return: Non-negative on success/Negative on failure + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). * - * Programmer: Mike McGreevy - * April 8, 2009 + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * July 20, 2013 * *------------------------------------------------------------------------- */ static herr_t -H5F_sblock_size(const H5F_t *f, const H5F_super_t *sblock, size_t *size_ptr) +H5F__cache_drvrinfo_free_icr(void *_thing) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + H5O_drvinfo_t *drvinfo = (H5O_drvinfo_t *)_thing; /* Pointer to the object */ - /* check arguments */ - HDassert(f); - HDassert(sblock); - HDassert(size_ptr); + FUNC_ENTER_STATIC_NOERR + + /* Check arguments */ + HDassert(drvinfo); + HDassert(drvinfo->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(drvinfo->cache_info.type == H5AC_DRVRINFO); - /* Set size value */ - *size_ptr = (size_t)H5F_SUPERBLOCK_SIZE(sblock->super_vers, f); + /* Destroy driver info message */ + H5MM_xfree(drvinfo); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5F_sblock_size() */ +} /* H5F__cache_drvrinfo_free_icr() */ diff --git a/src/H5Gcache.c b/src/H5Gcache.c index bedceb6..8dfecb1 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -46,7 +46,6 @@ /****************/ #define H5G_NODE_VERS 1 /* Symbol table node version number */ -#define H5G_NODE_BUF_SIZE 512 /* Size of stack buffer for serialized nodes */ /******************/ @@ -64,12 +63,14 @@ /********************/ /* Metadata cache (H5AC) callbacks */ -static H5G_node_t *H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5G_node_t *sym, unsigned *flags_ptr); -static herr_t H5G_node_dest(H5F_t *f, H5G_node_t *sym); -static herr_t H5G_node_clear(H5F_t *f, H5G_node_t *sym, hbool_t destroy); -static herr_t H5G_node_size(const H5F_t *f, const H5G_node_t *sym, size_t *size_ptr); +static herr_t H5G__cache_node_get_load_size(const void *udata, size_t *image_len); +static void *H5G__cache_node_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5G__cache_node_image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5G__cache_node_serialize(const H5F_t *f, void *image, + size_t len, void *thing); +static herr_t H5G__cache_node_free_icr(void *thing); /*********************/ @@ -88,13 +89,19 @@ static herr_t H5G_node_size(const H5F_t *f, const H5G_node_t *sym, size_t *size_ /* Symbol table nodes inherit cache-like properties from H5AC */ const H5AC_class_t H5AC_SNODE[1] = {{ - H5AC_SNODE_ID, - (H5AC_load_func_t)H5G_node_load, - (H5AC_flush_func_t)H5G_node_flush, - (H5AC_dest_func_t)H5G_node_dest, - (H5AC_clear_func_t)H5G_node_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5G_node_size, + H5AC_SNODE_ID, /* Metadata client ID */ + "Symbol table node", /* Metadata client name (for debugging) */ + H5FD_MEM_BTREE, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5G__cache_node_get_load_size, /* 'get_load_size' callback */ + H5G__cache_node_deserialize, /* 'deserialize' callback */ + H5G__cache_node_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5G__cache_node_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5G__cache_node_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; @@ -106,42 +113,80 @@ H5FL_SEQ_EXTERN(H5G_entry_t); /*------------------------------------------------------------------------- - * Function: H5G_node_load + * Function: H5G__cache_node_get_load_size() * - * Purpose: Loads a symbol table node from the file. + * Purpose: Determine the size of the on disk image of the node, and + * return this value in *image_len. * - * Return: Success: Ptr to the new table. + * Note that this computation requires access to the file pointer, + * which is not provided in the parameter list for this callback. + * Finesse this issue by passing in the file pointer twice to the + * H5AC_protect() call -- once as the file pointer proper, and + * again as the user data. + * + * Return: Success: SUCCEED + * Failure: FAIL * - * Failure: NULL - * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Programmer: John Mainzer + * 7/21/14 * *------------------------------------------------------------------------- */ -static H5G_node_t * -H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +static herr_t +H5G__cache_node_get_load_size(const void *_udata, size_t *image_len) { - H5G_node_t *sym = NULL; - H5WB_t *wb = NULL; /* Wrapped buffer for node data */ - uint8_t node_buf[H5G_NODE_BUF_SIZE]; /* Buffer for node */ - uint8_t *node; /* Pointer to node buffer */ - const uint8_t *p; - H5G_node_t *ret_value; /*for error handling */ - - FUNC_ENTER_NOAPI_NOINIT - - /* - * Check arguments. - */ + const H5F_t *f = (const H5F_t *)_udata; /* User data for callback */ + + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(udata); + HDassert(image_len); + + /* report image length */ + *image_len = (size_t)(H5G_NODE_SIZE(f)); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5G__cache_node_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5G__cache_node_deserialize + * + * Purpose: Given a buffer containing the on disk image of a symbol table + * node, allocate an instance of H5G_node_t, load the contence of the + * image into it, and return a pointer to the instance. + * + * Note that deserializing the image requires access to the file + * pointer, which is not included in the parameter list for this + * callback. Finesse this issue by passing in the file pointer + * twice to the H5AC_protect() call -- once as the file pointer + * proper, and again as the user data + * + * Return: Success: Pointer to in core representation + * Failure: NULL + * + * Programmer: John Mainzer + * 6/21/14 + * + *------------------------------------------------------------------------- + */ +static void * +H5G__cache_node_deserialize(const void *_image, size_t len, void *_udata, + hbool_t H5_ATTR_UNUSED *dirty) +{ + H5F_t *f = (H5F_t *)_udata; /* User data for callback */ + H5G_node_t *sym = NULL; /* Symbol table node created */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer to image to deserialize */ + void * ret_value; /* Return value */ - /* - * Initialize variables. - */ + FUNC_ENTER_STATIC + + /* Sanity checks */ + HDassert(image); + HDassert(len > 0); + HDassert(f); + HDassert(dirty); /* Allocate symbol table data structures */ if(NULL == (sym = H5FL_CALLOC(H5G_node_t))) @@ -150,262 +195,175 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) if(NULL == (sym->entry = H5FL_SEQ_CALLOC(H5G_entry_t, (size_t)(2 * H5F_SYM_LEAF_K(f))))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - /* Wrap the local buffer for serialized node info */ - if(NULL == (wb = H5WB_wrap(node_buf, sizeof(node_buf)))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for node */ - if(NULL == (node = (uint8_t *)H5WB_actual(wb, sym->node_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read the serialized symbol table node. */ - if(H5F_block_read(f, H5FD_MEM_BTREE, addr, sym->node_size, dxpl_id, node) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, NULL, "unable to read symbol table node") - - /* Get temporary pointer to serialized node */ - p = node; - /* magic */ - if(HDmemcmp(p, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "bad symbol table node signature") - p += H5_SIZEOF_MAGIC; + if(HDmemcmp(image, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, NULL, "bad symbol table node signature") + image += H5_SIZEOF_MAGIC; /* version */ - if(H5G_NODE_VERS != *p++) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "bad symbol table node version") + if(H5G_NODE_VERS != *image++) + HGOTO_ERROR(H5E_SYM, H5E_VERSION, NULL, "bad symbol table node version") /* reserved */ - p++; + image++; /* number of symbols */ - UINT16DECODE(p, sym->nsyms); + UINT16DECODE(image, sym->nsyms); /* entries */ - if(H5G__ent_decode_vec(f, &p, sym->entry, sym->nsyms) < 0) + if(H5G__ent_decode_vec(f, &image, sym->entry, sym->nsyms) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "unable to decode symbol table entries") /* Set return value */ ret_value = sym; done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value) if(sym && H5G__node_free(sym) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, NULL, "unable to destroy symbol table node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_load() */ +} /* end H5G__cache_node_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5G_node_flush + * Function: H5G__cache_node_image_len * - * Purpose: Flush a symbol table node to disk. + * Purpose: Compute the size of the data structure on disk and return + * it in *image_len. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ static herr_t -H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_t *sym, unsigned H5_ATTR_UNUSED * flags_ptr) +H5G__cache_node_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - H5WB_t *wb = NULL; /* Wrapped buffer for node data */ - uint8_t node_buf[H5G_NODE_BUF_SIZE]; /* Buffer for node */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5G_node_t *sym = (const H5G_node_t *)_thing; /* Pointer to object */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR - /* - * Check arguments. - */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Sanity checks */ HDassert(sym); + HDassert(sym->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(sym->cache_info.type == H5AC_SNODE); + HDassert(image_len); - /* - * Write the symbol node to disk. - */ - if(sym->cache_info.is_dirty) { - uint8_t *node; /* Pointer to node buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - - /* Wrap the local buffer for serialized node info */ - if(NULL == (wb = H5WB_wrap(node_buf, sizeof(node_buf)))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for node */ - if(NULL == (node = (uint8_t *)H5WB_actual(wb, sym->node_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't get actual buffer") - - /* Get temporary pointer to serialized symbol table node */ - p = node; - - /* magic number */ - HDmemcpy(p, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; - - /* version number */ - *p++ = H5G_NODE_VERS; - - /* reserved */ - *p++ = 0; - - /* number of symbols */ - UINT16ENCODE(p, sym->nsyms); - - /* entries */ - if(H5G__ent_encode_vec(f, &p, sym->entry, sym->nsyms) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "can't serialize") - HDmemset(p, 0, sym->node_size - (size_t)(p - node)); - - /* Write the serialized symbol table node. */ - if(H5F_block_write(f, H5FD_MEM_BTREE, addr, sym->node_size, dxpl_id, node) < 0) - HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "unable to write symbol table node to the file") - - /* Reset the node's dirty flag */ - sym->cache_info.is_dirty = FALSE; - } /* end if */ + *image_len = sym->node_size; - /* - * Destroy the symbol node? This might happen if the node is being - * preempted from the cache. - */ - if(destroy) - if(H5G_node_dest(f, sym) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to destroy symbol table node") + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5G__cache_node_image_len() */ -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_flush() */ +/*************************************/ +/* no H5G__cache_node_pre_serialize() */ +/*************************************/ /*------------------------------------------------------------------------- - * Function: H5G_node_dest + * Function: H5G__cache_node_serialize * - * Purpose: Destroy a symbol table node in memory. + * Purpose: Given a correctly sized buffer and an instace of H5G_node_t, + * serialize the contents of the instance of H5G_node_t, and write + * this data into the supplied buffer. This buffer will be written + * to disk. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 15 2003 + * Programmer: John Mainzer + * 7/21/14 * *------------------------------------------------------------------------- */ static herr_t -H5G_node_dest(H5F_t *f, H5G_node_t *sym) +H5G__cache_node_serialize(const H5F_t *f, void *_image, size_t len, + void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5G_node_t *sym = (H5G_node_t *)_thing; /* Pointer to object */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* - * Check arguments. - */ + /* Sanity checks */ HDassert(f); + HDassert(image); HDassert(sym); + HDassert(sym->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(sym->cache_info.type == H5AC_SNODE); + HDassert(len == sym->node_size); - /* Verify that node is clean */ - HDassert(sym->cache_info.is_dirty == FALSE); + /* magic number */ + HDmemcpy(image, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!sym->cache_info.free_file_space_on_destroy || H5F_addr_defined(sym->cache_info.addr)); + /* version number */ + *image++ = H5G_NODE_VERS; - /* Check for freeing file space for symbol table node */ - if(sym->cache_info.free_file_space_on_destroy) { - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_BTREE, H5AC_dxpl_id, sym->cache_info.addr, (hsize_t)sym->node_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to free symbol table node") - } /* end if */ + /* reserved */ + *image++ = 0; - /* Destroy symbol table node */ - if(H5G__node_free(sym) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to destroy symbol table node") + /* number of symbols */ + UINT16ENCODE(image, sym->nsyms); + + /* entries */ + if(H5G__ent_encode_vec(f, &image, sym->entry, sym->nsyms) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "can't serialize") + + /* Clear rest of symbol table node */ + HDmemset(image, 0, sym->node_size - (size_t)(image - (uint8_t *)_image)); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_dest() */ +} /* end H5G__cache_node_serialize() */ + + +/***************************************/ +/* no H5G__cache_node_notify() function */ +/***************************************/ /*------------------------------------------------------------------------- - * Function: H5G_node_clear + * Function: H5G__cache_node_free_icr * - * Purpose: Mark a symbol table node in memory as non-dirty. + * Purpose: Destroys a symbol table node in memory. * - * Return: Non-negative on success/Negative on failure + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 20 2003 + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ static herr_t -H5G_node_clear(H5F_t *f, H5G_node_t *sym, hbool_t destroy) +H5G__cache_node_free_icr(void *_thing) { - herr_t ret_value = SUCCEED; + H5G_node_t *sym = (H5G_node_t *)_thing; /* Pointer to the object */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* - * Check arguments. - */ + /* Sanity checks */ HDassert(sym); + HDassert(sym->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(sym->cache_info.type == H5AC_SNODE); - /* Reset the node's dirty flag */ - sym->cache_info.is_dirty = FALSE; - - /* - * Destroy the symbol node? This might happen if the node is being - * preempted from the cache. - */ - if(destroy) - if(H5G_node_dest(f, sym) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to destroy symbol table node") + /* Destroy symbol table node */ + if(H5G__node_free(sym) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to destroy symbol table node") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_clear() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_node_size - * - * Purpose: Compute the size in bytes of the specified instance of - * H5G_node_t on disk, and return it in *size_ptr. On failure - * the value of size_ptr is undefined. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer - * 5/13/04 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5G_node_size(const H5F_t H5_ATTR_UNUSED *f, const H5G_node_t *sym, size_t *size_ptr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* - * Check arguments. - */ - HDassert(f); - HDassert(size_ptr); - - *size_ptr = sym->node_size; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_node_size() */ +} /* end H5G__cache_node_free_icr() */ diff --git a/src/H5Gent.c b/src/H5Gent.c index 3f243de..3809933 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -460,7 +460,7 @@ H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, targ_oloc.addr = lnk->u.hard.addr; /* Get the object header */ - if(NULL == (oh = H5O_protect(&targ_oloc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(&targ_oloc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTPROTECT, FAIL, "unable to protect target object header") /* Check if a symbol table message exists */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index d695dac..cbb9a8e 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -541,7 +541,7 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED /* * Load the symbol table node for exclusive access. */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table node") /* Get base address of heap */ @@ -647,7 +647,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, /* * Load the symbol node. */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_WRITE))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") /* Get base address of heap */ @@ -691,7 +691,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, if(H5G_node_create(f, dxpl_id, H5B_INS_FIRST, NULL, NULL, NULL, new_node_p/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to split symbol table node") - if(NULL == (snrt = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, *new_node_p, f, H5AC_WRITE))) + if(NULL == (snrt = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, *new_node_p, f, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to split symbol table node") HDmemcpy(snrt->entry, sn->entry + H5F_SYM_LEAF_K(f), @@ -808,7 +808,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, HDassert(udata && udata->common.heap); /* Load the symbol table */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_WRITE))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") /* "Normal" removal of a single entry from the symbol table node */ @@ -1001,7 +1001,7 @@ H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, h HDassert(udata && udata->heap); /* Protect the symbol table node & local heap while we iterate over entries */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* @@ -1078,7 +1078,7 @@ H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, had HDassert(num_objs); /* Find the object node and add the number of symbol entries. */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") *num_objs += sn->nsyms; @@ -1123,7 +1123,7 @@ H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, ha HDassert(udata); /* Get a pointer to the symbol table node */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node"); /* Find the node, locate the object symbol table entry and retrieve the name */ @@ -1261,11 +1261,11 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd HDassert(udata); /* load the symbol table into memory from the source file */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* get the base address of the heap */ - if(NULL == (heap = H5HL_protect(f, dxpl_id, udata->src_heap_addr, H5AC_READ))) + if(NULL == (heap = H5HL_protect(f, dxpl_id, udata->src_heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5_ITER_ERROR, "unable to protect symbol name") /* copy object in this node one by one */ @@ -1420,7 +1420,7 @@ H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_ke * Save information about the symbol table node since we can't lock it * because we're about to call an application function. */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* Check if the link table needs to be extended */ @@ -1527,14 +1527,14 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, /* Pin the heap down in memory */ if(heap_addr > 0 && H5F_addr_defined(heap_addr)) - if(NULL == (heap = H5HL_protect(f, dxpl_id, heap_addr, H5AC_READ))) + if(NULL == (heap = H5HL_protect(f, dxpl_id, heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table heap") /* * If we couldn't load the symbol table node, then try loading the * B-tree node. */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) { + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) { H5G_bt_common_t udata; /*data to pass through B-tree */ H5E_clear_stack(NULL); /* discard that error */ diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 4c338c9..08188ae 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -160,7 +160,7 @@ H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create heap") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(f, dxpl_id, stab->heap_addr, H5AC_WRITE))) + if(NULL == (heap = H5HL_protect(f, dxpl_id, stab->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Insert name into the heap */ @@ -276,7 +276,7 @@ H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, const char *name, HDassert(obj_lnk); /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(f, dxpl_id, stab->heap_addr, H5AC_WRITE))) + if(NULL == (heap = H5HL_protect(f, dxpl_id, stab->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Initialize data to pass through B-tree */ @@ -373,7 +373,7 @@ H5G__stab_remove(const H5O_loc_t *loc, hid_t dxpl_id, H5RS_str_t *grp_full_path_ HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "not a symbol table") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(loc->file, dxpl_id, stab.heap_addr, H5AC_WRITE))) + if(NULL == (heap = H5HL_protect(loc->file, dxpl_id, stab.heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Initialize data to pass through B-tree */ @@ -431,7 +431,7 @@ H5G__stab_remove_by_idx(const H5O_loc_t *grp_oloc, hid_t dxpl_id, H5RS_str_t *gr HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "not a symbol table") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC_WRITE))) + if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Initialize data to pass through B-tree */ @@ -485,7 +485,7 @@ H5G__stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) HDassert(H5F_addr_defined(stab->heap_addr)); /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(f, dxpl_id, stab->heap_addr, H5AC_WRITE))) + if(NULL == (heap = H5HL_protect(f, dxpl_id, stab->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Set up user data for B-tree deletion */ @@ -546,7 +546,7 @@ H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(oloc->file, dxpl_id, stab.heap_addr, H5AC_READ))) + if(NULL == (heap = H5HL_protect(oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Check on iteration order */ @@ -766,7 +766,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(oloc->file, dxpl_id, stab.heap_addr, H5AC_READ))) + if(NULL == (heap = H5HL_protect(oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Remap index for decreasing iteration order */ @@ -888,7 +888,7 @@ H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't read message") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC_READ))) + if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Set up user data to pass to 'find' operation callback */ @@ -989,7 +989,7 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC_READ))) + if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Remap index for decreasing iteration order */ @@ -1081,10 +1081,10 @@ H5G__stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5O_stab_t *alt_stab) } /* end if */ /* Check if the symbol table message's heap address is valid */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC_READ))) { + if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) { /* Address is invalid, try the heap address in the alternate symbol * table message */ - if(!alt_stab || NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, alt_stab->heap_addr, H5AC_READ))) + if(!alt_stab || NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, alt_stab->heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "unable to locate heap") else { /* The alternate symbol table's heap address is valid. Adjust the diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 89b4a37..1c0adea 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -637,7 +637,7 @@ H5G__verify_cached_stab_test(H5O_loc_t *grp_oloc, H5G_entry_t *ent) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "b-tree address is invalid") /* Verify that the heap address is valid */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC_READ))) + if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "heap address is invalid") done: @@ -686,7 +686,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, HDassert(H5F_addr_defined(addr)); /* Load the node */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* Check each target object to see if its stab message (if present) matches @@ -701,7 +701,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, targ_oloc.addr = sn->entry[i].header; /* Load target object header */ - if(NULL == (targ_oh = H5O_protect(&targ_oloc, dxpl_id, H5AC_READ))) + if(NULL == (targ_oh = H5O_protect(&targ_oloc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to protect target object header") /* Check if a symbol table message exists */ diff --git a/src/H5HF.c b/src/H5HF.c index f57c5e2..0464da4 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -172,7 +172,7 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed for fractal heap info") /* Lock the heap header into memory */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC_WRITE))) + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap header") /* Point fractal heap wrapper at header and bump it's ref count */ @@ -231,7 +231,7 @@ H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) HDassert(H5F_addr_defined(fh_addr)); /* Load the heap header into memory */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC_READ))) + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap header") /* Check for pending heap deletion */ @@ -821,7 +821,7 @@ H5HF_close(H5HF_t *fh, hid_t dxpl_id) H5HF_hdr_t *hdr; /* Another pointer to fractal heap header */ /* Lock the heap header into memory */ - if(NULL == (hdr = H5HF_hdr_protect(fh->f, dxpl_id, heap_addr, H5AC_WRITE))) + if(NULL == (hdr = H5HF_hdr_protect(fh->f, dxpl_id, heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Delete heap, starting with header (unprotects header) */ @@ -865,7 +865,7 @@ H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) HDassert(H5F_addr_defined(fh_addr)); /* Lock the heap header into memory */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC_WRITE))) + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Check for files using shared heap header */ diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 07e5b36..ec8d9a6 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -53,12 +53,6 @@ #define H5HF_DBLOCK_VERSION 0 /* Direct block */ #define H5HF_IBLOCK_VERSION 0 /* Indirect block */ -/* Size of stack buffer for serialized headers */ -#define H5HF_HDR_BUF_SIZE 512 - -/* Size of stack buffer for serialized indirect blocks */ -#define H5HF_IBLOCK_BUF_SIZE 4096 - /******************/ /* Local Typedefs */ @@ -79,24 +73,48 @@ static herr_t H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *d static herr_t H5HF__dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable); /* Metadata cache (H5AC) callbacks */ -static H5HF_hdr_t *H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HF_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr); -static herr_t H5HF_cache_hdr_dest(H5F_t *f, H5HF_hdr_t *hdr); -static herr_t H5HF_cache_hdr_clear(H5F_t *f, H5HF_hdr_t *hdr, hbool_t destroy); -static herr_t H5HF_cache_hdr_size(const H5F_t *f, const H5HF_hdr_t *hdr, size_t *size_ptr); -static H5HF_indirect_t *H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HF_cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_indirect_t *iblock, unsigned H5_ATTR_UNUSED * flags_ptr); -static herr_t H5HF_cache_iblock_dest(H5F_t *f, H5HF_indirect_t *iblock); -static herr_t H5HF_cache_iblock_clear(H5F_t *f, H5HF_indirect_t *iblock, hbool_t destroy); -static herr_t H5HF_cache_iblock_notify(H5C_notify_action_t action, H5HF_indirect_t *iblock); -static herr_t H5HF_cache_iblock_size(const H5F_t *f, const H5HF_indirect_t *iblock, size_t *size_ptr); -static H5HF_direct_t *H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HF_cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_direct_t *dblock, unsigned H5_ATTR_UNUSED * flags_ptr); -static herr_t H5HF_cache_dblock_dest(H5F_t *f, H5HF_direct_t *dblock); -static herr_t H5HF_cache_dblock_clear(H5F_t *f, H5HF_direct_t *dblock, hbool_t destroy); -static herr_t H5HF_cache_dblock_notify(H5C_notify_action_t action, H5HF_direct_t *dblock); -static herr_t H5HF_cache_dblock_size(const H5F_t *f, const H5HF_direct_t *dblock, size_t *size_ptr); - +static herr_t H5HF__cache_hdr_get_load_size(const void *udata, size_t *image_len); +static void *H5HF__cache_hdr_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5HF__cache_hdr_image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5HF__cache_hdr_pre_serialize(const H5F_t *f, hid_t dxpl_id, + void *thing, haddr_t addr, size_t len, size_t compressed_len, + haddr_t *new_addr, size_t *new_len, size_t *new_compressed_len, + unsigned *flags); +static herr_t H5HF__cache_hdr_serialize(const H5F_t *f, void *image, + size_t len, void *thing); +static herr_t H5HF__cache_hdr_free_icr(void *thing); + +static herr_t H5HF__cache_iblock_get_load_size(const void *udata, size_t *image_len); +static void *H5HF__cache_iblock_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5HF__cache_iblock_image_len(const void *thing, + size_t *image_len, hbool_t *compressed_ptr, + size_t *compressed_image_len_ptr); +static herr_t H5HF__cache_iblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, + void *thing, haddr_t addr, size_t len, size_t compressed_len, + haddr_t *new_addr, size_t *new_len, size_t *new_compressed_len, + unsigned *flags); +static herr_t H5HF__cache_iblock_serialize(const H5F_t *f, void *image, + size_t len, void *thing); +static herr_t H5HF__cache_iblock_notify(H5C_notify_action_t action, void *thing); +static herr_t H5HF__cache_iblock_free_icr(void *thing); + +static herr_t H5HF__cache_dblock_get_load_size(const void *udata, size_t *image_len); +static void *H5HF__cache_dblock_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5HF__cache_dblock_image_len(const void *thing, + size_t *image_len, hbool_t *compressed_ptr, + size_t *compressed_image_len_ptr); +static herr_t H5HF__cache_dblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, + void *thing, haddr_t addr, size_t len, size_t compressed_len, + haddr_t *new_addr, size_t *new_len, size_t *new_compressed_len, + unsigned *flags); +static herr_t H5HF__cache_dblock_serialize(const H5F_t *f, void *image, + size_t len, void *thing); +static herr_t H5HF__cache_dblock_notify(H5C_notify_action_t action, void *thing); +static herr_t H5HF__cache_dblock_free_icr(void *thing); /* Debugging Function Prototypes */ #ifndef NDEBUG @@ -117,35 +135,53 @@ static herr_t H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, hid_t dxpl_i /* H5HF header inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_FHEAP_HDR[1] = {{ - H5AC_FHEAP_HDR_ID, - (H5AC_load_func_t)H5HF_cache_hdr_load, - (H5AC_flush_func_t)H5HF_cache_hdr_flush, - (H5AC_dest_func_t)H5HF_cache_hdr_dest, - (H5AC_clear_func_t)H5HF_cache_hdr_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5HF_cache_hdr_size, + H5AC_FHEAP_HDR_ID, /* Metadata client ID */ + "fractal heap header", /* Metadata client name (for debugging) */ + H5FD_MEM_FHEAP_HDR, /* File space memory type for client */ + H5AC__CLASS_SPECULATIVE_LOAD_FLAG, /* Client class behavior flags */ + H5HF__cache_hdr_get_load_size, /* 'get_load_size' callback */ + H5HF__cache_hdr_deserialize, /* 'deserialize' callback */ + H5HF__cache_hdr_image_len, /* 'image_len' callback */ + H5HF__cache_hdr_pre_serialize, /* 'pre_serialize' callback */ + H5HF__cache_hdr_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5HF__cache_hdr_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; /* H5HF indirect block inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_FHEAP_IBLOCK[1] = {{ - H5AC_FHEAP_IBLOCK_ID, - (H5AC_load_func_t)H5HF_cache_iblock_load, - (H5AC_flush_func_t)H5HF_cache_iblock_flush, - (H5AC_dest_func_t)H5HF_cache_iblock_dest, - (H5AC_clear_func_t)H5HF_cache_iblock_clear, - (H5AC_notify_func_t)H5HF_cache_iblock_notify, - (H5AC_size_func_t)H5HF_cache_iblock_size, + H5AC_FHEAP_IBLOCK_ID, /* Metadata client ID */ + "fractal heap indirect block", /* Metadata client name (for debugging) */ + H5FD_MEM_FHEAP_IBLOCK, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5HF__cache_iblock_get_load_size, /* 'get_load_size' callback */ + H5HF__cache_iblock_deserialize, /* 'deserialize' callback */ + H5HF__cache_iblock_image_len, /* 'image_len' callback */ + H5HF__cache_iblock_pre_serialize, /* 'pre_serialize' callback */ + H5HF__cache_iblock_serialize, /* 'serialize' callback */ + H5HF__cache_iblock_notify, /* 'notify' callback */ + H5HF__cache_iblock_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; /* H5HF direct block inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_FHEAP_DBLOCK[1] = {{ - H5AC_FHEAP_DBLOCK_ID, - (H5AC_load_func_t)H5HF_cache_dblock_load, - (H5AC_flush_func_t)H5HF_cache_dblock_flush, - (H5AC_dest_func_t)H5HF_cache_dblock_dest, - (H5AC_clear_func_t)H5HF_cache_dblock_clear, - (H5AC_notify_func_t)H5HF_cache_dblock_notify, - (H5AC_size_func_t)H5HF_cache_dblock_size, + H5AC_FHEAP_DBLOCK_ID, /* Metadata client ID */ + "fractal heap direct block", /* Metadata client name (for debugging) */ + H5FD_MEM_FHEAP_DBLOCK, /* File space memory type for client */ + H5C__CLASS_COMPRESSED_FLAG, /* Client class behavior flags */ + H5HF__cache_dblock_get_load_size, /* 'get_load_size' callback */ + H5HF__cache_dblock_deserialize, /* 'deserialize' callback */ + H5HF__cache_dblock_image_len, /* 'image_len' callback */ + H5HF__cache_dblock_pre_serialize, /* 'pre_serialize' callback */ + H5HF__cache_dblock_serialize, /* 'serialize' callback */ + H5HF__cache_dblock_notify, /* 'notify' callback */ + H5HF__cache_dblock_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; @@ -268,119 +304,191 @@ H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) /*------------------------------------------------------------------------- - * Function: H5HF_cache_hdr_load + * Function: H5HF__cache_hdr_get_load_size() * - * Purpose: Loads a fractal heap header from the disk. + * Purpose: Determine the size of the fractal heap header on disk, + * and set *image_len to this value. * - * Return: Success: Pointer to a new fractal heap + * This code is based on the old H5HF_cache_hdr_load() routine + * that was used with the version 2 metadata cache. Note the + * use of a dummy header to compute the on disk size of the header. + * + * Note also that the value returned by this function presumes that + * there is no I/O filtering data in the header. If there is, the + * size reported will be too small, and H5C_load_entry() + * will have to make two tries to load the fractal heap header. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF__cache_hdr_get_load_size(const void *_udata, size_t *image_len) +{ + const H5HF_hdr_cache_ud_t *udata = (const H5HF_hdr_cache_ud_t *)_udata; /* pointer to user data */ + H5HF_hdr_t dummy_hdr; /* dummy header -- to compute size */ + + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ + HDassert(udata); + HDassert(image_len); + + /* Set the internal parameters for the heap */ + dummy_hdr.f = udata->f; + dummy_hdr.sizeof_size = H5F_SIZEOF_SIZE(udata->f); + dummy_hdr.sizeof_addr = H5F_SIZEOF_ADDR(udata->f); + + /* Compute the 'base' size of the fractal heap header on disk */ + *image_len = (size_t)H5HF_HEADER_SIZE(&dummy_hdr); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HF__cache_hdr_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5HF__cache_hdr_deserialize + * + * Purpose: Given a buffer containing an on disk image of a fractal heap + * header block, allocate an instance of H5HF_hdr_t, load the contents + * of the buffer into into the new instance of H5HF_hdr_t, and then + * return a pointer to the new instance. + * + * Since H5HF__cache_hdr_get_load_size() reports header on disk size + * base on the assumption that the header contains no I/O filtering + * data, it is possible that the provided image will be too small. + * + * In this case, we DO NOT flag an error when this is discovered. + * Instead, we make note of the correct image size, and report + * success. + * + * Since H5HF__cache_hdr_image_len() callback is defined, + * H5C_load_entry() will call H5HF__cache_hdr_image_len() and + * obtain the correct image length. + * + * Since the H5AC__CLASS_SPECULATIVE_LOAD_FLAG is set, + * H5C_load_entry() will load an image of the correct size, and + * then call this function again to deserialize it. Before doing + * so, it will also call H5HF__cache_hdr_free_icr() to discard the + * result of the first deserialize call. + * + * Note that the v2 B-tree and free space manager associated + * with the fractal heap (roots stored in the huge_bt2 and fspace + * fields respectively) are not loaded at this time. As best I can + * tell from reviewing the code, they are loaded or created when + * they are accessed. + * + * Return: Success: Pointer to in core representation * Failure: NULL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 24 2006 + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ -static H5HF_hdr_t * -H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, + hbool_t H5_ATTR_UNUSED *dirty) { - H5HF_hdr_t *hdr = NULL; /* Fractal heap info */ - H5HF_hdr_cache_ud_t *udata = (H5HF_hdr_cache_ud_t *)_udata; - size_t size; /* Header size */ - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5HF_HDR_BUF_SIZE]; /* Buffer for header */ - uint8_t *buf; /* Pointer to header buffer */ - const uint8_t *p; /* Pointer into raw data buffer */ + H5HF_hdr_t *hdr = NULL; /* Fractal heap info */ + H5HF_hdr_cache_ud_t *udata = (H5HF_hdr_cache_ud_t *)_udata; /* User data for callback */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into into supplied image */ + size_t size; /* Header size */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ uint8_t heap_flags; /* Status flags for heap */ - H5HF_hdr_t *ret_value; /* Return value */ + void * ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Sanity checks */ + HDassert(image); + HDassert(len > 0); HDassert(udata); + HDassert(dirty); /* Allocate space for the fractal heap data structure */ if(NULL == (hdr = H5HF_hdr_alloc(udata->f))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't wrap buffer") - /* Compute the 'base' size of the fractal heap header on disk */ size = (size_t)H5HF_HEADER_SIZE(hdr); - /* Get a pointer to a buffer that's large enough for serialized header */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read header from disk */ - if(H5F_block_read(f, H5FD_MEM_FHEAP_HDR, addr, size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "can't read fractal heap header") - - /* Get temporary pointer to serialized header */ - p = buf; + /* the size we have just calculated presumes that there is no I/O + * filter information in the header. If there is no filter information, + * the deserialize operation should succeed. + * + * If there is filter information, the first attempt to deserialize + * the header will reveal this. In this case, we will be unable to + * deserialize the header as the supplied image will be too small. + * However, we will make note of the correct size and report success + * anyway. + * + * When H5C_load_entry() calls H5HF__cache_hdr_image_len(), we will report + * the correct size. Since the H5C__CLASS_SPECULATIVE_LOAD_FLAG is set, + * this will prompt H5C_load_entry() to load the correct size image, + * discard the result of the first attempt at deserialization, and + * call this routine a second time to deserialize the correct size + * buffer. + */ + HDassert(size <= len); /* Magic number */ - if(HDmemcmp(p, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "wrong fractal heap header signature") - p += H5_SIZEOF_MAGIC; + if(HDmemcmp(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap header signature") + image += H5_SIZEOF_MAGIC; /* Version */ - if(*p++ != H5HF_HDR_VERSION) + if(*image++ != H5HF_HDR_VERSION) HGOTO_ERROR(H5E_HEAP, H5E_VERSION, NULL, "wrong fractal heap header version") /* General heap information */ - UINT16DECODE(p, hdr->id_len); /* Heap ID length */ - UINT16DECODE(p, hdr->filter_len); /* I/O filters' encoded length */ + UINT16DECODE(image, hdr->id_len); /* Heap ID length */ + UINT16DECODE(image, hdr->filter_len); /* I/O filters' encoded length */ /* Heap status flags */ /* (bit 0: "huge" object IDs have wrapped) */ /* (bit 1: checksum direct blocks) */ - heap_flags = *p++; + heap_flags = *image++; hdr->huge_ids_wrapped = heap_flags & H5HF_HDR_FLAGS_HUGE_ID_WRAPPED; hdr->checksum_dblocks = heap_flags & H5HF_HDR_FLAGS_CHECKSUM_DBLOCKS; /* "Huge" object information */ - UINT32DECODE(p, hdr->max_man_size); /* Max. size of "managed" objects */ - H5F_DECODE_LENGTH(udata->f, p, hdr->huge_next_id); /* Next ID to use for "huge" object */ - H5F_addr_decode(udata->f, &p, &hdr->huge_bt2_addr); /* Address of "huge" object tracker B-tree */ + UINT32DECODE(image, hdr->max_man_size); /* Max. size of "managed" objects */ + H5F_DECODE_LENGTH(udata->f, image, hdr->huge_next_id); /* Next ID to use for "huge" object */ + H5F_addr_decode(udata->f, &image, &hdr->huge_bt2_addr); /* Address of "huge" object tracker B-tree */ /* "Managed" object free space information */ - H5F_DECODE_LENGTH(udata->f, p, hdr->total_man_free); /* Internal free space in managed direct blocks */ - H5F_addr_decode(udata->f, &p, &hdr->fs_addr); /* Address of free section header */ + H5F_DECODE_LENGTH(udata->f, image, hdr->total_man_free); /* Internal free space in managed direct blocks */ + H5F_addr_decode(udata->f, &image, &hdr->fs_addr); /* Address of free section header */ /* Heap statistics */ - H5F_DECODE_LENGTH(udata->f, p, hdr->man_size); - H5F_DECODE_LENGTH(udata->f, p, hdr->man_alloc_size); - H5F_DECODE_LENGTH(udata->f, p, hdr->man_iter_off); - H5F_DECODE_LENGTH(udata->f, p, hdr->man_nobjs); - H5F_DECODE_LENGTH(udata->f, p, hdr->huge_size); - H5F_DECODE_LENGTH(udata->f, p, hdr->huge_nobjs); - H5F_DECODE_LENGTH(udata->f, p, hdr->tiny_size); - H5F_DECODE_LENGTH(udata->f, p, hdr->tiny_nobjs); + H5F_DECODE_LENGTH(udata->f, image, hdr->man_size); + H5F_DECODE_LENGTH(udata->f, image, hdr->man_alloc_size); + H5F_DECODE_LENGTH(udata->f, image, hdr->man_iter_off); + H5F_DECODE_LENGTH(udata->f, image, hdr->man_nobjs); + H5F_DECODE_LENGTH(udata->f, image, hdr->huge_size); + H5F_DECODE_LENGTH(udata->f, image, hdr->huge_nobjs); + H5F_DECODE_LENGTH(udata->f, image, hdr->tiny_size); + H5F_DECODE_LENGTH(udata->f, image, hdr->tiny_nobjs); /* Managed objects' doubling-table info */ - if(H5HF__dtable_decode(hdr->f, &p, &(hdr->man_dtable)) < 0) + if(H5HF__dtable_decode(hdr->f, &image, &(hdr->man_dtable)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTENCODE, NULL, "unable to encode managed obj. doubling table info") /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(p - (const uint8_t *)buf) == (size - H5HF_SIZEOF_CHKSUM)); + HDassert((size_t)(image - (const uint8_t *)_image) == (size - H5HF_SIZEOF_CHKSUM)); /* Check for I/O filter information to decode */ if(hdr->filter_len > 0) { - size_t filter_info_off; /* Offset in header of filter information */ size_t filter_info_size; /* Size of filter information */ H5O_pline_t *pline; /* Pipeline information from the header on disk */ - /* Compute the offset of the filter info in the header */ - filter_info_off = (size_t)(p - (const uint8_t *)buf); - /* 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 */ @@ -389,28 +497,27 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Compute the heap header's size */ hdr->heap_size = size + filter_info_size; - /* Re-size current buffer */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, hdr->heap_size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read in I/O filter information */ - /* (and the checksum) */ - if(H5F_block_read(f, H5FD_MEM_FHEAP_HDR, (addr + filter_info_off), (filter_info_size + H5HF_SIZEOF_CHKSUM), dxpl_id, (buf + filter_info_off)) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "can't read fractal heap header's I/O pipeline filter info") + if(size == len) + /* we were supplied with too small a buffer -- goto done + * and let H5C_load_entry() retry with a larger buffer + */ + HGOTO_DONE((void *)hdr) - /* Point at correct offset in header for the filter information */ - p = buf + filter_info_off; + else + if((size + filter_info_size) != len) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "bad image len") /* Decode the size of a filtered root direct block */ - H5F_DECODE_LENGTH(udata->f, p, hdr->pline_root_direct_size); + H5F_DECODE_LENGTH(udata->f, image, hdr->pline_root_direct_size); /* Decode the filter mask for a filtered root direct block */ - UINT32DECODE(p, hdr->pline_root_direct_filter_mask); + UINT32DECODE(image, hdr->pline_root_direct_filter_mask); /* Decode I/O filter information */ - if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, udata->dxpl_id, NULL, H5O_PLINE_ID, p))) + if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, udata->dxpl_id, NULL, H5O_PLINE_ID, image))) HGOTO_ERROR(H5E_HEAP, H5E_CANTDECODE, NULL, "can't decode I/O pipeline filters") - p += hdr->filter_len; + + image += hdr->filter_len; /* Copy the information into the header's I/O pipeline structure */ if(NULL == H5O_msg_copy(H5O_PLINE_ID, pline, &(hdr->pline))) @@ -425,13 +532,13 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Compute checksum on entire header */ /* (including the filter information, if present) */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - (const uint8_t *)buf), 0); + computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (const uint8_t *)_image), 0); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - (const uint8_t *)buf) == hdr->heap_size); + HDassert((size_t)(image - (const uint8_t *)_image) == hdr->heap_size); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -442,291 +549,324 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, NULL, "can't finish initializing shared fractal heap header") /* Set return value */ - ret_value = hdr; + ret_value = (void *)hdr; done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_HEAP, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value && hdr) if(H5HF_hdr_free(hdr) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_hdr_load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* end H5HF__cache_hdr_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_hdr_flush + * Function: H5HF__cache_hdr_image_len * - * Purpose: Flushes a dirty fractal heap header to disk. + * Purpose: Return the actual size of the fractal heap header on + * disk image. * - * Return: Non-negative on success/Negative on failure + * If the header contains filter information, this size will be + * larger than the value returned by H5HF__cache_hdr_get_load_size(). * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 24 2006 + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ -static herr_t -H5HF_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr) +static herr_t +H5HF__cache_hdr_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5HF_HDR_BUF_SIZE]; /* Buffer for header */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5HF_hdr_t *hdr = (const H5HF_hdr_t *)_thing; /* Fractal heap info */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Sanity checks */ HDassert(hdr); + HDassert(hdr->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); + HDassert(image_len); - if(hdr->cache_info.is_dirty) { - uint8_t *buf; /* Temporary raw data buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - size_t size; /* Header size on disk */ - uint8_t heap_flags; /* Status flags for heap */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - -#ifndef NDEBUG -{ - /* Verify that flush dependencies are working correctly. Do this - * by verifying that either: - * - * 1) the header has a root iblock, and that the root iblock and all - * of its children are clean, or - * - * 2) The header has a root dblock, which is clean, or - * - * 3) The heap is empty, and thus the header has neither a root - * iblock no a root dblock. In this case, the flush ordering - * constraint is met by default. - * - * Do this with a call to H5HF__cache_verify_hdr_descendants_clean(). - */ - hbool_t descendants_clean = TRUE; + *image_len = hdr->heap_size; - if(H5HF__cache_verify_hdr_descendants_clean(f, dxpl_id, hdr, &descendants_clean) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify hdr descendants clean.") - HDassert(descendants_clean); -} -#endif /* NDEBUG */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HF__cache_hdr_image_len() */ - /* Set the shared heap header's file context for this operation */ - hdr->f = f; - - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't wrap buffer") - - /* Compute the size of the heap header on disk */ - size = hdr->heap_size; - - /* Get a pointer to a buffer that's large enough for serialized header */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "can't get actual buffer") - - /* Get temporary pointer to serialized header */ - p = buf; - - /* Magic number */ - HDmemcpy(p, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; - - /* Version # */ - *p++ = H5HF_HDR_VERSION; - - /* General heap information */ - UINT16ENCODE(p, hdr->id_len); /* Heap ID length */ - UINT16ENCODE(p, hdr->filter_len); /* I/O filters' encoded length */ - - /* Heap status flags */ - /* (bit 0: "huge" object IDs have wrapped) */ - /* (bit 1: checksum direct blocks) */ - heap_flags = 0; - heap_flags = (uint8_t)(heap_flags | (hdr->huge_ids_wrapped ? H5HF_HDR_FLAGS_HUGE_ID_WRAPPED : 0)); - heap_flags = (uint8_t)(heap_flags | (hdr->checksum_dblocks ? H5HF_HDR_FLAGS_CHECKSUM_DBLOCKS : 0)); - *p++ = heap_flags; - - /* "Huge" object information */ - UINT32ENCODE(p, hdr->max_man_size); /* Max. size of "managed" objects */ - H5F_ENCODE_LENGTH(f, p, hdr->huge_next_id); /* Next ID to use for "huge" object */ - H5F_addr_encode(f, &p, hdr->huge_bt2_addr); /* Address of "huge" object tracker B-tree */ - - /* "Managed" object free space information */ - H5F_ENCODE_LENGTH(f, p, hdr->total_man_free); /* Internal free space in managed direct blocks */ - H5F_addr_encode(f, &p, hdr->fs_addr); /* Address of free section header */ - - /* Heap statistics */ - H5F_ENCODE_LENGTH(f, p, hdr->man_size); - H5F_ENCODE_LENGTH(f, p, hdr->man_alloc_size); - H5F_ENCODE_LENGTH(f, p, hdr->man_iter_off); - H5F_ENCODE_LENGTH(f, p, hdr->man_nobjs); - H5F_ENCODE_LENGTH(f, p, hdr->huge_size); - H5F_ENCODE_LENGTH(f, p, hdr->huge_nobjs); - H5F_ENCODE_LENGTH(f, p, hdr->tiny_size); - H5F_ENCODE_LENGTH(f, p, hdr->tiny_nobjs); - - /* Managed objects' doubling-table info */ - if(H5HF__dtable_encode(hdr->f, &p, &(hdr->man_dtable)) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTENCODE, FAIL, "unable to encode managed obj. doubling table info") - - /* Check for I/O filter information to encode */ - if(hdr->filter_len > 0) { - /* Encode the size of a filtered root direct block */ - H5F_ENCODE_LENGTH(f, p, hdr->pline_root_direct_size); + +/*------------------------------------------------------------------------- + * Function: H5HF__cache_hdr_pre_serialize + * + * Purpose: As best I can tell, fractal heap header blocks are always + * allocated in real file space. Thus this routine simply verifies + * this, verifies that the len parameter contains the expected + * value, and returns an error if either of these checks fail. + * + * When compiled in debug mode, the function also verifies that all + * indirect and direct blocks that are children of the header are + * either clean, or not in the metadata cache. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF__cache_hdr_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing, + haddr_t addr, size_t len, size_t H5_ATTR_UNUSED compressed_len, + haddr_t H5_ATTR_UNUSED *new_addr, size_t H5_ATTR_UNUSED *new_len, + size_t H5_ATTR_UNUSED *new_compressed_len, unsigned *flags) +{ + H5HF_hdr_t *hdr = (H5HF_hdr_t *)_thing; /* Fractal heap info */ + herr_t ret_value = SUCCEED; /* Return value */ - /* Encode the filter mask for a filtered root direct block */ - UINT32ENCODE(p, hdr->pline_root_direct_filter_mask); + FUNC_ENTER_STATIC - /* Encode I/O filter information */ - if(H5O_msg_encode(hdr->f, H5O_PLINE_ID, FALSE, p, &(hdr->pline)) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTENCODE, FAIL, "can't encode I/O pipeline fiters") - p += hdr->filter_len; - } /* end if */ + /* Sanity checks */ + HDassert(f); + HDassert(hdr); + HDassert(hdr->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); + HDassert(H5F_addr_defined(addr)); + HDassert(addr == hdr->heap_addr); + HDassert(new_addr); + HDassert(new_len); + HDassert(flags); - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); +#ifndef NDEBUG +{ + hbool_t descendants_clean = TRUE; - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); + /* Verify that flush dependencies are working correctly. Do this + * by verifying that either: + * + * 1) the header has a root iblock, and that the root iblock and all + * of its children are clean, or + * + * 2) The header has a root dblock, which is clean, or + * + * 3) The heap is empty, and thus the header has neither a root + * iblock no a root dblock. In this case, the flush ordering + * constraint is met by default. + * + * Do this with a call to H5HF__cache_verify_hdr_descendants_clean(). + */ + if(H5HF__cache_verify_hdr_descendants_clean((H5F_t *)f, dxpl_id, hdr, &descendants_clean) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify hdr descendants clean.") + HDassert(descendants_clean); +} +#endif /* NDEBUG */ - /* Write the heap header. */ - HDassert((size_t)(p - buf) == size); - if(H5F_block_write(f, H5FD_MEM_FHEAP_HDR, addr, size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFLUSH, FAIL, "unable to save fractal heap header to disk") + if(H5F_IS_TMP_ADDR(f, addr)) + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "addr in temporary space?!?."); - hdr->cache_info.is_dirty = FALSE; - } /* end if */ + if(len != hdr->heap_size) + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "unexpected image len."); - if(destroy) - if(H5HF_cache_hdr_dest(f, hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap header") + *flags = 0; done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_HEAP, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") - FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_cache_hdr_flush() */ +} /* end H5HF__cache_hdr_pre_serialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_hdr_dest + * Function: H5HF__cache_hdr_serialize * - * Purpose: Destroys a fractal heap header in memory. + * Purpose: Construct the on disk image of the header, and place it in + * the buffer pointed to by image. Return SUCCEED on success, + * and FAIL on failure. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 24 2006 + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ -static herr_t -H5HF_cache_hdr_dest(H5F_t *f, H5HF_hdr_t *hdr) +static herr_t +H5HF__cache_hdr_serialize(const H5F_t *f, void *_image, size_t len, + void *_thing) { + H5HF_hdr_t *hdr = (H5HF_hdr_t *)_thing; /* Fractal heap info */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint8_t heap_flags; /* Status flags for heap */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* - * Check arguments. - */ + /* Sanity checks */ + HDassert(f); + HDassert(image); HDassert(hdr); - HDassert(hdr->rc == 0); + HDassert(hdr->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); + HDassert(len == hdr->heap_size); + + /* Set the shared heap header's file context for this operation */ + hdr->f = f; + + /* Magic number */ + HDmemcpy(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; + + /* Version # */ + *image++ = H5HF_HDR_VERSION; + + /* General heap information */ + UINT16ENCODE(image, hdr->id_len); /* Heap ID length */ + UINT16ENCODE(image, hdr->filter_len); /* I/O filters' encoded length */ + + /* Heap status flags */ + /* (bit 0: "huge" object IDs have wrapped) */ + /* (bit 1: checksum direct blocks) */ + heap_flags = 0; + heap_flags = (uint8_t)(heap_flags | (hdr->huge_ids_wrapped ? H5HF_HDR_FLAGS_HUGE_ID_WRAPPED : 0)); + heap_flags = (uint8_t)(heap_flags | (hdr->checksum_dblocks ? H5HF_HDR_FLAGS_CHECKSUM_DBLOCKS : 0)); + *image++ = heap_flags; + + /* "Huge" object information */ + UINT32ENCODE(image, hdr->max_man_size); /* Max. size of "managed" objects */ + H5F_ENCODE_LENGTH(f, image, hdr->huge_next_id); /* Next ID to use for "huge" object */ + H5F_addr_encode(f, &image, hdr->huge_bt2_addr); /* Address of "huge" object tracker B-tree */ + + /* "Managed" object free space information */ + H5F_ENCODE_LENGTH(f, image, hdr->total_man_free); /* Internal free space in managed direct blocks */ + H5F_addr_encode(f, &image, hdr->fs_addr); /* Address of free section header */ + + /* Heap statistics */ + H5F_ENCODE_LENGTH(f, image, hdr->man_size); + H5F_ENCODE_LENGTH(f, image, hdr->man_alloc_size); + H5F_ENCODE_LENGTH(f, image, hdr->man_iter_off); + H5F_ENCODE_LENGTH(f, image, hdr->man_nobjs); + H5F_ENCODE_LENGTH(f, image, hdr->huge_size); + H5F_ENCODE_LENGTH(f, image, hdr->huge_nobjs); + H5F_ENCODE_LENGTH(f, image, hdr->tiny_size); + H5F_ENCODE_LENGTH(f, image, hdr->tiny_nobjs); + + /* Managed objects' doubling-table info */ + if(H5HF__dtable_encode(hdr->f, &image, &(hdr->man_dtable)) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTENCODE, FAIL, "unable to encode managed obj. doubling table info") + + /* Check for I/O filter information to encode */ + if(hdr->filter_len > 0) { + /* Encode the size of a filtered root direct block */ + H5F_ENCODE_LENGTH(f, image, hdr->pline_root_direct_size); - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!hdr->cache_info.free_file_space_on_destroy || H5F_addr_defined(hdr->cache_info.addr)); + /* Encode the filter mask for a filtered root direct block */ + UINT32ENCODE(image, hdr->pline_root_direct_filter_mask); - /* Check for freeing file space for heap header */ - if(hdr->cache_info.free_file_space_on_destroy) { - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_FHEAP_HDR, H5AC_dxpl_id, hdr->cache_info.addr, (hsize_t)hdr->heap_size) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap header") + /* Encode I/O filter information */ + if(H5O_msg_encode(hdr->f, H5O_PLINE_ID, FALSE, image, &(hdr->pline)) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTENCODE, FAIL, "can't encode I/O pipeline fiters") + image += hdr->filter_len; } /* end if */ - /* Free the shared info itself */ - if(H5HF_hdr_free(hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "unable to release fractal heap header") + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0); + + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); + + /* sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) == len); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_hdr_dest() */ +} /* end H5HF__cache_hdr_serialize() */ + +/***************************************/ +/* no H5HF__cache_hdr_notify() function */ +/***************************************/ /*------------------------------------------------------------------------- - * Function: H5HF_cache_hdr_clear + * Function: H5HF__cache_hdr_free_icr * - * Purpose: Mark a fractal heap header in memory as non-dirty. + * Purpose: Free the in core representation of the fractal heap header. * - * Return: Non-negative on success/Negative on failure + * This routine frees just the header itself, not the + * associated version 2 B-Tree, the associated Free Space Manager, + * nor the indirect/direct block tree that is rooted in the header. * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 24 2006 + * This routine also does not free the file space that may + * be allocated to the header. + * + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ -static herr_t -H5HF_cache_hdr_clear(H5F_t *f, H5HF_hdr_t *hdr, hbool_t destroy) +static herr_t +H5HF__cache_hdr_free_icr(void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5HF_hdr_t *hdr = (H5HF_hdr_t *)_thing; /* Fractal heap info */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* - * Check arguments. - */ + /* Sanity checks */ HDassert(hdr); + HDassert(hdr->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); + HDassert(hdr->rc == 0); - /* Reset the dirty flag. */ - hdr->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5HF_cache_hdr_dest(f, hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap header") + if(H5HF_hdr_free(hdr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "unable to release fractal heap header") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_hdr_clear() */ +} /* end H5HF__cache_hdr_free_icr() */ + +/***********************************************************/ +/* metadata cache callback definitions for indirect blocks */ +/***********************************************************/ /*------------------------------------------------------------------------- - * Function: H5HF_cache_hdr_size + * Function: H5HF__cache_iblock_get_load_size() * - * Purpose: Compute the size in bytes of a fractal heap header - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Compute the size of the on disk image of the indirect + * block, and place this value in *image_len. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 24 2006 + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ -static herr_t -H5HF_cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5HF_hdr_t *hdr, size_t *size_ptr) +static herr_t +H5HF__cache_iblock_get_load_size(const void *_udata, size_t *image_len) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + const H5HF_iblock_cache_ud_t *udata = (const H5HF_iblock_cache_ud_t *)_udata; /* User data for callback */ - /* Check arguments */ - HDassert(f); - HDassert(hdr); - HDassert(size_ptr); + FUNC_ENTER_STATIC_NOERR - /* Set size value */ - *size_ptr = hdr->heap_size; + /* Sanity checks */ + HDassert(udata); + HDassert(image_len); + + *image_len = (size_t)H5HF_MAN_INDIRECT_SIZE(udata->par_info->hdr, *udata->nrows); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_cache_hdr_size() */ +} /* end H5HF__cache_iblock_get_load_size() */ /***********************************************************/ /* metadata cache callback definitions for indirect blocks */ @@ -734,53 +874,55 @@ H5HF_cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5HF_hdr_t *hdr, size_t /*------------------------------------------------------------------------- - * Function: H5HF_cache_iblock_load + * Function: H5HF__cache_iblock_deserialize * - * Purpose: Loads a fractal heap indirect block from the disk. + * Purpose: Given a buffer containing the on disk image of the indirect + * block, allocate an instance of H5HF_indirect_t, load the data + * in the buffer into this new instance, and return a pointer to + * it. * - * Return: Success: Pointer to a new fractal heap indirect block + * As best I can tell, the size of the indirect block image is fully + * know before the image is loaded, so this function should succeed + * unless the image is corrupt or memory allocation fails. * + * Return: Success: Pointer to in core representation * Failure: NULL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 27 2006 + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ -static H5HF_indirect_t * -H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5HF__cache_iblock_deserialize(const void *_image, size_t len, void *_udata, + hbool_t H5_ATTR_UNUSED *dirty) { H5HF_hdr_t *hdr; /* Shared fractal heap information */ - H5HF_iblock_cache_ud_t *udata = (H5HF_iblock_cache_ud_t *)_udata; /* user data for callback */ - H5HF_indirect_t *iblock = NULL; /* Indirect block info */ - H5WB_t *wb = NULL; /* Wrapped buffer for indirect block data */ - uint8_t iblock_buf[H5HF_IBLOCK_BUF_SIZE]; /* Buffer for indirect block */ - uint8_t *buf; /* Temporary buffer */ - const uint8_t *p; /* Pointer into raw data buffer */ + H5HF_iblock_cache_ud_t *udata = (H5HF_iblock_cache_ud_t *)_udata; /* User data for callback */ + H5HF_indirect_t *iblock = NULL; /* Indirect block info */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ haddr_t heap_addr; /* Address of heap header in the file */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ unsigned u; /* Local index variable */ - H5HF_indirect_t *ret_value; /* Return value */ + void * ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Sanity checks */ + HDassert(image); HDassert(udata); - - /* Allocate space for the fractal heap indirect block */ - if(NULL == (iblock = H5FL_CALLOC(H5HF_indirect_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - - /* Get the pointer to the shared heap header */ + HDassert(dirty); hdr = udata->par_info->hdr; + HDassert(hdr->f); /* Set the shared heap header's file context for this operation */ hdr->f = udata->f; + /* Allocate space for the fractal heap indirect block */ + if(NULL == (iblock = H5FL_CALLOC(H5HF_indirect_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + /* Share common heap information */ iblock->hdr = hdr; if(H5HF_hdr_incr(hdr) < 0) @@ -791,35 +933,23 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) iblock->nrows = *udata->nrows; iblock->nchildren = 0; - /* Wrap the local buffer for serialized indirect block */ - if(NULL == (wb = H5WB_wrap(iblock_buf, sizeof(iblock_buf)))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't wrap buffer") - /* Compute size of indirect block */ iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock->nrows); - /* Get a pointer to a buffer that's large enough for serialized indirect block */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, iblock->size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read indirect block from disk */ - if(H5F_block_read(f, H5FD_MEM_FHEAP_IBLOCK, addr, iblock->size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "can't read fractal heap indirect block") - - /* Get temporary pointer to serialized indirect block */ - p = buf; + /* sanity check */ + HDassert(iblock->size == len); /* Magic number */ - if(HDmemcmp(p, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "wrong fractal heap indirect block signature") - p += H5_SIZEOF_MAGIC; + if(HDmemcmp(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap indirect block signature") + image += H5_SIZEOF_MAGIC; /* Version */ - if(*p++ != H5HF_IBLOCK_VERSION) + if(*image++ != H5HF_IBLOCK_VERSION) HGOTO_ERROR(H5E_HEAP, H5E_VERSION, NULL, "wrong fractal heap direct block version") /* Address of heap that owns this block */ - H5F_addr_decode(udata->f, &p, &heap_addr); + H5F_addr_decode(udata->f, &image, &heap_addr); if(H5F_addr_ne(heap_addr, hdr->heap_addr)) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "incorrect heap header address for direct block") @@ -844,7 +974,7 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) } /* end else */ /* Offset of heap within the heap's address space */ - UINT64DECODE_VAR(p, iblock->block_off, hdr->heap_off_size); + UINT64DECODE_VAR(image, iblock->block_off, hdr->heap_off_size); /* Allocate & decode child block entry tables */ HDassert(iblock->nrows > 0); @@ -866,7 +996,7 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) for(u = 0; u < (iblock->nrows * hdr->man_dtable.cparam.width); u++) { /* Decode child block address */ - H5F_addr_decode(udata->f, &p, &(iblock->ents[u].addr)); + H5F_addr_decode(udata->f, &image, &(iblock->ents[u].addr)); /* Check for heap with I/O filters */ if(hdr->filter_len > 0) { @@ -876,7 +1006,7 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Decode extra information for direct blocks */ if(u < (hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width)) { /* Size of filtered direct block */ - H5F_DECODE_LENGTH(udata->f, p, iblock->filt_ents[u].size); + H5F_DECODE_LENGTH(udata->f, image, iblock->filt_ents[u].size); /* Sanity check */ /* (either both the address & size are defined or both are @@ -886,7 +1016,7 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) || (!H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size == 0)); /* I/O filter mask for filtered direct block */ - UINT32DECODE(p, iblock->filt_ents[u].filter_mask); + UINT32DECODE(image, iblock->filt_ents[u].filter_mask); } /* end if */ } /* end if */ @@ -901,13 +1031,13 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HDassert(iblock->nchildren); /* indirect blocks w/no children should have been deleted */ /* Compute checksum on indirect block */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - (const uint8_t *)buf), 0); + computed_chksum = H5_checksum_metadata((const uint8_t *)_image, (size_t)(image - (const uint8_t *)_image), 0); /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - (const uint8_t *)buf) == iblock->size); + HDassert((size_t)(image - (const uint8_t *)_image) == iblock->size); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -915,7 +1045,7 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Check if we have any indirect block children */ if(iblock->nrows > hdr->man_dtable.max_direct_rows) { - unsigned indir_rows; /* Number of indirect rows in this indirect block */ + unsigned indir_rows;/* Number of indirect rows in this indirect block */ /* Compute the number of indirect rows for this indirect block */ indir_rows = iblock->nrows - hdr->man_dtable.max_direct_rows; @@ -928,343 +1058,323 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) iblock->child_iblocks = NULL; /* Set return value */ - ret_value = iblock; + ret_value = (void *)iblock; done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_HEAP, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value && iblock) if(H5HF_man_iblock_dest(iblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_iblock_load() */ +} /* end H5HF__cache_iblock_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_iblock_flush + * Function: H5HF__cache_iblock_image_len * - * Purpose: Flushes a dirty fractal heap indirect block to disk. + * Purpose: Return the size of the on disk image of the iblock. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 6 2006 + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ -static herr_t -H5HF_cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_indirect_t *iblock, unsigned H5_ATTR_UNUSED * flags_ptr) +static herr_t +H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - H5WB_t *wb = NULL; /* Wrapped buffer for indirect block data */ - uint8_t iblock_buf[H5HF_IBLOCK_BUF_SIZE]; /* Buffer for indirect block */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5HF_indirect_t *iblock = (const H5HF_indirect_t *)_thing; /* Indirect block info */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Sanity checks */ HDassert(iblock); + HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + HDassert(image_len); - if(iblock->cache_info.is_dirty) { - H5HF_hdr_t *hdr; /* Shared fractal heap information */ - uint8_t *buf; /* Temporary buffer */ - uint8_t *p; /* Pointer into raw data buffer */ -#ifndef NDEBUG - unsigned nchildren = 0; /* Track # of children */ - unsigned max_child = 0; /* Track max. child entry used */ -#endif /* NDEBUG */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - size_t u; /* Local index variable */ + *image_len = iblock->size; -#ifndef NDEBUG + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HF__cache_iblock_image_len() */ + + +/*------------------------------------------------------------------------- + * Function: H5HF__cache_iblock_pre_serialize + * + * Purpose: The primary objective of this function is to determine if the + * indirect block is currently allocated in temporary file space, + * and if so, to move it to real file space before the entry is + * serialized. + * + * In debug compiles, this function also verifies that all children + * of this indirect block are either clean or are not in cache. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF__cache_iblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing, + haddr_t addr, size_t H5_ATTR_UNUSED len, size_t H5_ATTR_UNUSED compressed_len, + haddr_t *new_addr, size_t H5_ATTR_UNUSED *new_len, + size_t H5_ATTR_UNUSED *new_compressed_len, unsigned *flags) { - /* Verify that flush dependencies are working correctly. Do this - * by verifying that all children of this iblock are clean. - */ - hbool_t descendants_clean = TRUE; - unsigned iblock_status; + H5HF_hdr_t *hdr; /* Shared fractal heap information */ + H5HF_indirect_t *iblock = (H5HF_indirect_t *)_thing; /* Indirect block info */ + herr_t ret_value = SUCCEED; /* Return value */ - if(H5AC_get_entry_status(f, iblock->addr, &iblock_status) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get iblock status") + FUNC_ENTER_STATIC - /* since the current iblock is the guest of honor in a flush, we know - * that it is locked into the cache for the duration of the call. Hence - * there is no need to check to see if it is pinned or protected, or to - * protect it if it is not. - */ - if(H5HF__cache_verify_iblock_descendants_clean(f, dxpl_id, iblock, &iblock_status, &descendants_clean) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify descendants clean.") + /* Sanity checks */ + HDassert(f); + HDassert(iblock); + HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + HDassert(iblock->cache_info.size == iblock->size); + HDassert(H5F_addr_defined(addr)); + HDassert(H5F_addr_eq(iblock->addr, addr)); + HDassert(new_addr); + HDassert(new_len); + HDassert(flags); + hdr = iblock->hdr; + HDassert(hdr); + HDassert(hdr->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); - HDassert(descendants_clean); -} -#endif /* NDEBUG */ +#ifndef NDEBUG +{ + hbool_t descendants_clean = TRUE; + unsigned iblock_status = 0; - /* Get the pointer to the shared heap header */ - hdr = iblock->hdr; + /* verify that flush dependencies are working correctly. Do this + * by verifying that all children of this iblock are clean. + */ + if(H5AC_get_entry_status(f, iblock->addr, &iblock_status) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get iblock status") - /* Set the shared heap header's file context for this operation */ - hdr->f = f; + /* since the current iblock is the guest of honor in a flush, we know + * that it is locked into the cache for the duration of the call. Hence + * there is no need to check to see if it is pinned or protected, or to + * protect it if it is not. + */ + if(H5HF__cache_verify_iblock_descendants_clean((H5F_t *)f, dxpl_id, iblock, &iblock_status, &descendants_clean) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify descendants clean.") + HDassert(descendants_clean); +} +#endif /* NDEBUG */ - /* Wrap the local buffer for serialized indirect block */ - if(NULL == (wb = H5WB_wrap(iblock_buf, sizeof(iblock_buf)))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't wrap buffer") + /* Check to see if we must re-allocate the iblock from temporary to + * normal (AKA real) file space. + */ + if(H5F_IS_TMP_ADDR(f, addr)) { + haddr_t iblock_addr; - /* Get a pointer to a buffer that's large enough for serialized indirect block */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, iblock->size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "can't get actual buffer") + /* Allocate 'normal' space for the new indirect block on disk */ + if(HADDR_UNDEF == (iblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") - /* Get temporary pointer to buffer for serialized indirect block */ - p = buf; + /* Sanity check */ + HDassert(!H5F_addr_eq(iblock->addr, iblock_addr)); - /* Magic number */ - HDmemcpy(p, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; + /* Let the metadata cache know the block moved */ + if(H5AC_move_entry((H5F_t *)f, H5AC_FHEAP_IBLOCK, iblock->addr, iblock_addr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move indirect block") - /* Version # */ - *p++ = H5HF_IBLOCK_VERSION; + /* Update the internal address for the block */ + iblock->addr = iblock_addr; - /* Address of heap header for heap which owns this block */ - H5F_addr_encode(f, &p, hdr->heap_addr); + /* Check for root indirect block */ + if(NULL == iblock->parent) { + /* Update information about indirect block's location */ + hdr->man_dtable.table_addr = iblock_addr; - /* Offset of block in heap */ - UINT64ENCODE_VAR(p, iblock->block_off, hdr->heap_off_size); + /* Mark that heap header was modified */ + if(H5HF_hdr_dirty(hdr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") + } /* end if */ + else { + H5HF_indirect_t *par_iblock; /* Parent indirect block */ + unsigned par_entry; /* Entry in parent indirect block */ - /* Encode indirect block-specific fields */ - for(u = 0; u < (iblock->nrows * hdr->man_dtable.cparam.width); u++) { - /* Encode child block address */ - H5F_addr_encode(f, &p, iblock->ents[u].addr); + /* Get parent information */ + par_iblock = iblock->parent; + par_entry = iblock->par_entry; - /* Check for heap with I/O filters */ - if(hdr->filter_len > 0) { - /* Sanity check */ - HDassert(iblock->filt_ents); + /* Update information about indirect block's location */ + par_iblock->ents[par_entry].addr = iblock_addr; - /* Encode extra information for direct blocks */ - if(u < (hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width)) { - /* Sanity check */ - /* (either both the address & size are defined or both are - * not defined) - */ - HDassert((H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size) - || (!H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size == 0)); + /* Mark that parent was modified */ + if(H5HF_iblock_dirty(par_iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") + } /* end if */ - /* Size of filtered direct block */ - H5F_ENCODE_LENGTH(f, p, iblock->filt_ents[u].size); + *new_addr = iblock_addr; + *flags = H5C__SERIALIZE_MOVED_FLAG; + } /* end if */ + else + *flags = 0; - /* I/O filter mask for filtered direct block */ - UINT32ENCODE(p, iblock->filt_ents[u].filter_mask); - } /* end if */ - } /* end if */ +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF__cache_iblock_pre_serialize() */ + +/*------------------------------------------------------------------------- + * Function: H5HF__cache_iblock_serialize + * + * Purpose: Given a pointer to an iblock, and a pointer to a buffer of + * the appropriate size, write the contents of the iblock to the + * buffer in format appropriate for writing to disk. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t len, + void *_thing) +{ + H5HF_hdr_t *hdr; /* Shared fractal heap information */ + H5HF_indirect_t *iblock = (H5HF_indirect_t *)_thing; /* Indirect block info */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ #ifndef NDEBUG - /* Count child blocks */ - if(H5F_addr_defined(iblock->ents[u].addr)) { - nchildren++; - if(u > max_child) - max_child = u; - } /* end if */ -#endif /* NDEBUG */ - } /* end for */ - - /* Compute checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); - - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); - - /* Sanity check */ - HDassert((size_t)(p - buf) == iblock->size); -#ifndef NDEBUG - HDassert(nchildren == iblock->nchildren); - HDassert(max_child == iblock->max_child); + unsigned nchildren = 0; /* Track # of children */ + size_t max_child = 0; /* Track max. child entry used */ #endif /* NDEBUG */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ + size_t u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ - /* Check for needing to re-allocate indirect block from 'temp.' to 'normal' file space */ - if(H5F_IS_TMP_ADDR(f, addr)) { - /* Sanity check */ - HDassert(H5F_addr_eq(iblock->addr, addr)); - - /* Allocate 'normal' space for the new indirect block on disk */ - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") - - /* Sanity check */ - HDassert(!H5F_addr_eq(iblock->addr, addr)); - - /* Let the metadata cache know the block moved */ - if(H5AC_move_entry(f, H5AC_FHEAP_IBLOCK, iblock->addr, addr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move indirect block") - - /* Update the internal address for the block */ - iblock->addr = addr; - - /* Check for root indirect block */ - if(NULL == iblock->parent) { - /* Update information about indirect block's location */ - hdr->man_dtable.table_addr = addr; - - /* Mark that heap header was modified */ - if(H5HF_hdr_dirty(hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") - } /* end if */ - else { - H5HF_indirect_t *par_iblock; /* Parent indirect block */ - unsigned par_entry; /* Entry in parent indirect block */ + FUNC_ENTER_STATIC_NOERR - /* Get parent information */ - par_iblock = iblock->parent; - par_entry = iblock->par_entry; + /* Sanity checks */ + HDassert(f); + HDassert(image); + HDassert(iblock); + HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + HDassert(iblock->cache_info.size == iblock->size); + HDassert(len == iblock->size); - /* Update information about indirect block's location */ - par_iblock->ents[par_entry].addr = addr; + /* Indirect block must be in 'normal' file space */ + HDassert(!H5F_IS_TMP_ADDR(f, iblock->addr)); + HDassert(H5F_addr_eq(iblock->addr, iblock->cache_info.addr)); - /* Mark that parent was modified */ - if(H5HF_iblock_dirty(par_iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") - } /* end if */ - } /* end if */ + /* Get the pointer to the shared heap header */ + hdr = iblock->hdr; - /* Indirect block must be in 'normal' file space now */ - HDassert(!H5F_IS_TMP_ADDR(f, addr)); + /* Set the shared heap header's file context for this operation */ + hdr->f = f; - /* Write the indirect block */ - if(H5F_block_write(f, H5FD_MEM_FHEAP_IBLOCK, addr, iblock->size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFLUSH, FAIL, "unable to save fractal heap indirect block to disk") + /* Magic number */ + HDmemcpy(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; - /* Reset dirty flags */ - iblock->cache_info.is_dirty = FALSE; - } /* end if */ + /* Version # */ + *image++ = H5HF_IBLOCK_VERSION; - if(destroy) - if(H5HF_cache_iblock_dest(f, iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") + /* Address of heap header for heap which owns this block */ + H5F_addr_encode(f, &image, hdr->heap_addr); -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_HEAP, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") + /* Offset of block in heap */ + UINT64ENCODE_VAR(image, iblock->block_off, hdr->heap_off_size); - FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_cache_iblock_flush() */ + /* Encode indirect block-specific fields */ + for(u = 0; u < (iblock->nrows * hdr->man_dtable.cparam.width); u++) { + /* Encode child block address */ + H5F_addr_encode(f, &image, iblock->ents[u].addr); - -/*------------------------------------------------------------------------- - * Function: H5HF_cache_iblock_dest - * - * Purpose: Destroys a fractal heap indirect block in memory. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 6 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5HF_cache_iblock_dest(H5F_t *f, H5HF_indirect_t *iblock) -{ - herr_t ret_value = SUCCEED; /* Return value */ + /* Check for heap with I/O filters */ + if(hdr->filter_len > 0) { + /* Sanity check */ + HDassert(iblock->filt_ents); - FUNC_ENTER_NOAPI_NOINIT + /* Encode extra information for direct blocks */ + if(u < (hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width)) { + /* Sanity check */ + /* (either both the address & size are defined or both are + * not defined) + */ + HDassert((H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size) + || (!H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size == 0)); - /* - * Check arguments. - */ - HDassert(iblock); - HDassert(iblock->rc == 0); - HDassert(iblock->hdr); + /* Size of filtered direct block */ + H5F_ENCODE_LENGTH(f, image, iblock->filt_ents[u].size); - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!iblock->cache_info.free_file_space_on_destroy || H5F_addr_defined(iblock->cache_info.addr)); - - /* Check for freeing file space for indirect block */ - if(iblock->cache_info.free_file_space_on_destroy) { - /* Check if the indirect block is NOT currently allocated in temp. file space */ - /* (temp. file space does not need to be freed) */ - if(!H5F_IS_TMP_ADDR(f, iblock->cache_info.addr)) { - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_FHEAP_IBLOCK, H5AC_dxpl_id, iblock->cache_info.addr, (hsize_t)iblock->size) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap indirect block") + /* I/O filter mask for filtered direct block */ + UINT32ENCODE(image, iblock->filt_ents[u].filter_mask); + } /* end if */ } /* end if */ - } /* end if */ - /* Destroy fractal heap indirect block */ - if(H5HF_man_iblock_dest(iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_iblock_dest() */ - - -/*------------------------------------------------------------------------- - * Function: H5HF_cache_iblock_clear - * - * Purpose: Mark a fractal heap indirect block in memory as non-dirty. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 6 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5HF_cache_iblock_clear(H5F_t *f, H5HF_indirect_t *iblock, hbool_t destroy) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT +#ifndef NDEBUG + /* Count child blocks */ + if(H5F_addr_defined(iblock->ents[u].addr)) { + nchildren++; + if(u > max_child) + max_child = u; + } /* end if */ +#endif /* NDEBUG */ + } /* end for */ - /* - * Check arguments. - */ - HDassert(iblock); + /* Compute checksum */ + metadata_chksum = H5_checksum_metadata((uint8_t *)_image, (size_t)(image - (uint8_t *)_image), 0); - /* Reset the dirty flag. */ - iblock->cache_info.is_dirty = FALSE; + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); - if(destroy) - if(H5HF_cache_iblock_dest(f, iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") + /* Sanity checks */ + HDassert((size_t)(image - (uint8_t *)_image) == iblock->size); +#ifndef NDEBUG + HDassert(nchildren == iblock->nchildren); + HDassert(max_child == iblock->max_child); +#endif /* NDEBUG */ -done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_iblock_clear() */ +} /* end H5HF__cache_iblock_serialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_iblock_notify + * Function: H5HF__cache_iblock_notify * - * Purpose: Setup / takedown flush dependencies as indirect blocks + * Purpose: This function is used to create and destroy flush dependency + * relationships between iblocks and their parents as indirect blocks * are loaded / inserted and evicted from the metadata cache. * - * Return: Non-negative on success/Negative on failure + * In general, the parent will be another iblock, but it may be the + * header if the iblock in question is the root iblock. + * + * Return: Success: SUCCEED + * Failure: FAIL * * Programmer: John Mainzer - * 5/17/14 + * 6/21/14 * *------------------------------------------------------------------------- */ -static herr_t -H5HF_cache_iblock_notify(H5C_notify_action_t action, H5HF_indirect_t *iblock) +static herr_t +H5HF__cache_iblock_notify(H5C_notify_action_t action, void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5HF_indirect_t *iblock = (H5HF_indirect_t *)_thing; /* Indirect block info */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* - * Check arguments. - */ + /* Sanity checks */ HDassert(iblock); HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); HDassert(iblock->hdr); if(action == H5AC_NOTIFY_ACTION_BEFORE_EVICT) @@ -1309,6 +1419,7 @@ H5HF_cache_iblock_notify(H5C_notify_action_t action, H5HF_indirect_t *iblock) switch(action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: + case H5AC_NOTIFY_ACTION_AFTER_LOAD: if(iblock->parent) { /* this is a child iblock */ /* create flush dependency with parent iblock */ if(H5AC_create_flush_dependency(iblock->parent, iblock) < 0) @@ -1321,6 +1432,10 @@ H5HF_cache_iblock_notify(H5C_notify_action_t action, H5HF_indirect_t *iblock) } /* end else */ break; + case H5AC_NOTIFY_ACTION_AFTER_FLUSH: + /* do nothing */ + break; + case H5AC_NOTIFY_ACTION_BEFORE_EVICT: if(iblock->fd_parent) { /* this is a child iblock */ /* destroy flush dependency with parent iblock */ @@ -1341,38 +1456,104 @@ H5HF_cache_iblock_notify(H5C_notify_action_t action, H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_iblock_notify() */ +} /* end H5HF__cache_iblock_notify() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_iblock_size + * Function: H5HF__cache_iblock_free_icr * - * Purpose: Compute the size in bytes of a fractal heap indirect block - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Unlink the supplied instance of H5HF_indirect_t from the + * fractal heap and free its memory. * - * Return: Non-negative on success/Negative on failure + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 6 2006 + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ -static herr_t -H5HF_cache_iblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5HF_indirect_t *iblock, size_t *size_ptr) +static herr_t +H5HF__cache_iblock_free_icr(void *thing) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + H5HF_indirect_t *iblock = (H5HF_indirect_t *)thing; /* Fractal heap indirect block to free */ + herr_t ret_value = SUCCEED; /* Return value */ - /* Check arguments */ + FUNC_ENTER_STATIC + + /* Sanity checks */ HDassert(iblock); - HDassert(size_ptr); + HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + HDassert(iblock->rc == 0); + HDassert(iblock->hdr); + + /* Destroy fractal heap indirect block */ + if(H5HF_man_iblock_dest(iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF__cache_iblock_free_icr() */ + +/*********************************************************/ +/* metadata cache callback definitions for direct blocks */ +/*********************************************************/ + + +/*------------------------------------------------------------------------- + * Function: H5HF__cache_dblock_get_load_size() + * + * Purpose: Determine the size of the direct block on disk image, and + * return it in *image_len. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF__cache_dblock_get_load_size(const void *_udata, size_t *image_len) +{ + const H5HF_dblock_cache_ud_t *udata = (const H5HF_dblock_cache_ud_t *)_udata; /* User data for callback */ + const H5HF_parent_t *par_info; /* Pointer to parent information */ + const H5HF_hdr_t *hdr; /* Shared fractal heap information */ + size_t size; + + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ + HDassert(udata); + HDassert(image_len); + par_info = (const H5HF_parent_t *)(&(udata->par_info)); + HDassert(par_info); + hdr = par_info->hdr; + HDassert(hdr); + HDassert(hdr->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); + + /* Check for I/O filters on this heap */ + if(hdr->filter_len > 0) { + /* Check for root direct block */ + if(par_info->iblock == NULL) + size = hdr->pline_root_direct_size; + else + size = par_info->iblock->filt_ents[par_info->entry].size; + } /* end if */ + else + size = udata->dblock_size; - /* Set size value */ - *size_ptr = iblock->size; + *image_len = size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_cache_iblock_size() */ +} /* end H5HF__cache_dblock_get_load_size() */ /*********************************************************/ /* metadata cache callback definitions for direct blocks */ @@ -1380,49 +1561,55 @@ H5HF_cache_iblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5HF_indirect_t *ibl /*------------------------------------------------------------------------- - * Function: H5HF_cache_dblock_load + * Function: H5HF__cache_dblock_deserialize * - * Purpose: Loads a fractal heap direct block from the disk. + * Purpose: Given a buffer containing the on disk image of a direct + * block, allocate an instance of H5HF_direct_t, load the data + * in the buffer into this new instance, and return a pointer to + * it. * - * Return: Success: Pointer to a new fractal heap direct block + * As best I can tell, the size of the direct block image is fully + * know before the image is loaded, so this function should succeed + * unless the image is corrupt or memory allocation fails. * + * Return: Success: Pointer to in core representation * Failure: NULL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 27 2006 + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ -static H5HF_direct_t * -H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, + hbool_t H5_ATTR_UNUSED *dirty) { H5HF_hdr_t *hdr; /* Shared fractal heap information */ H5HF_dblock_cache_ud_t *udata = (H5HF_dblock_cache_ud_t *)_udata; /* User data for callback */ H5HF_parent_t *par_info; /* Pointer to parent information */ - H5HF_direct_t *dblock = NULL; /* Direct block info */ - const uint8_t *p; /* Pointer into raw data buffer */ + H5HF_direct_t *dblock = NULL; /* Direct block info */ + const uint8_t *image; /* Pointer into raw data buffer */ haddr_t heap_addr; /* Address of heap header in the file */ - H5HF_direct_t *ret_value; /* Return value */ + void * ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(udata != NULL); - HDassert(udata->f != NULL); - HDassert(udata->dblock_size > 0); + /* Sanity checks */ + HDassert(_image); + HDassert(udata); + par_info = (H5HF_parent_t *)(&(udata->par_info)); + HDassert(par_info); + hdr = par_info->hdr; + HDassert(hdr); + HDassert(hdr->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); + HDassert(dirty); /* Allocate space for the fractal heap direct block */ if(NULL == (dblock = H5FL_MALLOC(H5HF_direct_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") HDmemset(&dblock->cache_info, 0, sizeof(H5AC_info_t)); - /* Get the pointer to the shared heap header */ - par_info = (H5HF_parent_t *)(&(udata->par_info)); - hdr = par_info->hdr; - /* Set the shared heap header's file context for this operation */ hdr->f = udata->f; @@ -1435,6 +1622,10 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) dblock->size = udata->dblock_size; dblock->file_size = 0; + /* initialize fields used in serialization */ + dblock->write_buf = NULL; + dblock->write_size = 0; + /* Allocate block buffer */ /* XXX: Change to using free-list factories */ if(NULL == (dblock->blk = H5FL_BLK_MALLOC(direct_block, (size_t)dblock->size))) @@ -1449,28 +1640,21 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) unsigned filter_mask; /* Excluded filters for direct block */ /* Check for root direct block */ - if(par_info->iblock == NULL) { - /* Sanity check */ - HDassert(H5F_addr_eq(hdr->man_dtable.table_addr, addr)); - + if(par_info->iblock == NULL) /* Set up parameters to read filtered direct block */ read_size = hdr->pline_root_direct_size; - } /* end if */ - else { - /* Sanity check */ - HDassert(H5F_addr_eq(par_info->iblock->ents[par_info->entry].addr, addr)); - + else /* Set up parameters to read filtered direct block */ read_size = par_info->iblock->filt_ents[par_info->entry].size; - } /* end else */ + HDassert(len == read_size); - /* Allocate buffer to perform I/O filtering on */ + /* Allocate buffer to perform I/O filtering on and copy image into + * it. Must do this as H5Z_pipeline() may re-sized the buffer + * provided to it. + */ if(NULL == (read_buf = H5MM_malloc(read_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "memory allocation failed for pipeline buffer") - - /* Read filtered direct block from disk */ - if(H5F_block_read(f, H5FD_MEM_FHEAP_DBLOCK, addr, read_size, dxpl_id, read_buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "can't read fractal heap direct block") + HDmemcpy(read_buf, _image, len); /* Push direct block data through I/O filter pipeline */ nbytes = read_size; @@ -1488,25 +1672,25 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) H5MM_xfree(read_buf); } /* end if */ else { - /* Read direct block from disk */ - if(H5F_block_read(f, H5FD_MEM_FHEAP_DBLOCK, addr, dblock->size, dxpl_id, dblock->blk) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "can't read fractal heap direct block") + /* copy image to dblock->blk */ + HDassert(dblock->size == len); + HDmemcpy(dblock->blk, _image, dblock->size); } /* end else */ /* Start decoding direct block */ - p = dblock->blk; + image = dblock->blk; /* Magic number */ - if(HDmemcmp(p, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "wrong fractal heap direct block signature") - p += H5_SIZEOF_MAGIC; + if(HDmemcmp(image, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap direct block signature") + image += H5_SIZEOF_MAGIC; /* Version */ - if(*p++ != H5HF_DBLOCK_VERSION) + if(*image++ != H5HF_DBLOCK_VERSION) HGOTO_ERROR(H5E_HEAP, H5E_VERSION, NULL, "wrong fractal heap direct block version") /* Address of heap that owns this block (just for file integrity checks) */ - H5F_addr_decode(udata->f, &p, &heap_addr); + H5F_addr_decode(udata->f, &image, &heap_addr); if(H5F_addr_ne(heap_addr, hdr->heap_addr)) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "incorrect heap header address for direct block") @@ -1521,7 +1705,7 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) } /* end if */ /* Offset of heap within the heap's address space */ - UINT64DECODE_VAR(p, dblock->block_off, hdr->heap_off_size); + UINT64DECODE_VAR(image, dblock->block_off, hdr->heap_off_size); /* Decode checksum on direct block, if requested */ if(hdr->checksum_dblocks) { @@ -1529,11 +1713,11 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) uint32_t computed_chksum; /* Computed metadata checksum value */ /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Reset checksum field, for computing the checksum */ /* (Casting away const OK - QAK) */ - HDmemset((uint8_t *)p - H5HF_SIZEOF_CHKSUM, 0, (size_t)H5HF_SIZEOF_CHKSUM); + HDmemset((uint8_t *)image - H5HF_SIZEOF_CHKSUM, 0, (size_t)H5HF_SIZEOF_CHKSUM); /* Compute checksum on entire direct block */ computed_chksum = H5_checksum_metadata(dblock->blk, dblock->size, 0); @@ -1544,10 +1728,10 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) } /* end if */ /* Sanity check */ - HDassert((size_t)(p - dblock->blk) == (size_t)H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)); + HDassert((size_t)(image - dblock->blk) == (size_t)H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)); /* Set return value */ - ret_value = dblock; + ret_value = (void *)dblock; done: if(!ret_value && dblock) @@ -1555,402 +1739,646 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_dblock_load() */ +} /* end H5HF__cache_dblock_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_dblock_flush + * Function: H5HF__cache_dblock_image_len * - * Purpose: Flushes a dirty fractal heap direct block to disk. + * Purpose: Report the actual size of the direct block image on disk. + * Note that this value will probably be incorrect if compression + * is enabled and the entry is dirty. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 27 2006 + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ -static herr_t -H5HF_cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_direct_t *dblock, unsigned H5_ATTR_UNUSED * flags_ptr) +static herr_t +H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len, hbool_t *compressed_ptr, size_t *compressed_image_len_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + const H5HF_direct_t *dblock = (const H5HF_direct_t *)_thing; /* Direct block info */ + const H5HF_indirect_t *par_iblock; /* Parent iblock */ + const H5HF_hdr_t *hdr; /* Shared fractal heap information */ + hbool_t compressed; + size_t size; + size_t compressed_size; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Sanity checks */ HDassert(dblock); + HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); + HDassert(image_len); + HDassert(compressed_ptr); + HDassert(compressed_image_len_ptr); - if(dblock->cache_info.is_dirty) { - H5HF_hdr_t *hdr; /* Shared fractal heap information */ - hbool_t at_tmp_addr = H5F_IS_TMP_ADDR(f, addr); /* Flag to indicate direct block is at temporary address */ - void *write_buf; /* Pointer to buffer to write out */ - size_t write_size; /* Size of buffer to write out */ - uint8_t *p; /* Pointer into raw data buffer */ + /* Set up convenience variables */ + hdr = dblock->hdr; + par_iblock = dblock->parent; - /* Get the pointer to the shared heap header */ - hdr = dblock->hdr; + /* Check for I/O filters on this heap */ + if(hdr->filter_len > 0) { - /* Set the shared heap header's file context for this operation */ - hdr->f = f; + /* Filters are enabled, so set compressed to TRUE, and set + * size equal to the uncompressed size of the direct block. + * If the data is available, set compressed_size to the compressed + * size of the direct block -- otherwise set it equal to the + * uncompressed size. + * + * We have three possible scenarios here. + * + * First, the block may never have been flushed. In this + * case, both dblock->file_size and the size stored in the + * parent (either the header or the parent iblock) will all + * be zero. In this case, return the uncompressed size + * stored in dblock->size as the compressed size. + * + * Second, the block may have just been serialized, in which + * case, dblock->file_size should be zero, and the correct + * on disk size should be stored in the parent (again, either + * the header or the parent iblock as case may be). + * + * Third, we may be in the process of discarding this + * dblock without writing it. In this case, dblock->file_size + * should be non-zero and have the correct size. Note that + * in this case, the direct block will have been detached, + * and thus looking up the parent will likely return incorrect + * data. + */ + size = dblock->size; + compressed = TRUE; + compressed_size = dblock->size; /* will overwrite if compressed + * size is available. + */ + + if(dblock->file_size != 0) + compressed_size = dblock->file_size; + else { + if(par_iblock) { + unsigned par_entry; /* Entry in parent indirect block */ - HDassert(dblock->blk); - p = dblock->blk; + par_entry = dblock->par_entry; + compressed_size = par_iblock->filt_ents[par_entry].size; - /* Magic number */ - HDmemcpy(p, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; + } /* end if */ + else { + compressed_size = hdr->pline_root_direct_size; + } - /* Version # */ - *p++ = H5HF_DBLOCK_VERSION; + if(compressed_size == 0) + compressed_size = dblock->size; - /* Address of heap header for heap which owns this block */ - H5F_addr_encode(f, &p, hdr->heap_addr); + } /* end else */ + } /* end if */ + else { + size = dblock->size; + compressed = FALSE; + compressed_size = 0; /* a convenient, invalid value */ + } - /* Offset of block in heap */ - UINT64ENCODE_VAR(p, dblock->block_off, hdr->heap_off_size); + HDassert(size > 0); - /* Metadata checksum */ - if(hdr->checksum_dblocks) { - uint32_t metadata_chksum; /* Computed metadata checksum value */ + *image_len = size; + *compressed_ptr = compressed; + *compressed_image_len_ptr = compressed_size; - /* Clear the checksum field, to compute the checksum */ - HDmemset(p, 0, (size_t)H5HF_SIZEOF_CHKSUM); + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HF__cache_dblock_image_len() */ - /* Compute checksum on entire direct block */ - metadata_chksum = H5_checksum_metadata(dblock->blk, dblock->size, 0); + +/*------------------------------------------------------------------------- + * Function: H5HF__cache_dblock_pre_serialize + * + * Purpose: In principle, the purpose of this function is to determine + * the size and location of the disk image of the target direct + * block. In this case, the uncompressed size of the block is + * fixed, but sined the H5C__CLASS_COMPRESSED_FLAG is set, + * we may need to compute and report the compressed size. + * + * This is a bit sticky in the case of a direct block when I/O + * filters are enabled, as the size of the compressed version + * of the on disk image is not known until the direct block has + * been run through the filters. Further, the location of the + * on disk image may change if the compressed size of the image + * changes as well. + * + * To complicate matters further, the direct block may have been + * initially allocated in temporary (AKA imaginary) file space. + * In this case, we must relocate the direct block's on disk + * image to real file space regardless of whether it has changed + * size. + * + * One simplifying factor is the direct block's "blk" field, + * which contains a pointer to a buffer which (with the exception + * of a small header) contains the on disk image in uncompressed + * form. + * + * To square this particular circle, this function does + * everything the serialize function usually does, with the + * exception of copying the image into the image buffer provided + * to the serialize function by the metadata cache. The data to + * copy is provided to the serialize function in a buffer pointed + * to by the write_buf field. + * + * If I/O filters are enabled, on exit, + * H5HF__cache_dblock_pre_serialize() sets the write_buf field to + * point to a buffer containing the filtered image of the direct + * block. The serialize function should free this block, and set + * the write_buf field to NULL after copying it into the image + * buffer provided by the metadata cache. + * + * If I/O filters are not enabled, this function prepares + * the buffer pointed to by the blk field for copying to the + * image buffer provided by the metadata cache, and sets the + * write_buf field equal to the blk field. In this case, the + * serialize function should simply set the write_buf field to + * NULL after copying the direct block image into the image + * buffer. + * + * In both of the above cases, the length of the buffer pointed + * to by write_buf is provided in the write_len field. This + * field must contain 0 on entry to this function, and should + * be set back to 0 at the end of the serialize function. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF__cache_dblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing, + haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr, + size_t H5_ATTR_UNUSED *new_len, size_t *new_compressed_len, unsigned *flags) +{ + hbool_t at_tmp_addr; /* Flag to indicate direct block is */ + /* at temporary address */ + haddr_t dblock_addr; + H5HF_hdr_t *hdr; /* Shared fractal heap information */ + H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; /* Direct block info */ + H5HF_indirect_t *par_iblock; /* Parent indirect block */ + unsigned par_entry; /* Entry in parent indirect block */ + void *write_buf; /* Pointer to buffer to write out */ + size_t write_size; /* Size of buffer to write out */ + uint8_t *image; /* Pointer into raw data buffer */ + unsigned dblock_flags = 0; + herr_t ret_value = SUCCEED; /* Return value */ - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); - } /* end if */ + FUNC_ENTER_STATIC - /* Sanity check */ - HDassert((size_t)(p - dblock->blk) == (size_t)H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)); + /* Sanity checks */ + HDassert(f); + HDassert(dblock); + HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); + HDassert(dblock->write_buf == NULL); + HDassert(dblock->write_size == 0); + HDassert(dblock->cache_info.size == len); + HDassert(H5F_addr_defined(addr)); + HDassert(len == dblock->size); + HDassert(new_addr); + HDassert(new_compressed_len); + HDassert(flags); - /* Check for I/O filters on this heap */ - if(hdr->filter_len > 0) { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ - size_t nbytes; /* Number of bytes used */ - unsigned filter_mask = 0; /* Filter mask for block */ + /* Set up local variables */ + hdr = dblock->hdr; + dblock_addr = addr; /* will update dblock_addr if we move the block */ - /* Allocate buffer to perform I/O filtering on */ - write_size = dblock->size; - if(NULL == (write_buf = H5MM_malloc(write_size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "memory allocation failed for pipeline buffer") - HDmemcpy(write_buf, dblock->blk, write_size); + /* dblock->size must match dblock->cache_info.size */ + HDassert(dblock->cache_info.size == dblock->size); - /* Push direct block data through I/O filter pipeline */ - nbytes = write_size; - if(H5Z_pipeline(&(hdr->pline), 0, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &write_size, &write_buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "output pipeline failed") + /* Set the shared heap header's file context for this operation */ + hdr->f = (H5F_t *)f; - /* Use the compressed number of bytes as the size to write */ - write_size = nbytes; + HDassert(hdr); + HDassert(hdr->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); - /* Check for root direct block */ - if(dblock->parent == NULL) { - hbool_t hdr_changed = FALSE; /* Whether the header information changed */ + if(dblock->parent) { + /* this is the common case, in which the direct block is the child + * of an indirect block. Set up the convenience variables we will + * need if the address and/or compressed size of the on disk image + * of the direct block changes, and do some sanity checking in + * passing. + */ + par_iblock = dblock->parent; + par_entry = dblock->par_entry; - /* Sanity check */ - HDassert(H5F_addr_eq(hdr->man_dtable.table_addr, addr)); - HDassert(hdr->pline_root_direct_size > 0); + HDassert(par_iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(par_iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + HDassert(H5F_addr_eq(par_iblock->ents[par_entry].addr, addr)); + } /* end if */ + else { + /* the direct block is a root direct block -- just set par_iblock + * to NULL, as the field will not be used. + */ + par_iblock = NULL; + } /* end else */ - /* Check if the filter mask changed */ - if(hdr->pline_root_direct_filter_mask != filter_mask) { - hdr->pline_root_direct_filter_mask = filter_mask; - hdr_changed = TRUE; - } /* end if */ + at_tmp_addr = H5F_IS_TMP_ADDR(f, addr); - /* Check if we need to re-size the block on disk */ - if(hdr->pline_root_direct_size != write_size || at_tmp_addr) { - /* Check if the direct block is NOT currently allocated in temp. file space */ - /* (temp. file space does not need to be freed) */ - if(!at_tmp_addr) { - /* Release direct block's current disk space */ - if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, addr, (hsize_t)hdr->pline_root_direct_size) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") - } /* end if */ + /* Begin by preping the direct block to be written to disk. Do + * this by writing the correct magic number, the dblock version, + * the address of the header, the offset of the block in the heap, + * and the checksum at the beginning of the block. + */ - /* Allocate space for the compressed direct block */ - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") + HDassert(dblock->blk); + image = dblock->blk; - /* Let the metadata cache know, if the block moved */ - if(!H5F_addr_eq(hdr->man_dtable.table_addr, addr)) - if(H5AC_move_entry(f, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, addr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move direct block") + /* Magic number */ + HDmemcpy(image, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; - /* Update information about compressed direct block's location & size */ - hdr->man_dtable.table_addr = addr; - hdr->pline_root_direct_size = write_size; + /* Version # */ + *image++ = H5HF_DBLOCK_VERSION; - /* Note that heap header was modified */ - hdr_changed = TRUE; - } /* end if */ + /* Address of heap header for heap which owns this block */ + H5F_addr_encode(f, &image, hdr->heap_addr); - /* Check if heap header was modified */ - if(hdr_changed) - if(H5HF_hdr_dirty(hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") - } /* end if */ - else { - hbool_t par_changed = FALSE; /* Whether the parent's information changed */ - H5HF_indirect_t *par_iblock; /* Parent indirect block */ - unsigned par_entry; /* Entry in parent indirect block */ + /* Offset of block in heap */ + UINT64ENCODE_VAR(image, dblock->block_off, hdr->heap_off_size); - /* Get parent information */ - par_iblock = dblock->parent; - par_entry = dblock->par_entry; + /* Metadata checksum */ + if(hdr->checksum_dblocks) { + uint32_t metadata_chksum; /* Computed metadata checksum value */ - /* Sanity check */ - HDassert(H5F_addr_eq(par_iblock->ents[par_entry].addr, addr)); - HDassert(par_iblock->filt_ents[par_entry].size > 0); + /* Clear the checksum field, to compute the checksum */ + HDmemset(image, 0, (size_t)H5HF_SIZEOF_CHKSUM); - /* Check if the filter mask changed */ - if(par_iblock->filt_ents[par_entry].filter_mask != filter_mask) { - par_iblock->filt_ents[par_entry].filter_mask = filter_mask; - par_changed = TRUE; - } /* end if */ + /* Compute checksum on entire direct block */ + metadata_chksum = H5_checksum_metadata(dblock->blk, dblock->size, 0); - /* Check if we need to re-size the block on disk */ - if(par_iblock->filt_ents[par_entry].size != write_size || at_tmp_addr) { - /* Check if the direct block is NOT currently allocated in temp. file space */ - /* (temp. file space does not need to be freed) */ - if(!at_tmp_addr) { - /* Release direct block's current disk space */ - if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, addr, (hsize_t)par_iblock->filt_ents[par_entry].size) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") - } /* end if */ + /* Metadata checksum */ + UINT32ENCODE(image, metadata_chksum); + } /* end if */ - /* Allocate space for the compressed direct block */ - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") + /* at this point, dblock->blk should point to an uncompressed image of + * the direct block. If I/O filters are not enabled, this image should + * be ready to hand off to the metadata cache. + */ - /* Let the metadata cache know, if the block moved */ - if(!H5F_addr_eq(par_iblock->ents[par_entry].addr, addr)) - if(H5AC_move_entry(f, H5AC_FHEAP_DBLOCK, par_iblock->ents[par_entry].addr, addr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move direct block") + /* Sanity check */ + HDassert((size_t)(image - dblock->blk) == (size_t)H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)); - /* Update information about compressed direct block's location & size */ - par_iblock->ents[par_entry].addr = addr; - par_iblock->filt_ents[par_entry].size = write_size; + /* If I/O filters are enabled on this heap, we must run the direct block + * image through the filters to obtain the image that we will hand off + * to the metadata cache. + */ - /* Note that parent was modified */ - par_changed = TRUE; - } /* end if */ + /* Check for I/O filters on this heap */ + if(hdr->filter_len > 0) { + H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + size_t nbytes; /* Number of bytes used */ + unsigned filter_mask = 0; /* Filter mask for block */ - /* Check if parent was modified */ - if(par_changed) - if(H5HF_iblock_dirty(par_iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") - } /* end else */ - } /* end if */ - else { - write_buf = dblock->blk; - write_size = dblock->size; + /* Allocate buffer to perform I/O filtering on */ + write_size = dblock->size; - /* Check for needing to re-allocate direct block from 'temp.' to 'normal' file space */ - if(at_tmp_addr) { - /* Check for root direct block */ - if(NULL == dblock->parent) { - /* Sanity check */ - HDassert(H5F_addr_eq(hdr->man_dtable.table_addr, addr)); + if(NULL == (write_buf = H5MM_malloc(write_size))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "memory allocation failed for pipeline buffer") + HDmemcpy(write_buf, dblock->blk, write_size); - /* Allocate 'normal' space for the direct block */ - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") + /* Push direct block data through I/O filter pipeline */ + nbytes = write_size; + if(H5Z_pipeline(&(hdr->pline), 0, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &write_size, &write_buf) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "output pipeline failed") + + /* Use the compressed number of bytes as the size to write */ + write_size = nbytes; + + /* If the size and/or location of the on disk image of the + * direct block changes, we must touch up its parent to reflect + * these changes. Do this differently depending on whether the + * direct block's parent is an indirect block or (rarely) the + * fractal heap header. In this case, the direct block is known + * as a root direct block. + */ - /* Sanity check */ - HDassert(!H5F_addr_eq(hdr->man_dtable.table_addr, addr)); + /* Check for root direct block */ + if(dblock->parent == NULL) { + hbool_t hdr_changed = FALSE; /* Whether the header info changed */ - /* Let the metadata cache know the block moved */ - if(H5AC_move_entry(f, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, addr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move direct block") + /* Sanity check */ + HDassert(H5F_addr_eq(hdr->man_dtable.table_addr, addr)); + HDassert(hdr->pline_root_direct_size > 0); - /* Update information about direct block's location */ - hdr->man_dtable.table_addr = addr; + /* Check if the filter mask changed */ + if(hdr->pline_root_direct_filter_mask != filter_mask) { + hdr->pline_root_direct_filter_mask = filter_mask; + hdr_changed = TRUE; + } /* end if */ + + /* verify that the cache's last record of the compressed + * size matches the heap's last record. This value will + * likely change shortly. + */ + HDassert(compressed_len == hdr->pline_root_direct_size); - /* Mark that heap header was modified */ - if(H5HF_hdr_dirty(hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") + /* Check if we need to re-size the block on disk */ + if(hdr->pline_root_direct_size != write_size || at_tmp_addr) { + /* Check if the direct block is NOT currently allocated + * in temp. file space + * + * (temp. file space does not need to be freed) + */ + if(!at_tmp_addr) { + /* Release direct block's current disk space */ + if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, addr, (hsize_t)hdr->pline_root_direct_size) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") } /* end if */ - else { - H5HF_indirect_t *par_iblock; /* Parent indirect block */ - unsigned par_entry; /* Entry in parent indirect block */ - /* Get parent information */ - par_iblock = dblock->parent; - par_entry = dblock->par_entry; + /* Allocate space for the compressed direct block */ + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") + + /* Let the metadata cache know, if the block moved */ + if(!H5F_addr_eq(hdr->man_dtable.table_addr, dblock_addr)) + if(H5AC_move_entry((H5F_t *)f, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, dblock_addr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move direct block") + + /* Update information about compressed direct block's + * location & size + */ + HDassert(hdr->man_dtable.table_addr == addr); + HDassert(hdr->pline_root_direct_size == compressed_len); + hdr->man_dtable.table_addr = dblock_addr; + hdr->pline_root_direct_size = write_size; + + /* Note that heap header was modified */ + hdr_changed = TRUE; + } /* end if */ + + /* Check if heap header was modified */ + if(hdr_changed) + if(H5HF_hdr_dirty(hdr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") + } /* end if */ + else { /* the direct block's parent is an indirect block */ + hbool_t par_changed = FALSE; /* Whether the parent's infochanged */ + + /* Sanity check */ + HDassert(par_iblock); + HDassert(par_iblock->filt_ents[par_entry].size > 0); - /* Sanity check */ - HDassert(H5F_addr_eq(par_iblock->ents[par_entry].addr, addr)); + /* Check if the filter mask changed */ + if(par_iblock->filt_ents[par_entry].filter_mask != filter_mask) { + par_iblock->filt_ents[par_entry].filter_mask = filter_mask; + par_changed = TRUE; + } /* end if */ - /* Allocate 'normal' space for the direct block */ - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") + /* verify that the cache's last record of the compressed + * size matches the heap's last record. This value will + * likely change shortly. + */ + HDassert(compressed_len == par_iblock->filt_ents[par_entry].size); - /* Sanity check */ - HDassert(!H5F_addr_eq(par_iblock->ents[par_entry].addr, addr)); + /* Check if we need to re-size the block on disk */ + if(par_iblock->filt_ents[par_entry].size != write_size || at_tmp_addr) { + /* Check if the direct block is NOT currently allocated + * in temp. file space + * + * (temp. file space does not need to be freed) + */ + if(!at_tmp_addr) { + /* Release direct block's current disk space */ + if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, addr, (hsize_t)par_iblock->filt_ents[par_entry].size) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") + } /* end if */ - /* Let the metadata cache know the block moved */ - if(H5AC_move_entry(f, H5AC_FHEAP_DBLOCK, par_iblock->ents[par_entry].addr, addr) < 0) + /* Allocate space for the compressed direct block */ + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") + + /* Let the metadata cache know, if the block moved */ + if(!H5F_addr_eq(par_iblock->ents[par_entry].addr, dblock_addr)) + if(H5AC_move_entry((H5F_t *)f, H5AC_FHEAP_DBLOCK, par_iblock->ents[par_entry].addr, dblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move direct block") - /* Update information about direct block's location */ - par_iblock->ents[par_entry].addr = addr; + /* Update information about compressed direct block's + * location & size + */ + HDassert(par_iblock->ents[par_entry].addr == addr); + HDassert(par_iblock->filt_ents[par_entry].size == compressed_len); + par_iblock->ents[par_entry].addr = dblock_addr; + par_iblock->filt_ents[par_entry].size = write_size; - /* Mark that parent was modified */ - if(H5HF_iblock_dirty(par_iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") - } /* end else */ + /* Note that parent was modified */ + par_changed = TRUE; } /* end if */ + + /* Check if parent was modified */ + if(par_changed) + if(H5HF_iblock_dirty(par_iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end else */ + } /* end if */ + else { + /* I/O filters are not enabled -- thus all we need to do is check to + * see if the direct block is in temporary (AKA imaginary) file + * space, and move it to real file space if it is. + * + * As in the I/O filters case above, we will have to touch up the + * direct blocks parent if the direct block is relocated. + * + * Recall that temporary file space need not be freed, which + * simplifies matters slightly. + */ + write_buf = dblock->blk; + write_size = dblock->size; - /* Direct block must be in 'normal' file space now */ - HDassert(!H5F_IS_TMP_ADDR(f, addr)); + /* Check to see if we must re-allocate direct block from 'temp.' + * to 'normal' file space + */ + if(at_tmp_addr) { + /* Check for root direct block */ + if(NULL == dblock->parent) { + /* Sanity check */ + HDassert(H5F_addr_eq(hdr->man_dtable.table_addr, addr)); - /* Write the direct block */ - if(H5F_block_write(f, H5FD_MEM_FHEAP_DBLOCK, addr, write_size, dxpl_id, write_buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFLUSH, FAIL, "unable to save fractal heap direct block to disk") + /* Allocate 'normal' space for the direct block */ + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") - /* Release the write buffer, if it was allocated */ - if(write_buf != dblock->blk) - H5MM_xfree(write_buf); + /* Sanity check */ + HDassert(!H5F_addr_eq(hdr->man_dtable.table_addr, dblock_addr)); - dblock->cache_info.is_dirty = FALSE; - } /* end if */ + /* Let the metadata cache know the block moved */ + if(H5AC_move_entry((H5F_t *)f, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, dblock_addr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move direct block") - if(destroy) - if(H5HF_cache_dblock_dest(f, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") + /* Update information about direct block's location */ + hdr->man_dtable.table_addr = dblock_addr; -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_cache_dblock_flush() */ + /* Mark that heap header was modified */ + if(H5HF_hdr_dirty(hdr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") + } /* end if */ + else { /* the direct block's parent is an indirect block */ + /* Sanity check */ + HDassert(par_iblock); + HDassert(H5F_addr_eq(par_iblock->ents[par_entry].addr, addr)); - -/*------------------------------------------------------------------------- - * Function: H5HF_cache_dblock_dest - * - * Purpose: Destroys a fractal heap direct block in memory. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 27 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5HF_cache_dblock_dest(H5F_t *f, H5HF_direct_t *dblock) -{ - herr_t ret_value = SUCCEED; /* Return value */ + /* Allocate 'normal' space for the direct block */ + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") - FUNC_ENTER_NOAPI_NOINIT + /* Sanity check */ + HDassert(!H5F_addr_eq(par_iblock->ents[par_entry].addr, dblock_addr)); - /* - * Check arguments. - */ - HDassert(dblock); + /* Let the metadata cache know the block moved */ + if(H5AC_move_entry((H5F_t *)f, H5AC_FHEAP_DBLOCK, par_iblock->ents[par_entry].addr, dblock_addr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move direct block") - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!dblock->cache_info.free_file_space_on_destroy || H5F_addr_defined(dblock->cache_info.addr)); + /* Update information about direct block's location */ + par_iblock->ents[par_entry].addr = dblock_addr; - /* Check for freeing file space for direct block */ - if(dblock->cache_info.free_file_space_on_destroy) { - /* Sanity check */ - HDassert(dblock->file_size > 0); - - /* Check if the direct block is NOT currently allocated in temp. file space */ - /* (temp. file space does not need to be freed) */ - if(!H5F_IS_TMP_ADDR(f, dblock->cache_info.addr)) { - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, H5AC_dxpl_id, dblock->cache_info.addr, dblock->file_size) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") + /* Mark that parent was modified */ + if(H5HF_iblock_dirty(par_iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") + } /* end else */ } /* end if */ + } /* end else */ + + /* At this point, write_buf points to a buffer containing the image + * of the direct block that is ready to copy into the image buffer, + * and write_size contains the length of this buffer. + * + * Also, if image size or address has changed, the direct block's + * parent has been modified to reflect the change. + * + * Now, make note of the pointer and length of the above buffer for + * use by the serialize function. + */ + dblock->write_buf = (uint8_t *)write_buf; + dblock->write_size = write_size; + + /* finally, pass data back to the metadata cache as appropriate */ + if(!H5F_addr_eq(addr, dblock_addr)) { + dblock_flags |= H5C__SERIALIZE_MOVED_FLAG; + *new_addr = dblock_addr; } /* end if */ - /* Destroy fractal heap direct block */ - if(H5HF_man_dblock_dest(dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") + if((hdr->filter_len > 0) && (compressed_len != write_size)) { + dblock_flags |= H5C__SERIALIZE_COMPRESSED_FLAG; + *new_compressed_len = write_size; + } /* end if */ + + *flags = dblock_flags; + + /* final sanity check */ + HDassert(dblock->write_buf); + HDassert(dblock->write_size > 0); done: + /* discard the write buf if we have an error */ + if(write_buf && (write_buf != dblock->blk) && (dblock->write_buf == NULL)) + H5MM_xfree(write_buf); + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_dblock_dest() */ +} /* end H5HF__cache_dblock_pre_serialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_dblock_clear + * Function: H5HF__cache_dblock_serialize * - * Purpose: Mark a fractal heap direct block in memory as non-dirty. + * Purpose: In principle, this function is supposed to construct the on + * disk image of the direct block, and place that image in the + * image buffer provided by the metadata cache. * - * Return: Non-negative on success/Negative on failure + * However, since there are cases in which the pre_serialize + * function has to construct the on disk image to determine its size + * and address, this function simply copies the image prepared by + * the pre-serialize function into the supplied image buffer, and + * discards a buffer if necessary. * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 27 2006 + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ -static herr_t -H5HF_cache_dblock_clear(H5F_t *f, H5HF_direct_t *dblock, hbool_t destroy) +static herr_t +H5HF__cache_dblock_serialize(const H5F_t *f, void *image, size_t len, + void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; /* Direct block info */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR - /* - * Check arguments. - */ + /* Sanity checks */ + HDassert(f); + HDassert(image); + HDassert(len > 0); HDassert(dblock); + HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); + HDassert((dblock->blk != dblock->write_buf) || (dblock->cache_info.size == dblock->size)); + HDassert(dblock->write_buf); + HDassert(dblock->write_size > 0); + HDassert((dblock->blk != dblock->write_buf) || (dblock->write_size == dblock->size)); + HDassert(dblock->write_size == len); + + /* Copy the image from *(dblock->write_buf) to *image */ + HDmemcpy(image, dblock->write_buf, dblock->write_size); + + /* Free *(dblock->write_buf) if it was allocated by the + * pre-serialize function + */ + if(dblock->write_buf != dblock->blk) + H5MM_xfree(dblock->write_buf); - /* Reset the dirty flag. */ - dblock->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5HF_cache_dblock_dest(f, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") + /* Reset the write_buf and write_size fields */ + dblock->write_buf = NULL; + dblock->write_size = 0; -done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_dblock_clear() */ +} /* end H5HF__cache_dblock_serialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_dblock_notify + * Function: H5HF__cache_dblock_notify * * Purpose: Setup / takedown flush dependencies as direct blocks * are loaded / inserted and evicted from the metadata cache. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * * Programmer: John Mainzer - * 5/17/14 + * 6/21/14 * *------------------------------------------------------------------------- */ -static herr_t -H5HF_cache_dblock_notify(H5C_notify_action_t action, H5HF_direct_t *dblock) +static herr_t +H5HF__cache_dblock_notify(H5C_notify_action_t action, void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; /* Fractal heap direct block */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* - * Check arguments. - */ + /* Sanity checks */ HDassert(dblock); HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); HDassert(dblock->hdr); HDassert((dblock->fd_parent) || ((dblock->hdr->man_dtable.curr_root_rows == 0) && (dblock->block_off == (hsize_t)0))); switch(action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: + case H5AC_NOTIFY_ACTION_AFTER_LOAD: HDassert(dblock->parent == dblock->fd_parent); if(dblock->parent) { /* this is a leaf dblock */ /* create flush dependency with parent iblock */ @@ -1964,6 +2392,10 @@ H5HF_cache_dblock_notify(H5C_notify_action_t action, H5HF_direct_t *dblock) } /* end else */ break; + case H5AC_NOTIFY_ACTION_AFTER_FLUSH: + /* do nothing */ + break; + case H5AC_NOTIFY_ACTION_BEFORE_EVICT: HDassert((dblock->parent == dblock->fd_parent) || ((NULL == dblock->parent) && (dblock->fd_parent))); @@ -1986,39 +2418,47 @@ H5HF_cache_dblock_notify(H5C_notify_action_t action, H5HF_direct_t *dblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_dblock_notify() */ +} /* end H5HF__cache_dblock_notify() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_dblock_size + * Function: H5HF__cache_dblock_free_icr * - * Purpose: Compute the size in bytes of a fractal heap direct block - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Free the in core memory allocated to the supplied direct + * block. * - * Return: Non-negative on success/Negative on failure + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 24 2006 + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ -static herr_t -H5HF_cache_dblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5HF_direct_t *dblock, size_t *size_ptr) +static herr_t +H5HF__cache_dblock_free_icr(void *_thing) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; /* Fractal heap direct block */ + herr_t ret_value = SUCCEED; /* Return value */ - /* check arguments */ - HDassert(dblock); - HDassert(size_ptr); + FUNC_ENTER_STATIC - /* Set size value */ - *size_ptr = dblock->size; + /* Sanity checks */ + HDassert(dblock); + HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_cache_dblock_size() */ + /* Destroy fractal heap direct block */ + if(H5HF_man_dblock_dest(dblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF__cache_dblock_free_icr() */ /*------------------------------------------------------------------------ @@ -2144,7 +2584,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, * in this case, since we know that the entry is in cache, * we can pass NULL udata. */ - if(NULL == (root_iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5AC_READ))) + if(NULL == (root_iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5C__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") unprotect_root_iblock = TRUE; } /* end if */ @@ -2205,7 +2645,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, * in this case, since we know that the entry is in cache, * we can pass NULL udata. */ - if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5AC_READ))) + if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5C__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") unprotect_root_iblock = TRUE; HDassert(iblock == root_iblock); @@ -2595,7 +3035,7 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, hid_t dxpl_id, /* in this case, since we know that the */ /* entry is in cache, we can pass NULL udata */ - if(NULL == (child_iblock = (H5HF_indirect_t *) H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, child_iblock_addr, NULL, H5AC_READ))) + if(NULL == (child_iblock = (H5HF_indirect_t *) H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, child_iblock_addr, NULL, H5C__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") unprotect_child_iblock = TRUE; } /* end if */ diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 8620f6f..5183b67 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -323,7 +323,7 @@ H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(fwidth >= 0); /* Load the fractal heap header */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, addr, H5AC_READ))) + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Print the information about the heap's header */ @@ -459,13 +459,13 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HDassert(block_size > 0); /* Load the fractal heap header */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, hdr_addr, H5AC_READ))) + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, hdr_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* * Load the heap direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, addr, block_size, NULL, 0, H5AC_READ))) + if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, addr, block_size, NULL, 0, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap direct block") /* Print opening message */ @@ -716,13 +716,13 @@ H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HDassert(nrows > 0); /* Load the fractal heap header */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, hdr_addr, H5AC_READ))) + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, hdr_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* * Load the heap indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, addr, nrows, NULL, 0, FALSE, H5AC_READ, &did_protect))) + if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, addr, nrows, NULL, 0, FALSE, H5AC__READ_ONLY_FLAG, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap indirect block") /* Print the information about the heap's indirect block */ @@ -825,7 +825,7 @@ H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr, HDassert(fwidth >= 0); /* Load the fractal heap header */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC_READ))) + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Initialize the free space information for the heap */ diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 9a8da4a..5dd5b0c 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -149,6 +149,9 @@ H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblo HDmemset(dblock->blk, 0, dblock->size); #endif /* H5_CLEAR_MEMORY */ + dblock->write_buf = NULL; + dblock->write_size = 0; + /* Allocate [temporary] space for the direct block on disk */ if(H5F_USE_TMP_SPACE(hdr->f)) { if(HADDR_UNDEF == (dblock_addr = H5MF_alloc_tmp(hdr->f, (hsize_t)dblock->size))) @@ -308,9 +311,13 @@ H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_direct_t *dblock, } /* end if */ } /* end else */ - /* Indicate that the indirect block should be deleted & file space freed */ + /* Indicate that the indirect block should be deleted */ dblock->file_size = dblock_size; - cache_flags |= H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; + cache_flags |= H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG; + + /* If the dblock is in real file space, also tell the cache to free its file space */ + if (!H5F_IS_TMP_ADDR(hdr->f, dblock_addr)) + cache_flags |= H5AC__FREE_FILE_SPACE_FLAG; done: /* Unprotect the indirect block, with appropriate flags */ @@ -436,7 +443,7 @@ done: H5HF_direct_t * H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, size_t dblock_size, H5HF_indirect_t *par_iblock, unsigned par_entry, - H5AC_protect_t rw) + unsigned flags) { H5HF_direct_t *dblock; /* Direct block from cache */ H5HF_dblock_cache_ud_t udata; /* parent and other infor for deserializing direct block */ @@ -451,6 +458,9 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, HDassert(H5F_addr_defined(dblock_addr)); HDassert(dblock_size > 0); + /* only H5AC__READ_ONLY_FLAG may appear in flags */ + HDassert((flags & (~H5AC__READ_ONLY_FLAG)) == 0); + /* Set up parent info */ udata.par_info.hdr = hdr; udata.par_info.iblock = par_iblock; @@ -485,7 +495,7 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, } /* end else */ /* Protect the direct block */ - if(NULL == (dblock = (H5HF_direct_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, &udata, rw))) + if(NULL == (dblock = (H5HF_direct_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, &udata, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap direct block") /* Set the return value */ @@ -512,7 +522,7 @@ done: herr_t H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, H5HF_indirect_t **ret_iblock, unsigned *ret_entry, hbool_t *ret_did_protect, - H5AC_protect_t rw) + unsigned flags) { haddr_t iblock_addr; /* Indirect block's address */ H5HF_indirect_t *iblock; /* Pointer to indirect block */ @@ -531,6 +541,9 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, HDassert(ret_iblock); HDassert(ret_did_protect); + /* only H5AC__READ_ONLY_FLAG may appear in flags */ + HDassert((flags & (~H5AC__READ_ONLY_FLAG)) == 0); + /* Look up row & column for object */ if(H5HF_dtable_lookup(&hdr->man_dtable, obj_off, &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of object") @@ -539,7 +552,7 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, iblock_addr = hdr->man_dtable.table_addr; /* Lock root indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, hdr->man_dtable.curr_root_rows, NULL, 0, FALSE, rw, &did_protect))) + if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, hdr->man_dtable.curr_root_rows, NULL, 0, FALSE, flags, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Check for indirect block row */ @@ -569,7 +582,7 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, } /* end if */ /* Lock child indirect block */ - if(NULL == (new_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, nrows, iblock, entry, FALSE, rw, &new_did_protect))) + if(NULL == (new_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, nrows, iblock, entry, FALSE, flags, &new_did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Release the current indirect block */ diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index cf8da23..340940f 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -529,7 +529,7 @@ done: *------------------------------------------------------------------------- */ H5HF_hdr_t * -H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) +H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) { H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */ H5HF_hdr_t *hdr; /* Fractal heap header */ @@ -541,12 +541,15 @@ H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) HDassert(f); HDassert(H5F_addr_defined(addr)); + /* only H5AC__READ_ONLY_FLAG may appear in flags */ + HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* Set up userdata for protect call */ cache_udata.f = f; cache_udata.dxpl_id = dxpl_id; /* Lock the heap header into memory */ - if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, addr, &cache_udata, rw))) + if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, addr, &cache_udata, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap header") /* Set the header's address */ @@ -1109,7 +1112,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap indirect block") /* Lock new indirect block */ - if(NULL == (new_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, new_iblock_addr, child_nrows, iblock, next_entry, FALSE, H5AC_WRITE, &did_protect))) + if(NULL == (new_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, new_iblock_addr, child_nrows, iblock, next_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Move iterator down one level (pins indirect block) */ @@ -1303,7 +1306,7 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[row]); /* Lock child indirect block */ - if(NULL == (child_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock->ents[curr_entry].addr, child_nrows, iblock, curr_entry, FALSE, H5AC_WRITE, &did_protect))) + if(NULL == (child_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock->ents[curr_entry].addr, child_nrows, iblock, curr_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Set the current location of the iterator */ diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 4473803..547aaf0 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -330,8 +330,15 @@ H5HF_iblock_decr(H5HF_indirect_t *iblock) /* Check for expunging the indirect block from the metadata cache */ if(expunge_iblock) { - /* Evict the indirect block from the metadata cache */ - if(H5AC_expunge_entry(hdr->f, H5AC_dxpl_id, H5AC_FHEAP_IBLOCK, iblock_addr, H5AC__FREE_FILE_SPACE_FLAG) < 0) + unsigned cache_flags = H5AC__NO_FLAGS_SET; + + /* if the indirect block is in real file space, tell + * the cache to free its file space. + */ + if (!H5F_IS_TMP_ADDR(hdr->f, iblock_addr)) + cache_flags |= H5AC__FREE_FILE_SPACE_FLAG; + + if(H5AC_expunge_entry(hdr->f, H5AC_dxpl_id, H5AC_FHEAP_IBLOCK, iblock_addr, cache_flags) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "unable to remove indirect block from cache") } /* end if */ } /* end if */ @@ -424,7 +431,7 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si /* Move current direct block (used as root) into new indirect block */ /* Lock new indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, nrows, NULL, 0, FALSE, H5AC_WRITE, &did_protect))) + if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, nrows, NULL, 0, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Check if there's already a direct block as root) */ @@ -433,7 +440,7 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si H5HF_direct_t *dblock; /* Pointer to direct block to query */ /* Lock first (root) direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, hdr->man_dtable.table_addr, hdr->man_dtable.cparam.start_block_size, NULL, 0, H5AC_WRITE))) + if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, hdr->man_dtable.table_addr, hdr->man_dtable.cparam.start_block_size, NULL, 0, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap direct block") /* Attach direct block to new root indirect block */ @@ -879,7 +886,7 @@ H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id) dblock_size = hdr->man_dtable.cparam.start_block_size; /* Get pointer to last direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, root_iblock, 0, H5AC_WRITE))) + if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, root_iblock, 0, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap direct block") HDassert(dblock->parent == root_iblock); HDassert(dblock->par_entry == 0); @@ -1159,7 +1166,7 @@ done: H5HF_indirect_t * H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, - hbool_t must_protect, H5AC_protect_t rw, hbool_t *did_protect) + hbool_t must_protect, unsigned flags, hbool_t *did_protect) { H5HF_parent_t par_info; /* Parent info for loading block */ H5HF_indirect_t *iblock = NULL; /* Indirect block from cache */ @@ -1176,6 +1183,9 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, HDassert(iblock_nrows > 0); HDassert(did_protect); + /* only H5AC__READ_ONLY_FLAG may appear in flags */ + HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* Check if we are allowed to use existing pinned iblock pointer */ if(!must_protect) { /* Check for this block already being pinned */ @@ -1235,7 +1245,7 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, cache_udata.nrows = &iblock_nrows; /* Protect the indirect block */ - if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FHEAP_IBLOCK, iblock_addr, &cache_udata, rw))) + if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FHEAP_IBLOCK, iblock_addr, &cache_udata, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap indirect block") /* Set the indirect block's address */ @@ -1579,7 +1589,7 @@ H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, HDassert(iblock_nrows > 0); /* Lock indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, iblock_nrows, par_iblock, par_entry, TRUE, H5AC_WRITE, &did_protect))) + if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, iblock_nrows, par_iblock, par_entry, TRUE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") HDassert(iblock->nchildren > 0); HDassert(did_protect == TRUE); @@ -1637,8 +1647,14 @@ H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, } #endif /* NDEBUG */ - /* Indicate that the indirect block should be deleted & file space freed */ - cache_flags |= H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; + /* Indicate that the indirect block should be deleted */ + cache_flags |= H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG; + + /* If the indirect block is in real file space, tell + * the cache to free its file space as well. + */ + if (!H5F_IS_TMP_ADDR(hdr->f, iblock_addr)) + cache_flags |= H5AC__FREE_FILE_SPACE_FLAG; done: /* Unprotect the indirect block, with appropriate flags */ @@ -1680,7 +1696,7 @@ H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, haddr_t iblock_ad HDassert(heap_size); /* Protect the indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, nrows, par_iblock, par_entry, FALSE, H5AC_READ, &did_protect))) + if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, nrows, par_iblock, par_entry, FALSE, H5AC__READ_ONLY_FLAG, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap indirect block") /* Accumulate size of this indirect block */ diff --git a/src/H5HFiter.c b/src/H5HFiter.c index 137d0ee..262a9ee 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -217,7 +217,7 @@ H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, } /* end else */ /* Load indirect block for this context location */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, iblock_nrows, iblock_parent, iblock_par_entry, FALSE, H5AC_WRITE, &did_protect))) + if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, iblock_nrows, iblock_parent, iblock_par_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Make indirect block the context for the current location */ diff --git a/src/H5HFman.c b/src/H5HFman.c index 58dab10..5f95a91 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -161,7 +161,7 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information") /* Lock direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, sec_node->u.single.parent, sec_node->u.single.par_entry, H5AC_WRITE))) + if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, sec_node->u.single.parent, sec_node->u.single.par_entry, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load fractal heap direct block") /* Insert object into block */ @@ -274,7 +274,11 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, H5HF_operator_t op, void *op_data, unsigned op_flags) { H5HF_direct_t *dblock = NULL; /* Pointer to direct block to query */ - H5AC_protect_t dblock_access; /* Access method for direct block */ + unsigned dblock_access_flags; /* Access method for direct block */ + /* must equal either + * H5AC__NO_FLAGS_SET or + * H5AC__READ_ONLY_FLAG + */ haddr_t dblock_addr; /* Direct block address */ size_t dblock_size; /* Direct block size */ unsigned dblock_cache_flags; /* Flags for unprotecting direct block */ @@ -298,11 +302,11 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check pipeline */ H5HF_MAN_WRITE_CHECK_PLINE(hdr) - dblock_access = H5AC_WRITE; + dblock_access_flags = H5AC__NO_FLAGS_SET; dblock_cache_flags = H5AC__DIRTIED_FLAG; } /* end if */ else { - dblock_access = H5AC_READ; + dblock_access_flags = H5AC__READ_ONLY_FLAG; dblock_cache_flags = H5AC__NO_FLAGS_SET; } /* end else */ @@ -332,7 +336,7 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, dblock_size = hdr->man_dtable.cparam.start_block_size; /* Lock direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, NULL, 0, dblock_access))) + if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, NULL, 0, dblock_access_flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap direct block") } /* end if */ else { @@ -341,7 +345,7 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, unsigned entry; /* Entry of block */ /* Look up indirect block containing direct block */ - if(H5HF_man_dblock_locate(hdr, dxpl_id, obj_off, &iblock, &entry, &did_protect, H5AC_READ) < 0) + if(H5HF_man_dblock_locate(hdr, dxpl_id, obj_off, &iblock, &entry, &did_protect, H5AC__READ_ONLY_FLAG) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") /* Set direct block info */ @@ -359,7 +363,7 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, } /* end if */ /* Lock direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, iblock, entry, dblock_access))) { + if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, iblock, entry, dblock_access_flags))) { /* Unlock indirect block */ if(H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") @@ -578,7 +582,7 @@ H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) } /* end if */ else { /* Look up indirect block containing direct block */ - if(H5HF_man_dblock_locate(hdr, dxpl_id, obj_off, &iblock, &dblock_entry, &did_protect, H5AC_WRITE) < 0) + if(H5HF_man_dblock_locate(hdr, dxpl_id, obj_off, &iblock, &dblock_entry, &did_protect, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") /* Check for offset of invalid direct block */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 63c1a3e..4655d83 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -341,7 +341,7 @@ typedef struct H5HF_hdr_t { size_t rc; /* Reference count of heap's components using heap header */ haddr_t heap_addr; /* Address of heap header in the file */ size_t heap_size; /* Size of heap header in the file */ - H5AC_protect_t mode; /* Access mode for heap */ + unsigned mode; /* Access mode for heap */ H5F_t *f; /* Pointer to file for heap */ size_t file_rc; /* Reference count of files using heap header */ hbool_t pending_delete; /* Heap is pending deletion */ @@ -424,6 +424,31 @@ typedef struct H5HF_direct_t { size_t size; /* Size of direct block */ hsize_t file_size; /* Size of direct block in file (only valid when block's space is being freed) */ uint8_t *blk; /* Pointer to buffer containing block data */ + uint8_t *write_buf; /* Pointer to buffer containing the block data */ + /* in form ready to copy to the metadata */ + /* cache's image buffer. */ + /* */ + /* This field is used by */ + /* H5HF_cache_dblock_pre_serialize() to pass */ + /* the serialized image of the direct block to */ + /* H5HF_cache_dblock_serialize(). It should */ + /* NULL at all other times. */ + /* */ + /* If I/O filters are enabled, the pre- */ + /* the pre-serialize function will allocate */ + /* a buffer, copy the filtered version of the */ + /* direct block image into it, and place the */ + /* base address of the buffer in this field. */ + /* The serialize function must discard this */ + /* buffer after it copies the contents into */ + /* the image buffer provided by the metadata */ + /* cache. */ + /* */ + /* If I/O filters are not enabled, the */ + /* write_buf field is simply set equal to the */ + /* blk field by the pre-serialize function, */ + /* and back to NULL by the serialize function. */ + size_t write_size; /* size of the buffer pointed to by write_buf. */ /* Stored values */ hsize_t block_off; /* Offset of the block within the heap's address space */ @@ -597,7 +622,7 @@ H5_DLL hsize_t H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start H5_DLL H5HF_hdr_t * H5HF_hdr_alloc(H5F_t *f); H5_DLL haddr_t H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam); H5_DLL H5HF_hdr_t *H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, - H5AC_protect_t rw); + unsigned flags); H5_DLL herr_t H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF_hdr_finish_init(H5HF_hdr_t *hdr); @@ -638,7 +663,7 @@ H5_DLL herr_t H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, H5_DLL H5HF_indirect_t *H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, hbool_t must_protect, - H5AC_protect_t rw, hbool_t *did_protect); + unsigned flags, hbool_t *did_protect); H5_DLL herr_t H5HF_man_iblock_unprotect(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned cache_flags, hbool_t did_protect); H5_DLL herr_t H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, @@ -664,10 +689,10 @@ H5_DLL herr_t H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, H5_DLL H5HF_direct_t *H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, size_t dblock_size, H5HF_indirect_t *par_iblock, unsigned par_entry, - H5AC_protect_t rw); + unsigned flags); H5_DLL herr_t H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, H5HF_indirect_t **par_iblock, - unsigned *par_entry, hbool_t *par_did_protect, H5AC_protect_t rw); + unsigned *par_entry, hbool_t *par_did_protect, unsigned flags); H5_DLL herr_t H5HF_man_dblock_delete(H5F_t *f, hid_t dxpl_id, haddr_t dblock_addr, hsize_t dblock_size); H5_DLL herr_t H5HF_man_dblock_dest(H5HF_direct_t *dblock); diff --git a/src/H5HFsection.c b/src/H5HFsection.c index 01a7b4a..c997119 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -555,7 +555,7 @@ H5HF_sect_single_locate_parent(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t refresh, HDassert(sect); /* Look up indirect block containing direct blocks for range */ - if(H5HF_man_dblock_locate(hdr, dxpl_id, sect->sect_info.addr, &sec_iblock, &sec_entry, &did_protect, H5AC_READ) < 0) + if(H5HF_man_dblock_locate(hdr, dxpl_id, sect->sect_info.addr, &sec_iblock, &sec_entry, &did_protect, H5AC__READ_ONLY_FLAG) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") /* Increment reference count on indirect block that free section is in */ @@ -776,7 +776,7 @@ H5HF_sect_single_full_dblock(H5HF_hdr_t *hdr, hid_t dxpl_id, hdr->man_dtable.curr_root_rows > 0) { H5HF_direct_t *dblock; /* Pointer to direct block for section */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, sect->u.single.parent, sect->u.single.par_entry, H5AC_WRITE))) + if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, sect->u.single.parent, sect->u.single.par_entry, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load fractal heap direct block") HDassert(H5F_addr_eq(dblock->block_off + dblock_overhead, sect->sect_info.addr)); @@ -1094,7 +1094,7 @@ H5HF_sect_single_shrink(H5FS_section_info_t **_sect, void H5_ATTR_UNUSED *_udata /* (should be a root direct block) */ HDassert(dblock_addr == hdr->man_dtable.table_addr); if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, - dblock_size, (*sect)->u.single.parent, (*sect)->u.single.par_entry, H5AC_WRITE))) + dblock_size, (*sect)->u.single.parent, (*sect)->u.single.par_entry, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load fractal heap direct block") HDassert(H5F_addr_eq(dblock->block_off + dblock_size, (*sect)->sect_info.addr + (*sect)->sect_info.size)); @@ -1221,7 +1221,7 @@ H5HF_sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5F H5HF_direct_t *dblock; /* Direct block for section */ /* Protect the direct block for the section */ - dblock = H5HF_man_dblock_protect(iblock->hdr, H5AC_dxpl_id, dblock_addr, dblock_size, iblock, sect->u.single.par_entry, H5AC_READ); + dblock = H5HF_man_dblock_protect(iblock->hdr, H5AC_dxpl_id, dblock_addr, dblock_size, iblock, sect->u.single.par_entry, H5AC__READ_ONLY_FLAG); HDassert(dblock); /* Sanity check settings for section */ @@ -2536,7 +2536,7 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, /* If the child indirect block's address is defined, protect it */ if(H5F_addr_defined(child_iblock_addr)) { - if(NULL == (child_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, child_iblock_addr, child_nrows, sect->u.indirect.u.iblock, curr_entry, FALSE, H5AC_WRITE, &did_protect))) + if(NULL == (child_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, child_iblock_addr, child_nrows, sect->u.indirect.u.iblock, curr_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") } /* end if */ else @@ -2771,7 +2771,7 @@ H5HF_sect_indirect_revive_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_ HDassert(sect->sect_info.state == H5FS_SECT_SERIALIZED); /* Look up indirect block containing indirect blocks for section */ - if(H5HF_man_dblock_locate(hdr, dxpl_id, sect->sect_info.addr, &sec_iblock, NULL, &did_protect, H5AC_READ) < 0) + if(H5HF_man_dblock_locate(hdr, dxpl_id, sect->sect_info.addr, &sec_iblock, NULL, &did_protect, H5AC__READ_ONLY_FLAG) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") /* Increment reference count on indirect block that free section is in */ diff --git a/src/H5HG.c b/src/H5HG.c index ac8ed8d..46b535d 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -246,7 +246,7 @@ done: *------------------------------------------------------------------------- */ H5HG_heap_t * -H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) +H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) { H5HG_heap_t *heap; /* Global heap */ H5HG_heap_t *ret_value; /* Return value */ @@ -257,8 +257,11 @@ H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) HDassert(f); HDassert(H5F_addr_defined(addr)); + /* only H5AC__READ_ONLY_FLAG may appear in flags */ + HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* Lock the heap into memory */ - if(NULL == (heap = (H5HG_heap_t *)H5AC_protect(f, dxpl_id, H5AC_GHEAP, addr, f, rw))) + if(NULL == (heap = (H5HG_heap_t *)H5AC_protect(f, dxpl_id, H5AC_GHEAP, addr, f, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect global heap") /* Set the heap's address */ @@ -440,7 +443,7 @@ H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need) HDassert(H5F_addr_defined(addr)); /* Protect the heap */ - if(NULL == (heap = H5HG_protect(f, dxpl_id, addr, H5AC_WRITE))) + if(NULL == (heap = H5HG_protect(f, dxpl_id, addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") /* Re-allocate the heap information in memory */ @@ -554,7 +557,7 @@ H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/ } /* end if */ HDassert(H5F_addr_defined(addr)); - if(NULL == (heap = H5HG_protect(f, dxpl_id, addr, H5AC_WRITE))) + if(NULL == (heap = H5HG_protect(f, dxpl_id, addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") /* Split the free space to make room for the new object */ @@ -618,7 +621,7 @@ H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/, HDassert(hobj); /* Load the heap */ - if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC_READ))) + if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect global heap") HDassert(hobj->idx < heap->nused); @@ -692,7 +695,7 @@ H5HG_link(H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "no write intent on file") /* Load the heap */ - if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC_WRITE))) + if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") if(adjust != 0) { @@ -755,7 +758,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "no write intent on file") /* Load the heap */ - if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC_WRITE))) + if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") HDassert(hobj->idx < heap->nused); diff --git a/src/H5HGcache.c b/src/H5HGcache.c index aac73ed..5c6bee1 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -62,12 +62,14 @@ /********************/ /* Metadata cache callbacks */ -static H5HG_heap_t *H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HG_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - H5HG_heap_t *heap, unsigned H5_ATTR_UNUSED * flags_ptr); -static herr_t H5HG_dest(H5F_t *f, H5HG_heap_t *heap); -static herr_t H5HG_clear(H5F_t *f, H5HG_heap_t *heap, hbool_t destroy); -static herr_t H5HG_size(const H5F_t *f, const H5HG_heap_t *heap, size_t *size_ptr); +static herr_t H5HG__cache_heap_get_load_size(const void *udata, size_t *image_len); +static void *H5HG__cache_heap_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5HG__cache_heap_image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5HG__cache_heap_serialize(const H5F_t *f, void *image, + size_t len, void *thing); +static herr_t H5HG__cache_heap_free_icr(void *thing); /*********************/ @@ -76,13 +78,19 @@ static herr_t H5HG_size(const H5F_t *f, const H5HG_heap_t *heap, size_t *size_pt /* H5HG inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_GHEAP[1] = {{ - H5AC_GHEAP_ID, - (H5AC_load_func_t)H5HG_load, - (H5AC_flush_func_t)H5HG_flush, - (H5AC_dest_func_t)H5HG_dest, - (H5AC_clear_func_t)H5HG_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5HG_size, + H5AC_GHEAP_ID, /* Metadata client ID */ + "global heap", /* Metadata client name (for debugging) */ + H5FD_MEM_GHEAP, /* File space memory type for client */ + H5AC__CLASS_SPECULATIVE_LOAD_FLAG, /* Client class behavior flags */ + H5HG__cache_heap_get_load_size, /* 'get_load_size' callback */ + H5HG__cache_heap_deserialize, /* 'deserialize' callback */ + H5HG__cache_heap_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5HG__cache_heap_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5HG__cache_heap_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; @@ -98,162 +106,204 @@ const H5AC_class_t H5AC_GHEAP[1] = {{ /*------------------------------------------------------------------------- - * Function: H5HG_load + * Function: H5HG__cache_heap_get_load_size() * - * Purpose: Loads a global heap collection from disk. + * Purpose: Return the initial speculative read size to the metadata + * cache. This size will be used in the initial attempt to read + * the global heap. If this read is too small, the cache will + * try again with the correct value obtained from + * H5HG__cache_heap_image_len(). * - * Return: Success: Ptr to a global heap collection. + * Return: Success: SUCCEED + * Failure: FAIL * - * Failure: NULL + * Programmer: John Mainzer + * 7/27/14 * - * Programmer: Robb Matzke - * Friday, March 27, 1998 + *------------------------------------------------------------------------- + */ +static herr_t +H5HG__cache_heap_get_load_size(const void H5_ATTR_UNUSED *_udata, size_t *image_len) +{ + FUNC_ENTER_STATIC_NOERR + + HDassert(image_len); + + *image_len = (size_t)H5HG_MINSIZE; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HG__cache_heap_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5HG__cache_heap_deserialize + * + * Purpose: Given a buffer containing the on disk image of the global + * heap, deserialize it, load its contents into a newly allocated + * instance of H5HG_heap_t, and return a pointer to the new instance. + * + * Note that this heap client uses speculative reads. If the supplied + * buffer is too small, we simply make note of the correct size, and + * wait for the metadata cache to try again. + * + * Return: Success: Pointer to in core representation + * Failure: NULL + * + * Programmer: John Mainzer + * 7/27/14 * *------------------------------------------------------------------------- */ -static H5HG_heap_t * -H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +static void * +H5HG__cache_heap_deserialize(const void *_image, size_t len, void *_udata, + hbool_t H5_ATTR_UNUSED *dirty) { - H5HG_heap_t *heap = NULL; - uint8_t *p; - size_t nalloc, need; - size_t max_idx = 0; /* The maximum index seen */ - H5HG_heap_t *ret_value = NULL; /* Return value */ + H5F_t *f = (H5F_t *)_udata; /* File pointer -- obtained from user data */ + H5HG_heap_t *heap = NULL; /* New global heap */ + uint8_t *image; /* Pointer to image to decode */ + void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* check arguments */ + /* Sanity checks */ + HDassert(_image); + HDassert(len >= (size_t)H5HG_MINSIZE); HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(udata); + HDassert(dirty); - /* Read the initial 4k page */ + /* Allocate a new global heap */ if(NULL == (heap = H5FL_CALLOC(H5HG_heap_t))) 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))) + if(NULL == (heap->chunk = H5FL_BLK_MALLOC(gheap_chunk, len))) 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; + + /* copy the image buffer into the newly allocate chunk */ + HDmemcpy(heap->chunk, _image, len); + + image = heap->chunk; /* Magic number */ - if(HDmemcmp(p, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "bad global heap collection signature") - p += H5_SIZEOF_MAGIC; + if(HDmemcmp(image, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "bad global heap collection signature") + image += H5_SIZEOF_MAGIC; /* Version */ - if(H5HG_VERSION != *p++) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "wrong version number in global heap") + if(H5HG_VERSION != *image++) + HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "wrong version number in global heap") /* Reserved */ - p += 3; + image += 3; /* Size */ - H5F_DECODE_LENGTH(f, p, heap->size); + H5F_DECODE_LENGTH(f, image, heap->size); HDassert(heap->size >= H5HG_MINSIZE); - - /* - * If we didn't read enough in the first try, then read the rest of the - * collection now. - */ - if(heap->size > H5HG_MINSIZE) { - haddr_t next_addr = addr + (hsize_t)H5HG_MINSIZE; - - if(NULL == (heap->chunk = H5FL_BLK_REALLOC(gheap_chunk, heap->chunk, heap->size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - if(H5F_block_read(f, H5FD_MEM_GHEAP, next_addr, (heap->size - H5HG_MINSIZE), dxpl_id, heap->chunk + H5HG_MINSIZE) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read global heap collection") - } /* end if */ - - /* Decode each object */ - p = heap->chunk + H5HG_SIZEOF_HDR(f); - nalloc = H5HG_NOBJS(f, heap->size); - - /* Calloc the obj array because the file format spec makes no guarantee - * about the order of the objects, and unused slots must be set to zero. - */ - if(NULL == (heap->obj = H5FL_SEQ_CALLOC(H5HG_obj_t, nalloc))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - - heap->nalloc = nalloc; - while(p < (heap->chunk + heap->size)) { - if((p + H5HG_SIZEOF_OBJHDR(f)) > (heap->chunk + heap->size)) { - /* - * The last bit of space is too tiny for an object header, so we - * assume that it's free space. - */ - HDassert(NULL == heap->obj[0].begin); - heap->obj[0].size = (size_t)(((const uint8_t *)heap->chunk + heap->size) - p); - heap->obj[0].begin = p; - p += heap->obj[0].size; - } /* end if */ - else { - unsigned idx; - uint8_t *begin = p; - - UINT16DECODE(p, idx); - - /* Check if we need more room to store heap objects */ - if(idx >= heap->nalloc) { - size_t new_alloc; /* New allocation number */ - H5HG_obj_t *new_obj; /* New array of object descriptions */ - - /* Determine the new number of objects to index */ - new_alloc = MAX(heap->nalloc * 2, (idx + 1)); - HDassert(idx < new_alloc); - - /* Reallocate array of objects */ - if(NULL == (new_obj = H5FL_SEQ_REALLOC(H5HG_obj_t, heap->obj, new_alloc))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - - /* Clear newly allocated space */ - HDmemset(&new_obj[heap->nalloc], 0, (new_alloc - heap->nalloc) * sizeof(heap->obj[0])); - - /* Update heap information */ - heap->nalloc = new_alloc; - heap->obj = new_obj; - HDassert(heap->nalloc > heap->nused); + HDassert((len == H5HG_MINSIZE) /* first try */ || + ((len == heap->size) && (len > H5HG_MINSIZE))); /* second try */ + + if(len == heap->size) { /* proceed with the deserialize */ + size_t max_idx = 0; + size_t nalloc; + + /* Decode each object */ + image = heap->chunk + H5HG_SIZEOF_HDR(f); + nalloc = H5HG_NOBJS(f, heap->size); + + /* Calloc the obj array because the file format spec makes no guarantee + * about the order of the objects, and unused slots must be set to zero. + */ + if(NULL == (heap->obj = H5FL_SEQ_CALLOC(H5HG_obj_t, nalloc))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + heap->nalloc = nalloc; + + while(image < (heap->chunk + heap->size)) { + if((image + H5HG_SIZEOF_OBJHDR(f)) > (heap->chunk + heap->size)) { + /* + * The last bit of space is too tiny for an object header, so + * we assume that it's free space. + */ + HDassert(NULL == heap->obj[0].begin); + heap->obj[0].size = (size_t)(((const uint8_t *)heap->chunk + heap->size) - image); + heap->obj[0].begin = image; + image += heap->obj[0].size; } /* end if */ - - UINT16DECODE(p, heap->obj[idx].nrefs); - p += 4; /*reserved*/ - H5F_DECODE_LENGTH(f, p, heap->obj[idx].size); - heap->obj[idx].begin = begin; - - /* - * The total storage size includes the size of the object header - * and is zero padded so the next object header is properly - * aligned. The entire obj array was calloc'ed, so no need to zero - * the space here. The last bit of space is the free space object - * whose size is never padded and already includes the object - * header. - */ - if(idx > 0) { - need = H5HG_SIZEOF_OBJHDR(f) + H5HG_ALIGN(heap->obj[idx].size); - - if(idx > max_idx) - max_idx = idx; - } /* end if */ - else - need = heap->obj[idx].size; - p = begin + need; - } /* end else */ - } /* end while */ - HDassert(p == heap->chunk + heap->size); - HDassert(H5HG_ISALIGNED(heap->obj[0].size)); - - /* Set the next index value to use */ - if(max_idx > 0) - heap->nused = max_idx + 1; + else { + size_t need; + unsigned idx; + uint8_t *begin = image; + + UINT16DECODE(image, idx); + + /* Check if we need more room to store heap objects */ + if(idx >= heap->nalloc) { + size_t new_alloc; /* New allocation number */ + H5HG_obj_t *new_obj; /* New array of object descriptions */ + + /* Determine the new number of objects to index */ + new_alloc = MAX(heap->nalloc * 2, (idx + 1)); + HDassert(idx < new_alloc); + + /* Reallocate array of objects */ + if(NULL == (new_obj = H5FL_SEQ_REALLOC(H5HG_obj_t, heap->obj, new_alloc))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + + /* Clear newly allocated space */ + HDmemset(&new_obj[heap->nalloc], 0, (new_alloc - heap->nalloc) * sizeof(heap->obj[0])); + + /* Update heap information */ + heap->nalloc = new_alloc; + heap->obj = new_obj; + HDassert(heap->nalloc > heap->nused); + } /* end if */ + + UINT16DECODE(image, heap->obj[idx].nrefs); + image += 4; /*reserved*/ + H5F_DECODE_LENGTH(f, image, heap->obj[idx].size); + heap->obj[idx].begin = begin; + + /* + * The total storage size includes the size of the object + * header and is zero padded so the next object header is + * properly aligned. The entire obj array was calloc'ed, + * so no need to zero the space here. The last bit of space + * is the free space object whose size is never padded and + * already includes the object header. + */ + if(idx > 0) { + need = H5HG_SIZEOF_OBJHDR(f) + H5HG_ALIGN(heap->obj[idx].size); + if(idx > max_idx) + max_idx = idx; + } /* end if */ + else + need = heap->obj[idx].size; + + image = begin + need; + } /* end else */ + } /* end while */ + + HDassert(image == heap->chunk + heap->size); + HDassert(H5HG_ISALIGNED(heap->obj[0].size)); + + /* Set the next index value to use */ + if(max_idx > 0) + heap->nused = max_idx + 1; + else + heap->nused = 1; + + HDassert(max_idx < heap->nused); + + /* Add the new heap to the CWFS list for the file */ + if(H5F_cwfs_add(f, heap) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "unable to add global heap collection to file's CWFS") + } /* end if ( len == heap->size ) */ else - heap->nused = 1; - - HDassert(max_idx < heap->nused); - - /* Add the new heap to the CWFS list for the file */ - if(H5F_cwfs_add(f, heap) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "unable to add global heap collection to file's CWFS") + /* if len is less than heap size, then the initial speculative + * read was too small. In this case we return without reporting + * failure. H5C_load_entry() will call H5HG__cache_heap_image_len() + * to get the actual read size, and then repeat the read with the + * correct size, and call this function a second time. + */ + HDassert(len < heap->size); ret_value = heap; @@ -263,154 +313,126 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy global heap collection") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HG_load() */ +} /* end H5HG__cache_heap_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HG_flush + * Function: H5HG__cache_heap_image_len * - * Purpose: Flushes a global heap collection from memory to disk if it's - * dirty. Optionally deletes teh heap from memory. + * Purpose: Return the on disk image size of the global heap to the + * metadata cache via the image_len. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Robb Matzke - * Friday, March 27, 1998 + * Programmer: John Mainzer + * 7/27/14 * *------------------------------------------------------------------------- */ static herr_t -H5HG_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HG_heap_t *heap, unsigned H5_ATTR_UNUSED * flags_ptr) +H5HG__cache_heap_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + const H5HG_heap_t *heap = (const H5HG_heap_t *)_thing; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR - /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(H5F_addr_eq(addr, heap->addr)); + /* Sanity checks */ HDassert(heap); + HDassert(heap->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(heap->cache_info.type == H5AC_GHEAP); + HDassert(heap->size >= H5HG_MINSIZE); + HDassert(image_len); - if(heap->cache_info.is_dirty) { - if(H5F_block_write(f, H5FD_MEM_GHEAP, addr, heap->size, dxpl_id, heap->chunk) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "unable to write global heap collection to file") - heap->cache_info.is_dirty = FALSE; - } /* end if */ + *image_len = heap->size; - if(destroy) - if(H5HG_dest(f, heap) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy global heap collection") + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HG__cache_heap_image_len() */ -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HG_flush() */ +/**************************************/ +/* no H5HG_cache_heap_pre_serialize() */ +/**************************************/ /*------------------------------------------------------------------------- - * Function: H5HG_dest + * Function: H5HG__cache_heap_serialize + * + * Purpose: Given an appropriately sized buffer and an instance of + * H5HG_heap_t, serialize the global heap for writing to file, + * and copy the serialized verion into the buffer. * - * Purpose: Destroys a global heap collection in memory * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * Wednesday, January 15, 2003 + * Programmer: John Mainzer + * 7/27/14 * *------------------------------------------------------------------------- */ static herr_t -H5HG_dest(H5F_t *f, H5HG_heap_t *heap) +H5HG__cache_heap_serialize(const H5F_t *f, void *image, size_t len, + void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5HG_heap_t *heap = (H5HG_heap_t *)_thing; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR - /* Check arguments */ + HDassert(f); + HDassert(image); HDassert(heap); + HDassert(heap->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(heap->cache_info.type == H5AC_GHEAP); + HDassert(heap->size == len); + HDassert(heap->chunk); - /* Verify that node is clean */ - HDassert(heap->cache_info.is_dirty == FALSE); + /* copy the image into the buffer */ + HDmemcpy(image, heap->chunk, len); - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!heap->cache_info.free_file_space_on_destroy || H5F_addr_defined(heap->cache_info.addr)); - - /* Check for freeing file space for globalheap */ - if(heap->cache_info.free_file_space_on_destroy) { - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_GHEAP, H5AC_dxpl_id, heap->cache_info.addr, (hsize_t)heap->size) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free global heap") - } /* end if */ - - /* Destroy global heap collection */ - if(H5HG_free(heap) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy global heap collection") + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HG__cache_heap_serialize() */ -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5HG_dest() */ +/****************************************/ +/* no H5HG_cache_heap_notify() function */ +/****************************************/ /*------------------------------------------------------------------------- - * Function: H5HG_clear + * Function: H5HG__cache_heap_free_icr * - * Purpose: Mark a global heap in memory as non-dirty. + * Purpose: Free the in memory representation of the supplied global heap. * - * Return: Non-negative on success/Negative on failure + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). * - * Programmer: Quincey Koziol - * Thursday, March 20, 2003 + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 7/27/14 * *------------------------------------------------------------------------- */ static herr_t -H5HG_clear(H5F_t *f, H5HG_heap_t *heap, hbool_t destroy) +H5HG__cache_heap_free_icr(void *_thing) { + H5HG_heap_t *heap = (H5HG_heap_t *)_thing; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(heap); + HDassert(heap->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(heap->cache_info.type == H5AC_GHEAP); - /* Mark heap as clean */ - heap->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5HG_dest(f, heap) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy global heap collection") + /* Destroy global heap collection */ + if(H5HG_free(heap) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy global heap collection") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HG_clear() */ - - -/*------------------------------------------------------------------------- - * Function: H5HG_size - * - * Purpose: Compute the size in bytes of the specified instance of - * H5HG_heap_t on disk, and return it in *len_ptr. On failure, - * the value of *len_ptr is undefined. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer - * 5/13/04 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5HG_size(const H5F_t H5_ATTR_UNUSED *f, const H5HG_heap_t *heap, size_t *size_ptr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Check arguments */ - HDassert(heap); - HDassert(size_ptr); - - *size_ptr = heap->size; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HG_size() */ +} /* end H5HG__cache_heap_free_icr() */ diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c index 16d8c49..c79aac8 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -103,7 +103,7 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(indent >= 0); HDassert(fwidth >= 0); - if(NULL == (h = H5HG_protect(f, dxpl_id, addr, H5AC_READ))) + if(NULL == (h = H5HG_protect(f, dxpl_id, addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap collection"); HDfprintf(stream, "%*sGlobal Heap Collection...\n", indent, ""); diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h index f3546a2..9137e7b 100644 --- a/src/H5HGpkg.h +++ b/src/H5HGpkg.h @@ -143,7 +143,7 @@ struct H5HG_heap_t { /* Package Private Prototypes */ /******************************/ H5_DLL herr_t H5HG_free(H5HG_heap_t *heap); -H5_DLL H5HG_heap_t *H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw); +H5_DLL H5HG_heap_t *H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags); #endif /* _H5HGpkg_H */ diff --git a/src/H5HL.c b/src/H5HL.c index b1b5b24..eae0482 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -441,7 +441,7 @@ done: *------------------------------------------------------------------------- */ H5HL_t * -H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) +H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) { H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ H5HL_prfx_t *prfx = NULL; /* Local heap prefix */ @@ -457,14 +457,19 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) HDassert(f); HDassert(H5F_addr_defined(addr)); + /* only the H5AC__READ_ONLY_FLAG may appear in flags */ + HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* Construct the user data for protect callback */ + prfx_udata.made_attempt = FALSE; prfx_udata.sizeof_size = H5F_SIZEOF_SIZE(f); prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f); prfx_udata.prfx_addr = addr; prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); + prfx_udata.loaded = FALSE; /* Protect the local heap prefix */ - if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, rw))) + if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to load heap prefix") /* Get the pointer to the heap */ @@ -486,7 +491,7 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) dblk_udata.loaded = FALSE; /* Protect the local heap data block */ - if(NULL == (dblk = (H5HL_dblk_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, &dblk_udata, rw))) + if(NULL == (dblk = (H5HL_dblk_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, &dblk_udata, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to load heap data block") /* Pin the prefix, if the data block was loaded from file */ @@ -1071,13 +1076,15 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) HDassert(H5F_addr_defined(addr)); /* Construct the user data for protect callback */ + prfx_udata.made_attempt = FALSE; prfx_udata.sizeof_size = H5F_SIZEOF_SIZE(f); prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f); prfx_udata.prfx_addr = addr; prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); + prfx_udata.loaded = FALSE; /* Protect the local heap prefix */ - if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC_WRITE))) + if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load heap prefix") /* Get the pointer to the heap */ @@ -1092,7 +1099,7 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) dblk_udata.loaded = FALSE; /* Protect the local heap data block */ - if(NULL == (dblk = (H5HL_dblk_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, &dblk_udata, H5AC_WRITE))) + if(NULL == (dblk = (H5HL_dblk_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, &dblk_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load heap data block") /* Pin the prefix, if the data block was loaded from file */ @@ -1147,13 +1154,15 @@ H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size) HDassert(size); /* Construct the user data for protect callback */ + prfx_udata.made_attempt = FALSE; prfx_udata.sizeof_size = H5F_SIZEOF_SIZE(f); prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f); prfx_udata.prfx_addr = addr; prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); + prfx_udata.loaded = FALSE; /* Protect the local heap prefix */ - if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC_READ))) + if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load heap prefix") /* Get the pointer to the heap */ @@ -1199,13 +1208,15 @@ H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size) HDassert(heap_size); /* Construct the user data for protect callback */ + prfx_udata.made_attempt = FALSE; prfx_udata.sizeof_size = H5F_SIZEOF_SIZE(f); prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f); prfx_udata.prfx_addr = addr; prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); + prfx_udata.loaded = FALSE; /* Protect the local heap prefix */ - if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC_READ))) + if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load heap prefix") /* Get the pointer to the heap */ diff --git a/src/H5HLcache.c b/src/H5HLcache.c index b2c764d..17ded00 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -69,18 +69,26 @@ /********************/ /* Metadata cache callbacks */ -static void *H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HL_prefix_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned *flags_ptr); -static herr_t H5HL_prefix_dest(H5F_t *f, void *thing); -static herr_t H5HL_prefix_clear(H5F_t *f, void *thing, hbool_t destroy); -static herr_t H5HL_prefix_size(const H5F_t *f, const void *thing, size_t *size_ptr); -static void *H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HL_datablock_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned *flags_ptr); -static herr_t H5HL_datablock_dest(H5F_t *f, void *thing); -static herr_t H5HL_datablock_clear(H5F_t *f, void *thing, hbool_t destroy); -static herr_t H5HL_datablock_size(const H5F_t *f, const void *thing, size_t *size_ptr); +static herr_t H5HL__cache_prefix_get_load_size(const void *udata, size_t *image_len); +static void *H5HL__cache_prefix_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5HL__cache_prefix_image_len(const void *thing, + size_t *image_len, hbool_t *compressed_ptr, + size_t *compressed_image_len_ptr); +static herr_t H5HL__cache_prefix_serialize(const H5F_t *f, void *image, + size_t len, void *thing); +static herr_t H5HL__cache_prefix_free_icr(void *thing); + +static herr_t H5HL__cache_datablock_get_load_size(const void *udata, + size_t *image_len); +static void *H5HL__cache_datablock_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5HL__cache_datablock_image_len(const void *thing, + size_t *image_len, hbool_t *compressed_ptr, + size_t *compressed_image_len_ptr); +static herr_t H5HL__cache_datablock_serialize(const H5F_t *f, void *image, + size_t len, void *thing); +static herr_t H5HL__cache_datablock_free_icr(void *thing); /*********************/ @@ -89,23 +97,35 @@ static herr_t H5HL_datablock_size(const H5F_t *f, const void *thing, size_t *siz /* H5HL inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_LHEAP_PRFX[1] = {{ - H5AC_LHEAP_PRFX_ID, - H5HL_prefix_load, - H5HL_prefix_flush, - H5HL_prefix_dest, - H5HL_prefix_clear, - NULL, - H5HL_prefix_size, + H5AC_LHEAP_PRFX_ID, /* Metadata client ID */ + "local heap prefix", /* Metadata client name (for debugging) */ + H5FD_MEM_LHEAP, /* File space memory type for client */ + H5AC__CLASS_SPECULATIVE_LOAD_FLAG, /* Client class behavior flags */ + H5HL__cache_prefix_get_load_size, /* 'get_load_size' callback */ + H5HL__cache_prefix_deserialize, /* 'deserialize' callback */ + H5HL__cache_prefix_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5HL__cache_prefix_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5HL__cache_prefix_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; const H5AC_class_t H5AC_LHEAP_DBLK[1] = {{ - H5AC_LHEAP_DBLK_ID, - H5HL_datablock_load, - H5HL_datablock_flush, - H5HL_datablock_dest, - H5HL_datablock_clear, - NULL, - H5HL_datablock_size, + H5AC_LHEAP_DBLK_ID, /* Metadata client ID */ + "local heap datablock", /* Metadata client name (for debugging) */ + H5FD_MEM_LHEAP, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5HL__cache_datablock_get_load_size,/* 'get_load_size' callback */ + H5HL__cache_datablock_deserialize, /* 'deserialize' callback */ + H5HL__cache_datablock_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5HL__cache_datablock_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5HL__cache_datablock_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; @@ -149,7 +169,7 @@ H5HL__fl_deserialize(H5HL_t *heap) /* Build free list */ free_block = heap->free_block; while(H5HL_FREE_NULL != free_block) { - const uint8_t *p; /* Pointer into image buffer */ + const uint8_t *image; /* Pointer into image buffer */ /* Sanity check */ if(free_block >= heap->dblk_size) @@ -163,13 +183,13 @@ H5HL__fl_deserialize(H5HL_t *heap) fl->next = NULL; /* Decode offset of next free block */ - p = heap->dblk_image + free_block; - H5F_DECODE_LENGTH_LEN(p, free_block, heap->sizeof_size); + image = heap->dblk_image + free_block; + H5F_DECODE_LENGTH_LEN(image, free_block, heap->sizeof_size); if(free_block == 0) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "free block size is zero?") /* Decode length of this free block */ - H5F_DECODE_LENGTH_LEN(p, fl->size, heap->sizeof_size); + H5F_DECODE_LENGTH_LEN(image, fl->size, heap->sizeof_size); if((fl->offset + fl->size) > heap->dblk_size) HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "bad heap free list") @@ -217,17 +237,17 @@ H5HL__fl_serialize(const H5HL_t *heap) /* Serialize the free list into the heap data's image */ for(fl = heap->freelist; fl; fl = fl->next) { - uint8_t *p; /* Pointer into raw data buffer */ + uint8_t *image; /* Pointer into raw data buffer */ HDassert(fl->offset == H5HL_ALIGN(fl->offset)); - p = heap->dblk_image + fl->offset; + image = heap->dblk_image + fl->offset; if(fl->next) - H5F_ENCODE_LENGTH_LEN(p, fl->next->offset, heap->sizeof_size) + H5F_ENCODE_LENGTH_LEN(image, fl->next->offset, heap->sizeof_size) else - H5F_ENCODE_LENGTH_LEN(p, H5HL_FREE_NULL, heap->sizeof_size) + H5F_ENCODE_LENGTH_LEN(image, H5HL_FREE_NULL, heap->sizeof_size) - H5F_ENCODE_LENGTH_LEN(p, fl->size, heap->sizeof_size) + H5F_ENCODE_LENGTH_LEN(image, fl->size, heap->sizeof_size) } /* end for */ FUNC_LEAVE_NOAPI_VOID @@ -235,69 +255,88 @@ H5HL__fl_serialize(const H5HL_t *heap) /*------------------------------------------------------------------------- - * Function: H5HL_prefix_load + * Function: H5HL__cache_prefix_get_load_size() * - * Purpose: Loads a local heap prefix from disk. + * Purpose: Return the size of the buffer the metadata cache should + * load from file and pass to the deserialize routine. * - * Return: Success: Ptr to a local heap memory data structure. - * Failure: NULL + * The version 2 metadata cache callbacks included a test to + * ensure that the read did not pass the end of file, but this + * functionality has been moved to H5C_load_entry(). Thus + * all this function does is set *image_len equal to + * H5HL_SPEC_READ_SIZE, leaving it to the metadata cache to + * reduce the size of the read if appropriate. * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 17 1997 + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HL__cache_prefix_get_load_size(const void H5_ATTR_UNUSED *_udata, size_t *image_len) +{ + FUNC_ENTER_STATIC_NOERR + + HDassert(image_len); + + *image_len = H5HL_SPEC_READ_SIZE; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HL__cache_prefix_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5HL__cache_prefix_deserialize + * + * Purpose: Given a buffer containing the on disk image of the local + * heap prefix, deserialize it, load its contents into a newly allocated + * instance of H5HL_prfx_t, and return a pointer to the new instance. + * + * Return: Success: Pointer to in core representation + * Failure: NULL + * + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ static void * -H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +H5HL__cache_prefix_deserialize(const void *_image, size_t len, void *_udata, + hbool_t H5_ATTR_UNUSED *dirty) { - H5HL_t *heap = NULL; /* Local heap */ - H5HL_prfx_t *prfx = NULL; /* Heap prefix deserialized */ + H5HL_t *heap = NULL; /* Local heap */ + H5HL_prfx_t *prfx = NULL; /* Heap prefix deserialized */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into decoding buffer */ H5HL_cache_prfx_ud_t *udata = (H5HL_cache_prfx_ud_t *)_udata; /* User data for callback */ - uint8_t buf[H5HL_SPEC_READ_SIZE]; /* Buffer for decoding */ - size_t spec_read_size; /* Size of buffer to speculatively read in */ - const uint8_t *p; /* Pointer into decoding buffer */ - haddr_t eoa; /* Relative end of file address */ - hsize_t min; /* temp min value to avoid macro nesting */ - H5HL_prfx_t *ret_value; /* Return value */ + void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ + HDassert(image); + HDassert(len > 0); HDassert(udata); HDassert(udata->sizeof_size > 0); HDassert(udata->sizeof_addr > 0); HDassert(udata->sizeof_prfx > 0); - HDassert(udata->sizeof_prfx <= sizeof(buf)); - - /* Make certain we don't speculatively read off the end of the file */ - if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_LHEAP))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, NULL, "unable to determine file size") - - /* Compute the size of the speculative local heap prefix buffer */ - min = MIN(eoa - addr, H5HL_SPEC_READ_SIZE); - H5_CHECKED_ASSIGN(spec_read_size, size_t, min, hsize_t); - HDassert(spec_read_size >= udata->sizeof_prfx); - - /* Attempt to speculatively read both local heap prefix and heap data */ - if(H5F_block_read(f, H5FD_MEM_LHEAP, addr, spec_read_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read local heap prefix") - p = buf; + HDassert(H5F_addr_defined(udata->prfx_addr)); + HDassert(dirty); /* Check magic number */ - if(HDmemcmp(p, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC)) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "bad local heap signature") - p += H5_SIZEOF_MAGIC; + if(HDmemcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "bad local heap signature") + image += H5_SIZEOF_MAGIC; /* Version */ - if(H5HL_VERSION != *p++) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong version number in local heap") + if(H5HL_VERSION != *image++) + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong version number in local heap") /* Reserved */ - p += 3; - + image += 3; + /* Allocate space in memory for the heap */ if(NULL == (heap = H5HL_new(udata->sizeof_size, udata->sizeof_addr, udata->sizeof_prfx))) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "can't allocate local heap structure") @@ -311,16 +350,16 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) heap->prfx_size = udata->sizeof_prfx; /* Heap data size */ - H5F_DECODE_LENGTH_LEN(p, heap->dblk_size, udata->sizeof_size); + H5F_DECODE_LENGTH_LEN(image, heap->dblk_size, udata->sizeof_size); /* Free list head */ - H5F_DECODE_LENGTH_LEN(p, heap->free_block, udata->sizeof_size); + H5F_DECODE_LENGTH_LEN(image, heap->free_block, udata->sizeof_size); if((heap->free_block != H5HL_FREE_NULL) && (heap->free_block >= heap->dblk_size)) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "bad heap free list") /* Heap data address */ - H5F_addr_decode_len(udata->sizeof_addr, &p, &(heap->dblk_addr)); + H5F_addr_decode_len(udata->sizeof_addr, &image, &(heap->dblk_addr)); /* Check if heap block exists */ if(heap->dblk_size) { @@ -329,35 +368,53 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Note that the heap should be a single object in the cache */ heap->single_cache_obj = TRUE; - /* Allocate space for the heap data image */ - if(NULL == (heap->dblk_image = H5FL_BLK_MALLOC(lheap_chunk, heap->dblk_size))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") + /* Check if the current buffer from the speculative read + * already has the heap data + */ + if(len >= (heap->prfx_size + heap->dblk_size)) { + /* Allocate space for the heap data image */ + if(NULL == (heap->dblk_image = H5FL_BLK_MALLOC(lheap_chunk, heap->dblk_size))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") - /* Check if the current buffer from the speculative read already has the heap data */ - if(spec_read_size >= (heap->prfx_size + heap->dblk_size)) { - /* Set p to the start of the data block. This is necessary + /* Set image to the start of the data block. This is necessary * because there may be a gap between the used portion of the * prefix and the data block due to alignment constraints. */ - p = buf + heap->prfx_size; + image = ((const uint8_t *)_image) + heap->prfx_size; /* Copy the heap data from the speculative read buffer */ - HDmemcpy(heap->dblk_image, p, heap->dblk_size); + HDmemcpy(heap->dblk_image, image, heap->dblk_size); + + /* Build free list */ + if(H5HL__fl_deserialize(heap) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize free list") } /* end if */ else { - /* Read the local heap data block directly into buffer */ - if(H5F_block_read(f, H5FD_MEM_LHEAP, heap->dblk_addr, heap->dblk_size, dxpl_id, heap->dblk_image) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read heap data") - } /* end else */ - - /* Build free list */ - if(H5HL__fl_deserialize(heap) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize free list") + /* the supplied buffer is too small -- We have already made note + * of the correct size, so simply return success. H5C_load_entry() + * will notice the size discrepency, and re-try the load. + */ + + /* Make certain that this is the first try ... */ + HDassert(!udata->made_attempt); + + /* ... and mark the udata so that we know that we have used up + * our first try. + */ + udata->made_attempt = TRUE; + } /* end else */ } /* end if */ - else - /* Note that the heap should _NOT_ be a single object in the cache */ + else { + /* Note that the heap should _NOT_ be a single + * object in the cache + */ heap->single_cache_obj = FALSE; + + } /* end else */ } /* end if */ + /* Set flag to indicate prefix from loaded from file */ + udata->loaded = TRUE; + /* Set return value */ ret_value = prfx; @@ -375,273 +432,257 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_prefix_load() */ +} /* end H5HL__cache_prefix_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HL_prefix_flush + * Function: H5HL__cache_prefix_image_len * - * Purpose: Flushes a heap from memory to disk if it's dirty. Optionally - * deletes the heap from memory. + * Purpose: Return the on disk image size of a local heap prefix to the + * metadata cache via the image_len. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 17 1997 + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ static herr_t -H5HL_prefix_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - void *thing, unsigned H5_ATTR_UNUSED *flags_ptr) +H5HL__cache_prefix_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - H5HL_prfx_t *prfx = (H5HL_prfx_t *)thing; /* Local heap prefix to flush */ - H5WB_t *wb = NULL; /* Wrapped buffer for heap data */ - uint8_t heap_buf[H5HL_SPEC_READ_SIZE]; /* Buffer for heap */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5HL_prfx_t *prfx = (const H5HL_prfx_t *)_thing; /* Pointer to local heap prefix to query */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(prfx); + HDassert(prfx->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(prfx->cache_info.type == H5AC_LHEAP_PRFX); + HDassert(image_len); - if(prfx->cache_info.is_dirty) { - H5HL_t *heap = prfx->heap; /* Pointer to the local heap */ - uint8_t *buf; /* Pointer to heap buffer */ - size_t buf_size; /* Size of buffer for encoding & writing heap info */ - uint8_t *p; /* Pointer into raw data buffer */ - - /* Wrap the local buffer for serialized heap info */ - if(NULL == (wb = H5WB_wrap(heap_buf, sizeof(heap_buf)))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't wrap buffer") - - /* Compute the size of the buffer to encode & write */ - buf_size = heap->prfx_size; - if(heap->single_cache_obj) - buf_size += heap->dblk_size; - - /* Get a pointer to a buffer that's large enough for serialized heap */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, buf_size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "can't get actual buffer") - - /* Update the free block value from the free list */ - heap->free_block = heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL; - - /* Serialize the heap prefix */ - p = buf; - HDmemcpy(p, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; - *p++ = H5HL_VERSION; - *p++ = 0; /*reserved*/ - *p++ = 0; /*reserved*/ - *p++ = 0; /*reserved*/ - H5F_ENCODE_LENGTH_LEN(p, heap->dblk_size, heap->sizeof_size); - H5F_ENCODE_LENGTH_LEN(p, heap->free_block, heap->sizeof_size); - H5F_addr_encode_len(heap->sizeof_addr, &p, heap->dblk_addr); - - /* Check if the local heap is a single object in cache */ - if(heap->single_cache_obj) { - if((size_t)(p - buf) < heap->prfx_size) { - size_t gap; /* Size of gap between prefix and data block */ - - /* Set p to the start of the data block. This is necessary because - * there may be a gap between the used portion of the prefix and the - * data block due to alignment constraints. */ - gap = heap->prfx_size - (size_t)(p - buf); - HDmemset(p, 0, gap); - p += gap; - } /* end if */ - - /* Serialize the free list into the heap data's image */ - H5HL__fl_serialize(heap); - - /* Copy the heap data block into the cache image */ - HDmemcpy(p, heap->dblk_image, heap->dblk_size); - } /* end if */ - - /* Write the prefix [and possibly the data block] to the file */ - if(H5F_block_write(f, H5FD_MEM_LHEAP, addr, buf_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "unable to write heap header and data to file") + /* Set the prefix's size */ + *image_len = prfx->heap->prfx_size; - prfx->cache_info.is_dirty = FALSE; - } /* end if */ + /* If the heap is stored as a single object, add in the + * data block size also + */ + if(prfx->heap->single_cache_obj) + *image_len += prfx->heap->dblk_size; - /* Should we destroy the memory version? */ - if(destroy) - if(H5HL_prefix_dest(f, prfx) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap prefix") -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_HEAP, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HL__cache_prefix_image_len() */ - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_prefix_flush() */ +/****************************************/ +/* no H5HL_cache_prefix_pre_serialize() */ +/****************************************/ /*------------------------------------------------------------------------- - * Function: H5HL_prefix_dest + * Function: H5HL__cache_prefix_serialize * - * Purpose: Destroys a heap prefix in memory. + * Purpose: Given a pointer to an instance of H5HL_prfx_t and an + * appropriately sized buffer, serialize the contents of the + * instance for writing to disk, and copy the serialized data + * into the buffer. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 15 2003 + * Programmer: John Mainzer + * 7/21/14 * *------------------------------------------------------------------------- */ static herr_t -H5HL_prefix_dest(H5F_t *f, void *thing) +H5HL__cache_prefix_serialize(const H5F_t *f, void *_image, size_t len, + void *_thing) { - H5HL_prfx_t *prfx = (H5HL_prfx_t *)thing; /* Local heap prefix to destroy */ - herr_t ret_value = SUCCEED; /* Return value */ + H5HL_prfx_t *prfx = (H5HL_prfx_t *)_thing; /* Pointer to local heap prefix to query */ + H5HL_t *heap; /* Pointer to the local heap */ + uint8_t *image = (uint8_t *)_image; /* Pointer into image buffer */ + size_t buf_size; /* expected size of the image buffer */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR - /* check arguments */ + /* Check arguments */ + HDassert(f); + HDassert(image); HDassert(prfx); - HDassert(prfx->heap); + HDassert(prfx->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(prfx->cache_info.type == H5AC_LHEAP_PRFX); HDassert(H5F_addr_eq(prfx->cache_info.addr, prfx->heap->prfx_addr)); + HDassert(prfx->heap); - /* Verify that entry is clean */ - HDassert(prfx->cache_info.is_dirty == FALSE); - - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!prfx->cache_info.free_file_space_on_destroy || H5F_addr_defined(prfx->cache_info.addr)); + /* Get the pointer to the heap */ + heap = prfx->heap; + HDassert(heap); - /* Check for freeing file space for local heap prefix */ - if(prfx->cache_info.free_file_space_on_destroy) { - hsize_t free_size; /* Size of region to free in file */ + /* Compute the buffer size */ + buf_size = heap->prfx_size; + if(heap->single_cache_obj) + buf_size += heap->dblk_size; + HDassert(len == buf_size); + + /* Update the free block value from the free list */ + heap->free_block = heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL; + + /* Serialize the heap prefix */ + HDmemcpy(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; + *image++ = H5HL_VERSION; + *image++ = 0; /*reserved*/ + *image++ = 0; /*reserved*/ + *image++ = 0; /*reserved*/ + H5F_ENCODE_LENGTH_LEN(image, heap->dblk_size, heap->sizeof_size); + H5F_ENCODE_LENGTH_LEN(image, heap->free_block, heap->sizeof_size); + H5F_addr_encode_len(heap->sizeof_addr, &image, heap->dblk_addr); + + /* Check if the local heap is a single object in cache */ + if(heap->single_cache_obj) { + if((size_t)(image - (uint8_t *)_image) < heap->prfx_size) { + size_t gap; /* Size of gap between prefix and data block */ + + /* Set image to the start of the data block. This is necessary + * because there may be a gap between the used portion of + * the prefix and the data block due to alignment constraints. + */ + gap = heap->prfx_size - (size_t)(image - (uint8_t *)_image); + HDmemset(image, 0, gap); + image += gap; + } /* end if */ - /* Compute size to free for later */ - free_size = prfx->heap->prfx_size; - if(prfx->heap->single_cache_obj) - free_size += prfx->heap->dblk_size; + /* Serialize the free list into the heap data's image */ + H5HL__fl_serialize(heap); - /* Free the local heap prefix [and possible the data block] on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_LHEAP, H5AC_dxpl_id, prfx->cache_info.addr, free_size) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free local heap prefix") + /* Copy the heap data block into the cache image */ + HDmemcpy(image, heap->dblk_image, heap->dblk_size); } /* end if */ - /* Destroy local heap prefix */ - if(H5HL_prfx_dest(prfx) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't destroy local heap prefix") + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HL__cache_prefix_serialize() */ -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_prefix_dest() */ +/******************************************/ +/* no H5HL_cache_prefix_notify() function */ +/******************************************/ /*------------------------------------------------------------------------- - * Function: H5HL_prefix_clear + * Function: H5HL__cache_prefix_free_icr * - * Purpose: Mark a local heap prefix in memory as non-dirty. + * Purpose: Free the supplied in core representation of a local heap + * prefix. * - * Return: Non-negative on success/Negative on failure + * Note that this function handles the partially initialize prefix + * from a failed speculative load attempt. See comments below for + * details. * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 20 2003 + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ static herr_t -H5HL_prefix_clear(H5F_t H5_ATTR_UNUSED *f, void *thing, hbool_t destroy) +H5HL__cache_prefix_free_icr(void *_thing) { - H5HL_prfx_t *prfx = (H5HL_prfx_t *)thing; /* The local heap prefix to operate on */ - herr_t ret_value = SUCCEED; /* Return value */ + H5HL_prfx_t *prfx = (H5HL_prfx_t *)_thing; /* Pointer to local heap prefix to query */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* check arguments */ + /* Check arguments */ HDassert(prfx); + HDassert(prfx->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(prfx->cache_info.type == H5AC_LHEAP_PRFX); + HDassert(H5F_addr_eq(prfx->cache_info.addr, prfx->heap->prfx_addr)); - /* Mark heap prefix as clean */ - prfx->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5HL_prefix_dest(f, prfx) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap prefix") + /* Destroy local heap prefix */ + if(H5HL_prfx_dest(prfx) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't destroy local heap prefix") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_prefix_clear() */ +} /* end H5HL__cache_prefix_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5HL_prefix_size + * Function: H5HL__cache_datablock_get_load_size() * - * Purpose: Compute the size in bytes of the heap prefix on disk, - * and return it in *len_ptr. On failure, the value of *len_ptr - * is undefined. + * Purpose: Tell the metadata cache how large a buffer to read from + * file when loading a datablock. In this case, we simply lookup + * the correct value in the user data, and return it in *image_len. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: John Mainzer - * 5/13/04 + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ static herr_t -H5HL_prefix_size(const H5F_t H5_ATTR_UNUSED *f, const void *thing, size_t *size_ptr) +H5HL__cache_datablock_get_load_size(const void *_udata, size_t *image_len) { - const H5HL_prfx_t *prfx = (const H5HL_prfx_t *)thing; /* Pointer to local heap prefix to query */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR + const H5HL_cache_dblk_ud_t *udata = (const H5HL_cache_dblk_ud_t *)_udata; /* User data for callback */ - /* check arguments */ - HDassert(prfx); - HDassert(prfx->heap); - HDassert(size_ptr); + FUNC_ENTER_STATIC_NOERR - /* Calculate size of prefix in cache */ - *size_ptr = prfx->heap->prfx_size; + /* Check arguments */ + HDassert(udata); + HDassert(udata->heap); + HDassert(udata->heap->dblk_size > 0); + HDassert(image_len); - /* If the heap is stored as a single object, add in the data block size also */ - if(prfx->heap->single_cache_obj) - *size_ptr += prfx->heap->dblk_size; + *image_len = udata->heap->dblk_size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HL_prefix_size() */ +} /* end H5HL__cache_datablock_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5HL_datablock_load + * Function: H5HL__cache_datablock_deserialize * - * Purpose: Loads a local heap data block from disk. + * Purpose: Given a buffer containing the on disk image of a local + * heap data block, deserialize it, load its contents into a newly allocated + * instance of H5HL_dblk_t, and return a pointer to the new instance. * - * Return: Success: Ptr to a local heap data block memory data structure. - * Failure: NULL + * Return: Success: Pointer to in core representation + * Failure: NULL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Jan 5 2010 + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ static void * -H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +H5HL__cache_datablock_deserialize(const void *image, size_t len, void *_udata, + hbool_t H5_ATTR_UNUSED *dirty) { - H5HL_dblk_t *dblk = NULL; /* Local heap data block deserialized */ - H5HL_cache_dblk_ud_t *udata = (H5HL_cache_dblk_ud_t *)_udata; /* User data for callback */ - H5HL_dblk_t *ret_value; /* Return value */ + H5HL_dblk_t *dblk = NULL; /* Local heap data block deserialized */ + H5HL_cache_dblk_ud_t *udata = (H5HL_cache_dblk_ud_t *)_udata; /* User data for callback */ + void * ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); + HDassert(len > 0); HDassert(udata); HDassert(udata->heap); + HDassert(udata->heap->dblk_size == len); HDassert(!udata->heap->single_cache_obj); HDassert(NULL == udata->heap->dblk); + HDassert(dirty); /* Allocate space in memory for the heap data block */ if(NULL == (dblk = H5HL_dblk_new(udata->heap))) @@ -653,9 +694,8 @@ H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) if(NULL == (udata->heap->dblk_image = H5FL_BLK_MALLOC(lheap_chunk, udata->heap->dblk_size))) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "can't allocate data block image buffer") - /* Read local heap data block */ - if(H5F_block_read(f, H5FD_MEM_LHEAP, udata->heap->dblk_addr, udata->heap->dblk_size, dxpl_id, udata->heap->dblk_image) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read local heap data block") + /* copy the datablock from the read buffer */ + HDmemcpy(udata->heap->dblk_image, image, len); /* Build free list */ if(H5HL__fl_deserialize(udata->heap) < 0) @@ -675,180 +715,134 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap data block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_datablock_load() */ +} /* end H5HL__cache_datablock_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HL_datablock_flush + * Function: H5HL__cache_datablock_image_len * - * Purpose: Flushes a heap's data block from memory to disk if it's dirty. - * Optionally deletes the heap data block from memory. + * Purpose: Return the size of the on disk image of the datablock. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 17 1997 + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ static herr_t -H5HL_datablock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - void *_thing, unsigned H5_ATTR_UNUSED * flags_ptr) +H5HL__cache_datablock_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5HL_dblk_t *dblk = (const H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(dblk); + HDassert(dblk->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(dblk->cache_info.type == H5AC_LHEAP_DBLK); HDassert(dblk->heap); - HDassert(!dblk->heap->single_cache_obj); - - if(dblk->cache_info.is_dirty) { - H5HL_t *heap = dblk->heap; /* Pointer to the local heap */ - - /* Update the free block value from the free list */ - heap->free_block = heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL; + HDassert(dblk->heap->dblk_size > 0); + HDassert(image_len); - /* Serialize the free list into the heap data's image */ - H5HL__fl_serialize(heap); - - /* Write the data block to the file */ - if(H5F_block_write(f, H5FD_MEM_LHEAP, heap->dblk_addr, heap->dblk_size, dxpl_id, heap->dblk_image) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "unable to write heap data block to file") - - dblk->cache_info.is_dirty = FALSE; - } /* end if */ + *image_len = dblk->heap->dblk_size; - /* Should we destroy the memory version? */ - if(destroy) - if(H5HL_datablock_dest(f, dblk) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap data block") + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HL__cache_datablock_image_len() */ -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_datablock_flush() */ +/*******************************************/ +/* no H5HL_cache_datablock_pre_serialize() */ +/*******************************************/ /*------------------------------------------------------------------------- - * Function: H5HL_datablock_dest + * Function: H5HL__cache_datablock_serialize * - * Purpose: Destroys a local heap data block in memory. + * Purpose: Serialize the supplied datablock, and copy the serialized + * image into the supplied image buffer. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 15 2003 + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ static herr_t -H5HL_datablock_dest(H5F_t *f, void *_thing) +H5HL__cache_datablock_serialize(const H5F_t *f, void *image, size_t len, + void *_thing) { - H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ - herr_t ret_value = SUCCEED; /* Return value */ + H5HL_t *heap; /* Pointer to the local heap */ + H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR /* Check arguments */ + HDassert(f); + HDassert(image); HDassert(dblk); + HDassert(dblk->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(dblk->cache_info.type == H5AC_LHEAP_DBLK); HDassert(dblk->heap); - HDassert(!dblk->heap->single_cache_obj); - HDassert(H5F_addr_eq(dblk->cache_info.addr, dblk->heap->dblk_addr)); + heap = dblk->heap; + HDassert(heap->dblk_size == len); + HDassert(!heap->single_cache_obj); - /* Verify that entry is clean */ - HDassert(dblk->cache_info.is_dirty == FALSE); + /* Update the free block value from the free list */ + heap->free_block = heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL; - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!dblk->cache_info.free_file_space_on_destroy || H5F_addr_defined(dblk->cache_info.addr)); + /* Serialize the free list into the heap data's image */ + H5HL__fl_serialize(heap); - /* Check for freeing file space for local heap data block */ - if(dblk->cache_info.free_file_space_on_destroy) { - /* Free the local heap data block on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_LHEAP, H5AC_dxpl_id, dblk->cache_info.addr, (hsize_t)dblk->heap->dblk_size) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free local heap data block") - } /* end if */ + /* Copy the heap's data block into the cache's image */ + HDmemcpy(image, heap->dblk_image, heap->dblk_size); - /* Destroy local heap data block */ - if(H5HL_dblk_dest(dblk) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't destroy local heap data block") + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HL__cache_datablock_serialize() */ -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_datablock_dest() */ +/*********************************************/ +/* no H5HL_cache_datablock_notify() function */ +/*********************************************/ /*------------------------------------------------------------------------- - * Function: H5HL_datablock_clear + * Function: H5HL__cache_datablock_free_icr * - * Purpose: Mark a local heap data block in memory as non-dirty. + * Purpose: Free the in memory representation of the supplied local heap data block. * - * Return: Non-negative on success/Negative on failure + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 20 2003 + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 6/21/14 * *------------------------------------------------------------------------- */ static herr_t -H5HL_datablock_clear(H5F_t *f, void *_thing, hbool_t destroy) +H5HL__cache_datablock_free_icr(void *_thing) { H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(dblk); + HDassert(dblk->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(dblk->cache_info.type == H5AC_LHEAP_DBLK); - /* Mark local heap data block as clean */ - dblk->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5HL_datablock_dest(f, dblk) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap data block") + /* Destroy the data block */ + if(H5HL_dblk_dest(dblk) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap data block") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_datablock_clear() */ - - -/*------------------------------------------------------------------------- - * Function: H5HL_datablock_size - * - * Purpose: Compute the size in bytes of the local heap data block on disk, - * and return it in *len_ptr. On failure, the value of *len_ptr - * is undefined. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer - * 5/13/04 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5HL_datablock_size(const H5F_t H5_ATTR_UNUSED *f, const void *_thing, size_t *size_ptr) -{ - const H5HL_dblk_t *dblk = (const H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* check arguments */ - HDassert(dblk); - HDassert(dblk->heap); - HDassert(size_ptr); - - /* Set size of data block in cache */ - *size_ptr = dblk->heap->dblk_size; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HL_datablock_size() */ +} /* end H5HL__cache_datablock_free_icr() */ diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c index 4ac22b8..edddd65 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -69,7 +69,7 @@ H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int HDassert(indent >= 0); HDassert(fwidth >= 0); - if(NULL == (h = (H5HL_t *)H5HL_protect(f, dxpl_id, addr, H5AC_READ))) + if(NULL == (h = (H5HL_t *)H5HL_protect(f, dxpl_id, addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load heap") HDfprintf(stream, "%*sLocal Heap...\n", indent, ""); diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index 880cc05..75c9959 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -122,12 +122,16 @@ struct H5HL_prfx_t { /* Callback information for loading local heap prefix from disk */ typedef struct H5HL_cache_prfx_ud_t { /* Downwards */ + hbool_t made_attempt; /* Whether the deserialize routine */ + /* was already attempted */ size_t sizeof_size; /* Size of file sizes */ size_t sizeof_addr; /* Size of file addresses */ haddr_t prfx_addr; /* Address of prefix */ size_t sizeof_prfx; /* Size of heap prefix */ /* Upwards */ + hbool_t loaded; /* Whether prefix was loaded */ + /* from file */ } H5HL_cache_prfx_ud_t; /* Callback information for loading local heap data block from disk */ diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index 0b044b6..3035689 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -61,7 +61,7 @@ typedef struct H5HL_t H5HL_t; * Library prototypes... */ H5_DLL herr_t H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr/*out*/); -H5_DLL H5HL_t *H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw); +H5_DLL H5HL_t *H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags); H5_DLL void *H5HL_offset_into(const H5HL_t *heap, size_t offset); H5_DLL herr_t H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size); diff --git a/src/H5O.c b/src/H5O.c index 22086fa..d0ace29 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -1652,7 +1652,7 @@ done: *------------------------------------------------------------------------- */ H5O_t * -H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) +H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags) { H5O_t *oh = NULL; /* Object header protected */ H5O_cache_ud_t udata; /* User data for protecting object header */ @@ -1666,13 +1666,16 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) HDassert(loc); HDassert(loc->file); + /* prot_flags may only contain the H5AC__READ_ONLY_FLAG */ + HDassert((prot_flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + /* Check for valid address */ if(!H5F_addr_defined(loc->addr)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "address undefined") /* Check for write access on the file */ file_intent = H5F_INTENT(loc->file); - if((prot == H5AC_WRITE) && (0 == (file_intent & H5F_ACC_RDWR))) + if((0 == (prot_flags & H5AC__READ_ONLY_FLAG)) && (0 == (file_intent & H5F_ACC_RDWR))) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "no write intent on file") /* Construct the user data for protect callback */ @@ -1688,7 +1691,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) udata.common.addr = loc->addr; /* Lock the object header into the cache */ - if(NULL == (oh = (H5O_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, &udata, prot))) + if(NULL == (oh = (H5O_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, &udata, prot_flags))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header") /* Check if there are any continuation messages to process */ @@ -1725,7 +1728,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) /* (which adds to the object header) */ chk_udata.common.addr = cont_msg_info.msgs[curr_msg].addr; chk_udata.size = cont_msg_info.msgs[curr_msg].size; - if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, &chk_udata, prot))) + if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, &chk_udata, prot_flags))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk") /* Sanity check */ @@ -1769,7 +1772,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) /* (object header will have been marked dirty during protect, if we * have write access -QAK) */ - if(prot != H5AC_WRITE) + if((prot_flags & H5AC__READ_ONLY_FLAG) != 0) oh->prefix_modified = TRUE; #ifndef NDEBUG else { @@ -1787,7 +1790,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) } /* end if */ /* Check for any messages that were modified while being read in */ - if(udata.common.mesgs_modified && prot != H5AC_WRITE) + if(udata.common.mesgs_modified && (0 == (prot_flags & H5AC__READ_ONLY_FLAG))) oh->mesgs_modified = TRUE; /* Reset the field that contained chunk 0's size during speculative load */ @@ -1797,7 +1800,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) /* Take care of loose ends for modifications made while bringing in the * object header & chunks. */ - if(prot == H5AC_WRITE) { + if(0 == (prot_flags & H5AC__READ_ONLY_FLAG)) { /* Check for the object header prefix being modified somehow */ /* (usually through updating the # of object header messages) */ if(oh->prefix_modified) { @@ -1883,7 +1886,7 @@ H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id) HDassert(loc); /* Get header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_WRITE))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header") /* Increment the reference count on the object header */ @@ -2096,7 +2099,7 @@ H5O_touch(const H5O_loc_t *loc, hbool_t force, hid_t dxpl_id) HDassert(loc); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_WRITE))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Create/Update the modification time message */ @@ -2212,7 +2215,7 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) loc.holding_file = FALSE; /* Get the object header information */ - if(NULL == (oh = H5O_protect(&loc, dxpl_id, H5AC_WRITE))) + if(NULL == (oh = H5O_protect(&loc, dxpl_id, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Delete object */ @@ -2296,7 +2299,7 @@ H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type, hid_t dxpl_id) FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) /* Load the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Retrieve the type of the object */ @@ -2374,7 +2377,7 @@ H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id) FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, NULL) /* Load the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header") /* Test whether entry qualifies as a particular type of object */ @@ -2671,7 +2674,7 @@ H5O_get_hdr_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_hdr_info_t *hdr) HDmemset(hdr, 0, sizeof(*hdr)); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") /* Get the information for the object header */ @@ -2795,7 +2798,7 @@ H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info, HDassert(oinfo); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Reset the object info structure */ @@ -2916,7 +2919,7 @@ H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, H5P_genplist_t *oc_pli HDassert(oc_plist); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Set property values, if they were used for the object */ @@ -2971,7 +2974,7 @@ H5O_get_nlinks(const H5O_loc_t *loc, hid_t dxpl_id, hsize_t *nlinks) HDassert(nlinks); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Retrieve the # of link messages seen when the object header was loaded */ @@ -3088,7 +3091,7 @@ H5O_get_rc_and_type(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc, H5O_type_ HDassert(loc); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Set the object's reference count */ @@ -3461,7 +3464,7 @@ H5O_dec_rc_by_loc(const H5O_loc_t *loc, hid_t dxpl_id) HDassert(loc); /* Get header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Decrement the reference count on the object header */ diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 46e7ce4..52f414b 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -483,7 +483,7 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) HDassert(name); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, NULL, "unable to load object header") /* Check for attribute info stored */ @@ -632,7 +632,7 @@ H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, HGOTO_ERROR(H5E_ATTR, H5E_BADITER, NULL, "can't locate attribute") /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, NULL, "unable to load object header") /* Find out whether it has already been opened. If it has, close the object @@ -1283,7 +1283,7 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, HDassert(attr_op); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ @@ -1846,7 +1846,7 @@ H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) HDassert(name); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ @@ -2000,7 +2000,7 @@ H5O_attr_count(const H5O_loc_t *loc, hid_t dxpl_id) HDassert(loc); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Retrieve # of attributes on object */ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 816e06a..db1bd1f 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -68,17 +68,25 @@ /********************/ /* Metadata cache callbacks */ -static H5O_t *H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh, unsigned H5_ATTR_UNUSED * flags_ptr); -static herr_t H5O_dest(H5F_t *f, H5O_t *oh); -static herr_t H5O_clear(H5F_t *f, H5O_t *oh, hbool_t destroy); -static herr_t H5O_size(const H5F_t *f, const H5O_t *oh, size_t *size_ptr); - -static H5O_chunk_proxy_t *H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5O_cache_chk_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_chunk_proxy_t *chk_proxy, unsigned H5_ATTR_UNUSED * flags_ptr); -static herr_t H5O_cache_chk_dest(H5F_t *f, H5O_chunk_proxy_t *chk_proxy); -static herr_t H5O_cache_chk_clear(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, hbool_t destroy); -static herr_t H5O_cache_chk_size(const H5F_t *f, const H5O_chunk_proxy_t *chk_proxy, size_t *size_ptr); +static herr_t H5O__cache_get_load_size(const void *udata, size_t *image_len); +static void *H5O__cache_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5O__cache_image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5O__cache_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5O__cache_free_icr(void *thing); +static herr_t H5O__cache_clear(const H5F_t *f, void *thing, hbool_t about_to_destroy); + +static herr_t H5O__cache_chk_get_load_size(const void *udata, size_t *image_len); +static void *H5O__cache_chk_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5O__cache_chk_image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5O__cache_chk_serialize(const H5F_t *f, void *image, size_t len, + void *thing); +static herr_t H5O__cache_chk_free_icr(void *thing); +static herr_t H5O__cache_chk_clear(const H5F_t *f, void *thing, hbool_t about_to_destroy); /* Chunk proxy routines */ static herr_t H5O__chunk_proxy_dest(H5O_chunk_proxy_t *chunk_proxy); @@ -99,24 +107,36 @@ static herr_t H5O__add_cont_msg(H5O_cont_msgs_t *cont_msg_info, /* H5O object header prefix inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_OHDR[1] = {{ - H5AC_OHDR_ID, - (H5AC_load_func_t)H5O_load, - (H5AC_flush_func_t)H5O_flush, - (H5AC_dest_func_t)H5O_dest, - (H5AC_clear_func_t)H5O_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5O_size, + H5AC_OHDR_ID, /* Metadata client ID */ + "object header", /* Metadata client name (for debugging) */ + H5FD_MEM_OHDR, /* File space memory type for client */ + H5AC__CLASS_SPECULATIVE_LOAD_FLAG, /* Client class behavior flags */ + H5O__cache_get_load_size, /* 'get_load_size' callback */ + H5O__cache_deserialize, /* 'deserialize' callback */ + H5O__cache_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5O__cache_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5O__cache_free_icr, /* 'free_icr' callback */ + H5O__cache_clear, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; /* H5O object header chunk inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_OHDR_CHK[1] = {{ - H5AC_OHDR_CHK_ID, - (H5AC_load_func_t)H5O_cache_chk_load, - (H5AC_flush_func_t)H5O_cache_chk_flush, - (H5AC_dest_func_t)H5O_cache_chk_dest, - (H5AC_clear_func_t)H5O_cache_chk_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5O_cache_chk_size, + H5AC_OHDR_CHK_ID, /* Metadata client ID */ + "object header continuation chunk", /* Metadata client name (for debugging) */ + H5FD_MEM_OHDR, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5O__cache_chk_get_load_size, /* 'get_load_size' callback */ + H5O__cache_chk_deserialize, /* 'deserialize' callback */ + H5O__cache_chk_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5O__cache_chk_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5O__cache_chk_free_icr, /* 'free_icr' callback */ + H5O__cache_chk_clear, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; /* Declare external the free list for H5O_unknown_t's */ @@ -141,55 +161,75 @@ H5FL_SEQ_DEFINE(H5O_cont_t); /*------------------------------------------------------------------------- - * Function: H5O_load + * Function: H5O__cache_get_load_size() * - * Purpose: Loads an object header from disk. + * Purpose: Tell the metadata cache how much data to read from file in + * the first speculative read for the object header. Note that we do + * not have to be concerned about reading past the end of file, as the + * cache will clamp the read to avoid this if needed. * - * Return: Success: Pointer to the new object header. + * Return: Success: SUCCEED + * Failure: FAIL * - * Failure: NULL + * Programmer: John Mainzer + * 7/28/14 * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 5 1997 + *------------------------------------------------------------------------- + */ +static herr_t +H5O__cache_get_load_size(const void H5_ATTR_UNUSED *_udata, size_t *image_len) +{ + FUNC_ENTER_STATIC_NOERR + + /* Check arguments */ + HDassert(image_len); + + *image_len = H5O_SPEC_READ_SIZE; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O__cache_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__cache_deserialize + * + * Purpose: Attempt to deserialize the object header contained in the + * supplied buffer, load the data into an instance of H5O_t, and + * return a pointer to the new instance. + * + * Note that the object header is read with with a speculative read. + * If the initial read is too small, make note of this fact and return + * without error. H5C_load_entry() will note the size discrepency + * and retry the deserialize operation with the correct size read. + * + * Return: Success: Pointer to in core representation + * Failure: NULL + * + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ -static H5O_t * -H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5O__cache_deserialize(const void *_image, size_t len, void *_udata, + hbool_t *dirty) { - H5O_t *oh = NULL; /* Object header read in */ - H5O_cache_ud_t *udata = (H5O_cache_ud_t *)_udata; /* User data for callback */ - H5WB_t *wb = NULL; /* Wrapped buffer for prefix data */ - uint8_t read_buf[H5O_SPEC_READ_SIZE]; /* Buffer for speculative read */ - const uint8_t *p; /* Pointer into buffer to decode */ - uint8_t *buf; /* Buffer to decode */ - size_t spec_read_size; /* Size of buffer to speculatively read in */ - size_t prefix_size; /* Size of object header prefix */ - size_t buf_size; /* Size of prefix+chunk #0 buffer */ - haddr_t eoa; /* Relative end of file address */ - H5O_t *ret_value; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT + H5O_t *oh = NULL; /* Object header read in */ + H5O_cache_ud_t *udata = (H5O_cache_ud_t *)_udata; /* User data for callback */ + const uint8_t *image = (const uint8_t *)_image; /* Pointer into buffer to decode */ + size_t prefix_size; /* Size of object header prefix */ + size_t buf_size; /* Size of prefix+chunk #0 buffer */ + void * ret_value = NULL; /* Return value */ + + FUNC_ENTER_STATIC /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); + HDassert(len > 0); HDassert(udata); HDassert(udata->common.f); HDassert(udata->common.cont_msg_info); - - /* Make certain we don't speculatively read off the end of the file */ - if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_OHDR))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to determine file size") - - /* Compute the size of the speculative object header buffer */ - H5_CHECKED_ASSIGN(spec_read_size, size_t, MIN(eoa - addr, H5O_SPEC_READ_SIZE), hsize_t); - - /* Attempt to speculatively read both object header prefix and first chunk */ - if(H5F_block_read(f, H5FD_MEM_OHDR, addr, spec_read_size, dxpl_id, read_buf) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read object header") - p = read_buf; + HDassert(dirty); /* Allocate space for the object header data structure */ if(NULL == (oh = H5FL_CALLOC(H5O_t))) @@ -201,18 +241,18 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Check for presence of magic number */ /* (indicates version 2 or later) */ - if(!HDmemcmp(p, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + if(!HDmemcmp(image, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* Magic number */ - p += H5_SIZEOF_MAGIC; + image += H5_SIZEOF_MAGIC; /* Version */ - oh->version = *p++; - if(H5O_VERSION_2 != oh->version) + oh->version = *image++; + if(H5O_VERSION_2 != oh->version) HGOTO_ERROR(H5E_OHDR, H5E_VERSION, NULL, "bad object header version number") /* Flags */ - oh->flags = *p++; - if(oh->flags & ~H5O_HDR_ALL_FLAGS) + oh->flags = *image++; + if(oh->flags & ~H5O_HDR_ALL_FLAGS) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "unknown object header status flag(s)") /* Number of links to object (unless overridden by refcount message) */ @@ -222,13 +262,13 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) if(oh->flags & H5O_HDR_STORE_TIMES) { uint32_t tmp; /* Temporary value */ - UINT32DECODE(p, tmp); + UINT32DECODE(image, tmp); oh->atime = (time_t)tmp; - UINT32DECODE(p, tmp); + UINT32DECODE(image, tmp); oh->mtime = (time_t)tmp; - UINT32DECODE(p, tmp); + UINT32DECODE(image, tmp); oh->ctime = (time_t)tmp; - UINT32DECODE(p, tmp); + UINT32DECODE(image, tmp); oh->btime = (time_t)tmp; } /* end if */ else @@ -236,8 +276,9 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Attribute fields */ if(oh->flags & H5O_HDR_ATTR_STORE_PHASE_CHANGE) { - UINT16DECODE(p, oh->max_compact); - UINT16DECODE(p, oh->min_dense); + UINT16DECODE(image, oh->max_compact); + UINT16DECODE(image, oh->min_dense); + if(oh->max_compact < oh->min_dense) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "bad object header attribute phase change values") } /* end if */ @@ -249,19 +290,19 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* First chunk size */ switch(oh->flags & H5O_HDR_CHUNK0_SIZE) { case 0: /* 1 byte size */ - oh->chunk0_size = *p++; + oh->chunk0_size = *image++; break; case 1: /* 2 byte size */ - UINT16DECODE(p, oh->chunk0_size); + UINT16DECODE(image, oh->chunk0_size); break; case 2: /* 4 byte size */ - UINT32DECODE(p, oh->chunk0_size); + UINT32DECODE(image, oh->chunk0_size); break; case 3: /* 8 byte size */ - UINT64DECODE(p, oh->chunk0_size); + UINT64DECODE(image, oh->chunk0_size); break; default: @@ -272,7 +313,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) } /* end if */ else { /* Version */ - oh->version = *p++; + oh->version = *image++; if(H5O_VERSION_1 != oh->version) HGOTO_ERROR(H5E_OHDR, H5E_VERSION, NULL, "bad object header version number") @@ -280,13 +321,13 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) oh->flags = H5O_CRT_OHDR_FLAGS_DEF; /* Reserved */ - p++; + image++; /* Number of messages */ - UINT16DECODE(p, udata->v1_pfx_nmesgs); + UINT16DECODE(image, udata->v1_pfx_nmesgs); /* Link count */ - UINT32DECODE(p, oh->nlink); + UINT32DECODE(image, oh->nlink); /* Reset unused time fields */ oh->atime = oh->mtime = oh->ctime = oh->btime = 0; @@ -296,45 +337,36 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) oh->min_dense = 0; /* First chunk size */ - UINT32DECODE(p, oh->chunk0_size); - if((udata->v1_pfx_nmesgs > 0 && oh->chunk0_size < H5O_SIZEOF_MSGHDR_OH(oh)) || - (udata->v1_pfx_nmesgs == 0 && oh->chunk0_size > 0)) + UINT32DECODE(image, oh->chunk0_size); + + if((udata->v1_pfx_nmesgs > 0 && + oh->chunk0_size < H5O_SIZEOF_MSGHDR_OH(oh)) || + (udata->v1_pfx_nmesgs == 0 && oh->chunk0_size > 0)) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "bad object header chunk size") /* Reserved, in version 1 (for 8-byte alignment padding) */ - p += 4; + image += 4; } /* end else */ /* Determine object header prefix length */ - prefix_size = (size_t)(p - (const uint8_t *)read_buf); + prefix_size = (size_t)(image - (const uint8_t *)_image); HDassert((size_t)prefix_size == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); /* Compute the size of the buffer used */ buf_size = oh->chunk0_size + (size_t)H5O_SIZEOF_HDR(oh); - /* Check if the speculative read was large enough to parse the first chunk */ - if(spec_read_size < buf_size) { - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(read_buf, sizeof(read_buf)))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for serialized header */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, buf_size))) - HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Copy existing raw data into new buffer */ - HDmemcpy(buf, read_buf, spec_read_size); - - /* Read rest of the raw data */ - if(H5F_block_read(f, H5FD_MEM_OHDR, (addr + spec_read_size), (buf_size - spec_read_size), dxpl_id, (buf + spec_read_size)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read object header data") + /* Check to see if the buffer provided is large enough to contain both + * the prefix and the first chunk. If it isn't, make note of the desired + * size, but otherwise do nothing. H5C_load_entry() will notice the + * discrepency, load the correct size buffer, and retry the deserialize. + */ + if(len >= buf_size) { + /* Parse the first chunk */ + if(H5O__chunk_deserialize(oh, udata->common.addr, oh->chunk0_size, (const uint8_t *)_image, &(udata->common), dirty) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't deserialize first object header chunk") } /* end if */ else - buf = read_buf; - - /* Parse the first chunk */ - if(H5O__chunk_deserialize(oh, udata->common.addr, oh->chunk0_size, buf, &(udata->common), &oh->cache_info.is_dirty) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't deserialize first object header chunk") + HDassert(!udata->made_attempt); /* Note that we've loaded the object header from the file */ udata->made_attempt = TRUE; @@ -343,202 +375,234 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) ret_value = oh; done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") - /* Release the [possibly partially initialized] object header on errors */ if(!ret_value && oh) if(H5O_free(oh) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, NULL, "unable to destroy object header data") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_load() */ +} /* end H5O__cache_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5O_flush + * Function: H5O__cache_image_len * - * Purpose: Flushes (and destroys) an object header. + * Purpose: Compute the size in bytes of the specified instance of + * H5O_t on disk, and return it in *image_len. On failure, + * the value of *image_len is undefined. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 5 1997 + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ static herr_t -H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t H5_ATTR_UNUSED addr, H5O_t *oh, unsigned H5_ATTR_UNUSED * flags_ptr) +H5O__cache_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + const H5O_t *oh = (const H5O_t *)_thing; /* Object header to query */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); HDassert(oh); + HDassert(oh->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(oh->cache_info.type == H5AC_OHDR); + HDassert(image_len); + + /* Report the object header's prefix+first chunk length */ + if(oh->chunk0_size) + *image_len = (size_t)H5O_SIZEOF_HDR(oh) + oh->chunk0_size; + else + *image_len = oh->chunk[0].size; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O__cache_image_len() */ - /* flush */ - if(oh->cache_info.is_dirty) { - uint8_t *p; /* Pointer to object header prefix buffer */ +/********************************/ +/* no H5O_cache_pre_serialize() */ +/********************************/ + +/*------------------------------------------------------------------------- + * Function: H5O__cache_serialize + * + * Purpose: Serialize the contents of the supplied object header, and + * load this data into the supplied buffer. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 7/28/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O__cache_serialize(const H5F_t *f, void *image, size_t len, void *_thing) +{ + H5O_t *oh = (H5O_t *)_thing; /* Object header to encode */ + uint8_t *chunk_image; /* Pointer to object header prefix buffer */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Check arguments */ + HDassert(f); + HDassert(image); + HDassert(oh); + HDassert(oh->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(oh->cache_info.type == H5AC_OHDR); + HDassert(oh->chunk[0].size == len); #ifdef H5O_DEBUG -H5O_assert(oh); + H5O_assert(oh); #endif /* H5O_DEBUG */ - /* Point to raw data 'image' for first chunk, which has room for the prefix */ - p = oh->chunk[0].image; - - /* Later versions of object header prefix have different format and - * also require that chunk 0 always be updated, since the checksum - * on the entire block of memory needs to be updated if anything is - * modified */ - if(oh->version > H5O_VERSION_1) { - uint64_t chunk0_size; /* Size of chunk 0's data */ + /* Point to raw data 'image' for first chunk, which + * has room for the prefix + */ + chunk_image = oh->chunk[0].image; - HDassert(oh->chunk[0].size >= (size_t)H5O_SIZEOF_HDR(oh)); - chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh); + /* Later versions of object header prefix have different format and + * also require that chunk 0 always be updated, since the checksum + * on the entire block of memory needs to be updated if anything is + * modified + */ + if(oh->version > H5O_VERSION_1) { + uint64_t chunk0_size; /* Size of chunk 0's data */ - /* Verify magic number */ - HDassert(!HDmemcmp(p, H5O_HDR_MAGIC, H5_SIZEOF_MAGIC)); - p += H5_SIZEOF_MAGIC; + HDassert(oh->chunk[0].size >= (size_t)H5O_SIZEOF_HDR(oh)); + chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh); - /* Version */ - *p++ = oh->version; + /* Verify magic number */ + HDassert(!HDmemcmp(chunk_image, H5O_HDR_MAGIC, H5_SIZEOF_MAGIC)); + chunk_image += H5_SIZEOF_MAGIC; - /* Flags */ - *p++ = oh->flags; + /* Version */ + *chunk_image++ = oh->version; - /* Time fields */ - if(oh->flags & H5O_HDR_STORE_TIMES) { - UINT32ENCODE(p, oh->atime); - UINT32ENCODE(p, oh->mtime); - UINT32ENCODE(p, oh->ctime); - UINT32ENCODE(p, oh->btime); - } /* end if */ + /* Flags */ + *chunk_image++ = oh->flags; - /* Attribute fields */ - if(oh->flags & H5O_HDR_ATTR_STORE_PHASE_CHANGE) { - UINT16ENCODE(p, oh->max_compact); - UINT16ENCODE(p, oh->min_dense); - } /* end if */ + /* Time fields */ + if(oh->flags & H5O_HDR_STORE_TIMES) { + UINT32ENCODE(chunk_image, oh->atime); + UINT32ENCODE(chunk_image, oh->mtime); + UINT32ENCODE(chunk_image, oh->ctime); + UINT32ENCODE(chunk_image, oh->btime); + } /* end if */ - /* First chunk size */ - switch(oh->flags & H5O_HDR_CHUNK0_SIZE) { - case 0: /* 1 byte size */ - HDassert(chunk0_size < 256); - *p++ = (uint8_t)chunk0_size; - break; - - case 1: /* 2 byte size */ - HDassert(chunk0_size < 65536); - UINT16ENCODE(p, chunk0_size); - break; - - case 2: /* 4 byte size */ - /* use <= 2**32 -1 to stay within 4 bytes integer range */ - HDassert(chunk0_size <= 4294967295UL); - UINT32ENCODE(p, chunk0_size); - break; - - case 3: /* 8 byte size */ - UINT64ENCODE(p, chunk0_size); - break; - - default: - HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "bad size for chunk 0") - } /* end switch */ + /* Attribute fields */ + if(oh->flags & H5O_HDR_ATTR_STORE_PHASE_CHANGE) { + UINT16ENCODE(chunk_image, oh->max_compact); + UINT16ENCODE(chunk_image, oh->min_dense); } /* end if */ - else { - /* Version */ - *p++ = oh->version; - /* Reserved */ - *p++ = 0; + /* First chunk size */ + switch(oh->flags & H5O_HDR_CHUNK0_SIZE) { + case 0: /* 1 byte size */ + HDassert(chunk0_size < 256); + *chunk_image++ = (uint8_t)chunk0_size; + break; + + case 1: /* 2 byte size */ + HDassert(chunk0_size < 65536); + UINT16ENCODE(chunk_image, chunk0_size); + break; + + case 2: /* 4 byte size */ + /* use <= 2**32 -1 to stay within 4 bytes integer range */ + HDassert(chunk0_size <= 4294967295UL); + UINT32ENCODE(chunk_image, chunk0_size); + break; - /* Number of messages */ + case 3: /* 8 byte size */ + UINT64ENCODE(chunk_image, chunk0_size); + break; + + default: + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "bad size for chunk 0") + } /* end switch */ + } /* end if */ + else { + /* Version */ + *chunk_image++ = oh->version; + + /* Reserved */ + *chunk_image++ = 0; + + /* Number of messages */ #ifdef H5O_ENABLE_BAD_MESG_COUNT - if(oh->store_bad_mesg_count) - UINT16ENCODE(p, (oh->nmesgs - 1)) - else + if(oh->store_bad_mesg_count) + UINT16ENCODE(chunk_image, (oh->nmesgs - 1)) + else #endif /* H5O_ENABLE_BAD_MESG_COUNT */ - UINT16ENCODE(p, oh->nmesgs); - - /* Link count */ - UINT32ENCODE(p, oh->nlink); + UINT16ENCODE(chunk_image, oh->nmesgs); - /* First chunk size */ - UINT32ENCODE(p, (oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh))); + /* Link count */ + UINT32ENCODE(chunk_image, oh->nlink); - /* Zero to alignment */ - HDmemset(p, 0, (size_t)(H5O_SIZEOF_HDR(oh) - 12)); - p += (size_t)(H5O_SIZEOF_HDR(oh) - 12); - } /* end else */ - HDassert((size_t)(p - oh->chunk[0].image) == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); + /* First chunk size */ + UINT32ENCODE(chunk_image, (oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh))); - /* Serialize messages for this chunk */ - if(H5O__chunk_serialize(f, oh, (unsigned)0) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize first object header chunk") + /* Zero to alignment */ + HDmemset(chunk_image, 0, (size_t)(H5O_SIZEOF_HDR(oh) - 12)); + chunk_image += (size_t)(H5O_SIZEOF_HDR(oh) - 12); + } /* end else */ - /* Write the chunk out */ - HDassert(H5F_addr_defined(oh->chunk[0].addr)); - if(H5F_block_write(f, H5FD_MEM_OHDR, oh->chunk[0].addr, oh->chunk[0].size, dxpl_id, oh->chunk[0].image) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to write object header chunk to disk") + HDassert((size_t)(chunk_image - oh->chunk[0].image) == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); - /* Mark object header as clean now */ - oh->cache_info.is_dirty = FALSE; - } /* end if */ + /* Serialize messages for this chunk */ + if(H5O__chunk_serialize(f, oh, (unsigned)0) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize first object header chunk") - /* Destroy the object header, if requested */ - if(destroy) - if(H5O_dest(f, oh) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data") + /* copy the chunk into the image -- this is potentially expensive. + * Can we rework things so that the object header and the cache + * share a buffer? + */ + HDmemcpy(image, oh->chunk[0].image, len); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_flush() */ +} /* end H5O__cache_serialize() */ + +/**********************************/ +/* no H5O_cache_notify() function */ +/**********************************/ /*------------------------------------------------------------------------- - * Function: H5O_dest + * Function: H5O__cache_free_icr * - * Purpose: Destroys an object header. + * Purpose: Free the in core representation of the supplied object header. * - * Return: Non-negative on success/Negative on failure + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 15 2003 + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ static herr_t -H5O_dest(H5F_t *f, H5O_t *oh) -{ - herr_t ret_value = SUCCEED; /* Return value */ +H5O__cache_free_icr(void *_thing) +{ + H5O_t *oh = (H5O_t *)_thing; /* Object header to destroy */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(oh); - HDassert(oh->rc == 0); - - /* Verify that node is clean */ - HDassert(!oh->cache_info.is_dirty); - - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!oh->cache_info.free_file_space_on_destroy || H5F_addr_defined(oh->cache_info.addr)); - - /* Check for releasing file space for object header */ - if(oh->chunk && oh->cache_info.free_file_space_on_destroy) { - /* Free main (first) object header "chunk" */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_dxpl_id, oh->chunk[0].addr, (hsize_t)oh->chunk[0].size) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free object header") - } /* end if */ + HDassert(oh->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(oh->cache_info.type == H5AC_OHDR); /* Destroy object header */ if(H5O_free(oh) < 0) @@ -546,170 +610,143 @@ H5O_dest(H5F_t *f, H5O_t *oh) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dest() */ +} /* end H5O__cache_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5O_clear + * Function: H5O__cache_clear * - * Purpose: Mark a object header in memory as non-dirty. + * Purpose: Clear all dirty bits associated with this cache entry. * - * Return: Non-negative on success/Negative on failure + * This is ncessary as the object header cache client maintains + * its own dirty bits on individual messages. These dirty bits + * used to be cleared by the old V2 metadata cache flush callback, + * but now the metadata cache must clear them explicitly, as + * the serialize callback does not imply that the data has been + * written to disk. * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 20 2003 - * - * Changes: In the parallel case, there is the possibility that the - * the object header may be flushed by different processes - * over the life of the computation. Thus we must ensure - * that the chunk images are up to date before we mark the - * messages clean -- as otherwise we may overwrite valid - * data with a blank section of a chunk image. + * This callback is also necessary for the parallel case. * - * To deal with this, I have added code to call - * H5O_chunk_serialize() for all chunks before we - * mark all messages as clean if we are not destroying the - * object. Do this in the parallel case only, as the problem - * can only occur in this context. + * Return: Success: SUCCEED + * Failure: FAIL * - * JRM -- 10/12/10 + * Programmer: John Mainzer + * 9/22/14 * *------------------------------------------------------------------------- */ static herr_t -H5O_clear(H5F_t *f, H5O_t *oh, hbool_t destroy) -{ - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; +H5O__cache_clear(const H5F_t *f, void *_thing, hbool_t about_to_destroy) +{ + H5O_t *oh = (H5O_t *)_thing; /* Object header to reset */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(oh); + HDassert(oh->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(oh->cache_info.type == H5AC_OHDR); #ifdef H5_HAVE_PARALLEL - if ( ( oh->cache_info.is_dirty ) && ( ! destroy ) ) { - - size_t i; - - /* scan through all chunks associated with the object header, - * and cause them to update their images for all entries currently - * marked dirty. Must do this in the parallel case, as it is possible - * that this processor may clear this object header several times - * before flushing it -- thus causing undefined sections of the image - * to be written to disk overwriting valid data. + if((oh->nchunks > 0) && (!about_to_destroy)) { + /* Scan through chunk 0 (the chunk stored contiguously with this + * object header) and cause it to update its image of all entries + * currently marked dirty. Must do this in the parallel case, as + * it is possible that this processor may clear this object header + * several times before flushing it -- thus causing undefined + * sections of the image to be written to disk overwriting valid data. */ - - for ( i = 0; i < oh->nchunks; i++ ) { - - if(H5O__chunk_serialize(f, oh, i) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize object header chunk") - } - } + if(H5O__chunk_serialize(f, oh, 0) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize object header chunk") + } /* end if */ #endif /* H5_HAVE_PARALLEL */ /* Mark messages stored with the object header (i.e. messages in chunk 0) as clean */ for(u = 0; u < oh->nmesgs; u++) - oh->mesg[u].dirty = FALSE; + if(oh->mesg[u].chunkno == 0) + oh->mesg[u].dirty = FALSE; #ifndef NDEBUG /* Reset the number of messages dirtied by decoding */ oh->ndecode_dirtied = 0; #endif /* NDEBUG */ - /* Mark whole header as clean */ - oh->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5O_dest(f, oh) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data") - done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_clear() */ +} /* end H5O__cache_clear() */ /*------------------------------------------------------------------------- - * Function: H5O_size + * Function: H5O__cache_chk_get_load_size() * - * Purpose: Compute the size in bytes of the specified instance of - * H5O_t on disk, and return it in *len_ptr. On failure, - * the value of *len_ptr is undefined. + * Purpose: Tell the metadata cache how large the on disk image of the + * chunk proxy is, so it can load the image into a buffer for the + * deserialize call. In this case, we simply look up the size in + * the user data, and return it in *image_len, * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: John Mainzer - * 5/13/04 + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ static herr_t -H5O_size(const H5F_t H5_ATTR_UNUSED *f, const H5O_t *oh, size_t *size_ptr) +H5O__cache_chk_get_load_size(const void *_udata, size_t *image_len) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + const H5O_chk_cache_ud_t *udata = (const H5O_chk_cache_ud_t *)_udata; /* User data for callback */ - /* check args */ - HDassert(oh); - HDassert(size_ptr); + FUNC_ENTER_STATIC_NOERR - /* Report the object header's prefix+first chunk length */ - if(oh->chunk0_size) - *size_ptr = (size_t)H5O_SIZEOF_HDR(oh) + oh->chunk0_size; - else - *size_ptr = oh->chunk[0].size; + /* Check arguments */ + HDassert(udata); + HDassert(udata->oh); + HDassert(image_len); + + *image_len = udata->size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5O_size() */ +} /* end H5O__cache_chk_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5O_cache_chk_load + * Function: H5O__cache_chk_deserialize * - * Purpose: Loads an object header continuation chunk from disk. + * Purpose: Attempt to deserialize the object header continuation chunk + * contained in the supplied buffer, load the data into an instance + * of H5O_chunk_proxy_t, and return a pointer to the new instance. * - * Return: Success: Pointer to the new object header chunk proxy. - * Failure: NULL + * Return: Success: Pointer to in core representation + * Failure: NULL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Jul 12 2008 + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ -static H5O_chunk_proxy_t * -H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5O__cache_chk_deserialize(const void *image, size_t len, void *_udata, + hbool_t *dirty) { - H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk proxy object */ - H5O_chk_cache_ud_t *udata = (H5O_chk_cache_ud_t *)_udata; /* User data for callback */ - H5WB_t *wb = NULL; /* Wrapped buffer for prefix data */ - uint8_t chunk_buf[H5O_SPEC_READ_SIZE]; /* Buffer for speculative read */ - uint8_t *buf; /* Buffer to decode */ - H5O_chunk_proxy_t *ret_value; /* Return value */ + H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk proxy object */ + H5O_chk_cache_ud_t *udata = (H5O_chk_cache_ud_t *)_udata; /* User data for callback */ + void * ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); + HDassert(len > 0); HDassert(udata); HDassert(udata->oh); + HDassert(dirty); /* Allocate space for the object header data structure */ - if(NULL == (chk_proxy = H5FL_CALLOC(H5O_chunk_proxy_t))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "memory allocation failed") - - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(chunk_buf, sizeof(chunk_buf)))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for serialized header */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, udata->size))) - HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read rest of the raw data */ - if(H5F_block_read(f, H5FD_MEM_OHDR, addr, udata->size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read object header continuation chunk") + if(NULL == (chk_proxy = H5FL_CALLOC(H5O_chunk_proxy_t))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "memory allocation failed") /* Check if we are still decoding the object header */ /* (as opposed to bringing a piece of it back from the file) */ @@ -719,7 +756,7 @@ H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HDassert(udata->common.cont_msg_info); /* Parse the chunk */ - if(H5O__chunk_deserialize(udata->oh, udata->common.addr, udata->size, buf, &(udata->common), &chk_proxy->cache_info.is_dirty) < 0) + if(H5O__chunk_deserialize(udata->oh, udata->common.addr, udata->size, (const uint8_t *)image, &(udata->common), dirty) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't deserialize object header chunk") /* Set the fields for the chunk proxy */ @@ -737,7 +774,7 @@ H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Sanity check that the chunk representation we have in memory is * the same as the one being brought in from disk. */ - HDassert(0 == HDmemcmp(buf, chk_proxy->oh->chunk[chk_proxy->chunkno].image, chk_proxy->oh->chunk[chk_proxy->chunkno].size)); + HDassert(0 == HDmemcmp(image, chk_proxy->oh->chunk[chk_proxy->chunkno].image, chk_proxy->oh->chunk[chk_proxy->chunkno].size)); } /* end else */ /* Increment reference count of object header */ @@ -748,213 +785,195 @@ H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) ret_value = chk_proxy; done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") - - /* Release the [possibly partially initialized] object header on errors */ - if(!ret_value && chk_proxy) - if(H5O__chunk_proxy_dest(chk_proxy) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, NULL, "unable to destroy object header chunk proxy") - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_cache_chk_load() */ +} /* end H5O__cache_chk_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5O_cache_chk_flush + * Function: H5O__cache_chk_image_len * - * Purpose: Flushes (and destroys) an object header continuation chunk. + * Purpose: Return the on disk image size of a object header chunk to the + * metadata cache via the image_len. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Jul 12 2008 + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ static herr_t -H5O_cache_chk_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5O_chunk_proxy_t *chk_proxy, unsigned H5_ATTR_UNUSED * flags_ptr) +H5O__cache_chk_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT + const H5O_chunk_proxy_t * chk_proxy = (const H5O_chunk_proxy_t *)_thing; /* Chunk proxy to query */ - /* flush */ - if(chk_proxy->cache_info.is_dirty) { - /* Serialize messages for this chunk */ - if(H5O__chunk_serialize(f, chk_proxy->oh, chk_proxy->chunkno) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize object header continuation chunk") + FUNC_ENTER_STATIC_NOERR - /* Write the chunk out */ - HDassert(H5F_addr_defined(chk_proxy->oh->chunk[chk_proxy->chunkno].addr)); - HDassert(H5F_addr_eq(addr, chk_proxy->oh->chunk[chk_proxy->chunkno].addr)); - if(H5F_block_write(f, H5FD_MEM_OHDR, addr, chk_proxy->oh->chunk[chk_proxy->chunkno].size, dxpl_id, chk_proxy->oh->chunk[chk_proxy->chunkno].image) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to write object header continuation chunk to disk") + /* Check arguments */ + HDassert(chk_proxy); + HDassert(chk_proxy->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(chk_proxy->cache_info.type == H5AC_OHDR_CHK); + HDassert(chk_proxy->oh); + HDassert(image_len); - /* Mark object header as clean now */ - chk_proxy->cache_info.is_dirty = FALSE; - } /* end if */ + *image_len = chk_proxy->oh->chunk[chk_proxy->chunkno].size; - /* Destroy the object header, if requested */ - if(destroy) - if(H5O_cache_chk_dest(f, chk_proxy) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header continuation chunk data") + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O__cache_chk_image_len() */ -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_cache_chk_flush() */ +/************************************/ +/* no H5O_cache_chk_pre_serialize() */ +/************************************/ /*------------------------------------------------------------------------- - * Function: H5O_cache_chk_dest + * Function: H5O__cache_chk_serialize * - * Purpose: Destroys an object header continuation chunk. + * Purpose: Given a pointer to an instance of an object header chunk and an + * appropriately sized buffer, serialize the contents of the + * instance for writing to disk, and copy the serialized data + * into the buffer. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * July 12, 2008 + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ static herr_t -H5O_cache_chk_dest(H5F_t *f, H5O_chunk_proxy_t *chk_proxy) +H5O__cache_chk_serialize(const H5F_t *f, void *image, size_t len, void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5O_chunk_proxy_t * chk_proxy = (H5O_chunk_proxy_t *)_thing; /* Object header chunk to serialize */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ + HDassert(f); + HDassert(image); HDassert(chk_proxy); - HDassert(chk_proxy->chunkno > 0); - - /* Verify that node is clean */ - HDassert(chk_proxy->cache_info.is_dirty == FALSE); + HDassert(chk_proxy->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(chk_proxy->cache_info.type == H5AC_OHDR_CHK); + HDassert(chk_proxy->oh); + HDassert(chk_proxy->oh->chunk[chk_proxy->chunkno].size == len); - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!chk_proxy->cache_info.free_file_space_on_destroy || H5F_addr_defined(chk_proxy->cache_info.addr)); - - /* Check for releasing file space for object header */ - if(chk_proxy->cache_info.free_file_space_on_destroy) { - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_dxpl_id, chk_proxy->oh->chunk[chk_proxy->chunkno].addr, (hsize_t)chk_proxy->oh->chunk[chk_proxy->chunkno].size) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free object header continuation chunk") - } /* end if */ + /* Serialize messages for this chunk */ + if(H5O__chunk_serialize(f, chk_proxy->oh, chk_proxy->chunkno) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize object header continuation chunk") - /* Destroy object header chunk proxy */ - if(H5O__chunk_proxy_dest(chk_proxy) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to destroy object header chunk proxy") + /* copy the chunk into the image -- this is potentially expensive. + * Can we rework things so that the chunk and the cache share a buffer? + */ + HDmemcpy(image, chk_proxy->oh->chunk[chk_proxy->chunkno].image, len); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_cache_chk_dest() */ +} /* end H5O__cache_chk_serialize() */ + +/**************************************/ +/* no H5O_cache_chk_notify() function */ +/**************************************/ /*------------------------------------------------------------------------- - * Function: H5O_cache_chk_clear - * - * Purpose: Mark a object header continuation chunk in memory as non-dirty. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * July 12, 2008 + * Function: H5O__cache_chk_free_icr * - * Changes: In the parallel case, there is the possibility that the - * the object header chunk may be flushed by different - * processes over the life of the computation. Thus we must - * ensure that the chunk image is up to date before we mark its - * messages clean -- as otherwise we may overwrite valid - * data with a blank section of a chunk image. + * Purpose: Free the in core memory associated with the supplied object + * header continuation chunk. * - * To deal with this, I have added code to call - * H5O_chunk_serialize() for this chunk before we - * mark all messages as clean if we are not destroying the - * chunk. + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). * - * Do this in the parallel case only, as the problem - * can only occur in this context. + * Return: Success: SUCCEED + * Failure: FAIL * - * Note that at present at least, it seems that this fix - * is not necessary, as we don't seem to be able to - * generate a dirty chunk without creating a dirty object - * header. However, the object header code will be changing - * a lot in the near future, so I'll leave this fix in - * for now, unless Quincey requests otherwise. - * - * JRM -- 10/12/10 + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ static herr_t -H5O_cache_chk_clear(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, hbool_t destroy) +H5O__cache_chk_free_icr(void *_thing) { - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; + H5O_chunk_proxy_t * chk_proxy = (H5O_chunk_proxy_t *)_thing; /* Object header chunk proxy to release */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(chk_proxy); + HDassert(chk_proxy->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(chk_proxy->cache_info.type == H5AC_OHDR_CHK); -#ifdef H5_HAVE_PARALLEL - if((chk_proxy->oh->cache_info.is_dirty) && (!destroy)) - if(H5O__chunk_serialize(f, chk_proxy->oh, chk_proxy->chunkno) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize object header chunk") -#endif /* H5_HAVE_PARALLEL */ - - /* Mark messages in chunk as clean */ - for(u = 0; u < chk_proxy->oh->nmesgs; u++) - if(chk_proxy->oh->mesg[u].chunkno == chk_proxy->chunkno) - chk_proxy->oh->mesg[u].dirty = FALSE; - - /* Mark as clean */ - chk_proxy->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5O_cache_chk_dest(f, chk_proxy) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header continuation chunk data") + /* Destroy object header chunk proxy */ + if(H5O__chunk_proxy_dest(chk_proxy) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to destroy object header chunk proxy") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_cache_chk_clear() */ +} /* end H5O__cache_chk_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5O_cache_chk_size + * Function: H5O__cache_chk_clear * - * Purpose: Compute the size in bytes of the specified instance of - * an object header continuation chunk on disk, and return it in - * *len_ptr. On failure, the value of *len_ptr is undefined. + * Purpose: Clear all dirty bits associated with this cache entry. * - * Return: Non-negative on success/Negative on failure + * This is ncessary as the object header cache client maintains + * its own dirty bits on individual messages. These dirty bits + * used to be cleared by the old V2 metadata cache flush callback, + * but now the metadata cache must clear them explicitly, as + * the serialize callback does not imply that the data has been + * written to disk. * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * July 12, 2008 + * This callback is also necessary for the parallel case. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 9/22/14 * *------------------------------------------------------------------------- */ static herr_t -H5O_cache_chk_size(const H5F_t H5_ATTR_UNUSED *f, const H5O_chunk_proxy_t *chk_proxy, size_t *size_ptr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR +H5O__cache_chk_clear(const H5F_t *f, void *_thing, hbool_t about_to_destroy) +{ + H5O_chunk_proxy_t *chk_proxy = (H5O_chunk_proxy_t *)_thing; /* Object header chunk to reset */ + H5O_t *oh; /* Object header for chunk */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ - /* check args */ + FUNC_ENTER_STATIC + + /* Check arguments */ HDassert(chk_proxy); - HDassert(size_ptr); + HDassert(chk_proxy->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(chk_proxy->cache_info.type == H5AC_OHDR_CHK); + oh = chk_proxy->oh; + HDassert(oh); + HDassert(oh->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(oh->cache_info.type == H5AC_OHDR); - /* Report the object header continuation chunk's length */ - *size_ptr = chk_proxy->oh->chunk[chk_proxy->chunkno].size; +#ifdef H5_HAVE_PARALLEL + if((chk_proxy->oh->cache_info.is_dirty) && (!about_to_destroy)) + if(H5O__chunk_serialize(f, chk_proxy->oh, chk_proxy->chunkno) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize object header chunk") +#endif /* H5_HAVE_PARALLEL */ - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5O_cache_chk_size() */ + /* Mark messages in chunk as clean */ + for(u = 0; u < chk_proxy->oh->nmesgs; u++) + if(chk_proxy->oh->mesg[u].chunkno == chk_proxy->chunkno) + chk_proxy->oh->mesg[u].dirty = FALSE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O__cache_chk_clear() */ /*------------------------------------------------------------------------- @@ -1024,7 +1043,7 @@ static herr_t H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, H5O_common_cache_ud_t *udata, hbool_t *dirty) { - const uint8_t *p; /* Pointer into buffer to decode */ + const uint8_t *chunk_image; /* Pointer into buffer to decode */ uint8_t *eom_ptr; /* Pointer to end of messages for a chunk */ size_t curmesg; /* Current message being decoded in object header */ unsigned merged_null_msgs = 0; /* Number of null messages merged together */ @@ -1073,18 +1092,18 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image HDmemcpy(oh->chunk[chunkno].image, image, oh->chunk[chunkno].size); /* Point into chunk image to decode */ - p = oh->chunk[chunkno].image; + chunk_image = oh->chunk[chunkno].image; /* Handle chunk 0 as special case */ if(chunkno == 0) /* Skip over [already decoded] prefix */ - p += (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh)); + chunk_image += (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh)); /* Check for magic # on chunks > 0 in later versions of the format */ else if(chunkno > 0 && oh->version > H5O_VERSION_1) { /* Magic number */ - if(HDmemcmp(p, H5O_CHK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(chunk_image, H5O_CHK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "wrong object header chunk signature") - p += H5_SIZEOF_MAGIC; + chunk_image += H5_SIZEOF_MAGIC; } /* end if */ /* Save # of messages already inspected */ @@ -1095,7 +1114,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image #ifndef NDEBUG nullcnt = 0; #endif /* NDEBUG */ - while(p < eom_ptr) { + while(chunk_image < eom_ptr) { size_t mesgno; /* Current message to operate on */ size_t mesg_size; /* Size of message read in */ unsigned id; /* ID (type) of current message */ @@ -1106,20 +1125,20 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image /* Version # */ if(oh->version == H5O_VERSION_1) - UINT16DECODE(p, id) + UINT16DECODE(chunk_image, id) else - id = *p++; + id = *chunk_image++; /* Check for unknown message ID getting encoded in file */ if(id == H5O_UNKNOWN_ID) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "'unknown' message ID encoded in file?!?") /* Message size */ - UINT16DECODE(p, mesg_size); + UINT16DECODE(chunk_image, mesg_size); HDassert(mesg_size == H5O_ALIGN_OH(oh, mesg_size)); /* Message flags */ - flags = *p++; + flags = *chunk_image++; if(flags & ~H5O_MSG_FLAG_BITS) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unknown flag for message") if((flags & H5O_MSG_FLAG_SHARED) && (flags & H5O_MSG_FLAG_DONTSHARE)) @@ -1131,17 +1150,17 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image /* Reserved bytes/creation index */ if(oh->version == H5O_VERSION_1) - p += 3; /*reserved*/ + chunk_image += 3; /*reserved*/ else { /* Only decode creation index if they are being tracked */ if(oh->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED) - UINT16DECODE(p, crt_idx); + UINT16DECODE(chunk_image, crt_idx); } /* end else */ /* Try to detect invalidly formatted object header message that * extends past end of chunk. */ - if(p + mesg_size > eom_ptr) + if(chunk_image + mesg_size > eom_ptr) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "corrupt object header") #ifndef NDEBUG @@ -1177,7 +1196,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image oh->mesg[mesgno].flags = flags; oh->mesg[mesgno].crt_idx = crt_idx; oh->mesg[mesgno].native = NULL; - oh->mesg[mesgno].raw = (uint8_t *)p; /* Casting away const OK - QAK */ + oh->mesg[mesgno].raw = (uint8_t *)chunk_image; /* Casting away const OK - QAK */ oh->mesg[mesgno].raw_size = mesg_size; oh->mesg[mesgno].chunkno = chunkno; @@ -1233,10 +1252,10 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image } /* end else */ /* Advance decode pointer past message */ - p += mesg_size; + chunk_image += mesg_size; /* Check for 'gap' at end of chunk */ - if((eom_ptr - p) > 0 && (eom_ptr - p) < H5O_SIZEOF_MSGHDR_OH(oh)) { + if((eom_ptr - chunk_image) > 0 && (eom_ptr - chunk_image) < H5O_SIZEOF_MSGHDR_OH(oh)) { /* Gaps can only occur in later versions of the format */ HDassert(oh->version > H5O_VERSION_1); @@ -1244,10 +1263,10 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image HDassert(nullcnt == 0); /* Set gap information for chunk */ - oh->chunk[chunkno].gap = (size_t)(eom_ptr - p); + oh->chunk[chunkno].gap = (size_t)(eom_ptr - chunk_image); /* Increment location in chunk */ - p += oh->chunk[chunkno].gap; + chunk_image += oh->chunk[chunkno].gap; } /* end if */ } /* end while */ @@ -1257,7 +1276,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image uint32_t computed_chksum; /* Checksum computed in memory */ /* Metadata checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(chunk_image, stored_chksum); /* Compute checksum on chunk */ computed_chksum = H5_checksum_metadata(oh->chunk[chunkno].image, (oh->chunk[chunkno].size - H5O_SIZEOF_CHKSUM), 0); @@ -1268,7 +1287,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image } /* end if */ /* Sanity check */ - HDassert(p == oh->chunk[chunkno].image + oh->chunk[chunkno].size); + HDassert(chunk_image == oh->chunk[chunkno].image + oh->chunk[chunkno].size); /* Do some inspection/interpretation of new messages from this chunk */ /* (detect continuation messages, ref. count messages, etc.) */ @@ -1390,7 +1409,7 @@ H5O__chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno) /* Extra work, for later versions of the format */ if(oh->version > H5O_VERSION_1) { uint32_t metadata_chksum; /* Computed metadata checksum value */ - uint8_t *p; /* Pointer into object header chunk */ + uint8_t *chunk_image; /* Pointer into object header chunk */ /* Check for gap in chunk & zero it out */ if(oh->chunk[chunkno].gap) @@ -1401,8 +1420,8 @@ H5O__chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno) metadata_chksum = H5_checksum_metadata(oh->chunk[chunkno].image, (oh->chunk[chunkno].size - H5O_SIZEOF_CHKSUM), 0); /* Metadata checksum */ - p = oh->chunk[chunkno].image + (oh->chunk[chunkno].size - H5O_SIZEOF_CHKSUM); - UINT32ENCODE(p, metadata_chksum); + chunk_image = oh->chunk[chunkno].image + (oh->chunk[chunkno].size - H5O_SIZEOF_CHKSUM); + UINT32ENCODE(chunk_image, metadata_chksum); } /* end if */ done: @@ -1443,5 +1462,5 @@ H5O__chunk_proxy_dest(H5O_chunk_proxy_t *chk_proxy) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_chunk_proxy_dest() */ +} /* H5O__chunk_proxy_dest() */ diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index 41d3f66..bb82ad1 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -184,7 +184,7 @@ H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) chk_udata.size = oh->chunk[idx].size; /* Get the chunk proxy */ - if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC_WRITE))) + if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk") /* Sanity check */ @@ -337,7 +337,7 @@ H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) chk_udata.size = oh->chunk[idx].size; /* Get the chunk proxy */ - if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC_WRITE))) + if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Update index for chunk proxy in cache */ @@ -389,7 +389,7 @@ H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) chk_udata.size = oh->chunk[idx].size; /* Get the chunk proxy */ - if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC_WRITE))) + if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Sanity check */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index afd8e94..66322da 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -379,7 +379,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, } /* Get source object header */ - if(NULL == (oh_src = H5O_protect(oloc_src, dxpl_id, H5AC_READ))) + if(NULL == (oh_src = H5O_protect(oloc_src, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Retrieve user data for particular type of object to copy */ diff --git a/src/H5Odbg.c b/src/H5Odbg.c index 0531a90..0388cd5 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -566,7 +566,7 @@ H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f loc.addr = addr; loc.holding_file = FALSE; - if(NULL == (oh = H5O_protect(&loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(&loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* debug */ diff --git a/src/H5Oefl.c b/src/H5Oefl.c index e37e9b7..a7ce31a 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -128,7 +128,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, #ifndef NDEBUG HDassert(H5F_addr_defined(mesg->heap_addr)); - if(NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr, H5AC_READ))) + if(NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value") s = (const char *)H5HL_offset_into(heap, 0); @@ -145,7 +145,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, if(NULL == mesg->slot) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - if(NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr, H5AC_READ))) + if(NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value") for(u = 0; u < mesg->nused; u++) { /* Name */ @@ -487,7 +487,7 @@ H5O_efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_ds HGOTO_ERROR(H5E_EFL, H5E_CANTINIT, NULL, "can't create heap") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(file_dst, dxpl_id, efl_dst->heap_addr, H5AC_WRITE))) + if(NULL == (heap = H5HL_protect(file_dst, dxpl_id, efl_dst->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_EFL, H5E_PROTECT, NULL, "unable to protect EFL file name heap") /* Insert "empty" name first */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index d361194..c2756ea 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -476,7 +476,7 @@ H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg, HDassert(type_id < NELMTS(H5O_msg_class_g)); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header") /* Call the "real" read routine */ @@ -802,7 +802,7 @@ H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) HDassert(type); /* Load the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Count the messages of the correct type */ @@ -884,7 +884,7 @@ H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) HDassert(type_id < NELMTS(H5O_msg_class_g)); /* Load the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Call the "real" exists routine */ @@ -1224,7 +1224,7 @@ H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id, HDassert(op); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Call the "real" iterate routine */ @@ -2289,7 +2289,7 @@ H5O_msg_get_chunkno(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) HDassert(type); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Locate message of correct type */ @@ -2344,7 +2344,7 @@ H5O_msg_lock(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) HDassert(type); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Locate message of correct type */ @@ -2402,7 +2402,7 @@ H5O_msg_unlock(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) HDassert(type); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Locate message of correct type */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index cc262a0..92d0107 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -564,6 +564,8 @@ typedef struct H5O_btreek_t { * (Data structure in memory) */ typedef struct H5O_drvinfo_t { +/* Information for H5AC cache functions, _must_ be first field in structure */ + H5AC_info_t cache_info; char name[9]; /* Driver name */ size_t len; /* Length of encoded buffer */ uint8_t *buf; /* Buffer for encoded info */ @@ -659,7 +661,7 @@ H5_DLL herr_t H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, H5_DLL herr_t H5O_open(H5O_loc_t *loc); H5_DLL herr_t H5O_close(H5O_loc_t *loc); H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id); -H5_DLL H5O_t *H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot); +H5_DLL H5O_t *H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags); H5_DLL H5O_t *H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id); H5_DLL herr_t H5O_unpin(H5O_t *oh); H5_DLL herr_t H5O_dec_rc_by_loc(const H5O_loc_t *loc, hid_t dxpl_id); diff --git a/src/H5Otest.c b/src/H5Otest.c index d1627ef..e7312ee 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -108,7 +108,7 @@ H5O_is_attr_dense_test(hid_t oid) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ @@ -173,7 +173,7 @@ H5O_is_attr_empty_test(hid_t oid) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ @@ -266,7 +266,7 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ @@ -361,7 +361,7 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) H5_BEGIN_TAG(H5AC_ind_dxpl_id, loc->addr, FAIL); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ @@ -452,7 +452,7 @@ H5O_check_msg_marked_test(hid_t oid, hbool_t flag_val) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Locate "unknown" message */ @@ -511,7 +511,7 @@ H5O_expunge_chunks_test(const H5O_loc_t *loc, hid_t dxpl_id) FUNC_ENTER_NOAPI(FAIL) /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_WRITE))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Safety check */ @@ -571,7 +571,7 @@ H5O_get_rc(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc) HDassert(rc); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Save the refcount for the object header */ diff --git a/src/H5SM.c b/src/H5SM.c index abdb109..1d391f1 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -358,7 +358,7 @@ H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id) /* Set up user data for callback */ cache_udata.f = f; - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") } /* end if */ else @@ -412,7 +412,7 @@ H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_ad cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Look up index for message type */ @@ -831,7 +831,7 @@ H5SM_convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header, hid_t dxpl_i cache_udata.header = header; /* Protect the SOHM list */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, H5AC_WRITE))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM list index") /* Delete the B-tree and have messages copy themselves to the @@ -939,7 +939,7 @@ H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, /* Set up user data for callback */ cache_udata.f = f; - if(NULL == (my_table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_READ))) + if(NULL == (my_table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") } /* end if */ @@ -1071,7 +1071,7 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_WRITE))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* "complex" sharing checks */ @@ -1277,7 +1277,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, cache_udata.header = header; /* The index is a list; get it from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, defer ? H5AC_READ : H5AC_WRITE))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, defer ? H5AC__READ_ONLY_FLAG : H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") /* See if the message is already in the index and get its location. @@ -1530,7 +1530,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_WRITE))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and try to delete from it */ @@ -1799,7 +1799,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, cache_udata.header = header; /* If the index is stored as a list, get it from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, H5AC_WRITE))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") /* Find the message in the list */ @@ -1970,7 +1970,7 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) cache_udata.f = f; /* Read the rest of the SOHM table information from the cache */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Get index conversion limits */ @@ -2133,7 +2133,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, tbl_cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &tbl_cache_udata, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &tbl_cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and find the message in it */ @@ -2172,7 +2172,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, lst_cache_udata.header = header; /* If the index is stored as a list, get it from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &lst_cache_udata, H5AC_READ))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &lst_cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") /* Find the message in the list */ @@ -2375,7 +2375,7 @@ H5SM_read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, FAIL, "unable to open object header") /* Load the object header from the cache */ - if(NULL == (oh = H5O_protect(&oloc, dxpl_id, H5AC_READ))) + if(NULL == (oh = H5O_protect(&oloc, dxpl_id, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load object header") } /* end if */ else @@ -2530,7 +2530,7 @@ H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, &cache_udata, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") HDfprintf(stream, "%*sShared Message Master Table...\n", indent, ""); @@ -2616,7 +2616,7 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, cache_udata.header = &header; /* Get the list from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, list_addr, &cache_udata, H5AC_READ))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, list_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") HDfprintf(stream, "%*sShared Message List Index...\n", indent, ""); @@ -2693,7 +2693,7 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Get SOHM header size */ diff --git a/src/H5SMcache.c b/src/H5SMcache.c index eaeb889..d8c0824 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -47,12 +47,6 @@ /* Local Macros */ /****************/ -/* Size of stack buffer for serialized tables */ -#define H5SM_TBL_BUF_SIZE 1024 - -/* Size of stack buffer for serialized list indices */ -#define H5SM_LST_BUF_SIZE 1024 - /******************/ /* Local Typedefs */ @@ -64,16 +58,23 @@ /********************/ /* Metadata cache (H5AC) callbacks */ -static H5SM_master_table_t *H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5SM_table_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_master_table_t *table); -static herr_t H5SM_table_dest(H5F_t *f, H5SM_master_table_t* table); -static herr_t H5SM_table_clear(H5F_t *f, H5SM_master_table_t *table, hbool_t destroy); -static herr_t H5SM_table_size(const H5F_t *f, const H5SM_master_table_t *table, size_t *size_ptr); -static H5SM_list_t *H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_list_t *list); -static herr_t H5SM_list_dest(H5F_t *f, H5SM_list_t* list); -static herr_t H5SM_list_clear(H5F_t *f, H5SM_list_t *list, hbool_t destroy); -static herr_t H5SM_list_size(const H5F_t *f, const H5SM_list_t H5_ATTR_UNUSED *list, size_t *size_ptr); +static herr_t H5SM__cache_table_get_load_size(const void *udata, size_t *image_len); +static void *H5SM__cache_table_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5SM__cache_table_image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5SM__cache_table_serialize(const H5F_t *f, void *image, + size_t len, void *thing); +static herr_t H5SM__cache_table_free_icr(void *thing); + +static herr_t H5SM__cache_list_get_load_size(const void *udata, size_t *image_len); +static void *H5SM__cache_list_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5SM__cache_list_image_len(const void *thing, size_t *image_len, + hbool_t *compressed_ptr, size_t *compressed_image_len_ptr); +static herr_t H5SM__cache_list_serialize(const H5F_t *f, void *image, + size_t len, void *thing); +static herr_t H5SM__cache_list_free_icr(void *thing); /*********************/ @@ -82,23 +83,35 @@ static herr_t H5SM_list_size(const H5F_t *f, const H5SM_list_t H5_ATTR_UNUSED *l /* H5SM inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_SOHM_TABLE[1] = {{ - H5AC_SOHM_TABLE_ID, - (H5AC_load_func_t)H5SM_table_load, - (H5AC_flush_func_t)H5SM_table_flush, - (H5AC_dest_func_t)H5SM_table_dest, - (H5AC_clear_func_t)H5SM_table_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5SM_table_size, + H5AC_SOHM_TABLE_ID, /* Metadata client ID */ + "shared message table", /* Metadata client name (for debugging) */ + H5FD_MEM_SOHM_TABLE, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5SM__cache_table_get_load_size, /* 'get_load_size' callback */ + H5SM__cache_table_deserialize, /* 'deserialize' callback */ + H5SM__cache_table_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5SM__cache_table_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5SM__cache_table_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; const H5AC_class_t H5AC_SOHM_LIST[1] = {{ - H5AC_SOHM_LIST_ID, - (H5AC_load_func_t)H5SM_list_load, - (H5AC_flush_func_t)H5SM_list_flush, - (H5AC_dest_func_t)H5SM_list_dest, - (H5AC_clear_func_t)H5SM_list_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)H5SM_list_size, + H5AC_SOHM_LIST_ID, /* Metadata client ID */ + "shared message list", /* Metadata client name (for debugging) */ + H5FD_MEM_SOHM_TABLE, /* File space memory type for client */ + H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */ + H5SM__cache_list_get_load_size, /* 'get_load_size' callback */ + H5SM__cache_list_deserialize, /* 'deserialize' callback */ + H5SM__cache_list_image_len, /* 'image_len' callback */ + NULL, /* 'pre_serialize' callback */ + H5SM__cache_list_serialize, /* 'serialize' callback */ + NULL, /* 'notify' callback */ + H5SM__cache_list_free_icr, /* 'free_icr' callback */ + NULL, /* 'clear' callback */ + NULL, /* 'fsf_size' callback */ }}; @@ -114,32 +127,76 @@ const H5AC_class_t H5AC_SOHM_LIST[1] = {{ /*------------------------------------------------------------------------- - * Function: H5SM_table_load + * Function: H5SM__cache_table_get_load_size() + * + * Purpose: Return the size of the master table of Shared Object Header + * Message indexes on disk. As this cache client doesn't use + * speculative reads, this value should be accurate. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 7/28/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5SM__cache_table_get_load_size(const void *_udata, size_t *image_len) +{ + const H5SM_table_cache_ud_t *udata = (const H5SM_table_cache_ud_t *)_udata; /* User data for callback */ + + FUNC_ENTER_STATIC_NOERR + + /* Check arguments */ + HDassert(udata); + HDassert(udata->f); + HDassert(image_len); + + *image_len = H5SM_TABLE_SIZE(udata->f); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5SM__cache_table_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5SM__cache_table_deserialize * - * Purpose: Loads the master table of Shared Object Header Message - * indexes. + * Purpose: Given a buffer containing the on disk representation of the + * master table of Shared Object Header Message indexes, deserialize + * the table, copy the contents into a newly allocated instance of + * H5SM_master_table_t, and return a pointer to the new instance. * - * Return: Non-negative on success/Negative on failure + * Return: Success: Pointer to in core representation + * Failure: NULL * - * Programmer: James Laird - * November 6, 2006 + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ -static H5SM_master_table_t * -H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void H5_ATTR_UNUSED *udata) +static void * +H5SM__cache_table_deserialize(const void *_image, size_t len, void *_udata, + hbool_t H5_ATTR_UNUSED *dirty) { - H5SM_master_table_t *table = NULL; - 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 u; /* Counter variable for index headers */ - H5SM_master_table_t *ret_value; - - FUNC_ENTER_NOAPI_NOINIT + H5F_t *f; /* File pointer -- from user data */ + H5SM_master_table_t *table = NULL; /* Shared message table that we deserializing */ + H5SM_table_cache_ud_t *udata = (H5SM_table_cache_ud_t *)_udata; /* Pointer to user data */ + const uint8_t *image = (const uint8_t *)_image; /* 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 */ + void * ret_value; /* Return value */ + + FUNC_ENTER_STATIC + + /* Check arguments */ + HDassert(image); + HDassert(len > 0); + HDassert(udata); + HDassert(udata->f); + f = udata->f; + HDassert(dirty); /* Verify that we're reading version 0 of the table; this is the only * version defined so far. @@ -152,35 +209,18 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void H5_ATTR_UNUSED *udat /* Read number of indexes and version from file superblock */ table->num_indexes = H5F_SOHM_NINDEXES(f); - - HDassert(addr == H5F_SOHM_ADDR(f)); - HDassert(addr != HADDR_UNDEF); HDassert(table->num_indexes > 0); - /* Wrap the local buffer for serialized table info */ - if(NULL == (wb = H5WB_wrap(tbl_buf, sizeof(tbl_buf)))) - HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, NULL, "can't wrap buffer") - /* Compute the size of the SOHM table header on disk. This is the "table" * itself plus each index within the table */ table->table_size = H5SM_TABLE_SIZE(f); - - /* Get a pointer to a buffer that's large enough for serialized table */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, table->table_size))) - HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read header from disk */ - if(H5F_block_read(f, H5FD_MEM_SOHM_TABLE, addr, table->table_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_READERROR, NULL, "can't read SOHM table") - - /* Get temporary pointer to serialized table */ - p = buf; + HDassert(table->table_size == len); /* Check magic number */ - if(HDmemcmp(p, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) - HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, NULL, "bad SOHM table signature") - p += H5_SIZEOF_MAGIC; + if(HDmemcmp(image, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, NULL, "bad SOHM table signature") + image += H5_SIZEOF_MAGIC; /* Allocate space for the index headers in memory*/ if(NULL == (table->indexes = (H5SM_index_header_t *)H5FL_ARR_MALLOC(H5SM_index_header_t, (size_t)table->num_indexes))) @@ -189,45 +229,45 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void H5_ATTR_UNUSED *udat /* Read in the index headers */ for(u = 0; u < table->num_indexes; ++u) { /* Verify correct version of index list */ - if(H5SM_LIST_VERSION != *p++) + if(H5SM_LIST_VERSION != *image++) HGOTO_ERROR(H5E_SOHM, H5E_VERSION, NULL, "bad shared message list version number") /* Type of the index (list or B-tree) */ - table->indexes[u].index_type= (H5SM_index_type_t)*p++; + table->indexes[u].index_type= (H5SM_index_type_t)*image++; /* Type of messages in the index */ - UINT16DECODE(p, table->indexes[u].mesg_types); + UINT16DECODE(image, table->indexes[u].mesg_types); /* Minimum size of message to share */ - UINT32DECODE(p, table->indexes[u].min_mesg_size); + UINT32DECODE(image, table->indexes[u].min_mesg_size); /* List cutoff; fewer than this number and index becomes a list */ - UINT16DECODE(p, table->indexes[u].list_max); + UINT16DECODE(image, table->indexes[u].list_max); /* B-tree cutoff; more than this number and index becomes a B-tree */ - UINT16DECODE(p, table->indexes[u].btree_min); + UINT16DECODE(image, table->indexes[u].btree_min); /* Number of messages shared */ - UINT16DECODE(p, table->indexes[u].num_messages); + UINT16DECODE(image, table->indexes[u].num_messages); /* Address of the actual index */ - H5F_addr_decode(f, &p, &(table->indexes[u].index_addr)); + H5F_addr_decode(f, &image, &(table->indexes[u].index_addr)); /* Address of the index's heap */ - H5F_addr_decode(f, &p, &(table->indexes[u].heap_addr)); + H5F_addr_decode(f, &image, &(table->indexes[u].heap_addr)); /* Compute the size of a list index for this SOHM index */ table->indexes[u].list_size = H5SM_LIST_SIZE(f, table->indexes[u].list_max); } /* end for */ /* Read in checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - (const uint8_t *)buf) == table->table_size); + HDassert((size_t)(image - (const uint8_t *)_image) == table->table_size); /* Compute checksum on entire header */ - computed_chksum = H5_checksum_metadata(buf, (table->table_size - H5SM_SIZEOF_CHECKSUM), 0); + computed_chksum = H5_checksum_metadata(_image, (table->table_size - H5SM_SIZEOF_CHECKSUM), 0); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -237,147 +277,169 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void H5_ATTR_UNUSED *udat ret_value = table; done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value && table) if(H5SM_table_free(table) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTFREE, NULL, "unable to destroy sohm table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_table_load() */ +} /* end H5SM__cache_table_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5SM_table_flush + * Function: H5SM__cache_table_image_len * - * Purpose: Flushes (and destroys) the table of Shared Object Header - * Message indexes. + * Purpose: Compute the size in bytes of the specified instance of + * H5SM_master_table_t on disk, and return it in *image_len. + * On failure, the value of *image_len is undefined. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: James Laird - * November 6, 2006 + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ static herr_t -H5SM_table_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_master_table_t *table) +H5SM__cache_table_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - H5WB_t *wb = NULL; /* Wrapped buffer for table data */ - uint8_t tbl_buf[H5SM_TBL_BUF_SIZE]; /* Buffer for table */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5SM_master_table_t *table = (const H5SM_master_table_t *)_thing; /* Shared message table to query */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(table); + HDassert(table->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(table->cache_info.type == H5AC_SOHM_TABLE); + HDassert(image_len); - if(table->cache_info.is_dirty) { - uint8_t *buf; /* Temporary buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - uint32_t computed_chksum; /* Computed metadata checksum value */ - size_t u; /* Counter variable */ + *image_len = table->table_size; - /* Verify that we're writing version 0 of the table; this is the only - * version defined so far. - */ - HDassert(H5F_SOHM_VERS(f) == HDF5_SHAREDHEADER_VERSION); + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5SM__cache_table_image_len() */ - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(tbl_buf, sizeof(tbl_buf)))) - HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "can't wrap buffer") +/***************************************/ +/* no H5SM_cache_table_pre_serialize() */ +/***************************************/ - /* Get a pointer to a buffer that's large enough for serialized table */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, table->table_size))) - HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, FAIL, "can't get actual buffer") + +/*------------------------------------------------------------------------- + * Function: H5SM__cache_table_serialize + * + * Purpose: Serialize the contents of the supplied shared message table, and + * load this data into the supplied buffer. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 7/28/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5SM__cache_table_serialize(const H5F_t *f, void *_image, size_t len, + void *_thing) +{ + H5SM_master_table_t *table = (H5SM_master_table_t *)_thing; /* Shared message table to encode */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint32_t computed_chksum; /* Computed metadata checksum value */ + size_t u; /* Counter variable */ - /* Get temporary pointer to buffer for serialized table */ - p = buf; + FUNC_ENTER_STATIC_NOERR - /* Encode magic number */ - HDmemcpy(p, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; + /* Check arguments */ + HDassert(f); + HDassert(image); + HDassert(table); + HDassert(table->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(table->cache_info.type == H5AC_SOHM_TABLE); + HDassert(table->table_size == len); - /* Encode each index header */ - for(u = 0; u < table->num_indexes; ++u) { - /* Version for this list */ - *p++ = H5SM_LIST_VERSION; + /* Verify that we're writing version 0 of the table; this is the only + * version defined so far. + */ + HDassert(H5F_SOHM_VERS(f) == HDF5_SHAREDHEADER_VERSION); - /* Is message index a list or a B-tree? */ - *p++ = table->indexes[u].index_type; + /* Encode magic number */ + HDmemcpy(image, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; - /* Type of messages in the index */ - UINT16ENCODE(p, table->indexes[u].mesg_types); + /* Encode each index header */ + for(u = 0; u < table->num_indexes; ++u) { + /* Version for this list */ + *image++ = H5SM_LIST_VERSION; - /* Minimum size of message to share */ - UINT32ENCODE(p, table->indexes[u].min_mesg_size); + /* Is message index a list or a B-tree? */ + *image++ = table->indexes[u].index_type; - /* List cutoff; fewer than this number and index becomes a list */ - UINT16ENCODE(p, table->indexes[u].list_max); + /* Type of messages in the index */ + UINT16ENCODE(image, table->indexes[u].mesg_types); - /* B-tree cutoff; more than this number and index becomes a B-tree */ - UINT16ENCODE(p, table->indexes[u].btree_min); + /* Minimum size of message to share */ + UINT32ENCODE(image, table->indexes[u].min_mesg_size); - /* Number of messages shared */ - UINT16ENCODE(p, table->indexes[u].num_messages); + /* List cutoff; fewer than this number and index becomes a list */ + UINT16ENCODE(image, table->indexes[u].list_max); - /* Address of the actual index */ - H5F_addr_encode(f, &p, table->indexes[u].index_addr); + /* B-tree cutoff; more than this number and index becomes a B-tree */ + UINT16ENCODE(image, table->indexes[u].btree_min); - /* Address of the index's heap */ - H5F_addr_encode(f, &p, table->indexes[u].heap_addr); - } /* end for */ + /* Number of messages shared */ + UINT16ENCODE(image, table->indexes[u].num_messages); - /* Compute checksum on buffer */ - computed_chksum = H5_checksum_metadata(buf, (table->table_size - H5SM_SIZEOF_CHECKSUM), 0); - UINT32ENCODE(p, computed_chksum); + /* Address of the actual index */ + H5F_addr_encode(f, &image, table->indexes[u].index_addr); - /* Write the table to disk */ - HDassert((size_t)(p - buf) == table->table_size); - if(H5F_block_write(f, H5FD_MEM_SOHM_TABLE, addr, table->table_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTFLUSH, FAIL, "unable to save sohm table to disk") + /* Address of the index's heap */ + H5F_addr_encode(f, &image, table->indexes[u].heap_addr); + } /* end for */ - table->cache_info.is_dirty = FALSE; - } /* end if */ + /* Compute checksum on buffer */ + computed_chksum = H5_checksum_metadata(_image, (table->table_size - H5SM_SIZEOF_CHECKSUM), 0); + UINT32ENCODE(image, computed_chksum); - if(destroy) - if(H5SM_table_dest(f, table) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTFREE, FAIL, "unable to destroy sohm table") + /* sanity check */ + HDassert((size_t)(image - ((uint8_t *)_image)) == table->table_size); -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5SM__cache_table_serialize() */ - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_table_flush() */ +/*****************************************/ +/* no H5SM_cache_table_notify() function */ +/*****************************************/ /*------------------------------------------------------------------------- - * Function: H5SM_table_dest + * Function: H5SM__cache_table_free_icr * - * Purpose: Frees memory used by the SOHM table. + * Purpose: Free memory used by the SOHM table. * - * Return: Non-negative on success/Negative on failure + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). * - * Programmer: James Laird - * November 6, 2006 + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ static herr_t -H5SM_table_dest(H5F_t H5_ATTR_UNUSED *f, H5SM_master_table_t* table) +H5SM__cache_table_free_icr(void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5SM_master_table_t *table = (H5SM_master_table_t *)_thing; /* Shared message table to release */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(table); - HDassert(table->indexes); + HDassert(table->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(table->cache_info.type == H5AC_SOHM_TABLE); /* Destroy Shared Object Header Message table */ if(H5SM_table_free(table) < 0) @@ -385,105 +447,80 @@ H5SM_table_dest(H5F_t H5_ATTR_UNUSED *f, H5SM_master_table_t* table) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_table_dest() */ +} /* end H5SM_cache_table_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5SM_table_clear + * Function: H5SM__cache_list_get_load_size() * - * Purpose: Mark this table as no longer being dirty. + * Purpose: Return the on disk size of list of SOHM messages. In this case, + * we simply look up the size in the user data, and return that value + * in *image_len. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: James Laird - * November 6, 2006 + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ static herr_t -H5SM_table_clear(H5F_t *f, H5SM_master_table_t *table, hbool_t destroy) +H5SM__cache_list_get_load_size(const void *_udata, size_t *image_len) { - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* - * Check arguments. - */ - HDassert(table); - - /* Reset the dirty flag. */ - table->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5SM_table_dest(f, table) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTFREE, FAIL, "unable to delete SOHM master table") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_table_clear() */ + const H5SM_list_cache_ud_t *udata = (const H5SM_list_cache_ud_t *)_udata; /* User data for callback */ - -/*------------------------------------------------------------------------- - * Function: H5SM_table_size - * - * Purpose: Returns the size of the table encoded on disk. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: James Laird - * November 6, 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5SM_table_size(const H5F_t H5_ATTR_UNUSED *f, const H5SM_master_table_t *table, size_t *size_ptr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments */ - HDassert(f); - HDassert(table); - HDassert(size_ptr); + HDassert(udata); + HDassert(udata->header); + HDassert(udata->header->list_size > 0); + HDassert(image_len); - /* Set size value */ - *size_ptr = table->table_size; + *image_len = udata->header->list_size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_table_size() */ +} /* end H5SM__cache_list_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5SM_list_load + * Function: H5SM__cache_list_deserialize * - * Purpose: Loads a list of SOHM messages. + * Purpose: Given a buffer containing the on disk image of a list of + * SOHM message, deserialize the list, load it into a newly allocated + * instance of H5SM_list_t, and return a pointer to same. * - * Return: Non-negative on success/Negative on failure + * Return: Success: Pointer to in core representation + * Failure: NULL * - * Programmer: James Laird - * November 6, 2006 + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ -static H5SM_list_t * -H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5SM__cache_list_deserialize(const void *_image, size_t len, void *_udata, + hbool_t H5_ATTR_UNUSED *dirty) { - H5SM_list_t *list; /* The SOHM list being read in */ - H5SM_list_cache_ud_t *udata = (H5SM_list_cache_ud_t *)_udata; /* User data for callback */ - H5SM_bt2_ctx_t ctx; /* Message encoding context */ - H5WB_t *wb = NULL; /* Wrapped buffer for list index data */ - uint8_t lst_buf[H5SM_LST_BUF_SIZE]; /* Buffer for list index */ - uint8_t *buf; /* Reading buffer */ - 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 messages in list */ - H5SM_list_t *ret_value; /* Return value */ + H5SM_list_t *list = NULL; /* The SOHM list being read in */ + H5SM_list_cache_ud_t *udata = (H5SM_list_cache_ud_t *)_udata; /* User data for callback */ + H5SM_bt2_ctx_t ctx; /* Message encoding context */ + const uint8_t *image = (const uint8_t *)_image; /* 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 messages in list */ + void * ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ + HDassert(image); + HDassert(len > 0); + HDassert(udata); HDassert(udata->header); + HDassert(udata->header->list_size == len); + HDassert(dirty); /* Allocate space for the SOHM list data structure */ if(NULL == (list = H5FL_MALLOC(H5SM_list_t))) @@ -495,42 +532,28 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "file allocation failed for SOHM list") list->header = udata->header; - /* Wrap the local buffer for serialized list index info */ - if(NULL == (wb = H5WB_wrap(lst_buf, sizeof(lst_buf)))) - HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, NULL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for serialized list index */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, udata->header->list_size))) - HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read list from disk */ - if(H5F_block_read(f, H5FD_MEM_SOHM_INDEX, addr, udata->header->list_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_READERROR, NULL, "can't read SOHM list") - - /* Get temporary pointer to serialized list index */ - p = buf; - /* Check magic number */ - if(HDmemcmp(p, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(image, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC)) HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, NULL, "bad SOHM list signature") - p += H5_SIZEOF_MAGIC; + image += H5_SIZEOF_MAGIC; /* Read messages into the list array */ ctx.sizeof_addr = H5F_SIZEOF_ADDR(udata->f); for(u = 0; u < udata->header->num_messages; u++) { - if(H5SM_message_decode(p, &(list->messages[u]), &ctx) < 0) + if(H5SM_message_decode(image, &(list->messages[u]), &ctx) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, NULL, "can't decode shared message") - p += H5SM_SOHM_ENTRY_SIZE(udata->f); + + image += H5SM_SOHM_ENTRY_SIZE(udata->f); } /* end for */ /* Read in checksum */ - UINT32DECODE(p, stored_chksum); + UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - buf) <= udata->header->list_size); + HDassert((size_t)(image - (const uint8_t *)_image) <= udata->header->list_size); /* Compute checksum on entire header */ - computed_chksum = H5_checksum_metadata(buf, ((size_t)(p - buf) - H5SM_SIZEOF_CHECKSUM), 0); + computed_chksum = H5_checksum_metadata(_image, ((size_t)(image - (const uint8_t *)_image) - H5SM_SIZEOF_CHECKSUM), 0); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -544,9 +567,6 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) ret_value = list; done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value && list) { if(list->messages) list->messages = H5FL_ARR_FREE(H5SM_sohm_t, list->messages); @@ -554,205 +574,158 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_list_load() */ +} /* end H5SM__cache_list_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5SM_list_flush + * Function: H5SM__cache_list_image_len * - * Purpose: Flush this list index. + * Purpose: Get the size of the shared message list on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: James Laird - * November 6, 2006 + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ static herr_t -H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_list_t *list) +H5SM__cache_list_image_len(const void *_thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr) { - H5WB_t *wb = NULL; /* Wrapped buffer for list index data */ - uint8_t lst_buf[H5SM_LST_BUF_SIZE]; /* Buffer for list index */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5SM_list_t *list = (const H5SM_list_t *)_thing; /* Shared message list to query */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(list); + HDassert(list->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(list->cache_info.type == H5AC_SOHM_LIST); HDassert(list->header); + HDassert(image_len); - if(list->cache_info.is_dirty) { - H5SM_bt2_ctx_t ctx; /* Message encoding context */ - uint8_t *buf; /* Temporary buffer */ - 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 u; /* Local index variable */ - - /* Wrap the local buffer for serialized list index info */ - if(NULL == (wb = H5WB_wrap(lst_buf, sizeof(lst_buf)))) - HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for serialized list index */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, list->header->list_size))) - HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, FAIL, "can't get actual buffer") - - /* Get temporary pointer to buffer for serialized list index */ - p = buf; - - /* Encode magic number */ - HDmemcpy(p, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += H5_SIZEOF_MAGIC; - - /* Write messages from the messages array to disk */ - mesgs_written = 0; - ctx.sizeof_addr = H5F_SIZEOF_ADDR(f); - 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); - ++mesgs_written; - } /* end if */ - } /* end for */ - HDassert(mesgs_written == list->header->num_messages); - - /* Compute checksum on buffer */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); - UINT32ENCODE(p, computed_chksum); -#ifdef H5_CLEAR_MEMORY -HDmemset(p, 0, (list->header->list_size - (size_t)(p - buf))); -#endif /* H5_CLEAR_MEMORY */ + *image_len = list->header->list_size; - /* Write the list to disk */ - HDassert((size_t)(p - buf) <= list->header->list_size); - if(H5F_block_write(f, H5FD_MEM_SOHM_INDEX, addr, list->header->list_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTFLUSH, FAIL, "unable to save sohm table to disk") - - list->cache_info.is_dirty = FALSE; - } /* end if */ - - if(destroy) - if(H5SM_list_dest(f, list) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTFREE, FAIL, "unable to destroy list") - -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5SM__cache_list_image_len() */ - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_list_flush() */ +/**************************************/ +/* no H5SM_cache_list_pre_serialize() */ +/**************************************/ /*------------------------------------------------------------------------- - * Function: H5SM_list_dest + * Function: H5SM__cache_list_serialize * - * Purpose: Frees all memory used by the list. + * Purpose: Serialize the contents of the supplied shared message list, and + * load this data into the supplied buffer. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: James Laird - * November 6, 2006 + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ static herr_t -H5SM_list_dest(H5F_t *f, H5SM_list_t* list) +H5SM__cache_list_serialize(const H5F_t *f, void *_image, size_t len, + void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5SM_list_t *list = (H5SM_list_t *)_thing ; /* Instance being serialized */ + H5SM_bt2_ctx_t ctx; /* Message encoding context */ + uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ + uint32_t computed_chksum; /* Computed metadata checksum value */ + size_t mesgs_serialized; /* Number of messages serialized */ + size_t u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - /* Sanity check */ + /* Check arguments */ + HDassert(f); + HDassert(image); HDassert(list); + HDassert(list->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(list->cache_info.type == H5AC_SOHM_LIST); HDassert(list->header); - HDassert(list->messages); + HDassert(list->header->list_size == len); + + /* Encode magic number */ + HDmemcpy(image, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC); + image += H5_SIZEOF_MAGIC; + + /* serialize messages from the messages array */ + mesgs_serialized = 0; + ctx.sizeof_addr = H5F_SIZEOF_ADDR(f); + for(u = 0; ((u < list->header->list_max) && (mesgs_serialized < list->header->num_messages)); u++) { + if(list->messages[u].location != H5SM_NO_LOC) { + if(H5SM_message_encode(image, &(list->messages[u]), &ctx) < 0) + HGOTO_ERROR(H5E_SOHM, H5E_CANTFLUSH, FAIL, "unable to serialize shared message") + + image += H5SM_SOHM_ENTRY_SIZE(f); + ++mesgs_serialized; + } /* end if */ + } /* end for */ - /* If we're going to free the space on disk, the address must be valid */ - HDassert(!list->cache_info.free_file_space_on_destroy || H5F_addr_defined(list->cache_info.addr)); + HDassert(mesgs_serialized == list->header->num_messages); - /* Check for freeing file space for shared message index list */ - if(list->cache_info.free_file_space_on_destroy) { - /* Release the space on disk */ - /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_SOHM_INDEX, H5AC_dxpl_id, list->cache_info.addr, (hsize_t)list->header->list_size) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, FAIL, "unable to free shared message list") - } /* end if */ + /* Compute checksum on buffer */ + computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0); + UINT32ENCODE(image, computed_chksum); - /* Destroy Shared Object Header Message list */ - if(H5SM_list_free(list) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTRELEASE, FAIL, "unable to free shared message list") +#ifdef H5_CLEAR_MEMORY + HDmemset(image, 0, (list->header->list_size - (size_t)(image - (uint8_t *)_image))); +#endif /* H5_CLEAR_MEMORY */ + + /* sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) <= list->header->list_size); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_list_dest() */ +} /* end H5SM__cache_list_serialize() */ + +/****************************************/ +/* no H5SM_cache_list_notify() function */ +/****************************************/ /*------------------------------------------------------------------------- - * Function: H5SM_list_clear + * Function: H5SM__cache_list_free_icr * - * Purpose: Marks a list as not dirty. + * Purpose: Free all memory used by the list. * - * Return: Non-negative on success/Negative on failure + * Note: The metadata cache sets the object's cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr + * callback (checked in assert). * - * Programmer: James Laird - * November 6, 2006 + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 7/28/14 * *------------------------------------------------------------------------- */ static herr_t -H5SM_list_clear(H5F_t *f, H5SM_list_t *list, hbool_t destroy) +H5SM__cache_list_free_icr(void *_thing) { - herr_t ret_value = SUCCEED; /* Return value */ + H5SM_list_t *list = (H5SM_list_t *)_thing; /* Shared message list to release */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(list); + HDassert(list->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert(list->cache_info.type == H5AC_SOHM_LIST); - /* Reset the dirty flag. */ - list->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5SM_list_dest(f, list) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTFREE, FAIL, "unable to destroy SOHM list") + /* Destroy Shared Object Header Message list */ + if(H5SM_list_free(list) < 0) + HGOTO_ERROR(H5E_SOHM, H5E_CANTRELEASE, FAIL, "unable to free shared message list") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end of H5SM_list_clear() */ - - -/*------------------------------------------------------------------------- - * Function: H5SM_list_size - * - * Purpose: Gets the size of a list on disk. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: James Laird - * November 6, 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5SM_list_size(const H5F_t H5_ATTR_UNUSED *f, const H5SM_list_t *list, size_t *size_ptr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* check arguments */ - HDassert(f); - HDassert(list); - HDassert(list->header); - HDassert(size_ptr); - - /* Set size value */ - *size_ptr = list->header->list_size; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_list_size() */ +} /* end H5O_cache_list_free_icr() */ diff --git a/src/H5SMtest.c b/src/H5SMtest.c index 12ed766..c4e02bc 100644 --- a/src/H5SMtest.c +++ b/src/H5SMtest.c @@ -98,7 +98,7 @@ H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index for this message type */ diff --git a/test/cache.c b/test/cache.c index 85fbadb..a98a995 100644 --- a/test/cache.c +++ b/test/cache.c @@ -19,7 +19,6 @@ * This file contains tests for the cache implemented in * H5C.c */ -#include "H5private.h" /* Put this first, so H5open() isn't invoked in public macros */ #include "h5test.h" #include "H5Iprivate.h" #include "H5ACprivate.h" @@ -35,9 +34,8 @@ struct flush_cache_test_spec int entry_index; hbool_t insert_flag; unsigned int flags; - hbool_t expected_loaded; - hbool_t expected_cleared; - hbool_t expected_flushed; + hbool_t expected_deserialized; + hbool_t expected_serialized; hbool_t expected_destroyed; }; @@ -51,9 +49,8 @@ struct pe_flush_cache_test_spec int num_pins; int pin_type[MAX_PINS]; int pin_idx[MAX_PINS]; - hbool_t expected_loaded; - hbool_t expected_cleared; - hbool_t expected_flushed; + hbool_t expected_deserialized; + hbool_t expected_serialized; hbool_t expected_destroyed; }; @@ -68,9 +65,8 @@ struct fo_flush_entry_check hbool_t is_dirty; hbool_t is_protected; hbool_t is_pinned; - hbool_t expected_loaded; - hbool_t expected_cleared; - hbool_t expected_flushed; + hbool_t expected_deserialized; + hbool_t expected_serialized; hbool_t expected_destroyed; }; @@ -88,9 +84,8 @@ struct fo_flush_cache_test_spec int pin_idx[MAX_PINS]; int num_flush_ops; struct flush_op flush_ops[MAX_FLUSH_OPS]; - hbool_t expected_loaded; - hbool_t expected_cleared; - hbool_t expected_flushed; + hbool_t expected_deserialized; + hbool_t expected_serialized; hbool_t expected_destroyed; }; @@ -105,17 +100,17 @@ struct move_entry_test_spec /* private function declarations: */ -static unsigned smoke_check_1(void); -static unsigned smoke_check_2(void); -static unsigned smoke_check_3(void); -static unsigned smoke_check_4(void); -static unsigned smoke_check_5(void); -static unsigned smoke_check_6(void); -static unsigned smoke_check_7(void); -static unsigned smoke_check_8(void); -static unsigned smoke_check_9(void); -static unsigned smoke_check_10(void); -static unsigned write_permitted_check(void); +static unsigned smoke_check_1(int express_test); +static unsigned smoke_check_2(int express_test); +static unsigned smoke_check_3(int express_test); +static unsigned smoke_check_4(int express_test); +static unsigned smoke_check_5(int express_test); +static unsigned smoke_check_6(int express_test); +static unsigned smoke_check_7(int express_test); +static unsigned smoke_check_8(int express_test); +static unsigned smoke_check_9(int express_test); +static unsigned smoke_check_10(int express_test); +static unsigned write_permitted_check(int express_test); static unsigned check_insert_entry(void); static unsigned check_flush_cache(void); static void check_flush_cache__empty_cache(H5F_t * file_ptr); @@ -138,22 +133,21 @@ static void check_flush_cache__single_entry_test(H5F_t * file_ptr, hbool_t insert_flag, unsigned int flags, unsigned int flush_flags, - hbool_t expected_loaded, - hbool_t expected_cleared, - hbool_t expected_flushed, + hbool_t expected_deserialized, + hbool_t expected_serialized, hbool_t expected_destroyed); static void check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, int test_num, int entry_type, int entry_idx, + hbool_t unprot_dirty_flag, hbool_t mark_dirty, hbool_t pop_mark_dirty_prot, hbool_t pop_mark_dirty_pinned, hbool_t unprotect_unpin, unsigned int flags, unsigned int flush_flags, - hbool_t expected_cleared, - hbool_t expected_flushed, + hbool_t expected_serialized, hbool_t expected_destroyed); static void check_flush_cache__flush_ops(H5F_t * file_ptr); static void check_flush_cache__flush_op_test(H5F_t * file_ptr, @@ -168,7 +162,6 @@ static void check_flush_cache__flush_op_test(H5F_t * file_ptr, int check_size, struct fo_flush_entry_check check[]); static void check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr); -static unsigned check_flush_protected_err(void); static unsigned check_get_entry_status(void); static unsigned check_expunge_entry(void); static unsigned check_multiple_read_protect(void); @@ -178,6 +171,7 @@ static void check_move_entry__run_test(H5F_t * file_ptr, int test_num, static unsigned check_pin_protected_entry(void); static unsigned check_resize_entry(void); static unsigned check_evictions_enabled(void); +static unsigned check_flush_protected_err(void); static unsigned check_destroy_pinned_err(void); static unsigned check_destroy_protected_err(void); static unsigned check_duplicate_insert_err(void); @@ -203,6 +197,15 @@ static unsigned check_flush_deps(void); static unsigned check_flush_deps_err(void); static unsigned check_flush_deps_order(void); static unsigned check_notify_cb(void); +static unsigned check_entry_deletions_during_scans(void); +static void cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr); +static void cedds__H5C_make_space_in_cache(H5F_t * file_ptr); +static void cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr); +static void cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr); +static unsigned check_stats(void); +#if H5C_COLLECT_CACHE_STATS +static void check_stats__smoke_check_1(H5F_t * file_ptr); +#endif /* H5C_COLLECT_CACHE_STATS */ /**************************************************************************/ @@ -223,32 +226,42 @@ static unsigned check_notify_cb(void); * Programmer: John Mainzer * 6/16/04 * - * Modifications: - * - * JRM -- 1/18/05 - * Added code to skip this test if the skip_long_tests global - * is true. - * *------------------------------------------------------------------------- */ static unsigned -smoke_check_1(void) +smoke_check_1(int express_test) { hbool_t show_progress = FALSE; int dirty_unprotects = FALSE; int dirty_destroys = FALSE; hbool_t display_stats = FALSE; int32_t lag = 10; + int32_t max_index = (10 * 1024) - 1; int mile_stone = 1; H5F_t * file_ptr = NULL; TESTING("smoke check #1 -- all clean, ins, dest, ren, 4/2 MB cache"); - if ( skip_long_tests ) { - SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; + + case 1: + max_index = (1 * 1024) - 1; + break; + + case 2: + max_index = (512) - 1; + break; + + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -271,6 +284,7 @@ smoke_check_1(void) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -289,6 +303,7 @@ smoke_check_1(void) FUNC, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -307,6 +322,7 @@ smoke_check_1(void) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -336,6 +352,7 @@ smoke_check_1(void) FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -360,6 +377,7 @@ smoke_check_1(void) FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -407,32 +425,42 @@ smoke_check_1(void) * Programmer: John Mainzer * 6/24/04 * - * Modifications: - * - * JRM -- 1/18/05 - * Added code to skip this test if the skip_long_tests global - * is true. - * *------------------------------------------------------------------------- */ static unsigned -smoke_check_2(void) +smoke_check_2(int express_test) { hbool_t show_progress = FALSE; int dirty_unprotects = TRUE; int dirty_destroys = TRUE; hbool_t display_stats = FALSE; + int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; H5F_t * file_ptr = NULL; TESTING("smoke check #2 -- ~1/2 dirty, ins, dest, ren, 4/2 MB cache"); - if ( skip_long_tests ) { - SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; + + case 1: + max_index = (1 * 1024) - 1; + break; + + case 2: + max_index = (512) - 1; + break; + + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -455,6 +483,7 @@ smoke_check_2(void) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -473,6 +502,7 @@ smoke_check_2(void) FUNC, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -491,6 +521,7 @@ smoke_check_2(void) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -520,6 +551,7 @@ smoke_check_2(void) FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -544,6 +576,7 @@ smoke_check_2(void) FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -590,32 +623,42 @@ smoke_check_2(void) * Programmer: John Mainzer * 6/16/04 * - * Modifications: - * - * JRM -- 1/18/05 - * Added code to skip this test if the skip_long_tests global - * is true. - * *------------------------------------------------------------------------- */ static unsigned -smoke_check_3(void) +smoke_check_3(int express_test) { hbool_t show_progress = FALSE; int dirty_unprotects = FALSE; int dirty_destroys = FALSE; hbool_t display_stats = FALSE; + int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; H5F_t * file_ptr = NULL; TESTING("smoke check #3 -- all clean, ins, dest, ren, 2/1 KB cache"); - if ( skip_long_tests ) { - SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; + + case 1: + max_index = (1 * 1024) - 1; + break; + + case 2: + max_index = (512) - 1; + break; + + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -638,6 +681,7 @@ smoke_check_3(void) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -656,6 +700,7 @@ smoke_check_3(void) FUNC, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -674,6 +719,7 @@ smoke_check_3(void) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -703,6 +749,7 @@ smoke_check_3(void) FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -727,6 +774,7 @@ smoke_check_3(void) FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -774,32 +822,42 @@ smoke_check_3(void) * Programmer: John Mainzer * 6/24/04 * - * Modifications: - * - * JRM -- 1/18/05 - * Added code to skip this test if the skip_long_tests global - * is true. - * *------------------------------------------------------------------------- */ static unsigned -smoke_check_4(void) +smoke_check_4(int express_test) { hbool_t show_progress = FALSE; int dirty_unprotects = TRUE; int dirty_destroys = TRUE; hbool_t display_stats = FALSE; + int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; H5F_t * file_ptr = NULL; TESTING("smoke check #4 -- ~1/2 dirty, ins, dest, ren, 2/1 KB cache"); - if ( skip_long_tests ) { - SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; + + case 1: + max_index = (1 * 1024) - 1; + break; + + case 2: + max_index = (512) - 1; + break; + + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -822,6 +880,7 @@ smoke_check_4(void) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -840,6 +899,7 @@ smoke_check_4(void) FUNC, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -858,6 +918,7 @@ smoke_check_4(void) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -887,6 +948,7 @@ smoke_check_4(void) FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -911,6 +973,7 @@ smoke_check_4(void) FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -958,17 +1021,11 @@ smoke_check_4(void) * Programmer: John Mainzer * 10/14/04 * - * Modifications: - * - * JRM -- 1/18/05 - * Added code to skip this test if the skip_long_tests global - * is true. - * *------------------------------------------------------------------------- */ static unsigned -smoke_check_5(void) +smoke_check_5(int express_test) { herr_t result; hbool_t show_progress = FALSE; @@ -1029,18 +1086,25 @@ smoke_check_5(void) TESTING("smoke check #5 -- all clean, ins, prot, unprot, AR cache 1"); - if ( skip_long_tests ) { - - SKIPPED(); - - HDfprintf(stdout, " Long tests disabled.\n"); + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; - return 0; /* <========== note return */ - } + case 1: + max_index = (1 * 1024) - 1; + break; - if ( run_full_test ) { + case 2: + max_index = (512) - 1; + break; - max_index = (10 * 1024) - 1; + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -1193,17 +1257,11 @@ smoke_check_5(void) * Programmer: John Mainzer * 10/25/04 * - * Modifications: - * - * JRM -- 1/18/05 - * Added code to skip this test if the skip_long_tests global - * is true. - * *------------------------------------------------------------------------- */ static unsigned -smoke_check_6(void) +smoke_check_6(int express_test) { herr_t result; hbool_t show_progress = FALSE; @@ -1266,15 +1324,25 @@ smoke_check_6(void) pass = TRUE; - if ( skip_long_tests ) { - SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ - } + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; - if ( run_full_test ) { + case 1: + max_index = (1 * 1024) - 1; + break; - max_index = (10 * 1024) - 1; + case 2: + max_index = (512) - 1; + break; + + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } if ( show_progress ) /* 1 */ @@ -1425,17 +1493,11 @@ smoke_check_6(void) * Programmer: John Mainzer * 12/2/04 * - * Modifications: - * - * JRM -- 1/18/05 - * Added code to skip this test if the skip_long_tests global - * is true. - * *------------------------------------------------------------------------- */ static unsigned -smoke_check_7(void) +smoke_check_7(int express_test) { herr_t result; hbool_t show_progress = FALSE; @@ -1497,15 +1559,25 @@ smoke_check_7(void) TESTING("smoke check #7 -- all clean, ins, prot, unprot, AR cache 2"); - if ( skip_long_tests ) { - SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ - } + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; - if ( run_full_test ) { + case 1: + max_index = (1 * 1024) - 1; + break; - max_index = (10 * 1024) - 1; + case 2: + max_index = (512) - 1; + break; + + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -1658,17 +1730,11 @@ smoke_check_7(void) * Programmer: John Mainzer * 10/25/04 * - * Modifications: - * - * JRM -- 1/18/05 - * Added code to skip this test if the skip_long_tests global - * is true. - * *------------------------------------------------------------------------- */ static unsigned -smoke_check_8(void) +smoke_check_8(int express_test) { herr_t result; hbool_t show_progress = FALSE; @@ -1730,15 +1796,25 @@ smoke_check_8(void) TESTING("smoke check #8 -- ~1/2 dirty, ins, prot, unprot, AR cache 2"); - if ( skip_long_tests ) { - SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ - } + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; - if ( run_full_test ) { + case 1: + max_index = (1 * 1024) - 1; + break; - max_index = (10 * 1024) - 1; + case 2: + max_index = (512) - 1; + break; + + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -1901,7 +1977,7 @@ smoke_check_8(void) */ static unsigned -smoke_check_9(void) +smoke_check_9(int express_test) { herr_t result; hbool_t show_progress = FALSE; @@ -1909,6 +1985,7 @@ smoke_check_9(void) int dirty_destroys = FALSE; hbool_t display_stats = FALSE; hbool_t display_detailed_stats = FALSE; + int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; H5F_t * file_ptr = NULL; @@ -1916,10 +1993,25 @@ smoke_check_9(void) TESTING("smoke check #9 -- all clean, ins, dest, ren, 4/2 MB, corked"); - if ( skip_long_tests ) { - SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; + + case 1: + max_index = (1 * 1024) - 1; + break; + + case 2: + max_index = (512) - 1; + break; + + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -1960,6 +2052,7 @@ smoke_check_9(void) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1995,6 +2088,7 @@ smoke_check_9(void) FUNC, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2028,6 +2122,7 @@ smoke_check_9(void) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2087,6 +2182,7 @@ smoke_check_9(void) FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2126,6 +2222,7 @@ smoke_check_9(void) FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2200,7 +2297,7 @@ smoke_check_9(void) */ static unsigned -smoke_check_10(void) +smoke_check_10(int express_test) { herr_t result; hbool_t show_progress = FALSE; @@ -2208,6 +2305,7 @@ smoke_check_10(void) int dirty_destroys = TRUE; hbool_t display_stats = FALSE; hbool_t display_detailed_stats = FALSE; + int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; H5F_t * file_ptr = NULL; @@ -2215,10 +2313,25 @@ smoke_check_10(void) TESTING("smoke check #10 -- ~1/2 dirty, ins, dest, ren, 4/2 MB, corked"); - if ( skip_long_tests ) { - SKIPPED(); - HDfprintf(stdout, " Long tests disabled.\n"); - return 0; /* <========== note return */ + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; + + case 1: + max_index = (1 * 1024) - 1; + break; + + case 2: + max_index = (512) - 1; + break; + + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -2242,6 +2355,7 @@ smoke_check_10(void) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2275,6 +2389,7 @@ smoke_check_10(void) FUNC, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2308,6 +2423,7 @@ smoke_check_10(void) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2367,6 +2483,7 @@ smoke_check_10(void) FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2421,6 +2538,7 @@ smoke_check_10(void) FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2489,13 +2607,18 @@ smoke_check_10(void) *------------------------------------------------------------------------- */ static unsigned -write_permitted_check(void) +write_permitted_check(int +#if !H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS +H5_ATTR_UNUSED +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ +express_test) { #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS hbool_t show_progress = FALSE; hbool_t display_stats = FALSE; + int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; H5F_t * file_ptr = NULL; @@ -2506,6 +2629,27 @@ write_permitted_check(void) #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; + + case 1: + max_index = (1 * 1024) - 1; + break; + + case 2: + max_index = (512) - 1; + break; + + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; + } + pass = TRUE; if ( show_progress ) /* 1 */ @@ -2526,6 +2670,7 @@ write_permitted_check(void) FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2546,6 +2691,7 @@ write_permitted_check(void) write_permitted = FALSE; row_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2566,6 +2712,7 @@ write_permitted_check(void) write_permitted = TRUE; row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2595,6 +2742,7 @@ write_permitted_check(void) FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2610,6 +2758,7 @@ write_permitted_check(void) write_permitted = FALSE; col_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -3076,8 +3225,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); if ( result < 0 ) { @@ -3088,8 +3236,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -3100,8 +3247,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_CLEAR_ONLY_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_CLEAR_ONLY_FLAG); if ( result < 0 ) { @@ -3113,8 +3259,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_MARKED_ENTRIES_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_MARKED_ENTRIES_FLAG); if ( result < 0 ) { @@ -3175,9 +3320,8 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 100, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -3186,9 +3330,8 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 75, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -3197,9 +3340,8 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 25, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -3207,10 +3349,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -3219,9 +3360,8 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 10, /* insert_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -3230,9 +3370,8 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 20, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -3241,20 +3380,18 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 30, /* insert_flag = */ TRUE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 7, + /* entry_num = */ 7, /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -3272,92 +3409,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } }; @@ -3374,92 +3503,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE } }; @@ -3476,92 +3597,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } }; @@ -3579,92 +3692,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE - }, - { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE } }; @@ -3682,92 +3787,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } }; @@ -3785,92 +3882,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE } }; @@ -3889,92 +3978,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE } }; @@ -3995,92 +4076,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } }; @@ -4102,144 +4175,136 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct pe_flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 2, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 2, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 3, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 3, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 4, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 4, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 5, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 5, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 6, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 6, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 7, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, 30, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 7, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, 30, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } }; @@ -4256,128 +4321,120 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct pe_flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 2, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1}, + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 2, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1}, /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 3, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 3, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, - -1, -1, -1, -1 -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {10, -1, -1, -1 -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, + -1, -1, -1, -1 -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {10, -1, -1, -1 -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 2, - /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {10, 20, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 2, + /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {10, 20, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 3, - /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {10, 20, 30, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 3, + /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {10, 20, 30, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } }; @@ -4394,119 +4451,111 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct pe_flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE } }; @@ -4524,127 +4573,119 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct pe_flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 4, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* num_pins = */ 4, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 4, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 4, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } }; @@ -4663,123 +4704,115 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct pe_flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE - }, - { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE } }; @@ -4897,7 +4930,7 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, flush_flags); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -4915,21 +4948,18 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, base_addr = entries[spec[i].entry_type]; entry_ptr = &(base_addr[spec[i].entry_index]); - if ( ( entry_ptr->loaded != spec[i].expected_loaded ) || - ( entry_ptr->cleared != spec[i].expected_cleared ) || - ( entry_ptr->flushed != spec[i].expected_flushed ) || + if ( ( entry_ptr->deserialized != spec[i].expected_deserialized ) || + ( entry_ptr->serialized != spec[i].expected_serialized ) || ( entry_ptr->destroyed != spec[i].expected_destroyed ) ) { #if 0 /* This is useful debugging code. Lets keep it around. */ HDfprintf(stdout, - "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->loaded), - (int)(spec[i].expected_loaded), - (int)(entry_ptr->cleared), - (int)(spec[i].expected_cleared), - (int)(entry_ptr->flushed), - (int)(spec[i].expected_flushed), + "deslzd = %d(%d), slzd = %d(%d), dest = %d(%d)\n", + (int)(entry_ptr->deserialized), + (int)(spec[i].expected_deserialized), + (int)(entry_ptr->serialized), + (int)(spec[i].expected_serialized), (int)(entry_ptr->destroyed), (int)(spec[i].expected_destroyed)); @@ -4974,8 +5004,7 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -5003,10 +5032,9 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, base_addr = entries[spec[i].entry_type]; entry_ptr = &(base_addr[spec[i].entry_index]); - entry_ptr->loaded = FALSE; - entry_ptr->cleared = FALSE; - entry_ptr->flushed = FALSE; - entry_ptr->destroyed = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->serialized = FALSE; + entry_ptr->destroyed = FALSE; i++; } @@ -5133,8 +5161,7 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - flush_flags); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -5152,21 +5179,18 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, base_addr = entries[spec[i].entry_type]; entry_ptr = &(base_addr[spec[i].entry_index]); - if ( ( entry_ptr->loaded != spec[i].expected_loaded ) || - ( entry_ptr->cleared != spec[i].expected_cleared ) || - ( entry_ptr->flushed != spec[i].expected_flushed ) || + if ( ( entry_ptr->deserialized != spec[i].expected_deserialized ) || + ( entry_ptr->serialized != spec[i].expected_serialized ) || ( entry_ptr->destroyed != spec[i].expected_destroyed ) ) { #if 0 /* This is useful debugging code. Lets keep it around. */ HDfprintf(stdout, - "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->loaded), - (int)(spec[i].expected_loaded), - (int)(entry_ptr->cleared), - (int)(spec[i].expected_cleared), - (int)(entry_ptr->flushed), - (int)(spec[i].expected_flushed), + "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", + (int)(entry_ptr->deserialized), + (int)(spec[i].expected_deserialized), + (int)(entry_ptr->serialized), + (int)(spec[i].expected_serialized), (int)(entry_ptr->destroyed), (int)(spec[i].expected_destroyed)); @@ -5211,8 +5235,7 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -5240,10 +5263,9 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, base_addr = entries[spec[i].entry_type]; entry_ptr = &(base_addr[spec[i].entry_index]); - entry_ptr->loaded = FALSE; - entry_ptr->cleared = FALSE; - entry_ptr->flushed = FALSE; - entry_ptr->destroyed = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->serialized = FALSE; + entry_ptr->destroyed = FALSE; i++; } @@ -5330,9 +5352,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -5359,9 +5380,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -5378,9 +5398,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5440,9 +5459,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -5469,9 +5487,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -5488,9 +5505,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5528,7 +5544,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 0, /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 4, /* num_pins = */ 0, @@ -5547,9 +5563,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -5566,9 +5581,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5608,7 +5622,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 0, /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 4, /* num_pins = */ 0, @@ -5627,9 +5641,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -5646,9 +5659,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5669,11 +5681,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) if ( pass ) /* test #5 & #6 */ { /* Single entry test verifying that the cache can handle the case in - * which the call back function moves the entry for which it has - * been called. + * which the call back function first resizes and then moves the + * entry for which it has been called. * * Run this entry twice, as the first run moves the entry to its * alternate address, and the second moves it back. + * + * 10/8/07 -- JRM + * Added a resize operation to this test to satisfy the new + * requiremnt that any resize of an entry on flush will always + * be accompanied by a resize. Note that as a result, this + * test becomes redundant with later tests. */ int test_num = 5; /* and 6 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; @@ -5681,7 +5699,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE; int expected_index_len = 1; - size_t expected_index_size = VARIABLE_ENTRY_SIZE; + size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; struct fo_flush_cache_test_spec spec[1] = { { @@ -5695,11 +5713,11 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, + /* num_flush_ops = */ 2, /* flush_ops = */ /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, @@ -5708,9 +5726,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -5727,9 +5744,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5759,7 +5775,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) */ if ( pass ) { - spec[0].flush_ops[0].flag = TRUE; + spec[0].flush_ops[1].flag = TRUE; test_num = 6; check_flush_cache__flush_op_test(file_ptr, @@ -5787,6 +5803,12 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) * * Run this entry twice, as the first run moves the entry to its * alternate address, and the second moves it back. + * + * 10/8/07 -- JRM + * Added a resize operation to this test to satisfy the new + * requiremnt that any resize of an entry on flush will always + * be accompanied by a resize. Note that as a result, this + * test becomes redundant with later tests. */ int test_num = 7; /* and 8 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; @@ -5794,7 +5816,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE; int expected_index_len = 1; - size_t expected_index_size = VARIABLE_ENTRY_SIZE; + size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; struct fo_flush_cache_test_spec spec[1] = { { @@ -5808,11 +5830,11 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, + /* num_flush_ops = */ 2, /* flush_ops = */ /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, @@ -5821,9 +5843,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -5840,9 +5861,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5877,7 +5897,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) flush_flags = H5C__FLUSH_INVALIDATE_FLAG; expected_index_len = 0; expected_index_size = 0; - spec[0].flush_ops[0].flag = TRUE; + spec[0].flush_ops[1].flag = TRUE; spec[0].expected_destroyed = TRUE; check_flush_cache__flush_op_test(file_ptr, @@ -5917,7 +5937,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 0, /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 2, /* num_pins = */ 0, @@ -5936,9 +5956,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -5955,9 +5974,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -6030,7 +6048,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 0, /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 2, /* num_pins = */ 0, @@ -6049,9 +6067,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6068,9 +6085,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -6165,9 +6181,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6184,9 +6199,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6199,9 +6213,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6264,9 +6277,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -6283,9 +6295,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -6298,9 +6309,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -6362,9 +6372,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6381,9 +6390,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6396,9 +6404,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6460,9 +6467,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -6479,9 +6485,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -6494,9 +6499,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -6558,9 +6562,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6577,9 +6580,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6592,9 +6594,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6688,9 +6689,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6707,9 +6707,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6722,9 +6721,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6830,9 +6828,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6859,9 +6856,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -6888,9 +6884,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6917,9 +6912,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -6936,9 +6930,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ TRUE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -6951,9 +6944,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ TRUE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -6966,9 +6958,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -6981,9 +6972,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -7049,9 +7039,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7078,9 +7067,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7107,9 +7095,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7136,9 +7123,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -7165,9 +7151,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7194,9 +7179,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -7213,9 +7197,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7228,9 +7211,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7243,9 +7225,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7258,9 +7239,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -7325,9 +7305,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7354,9 +7333,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7383,9 +7361,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7412,9 +7389,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE }, { @@ -7441,9 +7417,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7470,9 +7445,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -7489,9 +7463,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7504,9 +7477,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7519,9 +7491,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7534,9 +7505,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -7597,9 +7567,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7626,9 +7595,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7655,9 +7623,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -7674,9 +7641,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -7734,9 +7700,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7763,9 +7728,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7792,9 +7756,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -7811,9 +7774,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -7941,9 +7903,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7970,9 +7931,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7999,9 +7959,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8028,9 +7987,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8057,9 +8015,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8086,9 +8043,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8115,9 +8071,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8144,9 +8099,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8173,9 +8127,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8202,9 +8155,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -8221,9 +8173,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8236,9 +8187,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8251,9 +8201,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } @@ -8388,9 +8337,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8417,9 +8365,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8446,9 +8393,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8475,9 +8421,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8504,9 +8449,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8533,9 +8477,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8562,9 +8505,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8591,9 +8533,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8620,9 +8561,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8649,9 +8589,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -8668,9 +8607,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8683,9 +8621,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8698,9 +8635,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } @@ -8760,9 +8696,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8789,9 +8724,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8818,9 +8752,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8847,9 +8780,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8876,9 +8808,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -8895,9 +8826,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -8958,9 +8888,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8987,9 +8916,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -9016,9 +8944,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -9045,9 +8972,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -9074,9 +9000,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -9093,9 +9018,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -9233,12 +9157,10 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, ( check[i].is_protected != FALSE ) ) || ( ( check[i].is_pinned != TRUE ) && ( check[i].is_pinned != FALSE ) ) || - ( ( check[i].expected_loaded != TRUE ) && - ( check[i].expected_loaded != FALSE ) ) || - ( ( check[i].expected_cleared != TRUE ) && - ( check[i].expected_cleared != FALSE ) ) || - ( ( check[i].expected_flushed != TRUE ) && - ( check[i].expected_flushed != FALSE ) ) || + ( ( check[i].expected_deserialized != TRUE ) && + ( check[i].expected_deserialized != FALSE ) ) || + ( ( check[i].expected_serialized != TRUE ) && + ( check[i].expected_serialized != FALSE ) ) || ( ( check[i].expected_destroyed != TRUE ) && ( check[i].expected_destroyed != FALSE ) ) ) { @@ -9310,8 +9232,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - flush_flags); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -9330,21 +9251,18 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, base_addr = entries[spec[i].entry_type]; entry_ptr = &(base_addr[spec[i].entry_index]); - if ( ( entry_ptr->loaded != spec[i].expected_loaded ) || - ( entry_ptr->cleared != spec[i].expected_cleared ) || - ( entry_ptr->flushed != spec[i].expected_flushed ) || + if ( ( entry_ptr->deserialized != spec[i].expected_deserialized ) || + ( entry_ptr->serialized != spec[i].expected_serialized ) || ( entry_ptr->destroyed != spec[i].expected_destroyed ) ) { #if 0 /* This is useful debugging code. Lets keep it around. */ HDfprintf(stdout, - "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->loaded), - (int)(spec[i].expected_loaded), - (int)(entry_ptr->cleared), - (int)(spec[i].expected_cleared), - (int)(entry_ptr->flushed), - (int)(spec[i].expected_flushed), + "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", + (int)(entry_ptr->deserialized), + (int)(spec[i].expected_deserialized), + (int)(entry_ptr->serialized), + (int)(spec[i].expected_serialized), (int)(entry_ptr->destroyed), (int)(spec[i].expected_destroyed)); @@ -9391,9 +9309,8 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, ( entry_ptr->header.is_protected != check[i].is_protected ) || ( entry_ptr->is_pinned != check[i].is_pinned ) || ( entry_ptr->header.is_pinned != check[i].is_pinned ) || - ( entry_ptr->loaded != check[i].expected_loaded ) || - ( entry_ptr->cleared != check[i].expected_cleared ) || - ( entry_ptr->flushed != check[i].expected_flushed ) || + ( entry_ptr->deserialized != check[i].expected_deserialized ) || + ( entry_ptr->serialized != check[i].expected_serialized ) || ( entry_ptr->destroyed != check[i].expected_destroyed ) ) { #if 0 /* This is useful debugging code. Lets keep it around for a while. */ @@ -9448,20 +9365,18 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, (int)(entry_ptr->header.is_pinned), (int)(check[i].is_pinned)); } - if ( entry_ptr->loaded != check[i].expected_loaded ) { - HDfprintf(stdout, "entry_ptr->loaded (expected) = %d (%d).\n", - (int)(entry_ptr->loaded), - (int)(check[i].expected_loaded)); - } - if ( entry_ptr->cleared != check[i].expected_cleared ) { - HDfprintf(stdout, "entry_ptr->cleared (expected) = %d (%d).\n", - (int)(entry_ptr->cleared), - (int)(check[i].expected_cleared)); + if ( entry_ptr->deserialized != + check[i].expected_deserialized ) { + HDfprintf(stdout, + "entry_ptr->deserialized (expected) = %d (%d).\n", + (int)(entry_ptr->deserialized), + (int)(check[i].expected_deserialized)); } - if ( entry_ptr->flushed != check[i].expected_flushed ) { - HDfprintf(stdout, "entry_ptr->flushed (expected) = %d (%d).\n", - (int)(entry_ptr->flushed), - (int)(check[i].expected_flushed)); + if ( entry_ptr->serialized != check[i].expected_serialized ) { + HDfprintf(stdout, + "entry_ptr->serialized (expected) = %d (%d).\n", + (int)(entry_ptr->serialized), + (int)(check[i].expected_serialized)); } if ( entry_ptr->destroyed != check[i].expected_destroyed ) { HDfprintf(stdout, "entry_ptr->destroyed (expected) = %d (%d).\n", @@ -9509,8 +9424,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -9542,10 +9456,9 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, entry_ptr->size = entry_sizes[spec[i].entry_type]; - entry_ptr->loaded = FALSE; - entry_ptr->cleared = FALSE; - entry_ptr->flushed = FALSE; - entry_ptr->destroyed = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->serialized = FALSE; + entry_ptr->destroyed = FALSE; i++; } @@ -9558,10 +9471,9 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, entry_ptr->size = entry_sizes[check[i].entry_type]; - entry_ptr->loaded = FALSE; - entry_ptr->cleared = FALSE; - entry_ptr->flushed = FALSE; - entry_ptr->destroyed = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->serialized = FALSE; + entry_ptr->destroyed = FALSE; i++; } @@ -9586,6 +9498,11 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, * * Modifications: * + * Updated test for minor changes in the behaviour + * of H5C_flush_single_entry(). + * + * JRM -- 2/16/15 + * *------------------------------------------------------------------------- */ @@ -9594,74 +9511,76 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) { H5C_t * cache_ptr = file_ptr->shared->cache; int i; - int num_variable_entries = 8; + int num_variable_entries = 10; int num_monster_entries = 31; int num_large_entries = 0; herr_t result; test_entry_t * entry_ptr; test_entry_t * base_addr; - struct expected_entry_status expected[8 + 31 + 14] = + struct expected_entry_status expected[10 + 31 + 14] = { /* the expected array is used to maintain a table of the expected status of every * entry used in this test. Note that since the function that processes this * array only processes as much of it as it is told to, we don't have to * worry about maintaining the status of entries that we haven't used yet. */ - /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: loaded: clrd: flshd: dest: par type: par idx: dep ref.count: dep height: order: */ - { VARIABLE_ENTRY_TYPE, 0, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { VARIABLE_ENTRY_TYPE, 1, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { VARIABLE_ENTRY_TYPE, 2, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { VARIABLE_ENTRY_TYPE, 3, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { VARIABLE_ENTRY_TYPE, 4, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { VARIABLE_ENTRY_TYPE, 5, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { VARIABLE_ENTRY_TYPE, 6, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { VARIABLE_ENTRY_TYPE, 7, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { LARGE_ENTRY_TYPE, 0, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { LARGE_ENTRY_TYPE, 1, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { LARGE_ENTRY_TYPE, 2, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { LARGE_ENTRY_TYPE, 3, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { LARGE_ENTRY_TYPE, 4, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { LARGE_ENTRY_TYPE, 5, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { LARGE_ENTRY_TYPE, 6, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { LARGE_ENTRY_TYPE, 7, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { LARGE_ENTRY_TYPE, 8, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { LARGE_ENTRY_TYPE, 9, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { LARGE_ENTRY_TYPE, 10, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { LARGE_ENTRY_TYPE, 11, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { LARGE_ENTRY_TYPE, 12, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { LARGE_ENTRY_TYPE, 13, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 } + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par idx: dep ref.count: dep height: order: */ + { VARIABLE_ENTRY_TYPE, 0, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { VARIABLE_ENTRY_TYPE, 1, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { VARIABLE_ENTRY_TYPE, 2, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { VARIABLE_ENTRY_TYPE, 3, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { VARIABLE_ENTRY_TYPE, 4, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { VARIABLE_ENTRY_TYPE, 5, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { VARIABLE_ENTRY_TYPE, 6, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { VARIABLE_ENTRY_TYPE, 7, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { VARIABLE_ENTRY_TYPE, 8, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { VARIABLE_ENTRY_TYPE, 9, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { LARGE_ENTRY_TYPE, 0, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { LARGE_ENTRY_TYPE, 1, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { LARGE_ENTRY_TYPE, 2, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { LARGE_ENTRY_TYPE, 3, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { LARGE_ENTRY_TYPE, 4, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { LARGE_ENTRY_TYPE, 5, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { LARGE_ENTRY_TYPE, 6, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { LARGE_ENTRY_TYPE, 7, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { LARGE_ENTRY_TYPE, 8, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { LARGE_ENTRY_TYPE, 9, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { LARGE_ENTRY_TYPE, 10, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { LARGE_ENTRY_TYPE, 11, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { LARGE_ENTRY_TYPE, 12, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { LARGE_ENTRY_TYPE, 13, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 } }; if ( pass ) { @@ -9718,38 +9637,49 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0, - (VARIABLE_ENTRY_SIZE / 2), TRUE); + (VARIABLE_ENTRY_SIZE / 4), TRUE); unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1, + (VARIABLE_ENTRY_SIZE / 4), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 2); unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 2, H5C__NO_FLAGS_SET); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3, - (VARIABLE_ENTRY_SIZE / 2), TRUE); + (VARIABLE_ENTRY_SIZE / 4), TRUE); unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4, - (VARIABLE_ENTRY_SIZE / 2), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4, H5C__DIRTIED_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4, H5C__NO_FLAGS_SET); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5, - (VARIABLE_ENTRY_SIZE / 2), TRUE); + (VARIABLE_ENTRY_SIZE / 4), TRUE); unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, H5C__NO_FLAGS_SET); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, + (VARIABLE_ENTRY_SIZE / 2), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, H5C__NO_FLAGS_SET); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, + (VARIABLE_ENTRY_SIZE / 2), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, H5C__DIRTIED_FLAG); + + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8, H5C__NO_FLAGS_SET); + + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9, H5C__NO_FLAGS_SET); - if ( ( cache_ptr->index_len != 8 ) || - ( cache_ptr->index_size != (4 * (VARIABLE_ENTRY_SIZE / 2)) + + if ( ( cache_ptr->index_len != 10 ) || + ( cache_ptr->index_size != (4 * (VARIABLE_ENTRY_SIZE / 4)) + + (2 * (VARIABLE_ENTRY_SIZE / 2)) + (4 * VARIABLE_ENTRY_SIZE) ) ) { pass = FALSE; @@ -9761,33 +9691,35 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) /* Now set up the pinning relationships: * - * Briefly, (VET, 0) is pinned by (VET, 1), (VET, 2), and (VET, 3) - * (VET, 7) is pinned by (VET, 3), and (VET, 5) + * Briefly, (VET, 0) is pinned by (VET, 1), (VET, 3), and (VET, 5) + * (VET, 9) is pinned by (VET, 5), and (VET, 7) */ create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 1, VARIABLE_ENTRY_TYPE, 0); - create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 2, - VARIABLE_ENTRY_TYPE, 0); create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 3, VARIABLE_ENTRY_TYPE, 0); - create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 3, - VARIABLE_ENTRY_TYPE, 7); create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 5, - VARIABLE_ENTRY_TYPE, 7); + VARIABLE_ENTRY_TYPE, 0); + create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 5, + VARIABLE_ENTRY_TYPE, 9); + create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 7, + VARIABLE_ENTRY_TYPE, 9); /* Next, set up the flush operations: * * Briefly, (VET, 1) dirties (VET, 0) * resizes (VET, 0) to 3/4 VARIABLE_ENTRY_SIZE * - * (VET, 2) dirties (VET, 0) + * (VET, 3) dirties (VET, 0) * resizes (VET, 0) to VARIABLE_ENTRY_SIZE * moves (VET, 0) to its alternate address * - * (VET, 3) dirties (VET, 0) - * resizes itself to VARIABLE_ENTRY_SIZE + * (VET, 5) dirties (VET, 0) + * resizes itself to VARIABLE_ENTRY_SIZE / 2 + * + * (VET, 7) dirties (VET, 9) * - * (VET, 7) dirties (VET, 6) + * (VET, 9) dirties (VET, 8) */ add_flush_op(VARIABLE_ENTRY_TYPE, 1, FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL); @@ -9795,20 +9727,23 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) VARIABLE_ENTRY_TYPE, 0, TRUE, 3 * VARIABLE_ENTRY_SIZE / 4, NULL); - add_flush_op(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__DIRTY, + add_flush_op(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL); - add_flush_op(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__RESIZE, + add_flush_op(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, TRUE, VARIABLE_ENTRY_SIZE, NULL); - add_flush_op(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__MOVE, + add_flush_op(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL); - add_flush_op(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__DIRTY, + add_flush_op(VARIABLE_ENTRY_TYPE, 5, FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL); - add_flush_op(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__RESIZE, - VARIABLE_ENTRY_TYPE, 3, TRUE, VARIABLE_ENTRY_SIZE, NULL); + add_flush_op(VARIABLE_ENTRY_TYPE, 5, FLUSH_OP__RESIZE, + VARIABLE_ENTRY_TYPE, 5, TRUE, VARIABLE_ENTRY_SIZE / 2, NULL); add_flush_op(VARIABLE_ENTRY_TYPE, 7, FLUSH_OP__DIRTY, - VARIABLE_ENTRY_TYPE, 6, FALSE, (size_t)0, NULL); + VARIABLE_ENTRY_TYPE, 9, FALSE, (size_t)0, NULL); + + add_flush_op(VARIABLE_ENTRY_TYPE, 9, FLUSH_OP__DIRTY, + VARIABLE_ENTRY_TYPE, 8, FALSE, (size_t)0, NULL); } if ( pass ) { @@ -9819,25 +9754,31 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * in * entry: cache? size: dirty? pinned? pins: flush operations: * - * (VET, 0) Y 5 KB Y Y - - + * (VET, 0) Y 2.5 KB Y Y - - * - * (VET, 1) Y 10 KB N N 0 dirty (VET, 0), + * (VET, 1) Y 2.5 KB Y N 0 dirty (VET, 0), * resize (VET, 0) to 7.5 KB * - * (VET, 2) Y 10 KB N N 0 dirty (VET, 0) + * (VET, 2) Y 10 KB N N - - + * + * + * (VET, 3) Y 2.5 KB N N 0 dirty (VET, 0) * resize (VET, 0) to 10 KB * move (VET, 0) to its alternate address * - * (VET, 3) Y 5 KB Y N 0, 7 dirty (VET, 0) - * resize (VET, 3) to 10 KB + * (VET, 4) Y 10 KB N N - - + * + * + * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0) + * resize (VET, 5) to 5 KB * - * (VET, 4) Y 5 KB Y N - - + * (VET, 6) Y 5 KB Y N - - * - * (VET, 5) Y 5 KB Y N 7 - + * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9) * - * (VET, 6) Y 10 KB N N - - + * (VET, 8) Y 10 KB N N - - * - * (VET, 7) Y 10 KB N Y - dirty (VET, 6) + * (VET, 9) Y 10 KB N N - dirty (VET, 8) * * Recall that in this test bed, flush operations are excuted the * first time the associated entry is flushed, and are then @@ -9858,9 +9799,10 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) } /* The cache should now be exactly full */ - if ( ( cache_ptr->index_len != 40 ) || + if ( ( cache_ptr->index_len != 42 ) || ( cache_ptr->index_size != 2 * 1024 * 1024 ) || - ( cache_ptr->index_size != ((4 * VARIABLE_ENTRY_SIZE / 2) + + ( cache_ptr->index_size != ((4 * VARIABLE_ENTRY_SIZE / 4) + + (2 * VARIABLE_ENTRY_SIZE / 2) + (4 * VARIABLE_ENTRY_SIZE) + (31 * MONSTER_ENTRY_SIZE) + (1 * LARGE_ENTRY_SIZE)) ) ) { @@ -9883,7 +9825,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { /* Now load a large entry. This should result in the eviction - * of (VET,1), and the increase in the size of (VET, 0) from .5 + * of (VET,2), and the increase in the size of (VET, 0) from .25 * VARIABLE_ENTRY_SIZE to .75 VARIABLE_ENTRY_SIZE. * * The following table illustrates the intended state of affairs @@ -9894,44 +9836,50 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) Y 7.5 KB Y Y - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) Y 2.5 KB N N - - * - * (VET, 2) Y 10 KB N N 0 dirty (VET, 0) + * (VET, 2) N 10 KB N N - - + * + * (VET, 3) Y 2.5 KB Y N 0 dirty (VET, 0) * resize (VET, 0) to 10 KB * move (VET, 0) to its alternate address * - * (VET, 3) Y 5 KB Y N 0, 7 dirty (VET, 0) - * resize (VET, 3) to 10 KB + * (VET, 4) Y 10 KB N N - - * - * (VET, 4) Y 5 KB Y N - - + * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0) + * resize (VET, 5) to 5 KB * - * (VET, 5) Y 5 KB Y N 7 - + * (VET, 6) Y 5 KB Y N - - * - * (VET, 6) Y 10 KB N N - - + * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9) * - * (VET, 7) Y 10 KB Y Y - dirty (VET, 6) + * (VET, 8) Y 10 KB N N - - + * + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) * * Start by updating the expected table for the expected changes in entry status: */ - expected[0].size = 3 * VARIABLE_ENTRY_SIZE / 4; - expected[1].in_cache = FALSE; - expected[1].flushed = TRUE; - expected[1].destroyed = TRUE; + expected[0].size = 3 * VARIABLE_ENTRY_SIZE / 4; + expected[1].is_dirty = FALSE; + expected[1].serialized = TRUE; + expected[2].in_cache = FALSE; + expected[2].destroyed = TRUE; num_large_entries = 2; protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG); - if ( ( cache_ptr->index_len != 40 ) || + if ( ( cache_ptr->index_len != 42 ) || ( cache_ptr->index_size != (2 * 1024 * 1024) - (VARIABLE_ENTRY_SIZE) + - (VARIABLE_ENTRY_SIZE / 4) + + (VARIABLE_ENTRY_SIZE / 2) + (LARGE_ENTRY_SIZE) ) || - ( cache_ptr->index_size != ((1 * 3 * VARIABLE_ENTRY_SIZE / 4 ) + - (3 * VARIABLE_ENTRY_SIZE / 2 ) + - (3 * VARIABLE_ENTRY_SIZE) + - (31 * MONSTER_ENTRY_SIZE) + + ( cache_ptr->index_size != ((1 * (3 * VARIABLE_ENTRY_SIZE / 4)) + + (3 * VARIABLE_ENTRY_SIZE / 4) + + (2 * VARIABLE_ENTRY_SIZE / 2) + + (3 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + (2 * LARGE_ENTRY_SIZE)) ) ) { pass = FALSE; failure_mssg = "unexpected size/len in flush op eviction test 3."; @@ -9947,8 +9895,8 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { /* Now load another large entry. This should result in the eviction - * of (VET, 2), the increase in the size of (VET, 0) from .75 - * VARIABLE_ENTRY_SIZE to 1.0 VARIABLE_ENTRY_SIZE, and the moving + * of (VET, 4), the increase in the size of (VET, 0) from .75 + * VARIABLE_ENTRY_SIZE to 1.0 VARIABLE_ENTRY_SIZE, and the renaming * of (VET, 0) to its alternate address. * * The following table shows the expected states of the variable @@ -9959,40 +9907,46 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) Y 10 KB Y Y - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) Y 2.5 KB N N - - * * (VET, 2) N 10 KB N N - - * - * (VET, 3) Y 5 KB Y N 0, 7 dirty (VET, 0) - * resize (VET, 3) to 10 KB + * (VET, 3) Y 2.5 KB N N - - + * + * (VET, 4) N 10 KB N N - - + * + * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0) + * resize (VET, 5) to 5 KB * - * (VET, 4) Y 5 KB Y N - - + * (VET, 6) Y 5 KB Y N - - * - * (VET, 5) Y 5 KB Y N 7 - + * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9) * - * (VET, 6) Y 10 KB N N - - + * (VET, 8) Y 10 KB N N - - * - * (VET, 7) Y 10 KB Y Y - dirty (VET, 6) + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) * * Start by updating the expected table for the expected changes in entry status: */ expected[0].size = VARIABLE_ENTRY_SIZE; expected[0].at_main_addr = FALSE; - expected[2].in_cache = FALSE; - expected[2].flushed = TRUE; - expected[2].destroyed = TRUE; + expected[3].is_dirty = FALSE; + expected[3].serialized = TRUE; + expected[4].in_cache = FALSE; + expected[4].destroyed = TRUE; num_large_entries = 3; protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__DIRTIED_FLAG); - if ( ( cache_ptr->index_len != 40 ) || + if ( ( cache_ptr->index_len != 42 ) || ( cache_ptr->index_size != (2 * 1024 * 1024) - (2 * VARIABLE_ENTRY_SIZE) + - (VARIABLE_ENTRY_SIZE / 2) + + (3 * VARIABLE_ENTRY_SIZE / 4) + (2 * LARGE_ENTRY_SIZE) ) || - ( cache_ptr->index_size != ((3 * VARIABLE_ENTRY_SIZE / 2) + + ( cache_ptr->index_size != ((3 * VARIABLE_ENTRY_SIZE / 4) + + (2 * VARIABLE_ENTRY_SIZE / 2) + (3 * VARIABLE_ENTRY_SIZE) + (31 * MONSTER_ENTRY_SIZE) + (3 * LARGE_ENTRY_SIZE)) ) ) { @@ -10010,13 +9964,14 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { - /* load two more large entries. This should result in (VET, 3) being - * flushed, and increasing its size from 1/2 VARIABLE_ENTRY_SIZE to + /* load two more large entries. This should result in (VET, 5) being + * flushed, and increasing its size from 1/4 VARIABLE_ENTRY_SIZE to * VARIABLE_ENTRY_SIZE. * * As a result of this size increase, the cache will have to look - * for another entry to evict. After flushing (VET, 4) and (VET, 5), - * it should evict (VET, 6), yielding the needed memory. + * for another entry to evict. After flushing (VET, 6) and (VET, 7), + * it should evict (VET, 8), yielding the needed memory and dirtying + * (VET, 9). * * The following table shows the expected states of the variable * size entries after the test. @@ -10026,33 +9981,37 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) Y 10 KB Y Y - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) Y 2.5 KB N N - - * * (VET, 2) N 10 KB N N - - * - * (VET, 3) Y 10 KB N N 0, 7 - + * (VET, 3) Y 2.5 KB N N - - + * + * (VET, 4) N 10 KB N N - - * - * (VET, 4) Y 5 KB N N - - + * (VET, 5) Y 5 KB N N 0, 9 - * - * (VET, 5) Y 5 KB N N 7 - + * (VET, 6) Y 5 KB N N - - * - * (VET, 6) N 10 KB N N - - + * (VET, 7) Y 5 KB N N 9 - * - * (VET, 7) Y 10 KB Y Y - dirty (VET, 6) + * (VET, 8) N 10 KB N N - - + * + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) * * Start by updating the expected table for the expected changes in entry status: */ - expected[3].size = VARIABLE_ENTRY_SIZE; - expected[3].is_dirty = FALSE; - expected[3].flushed = TRUE; - expected[4].is_dirty = FALSE; - expected[4].flushed = TRUE; + expected[5].size = VARIABLE_ENTRY_SIZE / 2; expected[5].is_dirty = FALSE; - expected[5].flushed = TRUE; - expected[6].in_cache = FALSE; - expected[6].flushed = TRUE; - expected[6].destroyed = TRUE; + expected[5].serialized = TRUE; + expected[6].is_dirty = FALSE; + expected[6].serialized = TRUE; + expected[7].is_dirty = FALSE; + expected[7].serialized = TRUE; + expected[8].in_cache = FALSE; + expected[8].destroyed = TRUE; + expected[9].is_dirty = TRUE; num_large_entries = 5; @@ -10063,13 +10022,15 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 4, H5C__DIRTIED_FLAG); /* verify cache size */ - if ( ( cache_ptr->index_len != 41 ) || + if ( ( cache_ptr->index_len != 43 ) || ( cache_ptr->index_size != (2 * 1024 * 1024) - (3 * VARIABLE_ENTRY_SIZE) + - (1 * VARIABLE_ENTRY_SIZE ) + /* size increases of (VET, 0) & (VET, 3) */ + (1 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 4) + (4 * LARGE_ENTRY_SIZE) ) || - ( cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 2) + - (3 * VARIABLE_ENTRY_SIZE) + + ( cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 2) + + (2 * VARIABLE_ENTRY_SIZE) + (31 * MONSTER_ENTRY_SIZE) + (5 * LARGE_ENTRY_SIZE)) ) ) { @@ -10090,7 +10051,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * cache to bring all the VARIABLE_ENTRY_TYPE entries to the * end of the LRU list. * - * Note that we don't have to worry about (VET, 0) and (VET, 7) + * Note that we don't have to worry about (VET, 0) and (VET, 9) * as they are pinned and thus not in the LRU list to begin with. */ for ( i = 0; i < 31; i++ ) @@ -10106,10 +10067,17 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) } /* verify cache size */ - if ( ( cache_ptr->index_len != 41 ) || + if ( ( cache_ptr->index_len != 43 ) || ( cache_ptr->index_size != (2 * 1024 * 1024) - - (2 * VARIABLE_ENTRY_SIZE) + - (4 * LARGE_ENTRY_SIZE) ) ) { + (3 * VARIABLE_ENTRY_SIZE) + + (1 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 4) + + (4 * LARGE_ENTRY_SIZE) ) || + ( cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 2) + + (2 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + + (5 * LARGE_ENTRY_SIZE)) ) ) { pass = FALSE; failure_mssg = "unexpected size/len in flush op eviction test 6."; @@ -10125,7 +10093,8 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { /* Now load three more large entries. This should result - * in the eviction of (VET, 3), and the unpinning of (VET, 0) + * in the evictions of (VET, 1), (VET, 3), and (VET, 5), and the + * unpinning of (VET, 0) * * The following table shows the expected states of the variable * size entries after the test. @@ -10135,26 +10104,34 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) Y 10 KB Y N - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) N 2.5 KB N N - - * * (VET, 2) N 10 KB N N - - * - * (VET, 3) N 10 KB N N - - + * (VET, 3) N 2.5 KB N N - - * - * (VET, 4) Y 5 KB N N - - + * (VET, 4) N 10 KB N N - - * - * (VET, 5) Y 5 KB N N 7 - + * (VET, 5) N 5 KB N N - - + * + * (VET, 6) Y 5 KB N N - - * - * (VET, 6) N 10 KB N N - - + * (VET, 7) Y 5 KB N N 9 - * - * (VET, 7) Y 10 KB Y Y - dirty (VET, 6) + * (VET, 8) N 10 KB N N - - + * + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) * * Start by updating the expected table for the expected changes in entry status: */ expected[0].is_pinned = FALSE; + expected[1].in_cache = FALSE; + expected[1].destroyed = TRUE; expected[3].in_cache = FALSE; expected[3].destroyed = TRUE; + expected[5].in_cache = FALSE; + expected[5].destroyed = TRUE; num_large_entries = 8; @@ -10167,7 +10144,9 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) /* verify cache size */ if ( ( cache_ptr->index_len != 43 ) || ( cache_ptr->index_size != (2 * 1024 * 1024) - - (3 * VARIABLE_ENTRY_SIZE) + + (4 * VARIABLE_ENTRY_SIZE) + + (1 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 4) + (7 * LARGE_ENTRY_SIZE) ) || ( cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 2) + (2 * VARIABLE_ENTRY_SIZE) + @@ -10187,7 +10166,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { - /* load another large entry. (VET, 4) should be evicted. + /* load another large entry. (VET, 6) should be evicted. * * The following table shows the expected states of the variable * size entries after the test. @@ -10197,25 +10176,29 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) Y 10 KB Y N - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) N 2.5 KB N N - - * * (VET, 2) N 10 KB N N - - * - * (VET, 3) N 10 KB N N - - + * (VET, 3) N 2.5 KB N N - - + * + * (VET, 4) N 10 KB N N - - * - * (VET, 4) N 5 KB N N - - + * (VET, 5) N 5 KB N N - - + * + * (VET, 6) N 5 KB N N - - * - * (VET, 5) Y 5 KB N N 7 - + * (VET, 7) Y 5 KB N N 9 - * - * (VET, 6) N 10 KB N N - - + * (VET, 8) N 10 KB N N - - * - * (VET, 7) Y 10 KB Y Y - dirty (VET, 6) + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) * * Start by updating the expected table for the expected changes in entry status: */ - expected[4].in_cache = FALSE; - expected[4].destroyed = TRUE; + expected[6].in_cache = FALSE; + expected[6].destroyed = TRUE; num_large_entries = 9; @@ -10251,7 +10234,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) /* Load another large entry. * - * (VET, 5) should be evicted, and (VET, 7) should be unpinned. + * (VET, 7) should be evicted, and (VET, 9) should be unpinned. * * The following table shows the expected states of the variable * size entries after the test. @@ -10261,26 +10244,30 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) Y 10 KB Y N - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) N 2.5 KB N N - - * * (VET, 2) N 10 KB N N - - * - * (VET, 3) N 10 KB N N - - + * (VET, 3) N 2.5 KB N N - - * - * (VET, 4) N 5 KB N N - - + * (VET, 4) N 10 KB N N - - * * (VET, 5) N 5 KB N N - - * - * (VET, 6) N 10 KB N N - - + * (VET, 6) N 5 KB N N - - + * + * (VET, 7) N 5 KB N N - - * - * (VET, 7) Y 10 KB Y N - dirty (VET, 6) + * (VET, 8) N 10 KB N N - - + * + * (VET, 9) Y 10 KB Y N - dirty (VET, 8) * * Start by updating the expected table for the expected changes in entry status: */ - expected[5].in_cache = FALSE; - expected[5].destroyed = TRUE; - expected[7].is_pinned = FALSE; + expected[7].in_cache = FALSE; + expected[7].destroyed = TRUE; + expected[9].is_pinned = FALSE; num_large_entries = 10; @@ -10353,20 +10340,66 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { - /* load two more large entries. - * - * (VET, 0) should be flushed, but not evicted initially since it is dirty. - * - * (VET, 7) should be evicted, but (VET, 7) has an eviction operation that - * dirties (VET, 6). Since (VET, 6) is not in the cache, it will be loaded. - * Since this results in no net increase in free space, the cache will - * continue to attempt to create free space. + /* load two more large entries. Things get a bit complicated here, + * so I'll go through the operation step by step. + * + * Initially, the cache has 4 KB of empty space, so the first entry + * (LET, 10) is loaded via calls to H5C_protect() H5C_unprotect() + * without causing any evictions. + * + * However, this is not the case for the call of H5C_protect() on + * (LET, 11). + * + * Before inserting (LET, 11), H5C_protect(LET, 11) must try to + * free up at least 4 KB of space. To do this, it starts scanning + * up the LRU list to find entries to evict. + * + * (VET, 0) is at the bottom of the LRU list, and thus is the first + * entry considered. However, it is dirty, so it flushed to disk, + * moved to the top of the LRU list, and marked clean. + * + * (VET, 9) is the next entry on the bottom of the LRU list. It is + * dirty too, calls its serialize callback function to construct an + * on disk image of the entry, and moves it to the top of the LRU + * list after the serialize callback returns. + * + * However, (VET 9)'s serialize function needs to modify (VET, 8), + * which is currently not in cache. Thus it calls H5C_protect(VET, 8) + * to gain access to it. H5C_protect(VET, 8) loads (VET, 8), and + * then attempts to evict entries to make space for it. While (VET, 9) + * is still at the bottom of the LRU, it is marked flush in progress + * and this is skipped. Thus the next entries on the LRU are (MET, 0) + * thru (MET, 30) and (LET, 0) thru (LET, 10) -- all of which are dirty, + * and are therefore flushed and moved to the head of the LRU list. + * + * The next entry on the bottom of the LRU list is (VET, 0), which + * is clean, and is therefore evicted to make space for (VET, 8). + * This space is sufficient, so H5C_protect(VET, 8) inserts + * (VET, 8) into the cache's index, marks it as protected, and + * returns to the serialize function for (VET, 9). + * + * When the serialize function for (VET, 9) is done with (VET, 8), it + * calls H5C_unprotect(VET, 8), which markes (VET, 8) as dirty and + * unprotected, and places it at the head of the LRU. + * + * The serialize function for (VET, 9) then returns, and (VET, 9) is + * is written to disk, marked clean, and moved to the head of the LRU. + * + * At this point, the cache is still full (since (VET, 8) took the + * space created by the eviction of (VET, 0)). Thus + * H5C_protect(LET, 11) continues to look for space. While + * (MET, 0) was the next item on the LRU list when it called the + * serialize function for (VET, 9), the function notices that the + * LRU has been modified, and restarts its search for candidates + * for eviction at the bottom of the LRU. * - * The cache will then flush all the monster and large entries, but since they - * are all dirty, they will not be evicted. + * (MET, 0) is now at the bottom of the LRU, and is clean. Thus + * it is evicted. This makes sufficient space for (LET, 11), so + * H5C_protect(LET, 11) inserts it into the cache, marks it as + * protected, and returns. * - * Finally, it will reach (VET, 0) again, and evict it on the second pass. - * This finally makes the necessary space. + * H5C_unprotect(LET, 11) marks (LET, 11) as unprotected, and then + * returns as well. * * The following table shows the expected states of the variable * size entries after the test. @@ -10376,44 +10409,54 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) N 10 KB N N - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) N 2.5 KB N N - - * * (VET, 2) N 10 KB N N - - * - * (VET, 3) N 10 KB N N - - + * (VET, 3) N 2.5 KB N N - - * - * (VET, 4) N 5 KB N N - - + * (VET, 4) N 10 KB N N - - * * (VET, 5) N 5 KB N N - - * - * (VET, 6) Y 10 KB Y N - - + * (VET, 6) N 5 KB N N - - * - * (VET, 7) N 10 KB N N - - + * (VET, 7) N 5 KB N N - - * - * Start by updating the expected table for the expected changes in entry status: + * (VET, 8) Y 10 KB Y N - - * - * Note that we reset the loaded, cleared, flushed, and destroyed fields of - * (VET,6) so we can track what is happening. + * (VET, 9) Y 10 KB N N - - + * + * Start by updating the expected table for the expected changes in + * entry status: + * + * Note that we reset the loaded, flushed, and destroyed + * fields of (VET,8) so we can track what is happening. */ base_addr = entries[VARIABLE_ENTRY_TYPE]; - entry_ptr = &(base_addr[6]); - entry_ptr->loaded = FALSE; - entry_ptr->cleared = FALSE; - entry_ptr->flushed = FALSE; - entry_ptr->destroyed = FALSE; + entry_ptr = &(base_addr[8]); + entry_ptr->deserialized = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->destroyed = FALSE; expected[0].in_cache = FALSE; expected[0].is_dirty = FALSE; - expected[0].flushed = TRUE; + expected[0].serialized = TRUE; expected[0].destroyed = TRUE; - expected[6].in_cache = TRUE; - expected[6].is_dirty = TRUE; - expected[6].loaded = TRUE; - expected[6].flushed = FALSE; - expected[6].destroyed = FALSE; - expected[7].in_cache = FALSE; - expected[7].flushed = TRUE; - expected[7].destroyed = TRUE; + expected[8].in_cache = TRUE; + expected[8].is_dirty = TRUE; + expected[8].deserialized = TRUE; + expected[8].serialized = FALSE; + expected[8].destroyed = FALSE; + expected[9].in_cache = TRUE; + expected[9].is_dirty = FALSE; + expected[9].serialized = TRUE; + expected[9].destroyed = FALSE; + + expected[10].in_cache = FALSE; + expected[10].is_dirty = FALSE; + expected[10].serialized = TRUE; + expected[10].destroyed = TRUE; num_large_entries = 12; @@ -10424,8 +10467,8 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) i < num_variable_entries + num_monster_entries + num_large_entries - 1; i++ ) { - expected[i].is_dirty = FALSE; - expected[i].flushed = TRUE; + expected[i].is_dirty = FALSE; + expected[i].serialized = TRUE; } for ( i = 10; i < 12; i++ ) @@ -10437,10 +10480,10 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) /* verify cache size */ if ( ( cache_ptr->index_len != 44 ) || ( cache_ptr->index_size != (2 * 1024 * 1024) - - (5 * VARIABLE_ENTRY_SIZE) + - (11 * LARGE_ENTRY_SIZE) ) || - ( cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE) + - (31 * MONSTER_ENTRY_SIZE) + + (2 * VARIABLE_ENTRY_SIZE) - + (10 * LARGE_ENTRY_SIZE) ) || + ( cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE) + + (30 * MONSTER_ENTRY_SIZE) + (12 * LARGE_ENTRY_SIZE)) ) ) { pass = FALSE; @@ -10456,10 +10499,33 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { + /* protect and unprotect VET 8 to move it to the top of the LRU */ + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8, H5C__NO_FLAGS_SET); + + /* Again, touch all the non VARIABLE_ENTRY_TYPE entries in the - * cache to bring the last remaining VARIABLE_ENTRY_TYPE entry to the - * end of the LRU list. + * cache to evict VET 9 and move VET 8 to the bottom of the LRU. + * + * Must do this twice to get the desired result. */ + + + /* skip MET 0 in first pass so that we evict VET 9 when we + * reload MET 0 + */ + for ( i = 1; i < num_monster_entries; i++ ) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); + } + + for ( i = 0; i < num_large_entries; i++ ) + { + protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); + } + for ( i = 0; i < num_monster_entries; i++ ) { protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); @@ -10480,6 +10546,22 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) expected[i].is_dirty = TRUE; } + /* update MET 0 to set its in cache flag, and reset the its destroyed flag */ + expected[10].in_cache = TRUE; + + /* pass through non variable entries will flush VET 8, and evict VET 9. + * Update accordingly. + */ + expected[8].in_cache = TRUE; + expected[8].is_dirty = TRUE; + expected[8].serialized = FALSE; + expected[8].destroyed = FALSE; + expected[9].in_cache = FALSE; + expected[9].is_dirty = FALSE; + expected[9].serialized = TRUE; + expected[9].destroyed = TRUE; + + /* verify cache size */ if ( ( cache_ptr->index_len != 44 ) || ( cache_ptr->index_size != (2 * 1024 * 1024) - @@ -10493,6 +10575,12 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) failure_mssg = "unexpected size/len in flush op eviction test 12."; } + /* modifications to the H5C_flush_single_entry() function have + * changed the behavior of the cache slightly, causing + * this test to fail. Comment out for now -- come back and + * fix if all goes well. + */ + /* verify entry status */ verify_entry_status(cache_ptr, 10, @@ -10504,10 +10592,11 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) /* Load two more large entries. * - * Since (VET, 6) is dirty, at first this will just cause (VET, 6) to be flushed. + * Since (VET, 8) is dirty, at first this will just cause (VET, 8) + * to be flushed. * - * But all other entries in the cache are dirty, so the cache will flush them all, - * and then evict (VET, 6) on the second pass. + * But all other entries in the cache are dirty, so the cache will + * flush them all, and then evict (VET, 8) on the second pass. * * The following table shows the expected states of the variable * size entries after the test. @@ -10517,27 +10606,32 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) N 10 KB N N - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) N 2.5 KB N N - - * * (VET, 2) N 10 KB N N - - * - * (VET, 3) N 10 KB N N - - + * (VET, 3) N 2.5 KB N N - - * - * (VET, 4) N 5 KB N N - - + * (VET, 4) N 10 KB N N - - * * (VET, 5) N 5 KB N N - - * - * (VET, 6) N 10 KB N N - - + * (VET, 6) N 5 KB N N - - * - * (VET, 7) N 10 KB N N - - + * (VET, 7) N 5 KB N N - - * - * Start by updating the expected table for the expected changes in entry status: + * (VET, 8) N 10 KB N N - - + * + * (VET, 9) N 10 KB N N - - + * + * Start by updating the expected table for the expected changes in + * entry status: */ - expected[6].in_cache = FALSE; - expected[6].is_dirty = FALSE; - expected[6].flushed = TRUE; - expected[6].destroyed = TRUE; + expected[8].in_cache = FALSE; + expected[8].is_dirty = FALSE; + expected[8].serialized = TRUE; + expected[8].destroyed = TRUE; num_large_entries = 14; @@ -10548,8 +10642,8 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) i < num_variable_entries + num_monster_entries + num_large_entries - 1; i++ ) { - expected[i].is_dirty = FALSE; - expected[i].flushed = TRUE; + expected[i].is_dirty = FALSE; + expected[i].serialized = TRUE; } for ( i = 12; i < 14; i++ ) @@ -10570,6 +10664,12 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) failure_mssg = "unexpected size/len in flush op eviction test 13."; } + /* modifications to the H5C_flush_single_entry() function have + * changed the behavior of the cache slightly, causing + * this test to fail. Comment out for now -- come back and + * fix if all goes well. + */ + /* verify entry status */ verify_entry_status(cache_ptr, 11, @@ -10585,8 +10685,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -10616,23 +10715,24 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( ( cache_ptr->insertions[VARIABLE_ENTRY_TYPE] != 0 ) || ( cache_ptr->pinned_insertions[VARIABLE_ENTRY_TYPE] != 0 ) || ( cache_ptr->clears[VARIABLE_ENTRY_TYPE] != 0 ) || - ( cache_ptr->flushes[VARIABLE_ENTRY_TYPE] != 14 ) || - ( cache_ptr->evictions[VARIABLE_ENTRY_TYPE] != 9 ) || + ( cache_ptr->flushes[VARIABLE_ENTRY_TYPE] != 8 ) || + ( cache_ptr->evictions[VARIABLE_ENTRY_TYPE] != 11 ) || + ( cache_ptr->take_ownerships[VARIABLE_ENTRY_TYPE] != 0 ) || ( cache_ptr->moves[VARIABLE_ENTRY_TYPE] != 1 ) || ( cache_ptr->entry_flush_moves[VARIABLE_ENTRY_TYPE] != 0 ) || ( cache_ptr->cache_flush_moves[VARIABLE_ENTRY_TYPE] != 0 ) || ( cache_ptr->pins[VARIABLE_ENTRY_TYPE] != 2 ) || ( cache_ptr->unpins[VARIABLE_ENTRY_TYPE] != 2 ) || - ( cache_ptr->dirty_pins[VARIABLE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->dirty_pins[VARIABLE_ENTRY_TYPE] != 2 ) || ( cache_ptr->pinned_flushes[VARIABLE_ENTRY_TYPE] != 0 ) || ( cache_ptr->pinned_clears[VARIABLE_ENTRY_TYPE] != 0 ) || ( cache_ptr->size_increases[VARIABLE_ENTRY_TYPE] != 3 ) || - ( cache_ptr->size_decreases[VARIABLE_ENTRY_TYPE] != 4 ) || + ( cache_ptr->size_decreases[VARIABLE_ENTRY_TYPE] != 6 ) || ( cache_ptr->entry_flush_size_changes[VARIABLE_ENTRY_TYPE] != 1 ) || ( cache_ptr->cache_flush_size_changes[VARIABLE_ENTRY_TYPE] != 0 ) ) { pass = FALSE; - failure_mssg = "Unexpected variable size entry stats."; + failure_mssg = "Unexpected variable size entry stats in check_flush_cache__flush_op_eviction_test()."; } } @@ -10641,8 +10741,9 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( ( cache_ptr->insertions[LARGE_ENTRY_TYPE] != 0 ) || ( cache_ptr->pinned_insertions[LARGE_ENTRY_TYPE] != 0 ) || ( cache_ptr->clears[LARGE_ENTRY_TYPE] != 0 ) || - ( cache_ptr->flushes[LARGE_ENTRY_TYPE] != 38 ) || + ( cache_ptr->flushes[LARGE_ENTRY_TYPE] != 25 ) || ( cache_ptr->evictions[LARGE_ENTRY_TYPE] != 14 ) || + ( cache_ptr->take_ownerships[LARGE_ENTRY_TYPE] != 0 ) || ( cache_ptr->moves[LARGE_ENTRY_TYPE] != 0 ) || ( cache_ptr->entry_flush_moves[LARGE_ENTRY_TYPE] != 0 ) || ( cache_ptr->cache_flush_moves[LARGE_ENTRY_TYPE] != 0 ) || @@ -10657,7 +10758,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) ( cache_ptr->cache_flush_size_changes[LARGE_ENTRY_TYPE] != 0 ) ) { pass = FALSE; - failure_mssg = "Unexpected monster entry stats."; + failure_mssg = "Unexpected large entry stats in check_flush_cache__flush_op_eviction_test()."; } } @@ -10666,8 +10767,9 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( ( cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0 ) || ( cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0 ) || ( cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0 ) || - ( cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 93 ) || - ( cache_ptr->evictions[MONSTER_ENTRY_TYPE] != 31 ) || + ( cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 62 ) || + ( cache_ptr->evictions[MONSTER_ENTRY_TYPE] != 32 ) || + ( cache_ptr->take_ownerships[MONSTER_ENTRY_TYPE] != 0 ) || ( cache_ptr->moves[MONSTER_ENTRY_TYPE] != 0 ) || ( cache_ptr->entry_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || ( cache_ptr->cache_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || @@ -10682,7 +10784,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) ( cache_ptr->cache_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) ) { pass = FALSE; - failure_mssg = "Unexpected monster entry stats."; + failure_mssg = "Unexpected monster entry stats in check_flush_cache__flush_op_eviction_test()."; } } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -10741,17 +10843,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 1, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 1, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -10759,17 +10860,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 2, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 2, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ TRUE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -10777,17 +10877,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 3, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 3, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -10795,17 +10894,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 4, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 4, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -10813,17 +10911,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 5, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 5, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -10831,17 +10928,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 6, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 6, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -10849,17 +10945,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 7, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 7, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -10867,17 +10962,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 8, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 8, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -10885,18 +10979,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 9, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 9, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -10904,18 +10997,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 10, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 10, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -10923,18 +11015,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 11, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 11, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -10942,18 +11033,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 12, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 12, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -10961,18 +11051,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 13, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 13, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -10980,18 +11069,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 14, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 14, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -10999,19 +11087,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 15, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 15, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11019,19 +11106,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 16, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 16, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11039,17 +11125,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 17, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 17, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11057,17 +11142,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 18, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 18, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ TRUE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11075,17 +11159,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 19, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 19, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11093,17 +11176,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 20, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 20, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11111,17 +11193,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 21, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 21, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11129,17 +11210,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 22, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 22, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11147,17 +11227,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 23, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 23, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11165,17 +11244,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 24, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 24, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11183,18 +11261,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 25, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 25, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11202,18 +11279,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 26, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 26, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11221,18 +11297,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 27, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 27, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11240,18 +11315,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 28, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 28, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11259,18 +11333,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 29, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 29, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11278,18 +11351,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 30, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 30, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11297,19 +11369,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 31, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 31, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11317,19 +11388,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 32, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + /* file_ptr */ file_ptr, + /* test_num */ 32, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11337,17 +11407,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 33, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 33, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11355,17 +11424,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 34, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 34, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11373,17 +11441,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 35, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 35, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11391,17 +11458,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 36, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 36, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11409,17 +11475,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 37, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 37, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11427,17 +11492,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 38, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 38, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11445,17 +11509,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 39, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 39, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11463,17 +11526,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 40, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 40, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11481,18 +11543,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 41, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 41, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11500,18 +11561,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 42, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 42, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11519,18 +11579,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 43, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 43, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11538,18 +11597,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 44, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 44, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11557,18 +11615,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 45, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 45, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11576,18 +11633,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 46, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 46, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11595,19 +11651,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 47, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 47, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11615,19 +11670,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 48, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 48, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11635,17 +11689,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 49, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 49, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11653,17 +11706,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 50, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 50, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11671,17 +11723,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 51, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 51, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11689,17 +11740,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 52, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 52, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11707,17 +11757,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 53, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 53, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11725,17 +11774,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 54, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 54, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11743,17 +11791,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 55, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 55, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11761,17 +11808,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 56, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 56, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11779,18 +11825,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 57, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 57, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11798,18 +11843,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 58, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 58, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11817,18 +11861,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 59, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 59, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11836,18 +11879,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 60, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 60, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11855,18 +11897,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 61, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 61, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11874,18 +11915,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 62, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 62, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11893,19 +11933,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 63, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 63, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11913,19 +11952,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 64, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 64, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11953,14 +11991,13 @@ check_flush_cache__single_entry(H5F_t * file_ptr) * This yields a total of 256 tests. * * The tests and their expected results are given in the spec table - * below. The values assigned to the expected_cleared, expected_flushed, + * below. The values assigned to the expected_serialized, * and expected_destroyed fields are somewhat arcane, so the following * overview may be useful. * * In addition to simply checking to see if the test case runs, * we also check to see if the desired operations take place on the - * cache entry. Thus expected_cleared is set to TRUE if we expect - * the entry to be flushed, expected_flushed is set to TRUE if we + * cache entry. Thus expected_serialized is set to TRUE if we * we expect the entry to be flushed, and expected_destroyed is set * to TRUE if we expect the entry to be destroyed. * @@ -11998,277 +12035,277 @@ check_flush_cache__single_entry(H5F_t * file_ptr) int test_num; int entry_type; int entry_idx; + hbool_t dirty_flag; hbool_t mark_dirty; hbool_t pop_mark_dirty_prot; hbool_t pop_mark_dirty_pinned; hbool_t unprotect_unpin; unsigned int flags; unsigned int flush_flags; - hbool_t expected_cleared; - hbool_t expected_flushed; + hbool_t expected_serialized; hbool_t expected_destroyed; } spec[256] = - /* pop pop - * ent mark mark - * test entry -ry mark dirty dirty unprot flush expect expect expect - * num type idx dirty prot pinned unpin flags flags clear flush destroy + /* pop pop + * ent unprot mark mark + * test entry -ry dirty mark dirty dirty unprot flush expect expect + * num type idx flag dirty prot pinned unpin flags flags srlzd destroy */ - { { 1, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE, FALSE }, - { 2, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE, FALSE }, - { 3, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 4, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 5, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 6, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 7, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 8, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 9, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 10, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 11, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 12, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 13, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 14, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 15, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 16, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 17, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 18, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 19, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 20, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 21, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 22, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 23, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 24, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 25, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 26, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 27, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 28, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 29, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 30, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 31, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 32, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 33, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE, FALSE }, - { 34, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE, FALSE }, - { 35, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 36, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 37, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 38, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 39, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 40, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 41, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 42, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 43, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 44, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 45, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 46, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 47, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 48, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 49, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 50, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 51, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 52, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 53, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 54, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 55, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 56, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 57, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 58, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 59, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 60, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 61, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 62, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 63, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 64, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 65, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 66, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 67, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 68, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 69, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 70, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 71, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 72, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 73, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 74, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 75, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 76, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 77, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 78, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 79, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 80, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 81, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 82, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 83, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 84, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 85, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 86, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 87, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 88, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 89, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 90, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 91, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 92, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 93, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 94, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 95, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 96, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 97, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 98, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 99, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 100, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 101, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 102, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 103, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 104, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 105, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 106, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 107, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 108, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 109, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 110, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 111, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 112, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 113, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 114, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 115, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 116, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 117, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 118, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 119, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 120, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 121, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 122, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 123, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 124, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 125, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 126, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 127, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 128, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 129, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 130, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 131, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 132, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 133, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 134, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 135, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 136, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 137, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 138, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 139, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 140, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 141, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 142, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 143, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 144, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 145, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 146, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 147, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 148, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 149, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 150, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 151, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 152, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 153, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 154, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 155, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 156, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 157, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 158, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 159, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 160, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 161, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 162, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 163, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 164, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 165, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 166, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 167, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 168, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 169, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 170, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 171, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 172, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 173, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 174, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 175, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 176, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 177, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 178, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 179, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 180, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 181, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 182, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 183, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 184, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 185, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 186, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 187, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 188, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 189, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 190, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 191, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 192, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 193, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 194, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 195, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 196, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 197, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 198, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 199, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 200, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 201, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 202, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 203, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 204, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 205, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 206, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 207, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 208, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 209, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 210, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 211, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 212, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 213, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 214, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 215, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 216, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 217, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 218, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 219, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 220, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 221, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 222, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 223, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 224, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 225, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 226, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 227, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 228, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 229, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 230, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 231, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 232, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 233, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 234, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 235, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 236, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 237, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 238, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 239, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 240, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 241, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 242, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 243, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 244, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 245, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 246, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 247, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 248, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 249, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 250, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 251, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 252, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 253, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 254, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 255, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 256, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE } }; + { { 1, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE }, + { 2, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE }, + { 3, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 4, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 5, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 6, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 7, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 8, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 9, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 10, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 11, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 12, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 13, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 14, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 15, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 16, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 17, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 18, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 19, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 20, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 21, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 22, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 23, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 24, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 25, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 26, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 27, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 28, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 29, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 30, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 31, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 32, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 33, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE }, + { 34, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE }, + { 35, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 36, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 37, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 38, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 39, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 40, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 41, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 42, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 43, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 44, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 45, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 46, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 47, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 48, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 49, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 50, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 51, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 52, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 53, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 54, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 55, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 56, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 57, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 58, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 59, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 60, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 61, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 62, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 63, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 64, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 65, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 66, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 67, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 68, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 69, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 70, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 71, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 72, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 73, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 74, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 75, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 76, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 77, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 78, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 79, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 80, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 81, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 82, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 83, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 84, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 85, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 86, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 87, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 88, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 89, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 90, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 91, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 92, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 93, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 94, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 95, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 96, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 97, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 98, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 99, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 100, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 101, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 102, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 103, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 104, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 105, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 106, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 107, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 108, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 109, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 110, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 111, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 112, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 113, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 114, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 115, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 116, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 117, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 118, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 119, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 120, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 121, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 122, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 123, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 124, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 125, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 126, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 127, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 128, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 129, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 130, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 131, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 132, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 133, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 134, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 135, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 136, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 137, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 138, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 139, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 140, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 141, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 142, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 143, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 144, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 145, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 146, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 147, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 148, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 149, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 150, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 151, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 152, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 153, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 154, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 155, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 156, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 157, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 158, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 159, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 160, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 161, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 162, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 163, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 164, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 165, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 166, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 167, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 168, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 169, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 170, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 171, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 172, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 173, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 174, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 175, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 176, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 177, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 178, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 179, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 180, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 181, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 182, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 183, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 184, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 185, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 186, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 187, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 188, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 189, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 190, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 191, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 192, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 193, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 194, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 195, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 196, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 197, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 198, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 199, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 200, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 201, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 202, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 203, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 204, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 205, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 206, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 207, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 208, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 209, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 210, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 211, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 212, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 213, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 214, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 215, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 216, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 217, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 218, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 219, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 220, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 221, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 222, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 223, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 224, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 225, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 226, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 227, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 228, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 229, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 230, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 231, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 232, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 233, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 234, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 235, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 236, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 237, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 238, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 239, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 240, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 241, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 242, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 243, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 244, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 245, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 246, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 247, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 248, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 249, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 250, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 251, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 252, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 253, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 254, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 255, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 256, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE } }; i = 0; while ( ( pass ) && ( i < 256 ) ) @@ -12279,14 +12316,14 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* test_num */ spec[i].test_num, /* entry_type */ spec[i].entry_type, /* entry_idx */ spec[i].entry_idx, + /* dirty_flag */ spec[i].dirty_flag, /* mark_dirty */ spec[i].mark_dirty, /* pop_mark_dirty_prot */ spec[i].pop_mark_dirty_prot, /* pop_mark_dirty_pinned */ spec[i].pop_mark_dirty_pinned, /* unprotect_unpin */ spec[i].unprotect_unpin, /* flags */ spec[i].flags, /* flush_flags */ spec[i].flush_flags, - /* expected_cleared */ spec[i].expected_cleared, - /* expected_flushed */ spec[i].expected_flushed, + /* expected_serialized */ spec[i].expected_serialized, /* expected_destroyed */ spec[i].expected_destroyed ); i++; @@ -12321,9 +12358,8 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, hbool_t insert_flag, unsigned int flags, unsigned int flush_flags, - hbool_t expected_loaded, - hbool_t expected_cleared, - hbool_t expected_flushed, + hbool_t expected_deserialized, + hbool_t expected_serialized, hbool_t expected_destroyed) { H5C_t * cache_ptr = file_ptr->shared->cache; @@ -12378,7 +12414,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, flush_flags); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -12388,21 +12424,17 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, flush_flags, test_num); failure_mssg = msg; } - else if ( ( entry_ptr->loaded != expected_loaded ) || - ( entry_ptr->cleared != expected_cleared ) || - ( entry_ptr->flushed != expected_flushed ) || + else if ( ( entry_ptr->deserialized != expected_deserialized ) || + ( entry_ptr->serialized != expected_serialized ) || ( entry_ptr->destroyed != expected_destroyed ) ) { - #if 0 /* This is useful debugging code -- lets keep it for a while */ HDfprintf(stdout, - "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->loaded), - (int)expected_loaded, - (int)(entry_ptr->cleared), - (int)expected_cleared, - (int)(entry_ptr->flushed), - (int)expected_flushed, + "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", + (int)(entry_ptr->deserialized), + (int)expected_deserialized, + (int)(entry_ptr->serialized), + (int)expected_serialized, (int)(entry_ptr->destroyed), (int)expected_destroyed); #endif @@ -12441,8 +12473,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -12463,10 +12494,9 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, } else { - entry_ptr->loaded = FALSE; - entry_ptr->cleared = FALSE; - entry_ptr->flushed = FALSE; - entry_ptr->destroyed = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->serialized = FALSE; + entry_ptr->destroyed = FALSE; } } @@ -12503,19 +12533,19 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, int test_num, int entry_type, int entry_idx, + hbool_t unprot_dirty_flag, hbool_t mark_dirty, hbool_t pop_mark_dirty_prot, hbool_t pop_mark_dirty_pinned, hbool_t unprotect_unpin, unsigned int flags, unsigned int flush_flags, - hbool_t expected_cleared, - hbool_t expected_flushed, + hbool_t expected_serialized, hbool_t expected_destroyed) { H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; - hbool_t expected_loaded = TRUE; + hbool_t expected_deserialized = TRUE; herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr = NULL; @@ -12559,7 +12589,9 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, mark_entry_dirty(entry_type, entry_idx); } - unprotect_entry(file_ptr, entry_type, entry_idx, (flags | H5C__PIN_ENTRY_FLAG)); + unprotect_entry(file_ptr, entry_type, entry_idx, + (unprot_dirty_flag ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) | + (flags | H5C__PIN_ENTRY_FLAG)); if ( mark_dirty ) { @@ -12574,8 +12606,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - flush_flags); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -12585,19 +12616,16 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, flush_flags, test_num); failure_mssg = msg; } - else if ( ( entry_ptr->loaded != expected_loaded ) || - ( entry_ptr->cleared != expected_cleared ) || - ( entry_ptr->flushed != expected_flushed ) || + else if ( ( entry_ptr->deserialized != expected_deserialized ) || + ( entry_ptr->serialized != expected_serialized ) || ( entry_ptr->destroyed != expected_destroyed ) ) { #if 0 /* this is useful debugging code -- keep it around */ HDfprintf(stdout, - "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->loaded), - (int)expected_loaded, - (int)(entry_ptr->cleared), - (int)expected_cleared, - (int)(entry_ptr->flushed), - (int)expected_flushed, + "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", + (int)(entry_ptr->deserialized), + (int)expected_deserialized, + (int)(entry_ptr->serialized), + (int)expected_serialized, (int)(entry_ptr->destroyed), (int)expected_destroyed); #endif @@ -12641,7 +12669,8 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, protect_entry(file_ptr, entry_type, entry_idx); unprotect_entry(file_ptr, entry_type, entry_idx, - (flags & H5C__DIRTIED_FLAG) | H5C__UNPIN_ENTRY_FLAG); + (unprot_dirty_flag ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) | + H5C__UNPIN_ENTRY_FLAG); } else { @@ -12652,8 +12681,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -12674,10 +12702,9 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, } else { - entry_ptr->loaded = FALSE; - entry_ptr->cleared = FALSE; - entry_ptr->flushed = FALSE; - entry_ptr->destroyed = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->serialized = FALSE; + entry_ptr->destroyed = FALSE; } } @@ -12982,9 +13009,8 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 1."); failure_mssg = msg; - } else if ( ( entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -13024,10 +13050,9 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 2."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || - ( entry_ptr->destroyed ) ) { + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || + ( entry_ptr->destroyed ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 2."); @@ -13037,7 +13062,7 @@ check_expunge_entry(void) } /* Expunge the entry and then verify that it is no longer in the cache. - * Also verify that the entry was loaded, cleared, and destroyed, but + * Also verify that the entry was loaded and destroyed, but * not flushed. */ if ( pass ) { @@ -13068,10 +13093,9 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 3."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( ! entry_ptr->cleared ) || - ( entry_ptr->flushed ) || - ( ! entry_ptr->destroyed ) ) { + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || + ( ! entry_ptr->destroyed ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry history 3."); @@ -13110,9 +13134,8 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 4."); failure_mssg = msg; - } else if ( ( entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -13153,9 +13176,8 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 5."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -13166,7 +13188,7 @@ check_expunge_entry(void) } /* Expunge the entry and then verify that it is no longer in the cache. - * Also verify that the entry was loaded, cleared and destroyed, but not + * Also verify that the entry was loaded and destroyed, but not * flushed. */ if ( pass ) { @@ -13198,9 +13220,8 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 6."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( ! entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -13795,8 +13816,23 @@ check_move_entry__run_test(H5F_t * file_ptr, test_entry_t * entry_ptr = NULL; H5C_cache_entry_t * test_ptr = NULL; - assert( cache_ptr ); - assert( spec_ptr ); + if ( cache_ptr == NULL ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "cache_ptr NULL on entry to move test #%d.", + test_num); + failure_mssg = msg; + + } else if ( spec_ptr == NULL ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "spec_ptr NULL on entry to move test #%d.", + test_num); + failure_mssg = msg; + + } if ( pass ) { @@ -14147,9 +14183,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 1."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14171,9 +14206,9 @@ check_resize_entry(void) } else { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, (void *)entry_ptr, - H5C__DIRTIED_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, + (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result < 0 ) { @@ -14228,9 +14263,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 2."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14258,9 +14292,9 @@ check_resize_entry(void) } else { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, (void *)entry_ptr, - H5C__DIRTIED_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, + (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result < 0 ) { @@ -14315,9 +14349,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 3."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14384,9 +14417,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 4."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14445,9 +14477,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 5."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14485,9 +14516,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 6."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( ! entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -14600,9 +14630,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 7."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14624,9 +14653,9 @@ check_resize_entry(void) } else { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, (void *)entry_ptr, - H5C__DIRTIED_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, + (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result < 0 ) { @@ -14683,9 +14712,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 8."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14713,9 +14741,9 @@ check_resize_entry(void) } else { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, (void *)entry_ptr, - H5C__DIRTIED_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, + (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result < 0 ) { @@ -14770,9 +14798,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 9."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14841,9 +14868,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 10."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14902,9 +14928,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 11."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14942,9 +14967,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 12."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( ! entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -15239,9 +15263,8 @@ check_evictions_enabled(void) HDsnprintf(msg, (size_t)128, "Unexpected status 1."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( ! entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -15306,9 +15329,8 @@ check_evictions_enabled(void) HDsnprintf(msg, (size_t)128, "Unexpected status 2."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( ! entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -15526,9 +15548,8 @@ check_evictions_enabled(void) HDsnprintf(msg, (size_t)128, "Unexpected status 3."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( ! entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -15562,9 +15583,8 @@ check_evictions_enabled(void) HDsnprintf(msg, (size_t)128, "Unexpected status 4."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( ! entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -15697,9 +15717,8 @@ check_evictions_enabled(void) HDsnprintf(msg, (size_t)128, "Unexpected status 5."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( ! entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -15791,8 +15810,7 @@ check_flush_protected_err(void) protect_entry(file_ptr, 0, 0); - if ( H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - H5C__NO_FLAGS_SET) >= 0 ) { + if ( H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET) >= 0 ) { pass = FALSE; failure_mssg = "flush succeeded on cache with protected entry.\n"; @@ -15801,8 +15819,7 @@ check_flush_protected_err(void) unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG); - if ( H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - H5C__NO_FLAGS_SET) < 0 ) { + if ( H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET) < 0 ) { pass = FALSE; failure_mssg = "flush failed after unprotect.\n"; @@ -15871,7 +15888,7 @@ check_destroy_pinned_err(void) protect_entry(file_ptr, 0, 0); unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); - if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT) >= 0 ) { + if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT) >= 0 ) { pass = FALSE; failure_mssg = "destroy succeeded on cache with pinned entry.\n"; @@ -15880,7 +15897,7 @@ check_destroy_pinned_err(void) unpin_entry(0, 0); - if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT) < 0 ) { + if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) { pass = FALSE; failure_mssg = "destroy failed after unpin.\n"; @@ -15957,7 +15974,7 @@ check_destroy_protected_err(void) protect_entry(file_ptr, 0, 0); - if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT) >= 0 ) { + if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT) >= 0 ) { pass = FALSE; failure_mssg = "destroy succeeded on cache with protected entry.\n"; @@ -15966,7 +15983,7 @@ check_destroy_protected_err(void) unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG); - if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT) < 0 ) { + if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) { pass = FALSE; failure_mssg = "destroy failed after unprotect.\n"; @@ -16050,8 +16067,9 @@ check_duplicate_insert_err(void) base_addr = entries[0]; entry_ptr = &(base_addr[0]); - result = H5C_insert_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, (void *)entry_ptr, H5C__NO_FLAGS_SET); + result = H5C_insert_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + (void *)entry_ptr, H5C__NO_FLAGS_SET); if ( result >= 0 ) { @@ -16227,9 +16245,9 @@ check_double_pin_err(void) if ( pass ) { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, (void *)entry_ptr, - H5C__PIN_ENTRY_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + (void *)entry_ptr, H5C__PIN_ENTRY_FLAG); if ( result > 0 ) { @@ -16312,9 +16330,9 @@ check_double_unpin_err(void) if ( pass ) { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, (void *)entry_ptr, - H5C__UNPIN_ENTRY_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + (void *)entry_ptr, H5C__UNPIN_ENTRY_FLAG); if ( result > 0 ) { @@ -16513,8 +16531,9 @@ check_double_protect_err(void) if ( pass ) { - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, NULL, H5C__NO_FLAGS_SET); + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + &entry_ptr->addr, H5C__NO_FLAGS_SET); if ( cache_entry_ptr != NULL ) { @@ -16592,9 +16611,9 @@ check_double_unprotect_err(void) if ( pass ) { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, (void *)entry_ptr, - H5C__NO_FLAGS_SET); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + (void *)entry_ptr, H5C__NO_FLAGS_SET); if ( result > 0 ) { @@ -16757,7 +16776,7 @@ check_expunge_entry_errs(void) if ( pass ) { - result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, + result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types[0]), entry_ptr->addr, H5C__NO_FLAGS_SET); if ( result > 0 ) { @@ -16775,7 +16794,7 @@ check_expunge_entry_errs(void) if ( pass ) { - result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, + result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types[0]), entry_ptr->addr, H5C__NO_FLAGS_SET); if ( result > 0 ) { @@ -16793,7 +16812,7 @@ check_expunge_entry_errs(void) if ( pass ) { - result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, + result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types[0]), entry_ptr->addr, H5C__NO_FLAGS_SET); if ( result < 0 ) { @@ -16969,9 +16988,9 @@ check_unprotect_ro_dirty_err(void) if ( pass ) { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, (void *)entry_ptr, - H5C__DIRTIED_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result >= 0 ) { @@ -17013,9 +17032,9 @@ check_unprotect_ro_dirty_err(void) if ( pass ) { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, (void *)entry_ptr, - H5C__DIRTIED_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result > 0 ) { @@ -17099,8 +17118,9 @@ check_protect_ro_rw_err(void) if ( pass ) { - thing_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, NULL, H5C__NO_FLAGS_SET); + thing_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + &entry_ptr->addr, H5C__NO_FLAGS_SET); if ( thing_ptr != NULL ) { @@ -20402,10 +20422,6 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - if ( pass ) { - - takedown_cache(file_ptr, FALSE, FALSE); - } /* now test the flash cache size increment code. At least at present, * there should be no interaction between the regular auto-resize @@ -20420,18 +20436,18 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* allocate a cache, enable the flash cache size increase code, and - * then force the flash size increase code through all its operational - * modes. Verify that all performs as expected. + /* Place the cache in a known state via a flush-destroy on the cache + * to clear out all entries, and then a reset on all the entries. + * Then configure the cache for the flash cache size increase tests, + * and force the flash size increase code through all its operational + * modes. Verify that all perform as expected. */ if ( pass ) { - reset_entries(); + flush_cache(file_ptr, TRUE, FALSE, FALSE); - file_ptr = setup_cache((size_t)(2 * 1024), - (size_t)(1 * 1024)); - cache_ptr = file_ptr->shared->cache; + reset_entries(); } if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -27913,10 +27929,10 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) int32_t entry_idx = 0; int32_t i; - /* Expected loaded status of entries depends on how they get into - * the cache. Insertions = not loaded, protect/unprotect = loaded. + /* Expected deserialized status of entries depends on how they get into + * the cache. Insertions = not deserialized, protect/unprotect = deserialized. */ - hbool_t loaded = (hbool_t)!(fill_via_insertion); + hbool_t deserialized = (hbool_t)!(fill_via_insertion); /* Set up the expected array. This is used to maintain a table of the * expected status of every entry used in this test. @@ -27924,157 +27940,157 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) struct expected_entry_status expected[150] = { /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: loaded: clrd: flshd: dest: par type: par idx: dep ref.count: dep height: order: */ - { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 4, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 5, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 6, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 7, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 8, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 9, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 10, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 11, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 12, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 13, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 14, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 15, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 16, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 17, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 18, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 19, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 20, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 21, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 22, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 23, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 24, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 25, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 26, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 27, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 28, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 29, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 30, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 31, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 32, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 33, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 34, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 35, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 36, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 37, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 38, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 39, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 40, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 41, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 42, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 43, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 44, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 45, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 46, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 47, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 48, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 49, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 50, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 51, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 52, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 53, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 54, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 55, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 56, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 57, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 58, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 59, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 60, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 61, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 62, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 63, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 64, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 65, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 66, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 67, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 68, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 69, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 70, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 71, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 72, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 73, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 74, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 75, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 76, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 77, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 78, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 79, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 80, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 81, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 82, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 83, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 84, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 85, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 86, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 87, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 88, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 89, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 90, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 91, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 92, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 93, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 94, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 95, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 96, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 97, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 98, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 99, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 100, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 101, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 102, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 103, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 104, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 105, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 106, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 107, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 108, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 109, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 110, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 111, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 112, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 113, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 114, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 115, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 116, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 117, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 118, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 119, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 120, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 121, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 122, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 123, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 124, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 125, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 126, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 127, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 128, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 129, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 130, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 131, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 132, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 133, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 134, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 135, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 136, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 137, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 138, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 139, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 140, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 141, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 142, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 143, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 144, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 145, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 146, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 147, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 148, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { HUGE_ENTRY_TYPE, 149, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 } + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type: par idx: dep ref.count: dep height: order: */ + { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 4, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 5, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 6, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 7, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 8, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 9, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 10, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 11, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 12, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 13, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 14, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 15, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 16, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 17, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 18, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 19, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 20, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 21, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 22, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 23, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 24, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 25, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 26, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 27, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 28, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 29, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 30, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 31, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 32, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 33, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 34, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 35, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 36, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 37, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 38, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 39, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 40, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 41, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 42, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 43, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 44, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 45, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 46, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 47, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 48, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 49, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 50, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 51, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 52, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 53, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 54, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 55, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 56, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 57, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 58, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 59, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 60, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 61, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 62, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 63, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 64, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 65, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 66, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 67, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 68, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 69, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 70, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 71, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 72, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 73, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 74, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 75, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 76, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 77, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 78, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 79, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 80, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 81, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 82, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 83, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 84, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 85, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 86, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 87, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 88, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 89, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 90, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 91, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 92, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 93, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 94, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 95, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 96, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 97, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 98, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 99, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 100, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 101, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 102, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 103, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 104, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 105, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 106, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 107, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 108, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 109, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 110, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 111, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 112, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 113, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 114, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 115, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 116, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 117, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 118, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 119, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 120, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 121, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 122, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 123, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 124, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 125, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 126, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 127, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 128, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 129, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 130, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 131, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 132, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 133, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 134, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 135, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 136, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 137, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 138, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 139, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 140, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 141, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 142, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 143, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 144, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 145, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 146, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 147, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 148, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 149, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 } }; pass = TRUE; @@ -28167,7 +28183,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) */ expected[entry_idx].in_cache = TRUE; expected[entry_idx].is_dirty = TRUE; - expected[entry_idx].loaded = (unsigned char)loaded; + expected[entry_idx].deserialized = (unsigned char)deserialized; verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ entry_idx, /* int tag */ @@ -28231,13 +28247,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) */ /* entry w/ index 0 has now been flushed and is now clean. */ - expected[0].flushed = TRUE; expected[0].is_dirty = FALSE; + expected[0].serialized = TRUE; /* entry w/ index 26 is now in the cache and dirty. */ expected[26].in_cache = TRUE; expected[26].is_dirty = TRUE; - expected[26].loaded = (unsigned char)loaded; + expected[26].deserialized = (unsigned char)deserialized; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -28285,13 +28301,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) */ /* entry w/ index 1 has now been flushed and is now clean. */ - expected[1].flushed = TRUE; expected[1].is_dirty = FALSE; + expected[1].serialized = TRUE; /* entry w/ index 27 is now in the cache and dirty. */ expected[27].in_cache = TRUE; expected[27].is_dirty = TRUE; - expected[27].loaded = (unsigned char)loaded; + expected[27].deserialized = (unsigned char)deserialized; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -28331,12 +28347,12 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) * entry currently getting inserted is now in the cache and * dirty. */ - expected[entry_idx - 26].flushed = TRUE; expected[entry_idx - 26].is_dirty = FALSE; + expected[entry_idx - 26].serialized = TRUE; expected[entry_idx].in_cache = TRUE; expected[entry_idx].is_dirty = TRUE; - expected[entry_idx].loaded = (unsigned char)loaded; + expected[entry_idx].deserialized = (unsigned char)deserialized; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -28411,15 +28427,15 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) expected[0].destroyed = TRUE; /* entries w/ indices 24,25 have now been flushed and are clean. */ - expected[24].flushed = TRUE; expected[24].is_dirty = FALSE; - expected[25].flushed = TRUE; + expected[24].serialized = TRUE; expected[25].is_dirty = FALSE; + expected[25].serialized = TRUE; /* entry w/ index 50 is now in the cache and dirty */ expected[50].in_cache = TRUE; expected[50].is_dirty = TRUE; - expected[50].loaded = (unsigned char)loaded; + expected[50].deserialized = (unsigned char)deserialized; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -28464,7 +28480,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) /* This past inserted entry is now in the cache and dirty */ expected[entry_idx].in_cache = TRUE; expected[entry_idx].is_dirty = TRUE; - expected[entry_idx].loaded = (unsigned char)loaded; + expected[entry_idx].deserialized = (unsigned char)deserialized; /* The entry inserted 50 insertions ago has been evicted */ expected[entry_idx - 50].in_cache = FALSE; @@ -28476,8 +28492,8 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) * 25 insertions ago. */ if (entry_idx < 75) { - expected[entry_idx - 25].flushed = TRUE; expected[entry_idx - 25].is_dirty = FALSE; + expected[entry_idx - 25].serialized = TRUE; } /* If the newly inserted entry is among the last * 25 insertions in this loop, then the insertion will @@ -28488,8 +28504,8 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) * flush-then-evict, it switches to evict-then-flush. */ else { - expected[entry_idx - 26].flushed = TRUE; expected[entry_idx - 26].is_dirty = FALSE; + expected[entry_idx - 26].serialized = TRUE; } /* Verify this expected status */ @@ -28551,8 +28567,8 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) /* entries w/ indices 74-99 have been flushed. */ for (i = 74; i < 100; i++) { - expected[i].flushed = TRUE; expected[i].is_dirty = FALSE; + expected[i].serialized = TRUE; } verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ 0, /* int tag */ @@ -28595,7 +28611,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) /* This past inserted entry is now in the cache and dirty */ expected[entry_idx].in_cache = TRUE; expected[entry_idx].is_dirty = TRUE; - expected[entry_idx].loaded = (unsigned char)loaded; + expected[entry_idx].deserialized = (unsigned char)deserialized; /* The entry with ID minus 50 will have been evicted */ expected[entry_idx - 50].in_cache = FALSE; @@ -28645,13 +28661,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) expected[76].destroyed = TRUE; /* entry w/ index 100 has now been flushed and is now clean. */ - expected[100].flushed = TRUE; expected[100].is_dirty = FALSE; + expected[100].serialized = TRUE; /* entry w/ index 26 is now in the cache and dirty. */ expected[126].in_cache = TRUE; expected[126].is_dirty = TRUE; - expected[126].loaded = (unsigned char)loaded; + expected[126].deserialized = (unsigned char)deserialized; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -28689,15 +28705,15 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) /* This past inserted entry is now in the cache and dirty */ expected[entry_idx].in_cache = TRUE; expected[entry_idx].is_dirty = TRUE; - expected[entry_idx].loaded = (unsigned char)loaded; + expected[entry_idx].deserialized = (unsigned char)deserialized; /* The entry with ID minus 50 will have been evicted */ expected[entry_idx - 50].in_cache = FALSE; expected[entry_idx - 50].destroyed = TRUE; /* The entry with ID minus 26 will now be clean */ - expected[entry_idx - 26].flushed = TRUE; expected[entry_idx - 26].is_dirty = FALSE; + expected[entry_idx - 26].serialized = TRUE; /* verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -28712,7 +28728,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); - if ( pass ) { + if ( cache_ptr ) { /* We're done with testing. We can take down the cache. */ takedown_cache(file_ptr, FALSE, FALSE); @@ -28754,12 +28770,12 @@ check_flush_deps(void) struct expected_entry_status expected[5] = { /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: loaded: clrd: flshd: dest: par type: par idx: dep ref.count: dep height: order: */ - { PICO_ENTRY_TYPE, 0, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { PICO_ENTRY_TYPE, 1, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { PICO_ENTRY_TYPE, 2, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { PICO_ENTRY_TYPE, 3, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { PICO_ENTRY_TYPE, 4, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 } + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type: par idx: dep ref.count: dep height: order: */ + { PICO_ENTRY_TYPE, 0, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { PICO_ENTRY_TYPE, 1, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { PICO_ENTRY_TYPE, 2, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { PICO_ENTRY_TYPE, 3, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { PICO_ENTRY_TYPE, 4, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 } }; TESTING("flush dependencies"); @@ -30793,12 +30809,12 @@ check_flush_deps_order(void) struct expected_entry_status expected[5] = { /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: loaded: clrd: flshd: dest: par type: par idx: dep ref.count: dep height: order: */ - { PICO_ENTRY_TYPE, 0, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { PICO_ENTRY_TYPE, 1, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { PICO_ENTRY_TYPE, 2, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { PICO_ENTRY_TYPE, 3, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { PICO_ENTRY_TYPE, 4, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 } + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type: par idx: dep ref.count: dep height: order: */ + { PICO_ENTRY_TYPE, 0, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { PICO_ENTRY_TYPE, 1, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { PICO_ENTRY_TYPE, 2, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { PICO_ENTRY_TYPE, 3, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { PICO_ENTRY_TYPE, 4, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 } }; unsigned flush_order; /* Index for tracking flush order */ @@ -30881,25 +30897,25 @@ check_flush_deps_order(void) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency */ expected[0].is_dirty = FALSE; - expected[0].flushed = TRUE; + expected[0].serialized = TRUE; expected[0].flush_order = 0; expected[1].is_dirty = FALSE; - expected[1].flushed = TRUE; + expected[1].serialized = TRUE; expected[1].flush_order = 1; expected[1].is_protected = FALSE; expected[2].is_dirty = FALSE; - expected[2].flushed = TRUE; + expected[2].serialized = TRUE; expected[3].is_dirty = FALSE; - expected[3].flushed = TRUE; + expected[3].serialized = TRUE; expected[4].is_dirty = FALSE; - expected[4].flushed = TRUE; + expected[4].serialized = TRUE; /* Verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -30979,27 +30995,27 @@ check_flush_deps_order(void) dirty_entry(file_ptr, entry_type, 1, FALSE); if ( !pass ) CACHE_ERROR("dirty_entry failed") - /* Reset 'flushed' flag & 'flush_order' value in expected array */ - expected[0].flushed = FALSE; + /* Reset 'serialized' flag & 'flush_order' value in expected array */ + expected[0].serialized = FALSE; expected[0].flush_order = -1; - expected[1].flushed = FALSE; + expected[1].serialized = FALSE; expected[1].flush_order = -1; /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency */ expected[0].is_dirty = FALSE; - expected[0].flushed = TRUE; + expected[0].serialized = TRUE; expected[0].flush_order = 1; expected[0].is_protected = FALSE; expected[1].is_dirty = FALSE; - expected[1].flushed = TRUE; + expected[1].serialized = TRUE; expected[1].flush_order = 0; /* Verify the status */ @@ -31090,31 +31106,31 @@ check_flush_deps_order(void) dirty_entry(file_ptr, entry_type, 2, TRUE); if ( !pass ) CACHE_ERROR("dirty_entry failed") - /* Reset 'flushed' flag & 'flush_order' value in expected array */ - expected[0].flushed = FALSE; + /* Reset 'serialized' flag & 'flush_order' value in expected array */ + expected[0].serialized = FALSE; expected[0].flush_order = -1; - expected[1].flushed = FALSE; + expected[1].serialized = FALSE; expected[1].flush_order = -1; - expected[2].flushed = FALSE; + expected[2].serialized = FALSE; expected[2].flush_order = -1; /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency */ expected[0].is_dirty = FALSE; - expected[0].flushed = TRUE; + expected[0].serialized = TRUE; expected[0].flush_order = 0; expected[1].is_dirty = FALSE; - expected[1].flushed = TRUE; + expected[1].serialized = TRUE; expected[1].flush_order = 1; expected[2].is_dirty = FALSE; - expected[2].flushed = TRUE; + expected[2].serialized = TRUE; expected[2].flush_order = 2; expected[2].is_protected = FALSE; @@ -31211,32 +31227,32 @@ check_flush_deps_order(void) dirty_entry(file_ptr, entry_type, 2, FALSE); if ( !pass ) CACHE_ERROR("dirty_entry failed") - /* Reset 'flushed' flag & 'flush_order' value in expected array */ - expected[0].flushed = FALSE; + /* Reset 'serialized' flag & 'flush_order' value in expected array */ + expected[0].serialized = FALSE; expected[0].flush_order = -1; - expected[1].flushed = FALSE; + expected[1].serialized = FALSE; expected[1].flush_order = -1; - expected[2].flushed = FALSE; + expected[2].serialized = FALSE; expected[2].flush_order = -1; /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency */ expected[0].is_dirty = FALSE; - expected[0].flushed = TRUE; + expected[0].serialized = TRUE; expected[0].flush_order = 2; expected[0].is_protected = FALSE; expected[1].is_dirty = FALSE; - expected[1].flushed = TRUE; + expected[1].serialized = TRUE; expected[1].flush_order = 0; expected[2].is_dirty = FALSE; - expected[2].flushed = TRUE; + expected[2].serialized = TRUE; expected[2].flush_order = 1; /* Verify the status */ @@ -31388,37 +31404,37 @@ check_flush_deps_order(void) dirty_entry(file_ptr, entry_type, 3, TRUE); if ( !pass ) CACHE_ERROR("dirty_entry failed") - /* Reset 'flushed' flag & 'flush_order' value in expected array */ - expected[0].flushed = FALSE; + /* Reset 'serialized' flag & 'flush_order' value in expected array */ + expected[0].serialized = FALSE; expected[0].flush_order = -1; - expected[1].flushed = FALSE; + expected[1].serialized = FALSE; expected[1].flush_order = -1; - expected[2].flushed = FALSE; + expected[2].serialized = FALSE; expected[2].flush_order = -1; - expected[3].flushed = FALSE; + expected[3].serialized = FALSE; expected[3].flush_order = -1; /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency */ expected[0].is_dirty = FALSE; - expected[0].flushed = TRUE; + expected[0].serialized = TRUE; expected[0].flush_order = 0; expected[1].is_dirty = FALSE; - expected[1].flushed = TRUE; + expected[1].serialized = TRUE; expected[1].flush_order = 1; expected[1].is_protected = FALSE; expected[2].is_dirty = FALSE; - expected[2].flushed = TRUE; + expected[2].serialized = TRUE; expected[2].flush_order = 2; expected[2].is_protected = FALSE; - expected[3].flushed = TRUE; + expected[3].serialized = TRUE; expected[3].flush_order = 3; expected[3].is_protected = FALSE; @@ -31613,39 +31629,39 @@ check_flush_deps_order(void) dirty_entry(file_ptr, entry_type, 3, FALSE); if ( !pass ) CACHE_ERROR("dirty_entry failed") - /* Reset 'flushed' flag & 'flush_order' value in expected array */ - expected[0].flushed = FALSE; + /* Reset 'serialized' flag & 'flush_order' value in expected array */ + expected[0].serialized = FALSE; expected[0].flush_order = -1; - expected[1].flushed = FALSE; + expected[1].serialized = FALSE; expected[1].flush_order = -1; - expected[2].flushed = FALSE; + expected[2].serialized = FALSE; expected[2].flush_order = -1; - expected[3].flushed = FALSE; + expected[3].serialized = FALSE; expected[3].flush_order = -1; /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency */ expected[0].is_dirty = FALSE; - expected[0].flushed = TRUE; + expected[0].serialized = TRUE; expected[0].flush_order = 3; expected[0].is_protected = FALSE; expected[1].is_dirty = FALSE; - expected[1].flushed = TRUE; + expected[1].serialized = TRUE; expected[1].flush_order = 2; expected[1].is_protected = FALSE; expected[2].is_dirty = FALSE; - expected[2].flushed = TRUE; + expected[2].serialized = TRUE; expected[2].flush_order = 1; expected[2].is_protected = FALSE; expected[3].is_dirty = FALSE; - expected[3].flushed = TRUE; + expected[3].serialized = TRUE; expected[3].flush_order = 0; /* Verify the status */ @@ -31784,41 +31800,41 @@ check_flush_deps_order(void) dirty_entry(file_ptr, entry_type, 4, TRUE); if ( !pass ) CACHE_ERROR("dirty_entry failed") - /* Reset 'flushed' flag & 'flush_order' value in expected array */ - expected[0].flushed = FALSE; + /* Reset 'serialized' flag & 'flush_order' value in expected array */ + expected[0].serialized = FALSE; expected[0].flush_order = -1; - expected[1].flushed = FALSE; + expected[1].serialized = FALSE; expected[1].flush_order = -1; - expected[2].flushed = FALSE; + expected[2].serialized = FALSE; expected[2].flush_order = -1; - expected[3].flushed = FALSE; + expected[3].serialized = FALSE; expected[3].flush_order = -1; - expected[4].flushed = FALSE; + expected[4].serialized = FALSE; expected[4].flush_order = -1; /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency */ expected[0].is_dirty = FALSE; - expected[0].flushed = TRUE; + expected[0].serialized = TRUE; expected[0].flush_order = 0; expected[1].is_dirty = FALSE; - expected[1].flushed = TRUE; + expected[1].serialized = TRUE; expected[1].flush_order = 1; expected[2].is_dirty = FALSE; - expected[2].flushed = TRUE; + expected[2].serialized = TRUE; expected[2].flush_order = 2; expected[3].is_dirty = FALSE; - expected[3].flushed = TRUE; + expected[3].serialized = TRUE; expected[3].flush_order = 3; expected[4].is_dirty = FALSE; - expected[4].flushed = TRUE; + expected[4].serialized = TRUE; expected[4].flush_order = 4; expected[4].is_protected = FALSE; @@ -31920,42 +31936,42 @@ check_flush_deps_order(void) dirty_entry(file_ptr, entry_type, 4, FALSE); if ( !pass ) CACHE_ERROR("dirty_entry failed") - /* Reset 'flushed' flag & 'flush_order' value in expected array */ - expected[0].flushed = FALSE; + /* Reset 'serialized' flag & 'flush_order' value in expected array */ + expected[0].serialized = FALSE; expected[0].flush_order = -1; - expected[1].flushed = FALSE; + expected[1].serialized = FALSE; expected[1].flush_order = -1; - expected[2].flushed = FALSE; + expected[2].serialized = FALSE; expected[2].flush_order = -1; - expected[3].flushed = FALSE; + expected[3].serialized = FALSE; expected[3].flush_order = -1; - expected[4].flushed = FALSE; + expected[4].serialized = FALSE; expected[4].flush_order = -1; /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency */ expected[0].is_dirty = FALSE; - expected[0].flushed = TRUE; + expected[0].serialized = TRUE; expected[0].flush_order = 4; expected[0].is_protected = FALSE; expected[1].is_dirty = FALSE; - expected[1].flushed = TRUE; + expected[1].serialized = TRUE; expected[1].flush_order = 0; expected[2].is_dirty = FALSE; - expected[2].flushed = TRUE; + expected[2].serialized = TRUE; expected[2].flush_order = 1; expected[3].is_dirty = FALSE; - expected[3].flushed = TRUE; + expected[3].serialized = TRUE; expected[3].flush_order = 2; expected[4].is_dirty = FALSE; - expected[4].flushed = TRUE; + expected[4].serialized = TRUE; expected[4].flush_order = 3; /* Verify the status */ @@ -32118,42 +32134,42 @@ check_flush_deps_order(void) dirty_entry(file_ptr, entry_type, 4, TRUE); if ( !pass ) CACHE_ERROR("dirty_entry failed") - /* Reset 'flushed' flag & 'flush_order' value in expected array */ - expected[0].flushed = FALSE; + /* Reset 'serialized' flag & 'flush_order' value in expected array */ + expected[0].serialized = FALSE; expected[0].flush_order = -1; - expected[1].flushed = FALSE; + expected[1].serialized = FALSE; expected[1].flush_order = -1; - expected[2].flushed = FALSE; + expected[2].serialized = FALSE; expected[2].flush_order = -1; - expected[3].flushed = FALSE; + expected[3].serialized = FALSE; expected[3].flush_order = -1; - expected[4].flushed = FALSE; + expected[4].serialized = FALSE; expected[4].flush_order = -1; /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency */ expected[0].is_dirty = FALSE; - expected[0].flushed = TRUE; + expected[0].serialized = TRUE; expected[0].flush_order = 2; expected[0].is_protected = FALSE; expected[1].is_dirty = FALSE; - expected[1].flushed = TRUE; + expected[1].serialized = TRUE; expected[1].flush_order = 3; expected[1].is_protected = FALSE; expected[2].is_dirty = FALSE; - expected[2].flushed = TRUE; + expected[2].serialized = TRUE; expected[3].is_dirty = FALSE; - expected[3].flushed = TRUE; + expected[3].serialized = TRUE; expected[3].flush_order = 0; expected[4].is_dirty = FALSE; - expected[4].flushed = TRUE; + expected[4].serialized = TRUE; expected[4].flush_order = 1; expected[4].is_protected = FALSE; @@ -32369,44 +32385,44 @@ check_flush_deps_order(void) dirty_entry(file_ptr, entry_type, 4, TRUE); if ( !pass ) CACHE_ERROR("dirty_entry failed") - /* Reset 'flushed' flag & 'flush_order' value in expected array */ - expected[0].flushed = FALSE; + /* Reset 'serialized' flag & 'flush_order' value in expected array */ + expected[0].serialized = FALSE; expected[0].flush_order = -1; - expected[1].flushed = FALSE; + expected[1].serialized = FALSE; expected[1].flush_order = -1; - expected[2].flushed = FALSE; + expected[2].serialized = FALSE; expected[2].flush_order = -1; - expected[3].flushed = FALSE; + expected[3].serialized = FALSE; expected[3].flush_order = -1; - expected[4].flushed = FALSE; + expected[4].serialized = FALSE; expected[4].flush_order = -1; /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency */ expected[0].is_dirty = FALSE; - expected[0].flushed = TRUE; + expected[0].serialized = TRUE; expected[0].flush_order = 0; expected[0].is_protected = FALSE; expected[1].is_dirty = FALSE; - expected[1].flushed = TRUE; + expected[1].serialized = TRUE; expected[1].flush_order = 3; expected[1].is_protected = FALSE; expected[2].is_dirty = FALSE; - expected[2].flushed = TRUE; + expected[2].serialized = TRUE; expected[2].flush_order = 4; expected[2].is_protected = FALSE; expected[3].is_dirty = FALSE; - expected[3].flushed = TRUE; + expected[3].serialized = TRUE; expected[3].flush_order = 1; expected[4].is_dirty = FALSE; - expected[4].flushed = TRUE; + expected[4].serialized = TRUE; expected[4].flush_order = 2; expected[4].is_protected = FALSE; @@ -32636,44 +32652,44 @@ check_flush_deps_order(void) dirty_entry(file_ptr, entry_type, 4, TRUE); if ( !pass ) CACHE_ERROR("dirty_entry failed") - /* Reset 'flushed' flag & 'flush_order' value in expected array */ - expected[0].flushed = FALSE; + /* Reset 'serialized' flag & 'flush_order' value in expected array */ + expected[0].serialized = FALSE; expected[0].flush_order = -1; - expected[1].flushed = FALSE; + expected[1].serialized = FALSE; expected[1].flush_order = -1; - expected[2].flushed = FALSE; + expected[2].serialized = FALSE; expected[2].flush_order = -1; - expected[3].flushed = FALSE; + expected[3].serialized = FALSE; expected[3].flush_order = -1; - expected[4].flushed = FALSE; + expected[4].serialized = FALSE; expected[4].flush_order = -1; /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency */ expected[0].is_dirty = FALSE; - expected[0].flushed = TRUE; + expected[0].serialized = TRUE; expected[0].flush_order = 0; expected[0].is_protected = FALSE; expected[1].is_dirty = FALSE; - expected[1].flushed = TRUE; + expected[1].serialized = TRUE; expected[1].flush_order = 2; expected[1].is_protected = FALSE; expected[2].is_dirty = FALSE; - expected[2].flushed = TRUE; + expected[2].serialized = TRUE; expected[2].flush_order = 4; expected[2].is_protected = FALSE; expected[3].is_dirty = FALSE; - expected[3].flushed = TRUE; + expected[3].serialized = TRUE; expected[3].flush_order = 1; expected[4].is_dirty = FALSE; - expected[4].flushed = TRUE; + expected[4].serialized = TRUE; expected[4].flush_order = 3; expected[4].is_protected = FALSE; @@ -32802,13 +32818,13 @@ check_notify_cb(void) unsigned u; /* Local index variable */ struct expected_entry_status expected[5] = { - /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: loaded: clrd: flshd: dest: par type: par idx: dep ref.count: dep height: order: */ - { NOTIFY_ENTRY_TYPE, 0, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { NOTIFY_ENTRY_TYPE, 1, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { NOTIFY_ENTRY_TYPE, 2, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { NOTIFY_ENTRY_TYPE, 3, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, - { NOTIFY_ENTRY_TYPE, 4, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 } + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type: par idx: dep ref.count: dep height: order: */ + { NOTIFY_ENTRY_TYPE, 0, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { NOTIFY_ENTRY_TYPE, 1, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { NOTIFY_ENTRY_TYPE, 2, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { NOTIFY_ENTRY_TYPE, 3, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { NOTIFY_ENTRY_TYPE, 4, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 } }; TESTING("'notify' callback"); @@ -32859,11 +32875,11 @@ check_notify_cb(void) if ( !pass ) CACHE_ERROR("expunge_entry failed") /* Change expected values, and verify the status of the entries - * after each insertion + * after each expunge */ expected[u].in_cache = FALSE; - expected[u].is_dirty = FALSE; - expected[u].cleared = TRUE; + expected[u].is_dirty = TRUE; + expected[u].serialized = FALSE; expected[u].destroyed = TRUE; /* Verify the status */ @@ -32892,7 +32908,7 @@ check_notify_cb(void) expected[u].in_cache = TRUE; expected[u].is_dirty = FALSE; expected[u].is_protected = TRUE; - expected[u].loaded = TRUE; + expected[u].deserialized = TRUE; /* Verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ @@ -32942,11 +32958,11 @@ check_notify_cb(void) if ( !pass ) CACHE_ERROR("expunge_entry failed") /* Change expected values, and verify the status of the entries - * after each insertion + * after each expunge */ expected[u].in_cache = FALSE; - expected[u].is_dirty = FALSE; - expected[u].cleared = TRUE; + expected[u].is_dirty = TRUE; + expected[u].serialized = FALSE; expected[u].destroyed = TRUE; /* Verify the status */ @@ -32979,16 +32995,2076 @@ done: /*------------------------------------------------------------------------- - * Function: main + * Function: check_entry_deletions_during_scans() * - * Purpose: Run tests on the cache code contained in H5C.c + * Purpose: With the addition of the H5C__TAKE_OWNERSHIP_FLAG, it is + * possible for an entry to be removed from the cache as a + * side effect of flushing an entry. * - * Return: Success: + * For the most part, this doesn't cause problems. However, + * during the scans of lists, it is possible that the entry + * removed will be the next entry in the scan -- which if not + * detected, will typeically cause the cache to attempt to flush + * an entry that is no longer in the cache, and which may have + * been deleted. * - * Failure: + * This function contans tests for correct handling on this + * situation. + * + * Do nothing if pass is FALSE on entry. + * + * Return: void * * Programmer: John Mainzer - * 6/24/04 + * 4/3/15 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +static unsigned +check_entry_deletions_during_scans(void) +{ + H5F_t * file_ptr = NULL; + + TESTING("entry deletion during list scan detection and adaption"); + + pass = TRUE; + + /* allocate a cache, and flush it under various circumstances. + * To the extent possible, verify that the desired actions took + * place. + */ + + if ( pass ) { + + reset_entries(); + + file_ptr = setup_cache((size_t)(2 * 1024 * 1024), + (size_t)(1 * 1024 * 1024)); + } + + /* run the tests. This set of tests is somewhat eclectic, as + * we are trying to test all locations where the deletion of + * an entry from the cache as a side effect of the fluch of + * a different entry could cause problems. + */ + + if ( pass ) { + + cedds__expunge_dirty_entry_in_flush_test(file_ptr); + } + + if ( pass ) { + + cedds__H5C_make_space_in_cache(file_ptr); + } + + if ( pass ) { + + cedds__H5C__autoadjust__ageout__evict_aged_out_entries(file_ptr); + } + + if ( pass ) { + + cedds__H5C_flush_invalidate_cache__bucket_scan(file_ptr); + } + + + if ( pass ) { + + takedown_cache(file_ptr, FALSE, FALSE); + } + + if ( pass ) { PASSED(); } else { H5_FAILED(); } + + if ( ! pass ) { + + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", + FUNC, failure_mssg); + } + + return (unsigned)!pass; + +} /* check_entry_deletions_during_scans() */ + + +/*------------------------------------------------------------------------- + * Function: cedds__expunge_dirty_entry_in_flush_test() + * + * Purpose: Verify that H5C_flush_cache() can handle the removal of + * a dirty entry from the cache during its scan of the + * skip list. + * + * Do this by setting up a full cache, with the last entry + * on the LRU being both dirty and having a flush operation + * that deletes the second to last entry on the LRU. Then + * flush the cache, triggering the flush of the last + * item, and thereby the deletion of the second to last item. + * + * H5C_flush_cache() should handle this deletion gracefully. + * + * Do nothing if pass is FALSE on entry. + * + * Return: void + * + * Programmer: John Mainzer + * 4/4/15 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +static void +cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) +{ + H5C_t * cache_ptr = file_ptr->shared->cache; + int i; + herr_t result; + struct expected_entry_status expected[36] = + { + /* the expected array is used to maintain a table of the expected status of every + * entry used in this test. Note that since the function that processes this + * array only processes as much of it as it is told to, we don't have to + * worry about maintaining the status of entries that we haven't used yet. + */ + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par idx: dep ref.count: dep height: order: */ + { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 } + }; + + if ( pass ) { + + if ( cache_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "cache_ptr NULL on entry to cedds expunge dirty entry in flush test."; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + failure_mssg = "cache not empty on entry to cedds expunge dirty entry in flush test."; + } + else if ( ( cache_ptr->max_cache_size != (2 * 1024 * 1024 ) ) || + ( cache_ptr->min_clean_size != (1 * 1024 * 1024 ) ) ) { + + pass = FALSE; + failure_mssg = + "unexpected cache config at start of cedds expunge dirty entry in flush test."; + + } else { + + /* set min clean size to zero for this test as it simplifies + * computing the expected cache size after each operation. + */ + + cache_ptr->min_clean_size = 0; + } + } + + if ( pass ) { + + /* The basic idea of this test is to setup the cache such + * that: + * + * 1) the cache contains several dirty entries. + * + * 2) the first entry on the slist is dirty, and has a flush + * operation that will remove the second entry on the + * slist. + * + * Then load flush the cache. Cache should handle the + * removal of the next entry in the slist scan gracefully. + */ + + /* reset the stats before we start. If stats are enabled, we will + * check to see if they are as expected at the end. + */ + H5C_stats__reset(cache_ptr); + + + /* Load four huge entries into the cache. Recall that huge entries + * are one fourth the size of monster entries (16 KB vs. 64 KB). + */ + for ( i = 0; i < 4; i++ ) { + + protect_entry(file_ptr, HUGE_ENTRY_TYPE, i); + unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); + } + + if ( ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != (4 * HUGE_ENTRY_SIZE) ) ) { + + pass = FALSE; + + failure_mssg = "unexpected size/len in cedds expunge dirty entry in flush test (1)"; + } + } + + if ( pass ) { + + /* Next, set up the flush operation: + * + * (HET, 0) expunges (HET, 1) + * + */ + add_flush_op(HUGE_ENTRY_TYPE, 0, FLUSH_OP__EXPUNGE, + HUGE_ENTRY_TYPE, 1, FALSE, (size_t)0, NULL); + + } + + if ( pass ) { + + /* to summarize, at present the following entries + * are in cache with the following characteristics: + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (HET, 0) Y 16 KB Y N - expunge (HET 1) + * + * (HET, 1) Y 16 KB Y N - - + * + * (HET, 2) Y 16 KB Y N - - + * + * (HET, 3) Y 16 KB Y N - - + * + * Recall that in this test bed, flush operations are excuted the + * first time the associated entry is flushed, and are then + * deleted. + */ + + /* verify the expected status of all entries we have loaded to date: */ + verify_entry_status(cache_ptr, 0, 4, expected); + } + + /* flush the cache to run the test. In the process, clean up after test. */ + + if ( pass ) { + + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); + + if ( result < 0 ) { + + pass = FALSE; + failure_mssg = "Cache flush invalidate failed in cedds expunge dirty entry in flush test"; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected cache len/size after cedds expunge dirty entry in flush test"; + + } + } + +#if H5C_COLLECT_CACHE_STATS + /* If we are collecting stats, check to see if we get the expected + * values. + */ + if ( pass ) { + + if ( ( cache_ptr->insertions[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_insertions[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->clears[HUGE_ENTRY_TYPE] != 1 ) || + ( cache_ptr->flushes[HUGE_ENTRY_TYPE] != 3 ) || + ( cache_ptr->evictions[HUGE_ENTRY_TYPE] != 4 ) || + ( cache_ptr->take_ownerships[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->moves[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_moves[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_moves[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pins[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->unpins[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->dirty_pins[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_flushes[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_clears[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_increases[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_decreases[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_size_changes[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_size_changes[HUGE_ENTRY_TYPE] != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected huge size entry stats in cedds__expunge_dirty_entry_in_flush_test()."; + } + } + + if ( pass ) { + + if ( ( cache_ptr->slist_scan_restarts != 1 ) || + ( cache_ptr->LRU_scan_restarts != 0 ) || + ( cache_ptr->hash_bucket_scan_restarts != 0 ) ) { + + pass = FALSE; + failure_mssg = "unexpected scan restart stats in cedds__expunge_dirty_entry_in_flush_test()."; + } + } +#endif /* H5C_COLLECT_CACHE_STATS */ + + if ( pass ) { + + reset_entries(); + } + + if ( pass ) { + + /* reset cache min clean size to its expected value */ + cache_ptr->min_clean_size = (1 * 1024 * 1024); + } + + return; + +} /* cedds__expunge_dirty_entry_in_flush_test() */ + + +/*------------------------------------------------------------------------- + * Function: cedds__H5C_make_space_in_cache() + * + * Purpose: Verify that H5C_make_space_in_cache() can handle the + * removal from the cache of the next item in its reverse scan + * of the LRU list. + * + * Do this by setting up a full cache, with the last entry + * on the LRU being both dirty and having a flush operation + * that deleted the second to last entry on the LRU. Then + * load an additional entry, triggering the flush of the last + * item, and thereby the deletion of the second to last item. + * + * H5C_make_space_in_cache() should detect this deletion, and + * restart its scan of the LRU from the tail, instead of + * examining the now deleted next item up on the LRU. + * + * Do nothing if pass is FALSE on entry. + * + * Return: void + * + * Programmer: John Mainzer + * 4/4/15 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +static void +cedds__H5C_make_space_in_cache(H5F_t * file_ptr) +{ + H5C_t * cache_ptr = file_ptr->shared->cache; + int i; + const int num_huge_entries = 4; + const int num_monster_entries = 32; + herr_t result; + struct expected_entry_status expected[36] = + { + /* the expected array is used to maintain a table of the expected status of every + * entry used in this test. Note that since the function that processes this + * array only processes as much of it as it is told to, we don't have to + * worry about maintaining the status of entries that we haven't used yet. + */ + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par idx: dep ref.count: dep height: order: */ + { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 } + }; + + if ( pass ) { + + if ( cache_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "cache_ptr NULL on entry to cedds for H5C_make_space_in_cache() test."; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + failure_mssg = "cache not empty at start of flush ops eviction test."; + } + else if ( ( cache_ptr->max_cache_size != (2 * 1024 * 1024 ) ) || + ( cache_ptr->min_clean_size != (1 * 1024 * 1024 ) ) ) { + + pass = FALSE; + failure_mssg = + "unexpected cache config at start of cedds H5C__make_space_in_cache() test."; + + } else { + + /* set min clean size to zero for this test as it simplifies + * computing the expected cache size after each operation. + */ + + cache_ptr->min_clean_size = 0; + } + } + + if ( pass ) { + + /* The basic idea of this test is to setup the cache such + * that: + * + * 1) the cache is full + * + * 2) the last entry on the LRU is dirty, and has a flush + * operation that will remove the second to last entry + * on the LRU from the cache. + * + * Then load another entry into the cache. See if + * H5C__make_space_in_cache() detects the removal of + * the next item in the scan, and restarts the scan + * from the bottom of the LRU. Note that the newly + * loaded entry must be large enough to require that + * the scan continue after the entry is expunged. + */ + + /* reset the stats before we start. If stats are enabled, we will + * check to see if they are as expected at the end. + */ + H5C_stats__reset(cache_ptr); + + + /* Load four huge entries into the cache. Recall that huge entries + * are one fourth the size of monster entries (16 KB vs. 64 KB). + */ + for ( i = 0; i < 4; i++ ) { + + protect_entry(file_ptr, HUGE_ENTRY_TYPE, i); + unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); + } + + if ( ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != (4 * HUGE_ENTRY_SIZE) ) ) { + + pass = FALSE; + + failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (1)"; + } + } + + if ( pass ) { + + /* Next, set up the flush operation: + * + * (HET, 0) expunges (HET, 1) + * + */ + add_flush_op(HUGE_ENTRY_TYPE, 0, FLUSH_OP__EXPUNGE, + HUGE_ENTRY_TYPE, 1, FALSE, (size_t)0, NULL); + + } + + if ( pass ) { + + /* to summarize, at present the following entries + * are in cache with the following characteristics: + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (HET, 0) Y 16 KB Y N - expunge (HET 1) + * + * (HET, 1) Y 16 KB N N - - + * + * (HET, 2) Y 16 KB N N - - + * + * (HET, 3) Y 16 KB N N - - + * + * Recall that in this test bed, flush operations are excuted the + * first time the associated entry is flushed, and are then + * deleted. + */ + + /* Now fill up the cache with other, unrelated entries. Recall + * that the cache size is 2 MB and 31 * 64 KB + 4 * 16 KP == 2 MB. + */ + for ( i = 0; i < 31; i++ ) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); + } + + /* The cache should now be exactly full */ + if ( ( cache_ptr->index_len != 35 ) || + ( cache_ptr->index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->index_size != ((4 * HUGE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE)) ) ) { + + pass = FALSE; + failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (2)"; + + } else { + + /* verify the expected status of all entries we have loaded to date: */ + verify_entry_status(cache_ptr, 0, 35, expected); + } + } + + if ( pass ) { + + /* now load another monster entry. This should cause + * H5C__make_space_in_cache() to be called. (HET 0) is dirty, and is at + * the bottom of the LRU. * Thus it will be flushed, and moved to the + * head of the LRU. However, during the flush, (HET 1) should be expunged + * from the cache. Since (MET 1) is the next item in + * H5C__make_space_in_cache(), must detect its removal from the cache, + * and refrain from trying to flush it. + * + * Since all entries in the cache are dirty, all entries will be flushed, + * and HET 0, 2, and 3 will be evicted to make room for the new + * monster entry (MET, 31). + * + * Verify this. If H5C_make_space_in_cache() chokes, failure will + * be detected in protect_entry(). Thus end the "if ( pass )" clause + * there so the error message will not be overwritten. + */ + + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31); + } + + if ( pass ) { + + /* if the protect succeeded, unprotect and verify that all is at + * it should be. + */ + + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31, H5C__DIRTIED_FLAG); + + /* The cache should now be exactly full */ + if ( ( cache_ptr->index_len != 32 ) || + ( cache_ptr->index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->index_size != (32 * MONSTER_ENTRY_SIZE) ) ) { + + pass = FALSE; + failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (3)"; + + } else { + + /* modify the expected table to match the new situation, and + * then call verify_entry_status(). + */ + for ( i = 0; i < num_huge_entries; i++ ) + { + expected[i].in_cache = FALSE; + expected[i].is_dirty = FALSE; + expected[i].serialized = TRUE; + expected[i].destroyed = TRUE; + } + + /* (HET, 1) was expunged, so touch its entry up accordingly */ + expected[1].is_dirty = TRUE; + expected[1].serialized = FALSE; + + for ( i = num_huge_entries; i < num_huge_entries + num_monster_entries - 1; i++ ) + { + expected[i].is_dirty = FALSE; + expected[i].serialized = TRUE; + } + + /* verify the expected status of all entries: */ + verify_entry_status(cache_ptr, 0, 36, expected); + } + } + + /* flush the cache and end the test. */ + + if ( pass ) { + + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); + + if ( result < 0 ) { + + pass = FALSE; + failure_mssg = "Cache flush invalidate failed after flush op eviction test"; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected cache len/size after cleanup of flush op eviction test"; + + } + } + +#if H5C_COLLECT_CACHE_STATS + /* If we are collecting stats, check to see if we get the expected + * values. + */ + + if ( pass ) { + + if ( ( cache_ptr->insertions[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_insertions[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->clears[HUGE_ENTRY_TYPE] != 1 ) || + ( cache_ptr->flushes[HUGE_ENTRY_TYPE] != 3 ) || + ( cache_ptr->evictions[HUGE_ENTRY_TYPE] != 4 ) || + ( cache_ptr->take_ownerships[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->moves[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_moves[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_moves[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pins[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->unpins[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->dirty_pins[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_flushes[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_clears[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_increases[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_decreases[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_size_changes[HUGE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_size_changes[HUGE_ENTRY_TYPE] != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected large entry stats in cedds__H5C_make_space_in_cache()."; + } + } + + if ( pass ) { + + if ( ( cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 32 ) || + ( cache_ptr->evictions[MONSTER_ENTRY_TYPE] != 32 ) || + ( cache_ptr->take_ownerships[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->unpins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->dirty_pins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_flushes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_increases[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_decreases[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected monster entry stats in cedds__H5C_make_space_in_cache()."; + } + } + + if ( pass ) { + + if ( ( cache_ptr->slist_scan_restarts != 0 ) || + ( cache_ptr->LRU_scan_restarts != 1 ) || + ( cache_ptr->hash_bucket_scan_restarts != 0 ) ) { + + pass = FALSE; + failure_mssg = "unexpected scan restart stats in cedds__H5C_make_space_in_cache()."; + } + } +#endif /* H5C_COLLECT_CACHE_STATS */ + + if ( pass ) { + + reset_entries(); + } + + if ( pass ) { + + /* reset cache min clean size to its expected value */ + cache_ptr->min_clean_size = (1 * 1024 * 1024); + } + + return; + +} /* cedds__H5C_make_space_in_cache() */ + + +/*------------------------------------------------------------------------- + * Function: cedds__H5C__autoadjust__ageout__evict_aged_out_entries() + * + * Purpose: Verify that H5C__autoadjust__ageout__evict_aged_out_entries() + * can handle the removal from the cache of the next item in + * its reverse scan of the LRU list. + * + * Do this by setting up a full cache, with the last entry + * on the LRU being both dirty and having a flush operation + * that deletes the second to last entry on the LRU. Then + * access the first item in the LRU repeatedly until the + * item, and thereby the deletion of the second to last item. + * + * H5C_make_space_in_cache() should detect this deletion, and + * restart its scan of the LRU from the tail, instead of + * examining the now deleted next item up on the LRU. + * + * Do nothing if pass is FALSE on entry. + * + * Return: void + * + * Programmer: John Mainzer + * 4/4/15 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +static void +cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) +{ + H5C_t * cache_ptr = file_ptr->shared->cache; + int i; + herr_t result; + struct expected_entry_status expected[36] = + { + /* the expected array is used to maintain a table of the expected status of every + * entry used in this test. Note that since the function that processes this + * array only processes as much of it as it is told to, we don't have to + * worry about maintaining the status of entries that we haven't used yet. + */ + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par idx: dep ref.count: dep height: order: */ + { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 } + }; + H5C_auto_size_ctl_t saved_auto_size_ctl; + H5C_auto_size_ctl_t test_auto_size_ctl = + { + /* int32_t version = */ H5C__CURR_AUTO_SIZE_CTL_VER, + /* H5C_auto_resize_report_fcn rpt_fcn = */ test_rpt_fcn, + + /* hbool_t set_initial_size = */ TRUE, + /* size_t initial_size = */ (2 * 1024 * 1024), + + /* double min_clean_fraction = */ 0.5f, + + /* size_t max_size = */ (8 * 1024 * 1024), + /* size_t min_size = */ (1 * 1024 * 1024), + + /* int64_t epoch_length = */ 1000, + + + /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, + + /* double lower_hr_threshold = */ 0.75f, + + /* 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, + + /* double upper_hr_threshold = */ 0.995f, + + /* double decrement = */ 0.5f, + + /* hbool_t apply_max_decrement = */ FALSE, + /* size_t max_decrement = */ (1 * 1024 * 1024), + + /* int32_t epochs_before_eviction = */ 1, + + /* hbool_t apply_empty_reserve = */ TRUE, + /* double empty_reserve = */ 0.05f + }; + + if ( pass ) { + + if ( cache_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "cache_ptr NULL on entry to cedds for H5C__autoadjust__ageout__evict_aged_out_entries() test."; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + failure_mssg = "cache not empty at start cedds for H5C__autoadjust__ageout__evict_aged_out_entries() test."; + } + else if ( ( cache_ptr->max_cache_size != (2 * 1024 * 1024 ) ) || + ( cache_ptr->min_clean_size != (1 * 1024 * 1024 ) ) ) { + + pass = FALSE; + failure_mssg = + "unexpected cache config at start of cedds H5C__autoadjust__ageout__evict_aged_out_entries() test."; + + } else { + + /* set min clean size to zero for this test as it simplifies + * computing the expected cache size after each operation. + */ + + cache_ptr->min_clean_size = 0; + } + } + + /* save the initial resize configuration so we can restore it later */ + if ( pass ) { + + saved_auto_size_ctl.version = H5C__CURR_AUTO_SIZE_CTL_VER; + + result = H5C_get_cache_auto_resize_config(cache_ptr, + &saved_auto_size_ctl); + + if ( result != SUCCEED ) { + + pass = FALSE; + failure_mssg = "H5C_get_cache_auto_resize_config failed."; + + } + } + + /* set the resize configuration we will be using in the test */ + if ( pass ) { + + result = H5C_set_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); + + if ( result != SUCCEED ) { + + pass = FALSE; + failure_mssg = "H5C_set_cache_auto_resize_config failed 1.\n"; + } + } + + if ( pass ) { + + /* The basic idea of this test is to setup the cache such + * that: + * + * 1) the cache is full + * + * 2) the last entry on the LRU is dirty, and has a flush + * operation that will remove the second to last entry + * on the LRU from the cache. + * + * Then access the first item in the LRU until the epoch + * and H5C__autoadjust__ageout__evict_aged_out_entries() + * is invoked. Verify that the function deals with the + * deletion of the next item in its scan cleanly. + */ + + /* reset the stats before we start. If stats are enabled, we will + * check to see if they are as expected at the end. + */ + H5C_stats__reset(cache_ptr); + + + /* load the first entry -- mark it dirty */ + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG); + + /* Then load the rest of the entries to fill the cache: + * + * Recall that the cache size is 2 MB and 32 * 64 KB == 2 MB. + */ + for ( i = 1; i < 32; i++ ) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); + } + } + + if ( pass ) { + + /* Next, set up the flush operation: + * + * (MET, 0) expunges (MET, 1) + * + */ + add_flush_op(MONSTER_ENTRY_TYPE, 0, FLUSH_OP__EXPUNGE, + MONSTER_ENTRY_TYPE, 1, FALSE, (size_t)0, NULL); + + } + + if ( pass ) { + + /* to summarize, at present the following entries + * are in cache with the following characteristics: + * + * in + * entry: cache? size: dirty? pinned? pins: flush operations: + * + * (MET, 0) Y 64 KB Y N - expunge (MET 1) + * + * (MET, 1-31) Y 64 KB N N - - + * + * Recall that in this test bed, flush operations are excuted the + * first time the associated entry is flushed, and are then + * deleted. + */ + + /* The cache should now be exactly full */ + if ( ( cache_ptr->index_len != 32 ) || + ( cache_ptr->index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->index_size != (32 * MONSTER_ENTRY_SIZE) ) ) { + + pass = FALSE; + failure_mssg = "unexpected size/len in H5C__autoadjust__ageout__evict_aged_out_entries() test (1)"; + + } else { + + /* verify the expected status of all entries we have loaded to date: */ + verify_entry_status(cache_ptr, 0, 32, expected); + } + } + + /* protect and unprotect (MET, 31) repeatedly until the end of the first epoch */ + while ( ( pass ) && ( cache_ptr->cache_accesses > 0 ) ) { + + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31, H5C__NO_FLAGS_SET); + } + + /* at this point, an epoch marker entry should have been inserted into the LRU */ + + if ( pass ) { + + /* protect and unprotect (MET, 31) again to get cache_accesses > 0 */ + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31, H5C__NO_FLAGS_SET); + } + + /* protect and unprotect (MET, 31) repeatedly until the end of the second epoch */ + while ( ( pass ) && ( cache_ptr->cache_accesses > 0 ) ) { + + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31, H5C__NO_FLAGS_SET); + } + + /* at this point, only (MET, 0) and (MET, 31) should remain in the cache, + * all other entries having been evicted by the ageout adaptive cache + * resizing algorithm. (Since (MET, 0) was dirty, it was flushed and + * moved to the head of the LRU by the ageout algorithm.) + */ + + if ( pass ) { + + if ( ( cache_ptr->index_len != 2 ) || + ( cache_ptr->index_size != 2 * MONSTER_ENTRY_SIZE ) ) { + + pass = FALSE; + failure_mssg = "unexpected size/len in H5C__autoadjust__ageout__evict_aged_out_entries() test (2)"; + + } else { + + /* update the expected table to reflect the expected values at + * this point, and then verify. + */ + + expected[0].is_dirty = FALSE; + expected[0].serialized = TRUE; + + for ( i = 1; i < 31; i++ ) + { + expected[i].in_cache = FALSE; + expected[i].is_dirty = FALSE; + expected[i].destroyed = TRUE; + } + + verify_entry_status(cache_ptr, 0, 32, expected); + } + } + + /* restore the initial resize configuration */ + if ( pass ) { + + saved_auto_size_ctl.set_initial_size = TRUE; + saved_auto_size_ctl.initial_size = 2 * 1024 * 1024; + + result = H5C_set_cache_auto_resize_config(cache_ptr, &saved_auto_size_ctl); + + if ( result != SUCCEED ) { + + pass = FALSE; + failure_mssg = "H5C_set_cache_auto_resize_config failed 2.\n"; + } + } + + /* flush the cache and end the test. */ + + if ( pass ) { + + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); + + if ( result < 0 ) { + + pass = FALSE; + failure_mssg = "Cache flush invalidate failed after flush op eviction test"; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected cache len/size after cleanup of flush op eviction test"; + + } + } + +#if H5C_COLLECT_CACHE_STATS + /* If we are collecting stats, check to see if we get the expected + * values. + */ + + if ( pass ) { + + if ( ( cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 1 ) || + ( cache_ptr->evictions[MONSTER_ENTRY_TYPE] != 32 ) || + ( cache_ptr->take_ownerships[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->unpins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->dirty_pins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_flushes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_increases[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_decreases[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected monster entry stats in cedds__H5C__autoadjust__ageout__evict_aged_out_entries()."; + } + } + + if ( pass ) { + + if ( ( cache_ptr->slist_scan_restarts != 0 ) || + ( cache_ptr->LRU_scan_restarts != 1 ) || + ( cache_ptr->hash_bucket_scan_restarts != 0 ) ) { + + pass = FALSE; + failure_mssg = "unexpected scan restart stats in cedds__H5C__autoadjust__ageout__evict_aged_out_entries()."; + } + } +#endif /* H5C_COLLECT_CACHE_STATS */ + + if ( pass ) { + + reset_entries(); + } + + if ( pass ) { + + /* reset cache min clean size to its expected value */ + cache_ptr->min_clean_size = (1 * 1024 * 1024); + } + + return; + +} /* cedds__H5C__autoadjust__ageout__evict_aged_out_entries() */ + + +/*------------------------------------------------------------------------- + * Function: cedds__H5C_flush_invalidate_cache__bucket_scan() + * + * Purpose: Verify that H5C_flush_invalidate_cache() can handle + * the removal from the cache of the next item in + * its scans of hash buckets. + * + * !!!!!!!!!! WARNING !!!!!!!!!! + * + * This test may fail to function correctly if the hash + * table size or hash function is altered. + * + * To setup the test, this function depends on the fact that + * H5C_flush_invalidate_cache() does alternating scans of the + * slist and the index. If this changes, the test will likely + * also cease to function correctly. + * + * The test relies on a known hash function and hash table + * size to select a set of test entries that will all hash + * to the same hash bucket -- call it the test hash bucket. + * It also relies on known behavior of the cache to place + * the entries in the test bucket in a known order. + * + * To avoid pre-mature flushes of the entries in the + * test hash bucket, all entries are initially clean, + * with the exception of the first entry which is dirty. + * It avoids premature flushing by being the parent in + * a flush dependency. The first entry in the test bucket + * also has a flush op which expunges the second entry -- + * setting up the failure. + * + * An additional dirty entry is added (which must hash + * to a different bucket, and must have a higher address + * than at least the first entry in the test hash bucket. + * This entry is the child in a flush dependency with the + * first entry in the above hash bucket, and contains + * a flush op to destroy this flush dependency. + * + * Since the first entry in the test hash bucket has a lower + * address that the other dirty entry, the scan of the + * slist encounters it first, and passes over it because + * it has a flush dependency height of 1. + * + * The scan then encounters the second dirty entry and flushes + * it -- causing it to destroy the flush dependency and thus + * reducing the flush dependency height of the first entry in + * the test hash bucket to zero. + * + * After completing a scan of the slist, + * H5C_flush_invalidate_cache() then scans the index, + * flushing all entries of flush dependency height zero. + * + * This sets up the potential error when the first entry + * in the test hash bucket is flushed -- expunging the + * second entry as a side effect. If + * H5C_flush_invalidate_cache() fails to detect this, + * it will attempt to continue its scan of the bucket with + * an entry that has been deleted from the cache. + * + * Do nothing if pass is FALSE on entry. + * + * Return: void + * + * Programmer: John Mainzer + * 4/9/15 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +static void +cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) +{ + H5C_t * cache_ptr = file_ptr->shared->cache; + int i; + int expected_hash_bucket = 0; + herr_t result; + haddr_t entry_addr; + test_entry_t * entry_ptr; + test_entry_t * base_addr = NULL; + struct H5C_cache_entry_t * scan_ptr; + struct expected_entry_status expected[5] = + { + /* the expected array is used to maintain a table of the expected status of every + * entry used in this test. Note that since the function that processes this + * array only processes as much of it as it is told to, we don't have to + * worry about maintaining the status of entries that we haven't used yet. + */ + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type: par idx: dep ref.count: dep height: order: */ + { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, -1, -1, {1,0,0,0,0,0}, 1, -1 }, + { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, -1, -1, {0,0,0,0,0,0}, 0, -1 }, + { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, MONSTER_ENTRY_TYPE, 0, {0,0,0,0,0,0}, 0, -1 } + }; + + if ( pass ) { + + if ( cache_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "cache_ptr NULL on entry to cedds for H5C__autoadjust__ageout__evict_aged_out_entries() test."; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + failure_mssg = "cache not empty at start cedds for H5C__autoadjust__ageout__evict_aged_out_entries() test."; + } + else if ( ( cache_ptr->max_cache_size != (2 * 1024 * 1024 ) ) || + ( cache_ptr->min_clean_size != (1 * 1024 * 1024 ) ) ) { + + pass = FALSE; + failure_mssg = + "unexpected cache config at start of cedds H5C__autoadjust__ageout__evict_aged_out_entries() test."; + + } else { + + /* set min clean size to zero for this test as it simplifies + * computing the expected cache size after each operation. + */ + + cache_ptr->min_clean_size = 0; + } + } + + + if ( pass ) { + + /* reset the stats before we start. If stats are enabled, we will + * check to see if they are as expected at the end. + */ + + H5C_stats__reset(cache_ptr); + + + /* load one dirty and three clean entries that should hash to the + * same hash bucket. + */ + + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG); + + for ( i = 8; i <= 24; i += 8 ) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); + } + } + + if ( pass ) { + + /* verify that the above entries hash to the same bucket */ + base_addr = entries[MONSTER_ENTRY_TYPE]; + entry_ptr = &(base_addr[0]); + entry_addr = entry_ptr->header.addr; + + HDassert(entry_addr == entry_ptr->addr); + + expected_hash_bucket = H5C__HASH_FCN(entry_addr); + + for ( i = 8; i <= 24; i += 8 ) { + + entry_ptr = &(base_addr[i]); + entry_addr = entry_ptr->header.addr; + + if ( expected_hash_bucket != H5C__HASH_FCN(entry_addr) ) { + + pass = FALSE; + failure_mssg = "Test entries don't map to same bucket -- hash table size or hash fcn change?"; + } + } + } + + if ( pass ) { + + /* setup the expunge flush operation: + * + * (MET, 0) expunges (MET, 8) + * + */ + add_flush_op(MONSTER_ENTRY_TYPE, 0, FLUSH_OP__EXPUNGE, + MONSTER_ENTRY_TYPE, 8, FALSE, (size_t)0, NULL); + } + + if ( pass ) { + + /* load the entry that will have a flush dependencey with (MET, 0), + * thus preventing it from being flushed on the first pass through + * the skip list. + */ + + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31, H5C__DIRTIED_FLAG); + } + + if ( pass ) { + + /* verify that the dirty entry doesn't map to the same + * hash bucket as the clean entries. + */ + + entry_ptr = &(base_addr[31]); + entry_addr = entry_ptr->header.addr; + + if ( expected_hash_bucket == H5C__HASH_FCN(entry_addr) ) { + + pass = FALSE; + failure_mssg = "Dirty entry maps to same hash bucket as clean entries?!?!"; + } + } + + if ( pass ) { + + /* Next, create the flush dependency requiring (MET, 31) to + * be flushed prior to (MET, 0). + */ + + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); + create_flush_dependency(MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_TYPE, 31); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG); + + } + + if ( pass ) { + + /* Then, setup the flush operation to take down the flush + * dependency when (MET, 31) is flushed. + * + * (MET, 31) destroys flush dependency with (MET, 8) + * + */ + add_flush_op(MONSTER_ENTRY_TYPE, 31, FLUSH_OP__DEST_FLUSH_DEP, + MONSTER_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL); + + } + + if ( pass ) { + + /* verify the expected status of all entries we have loaded to date: */ + verify_entry_status(cache_ptr, 0, 5, expected); + } + + if ( pass ) { + + /* now do some protect / unprotect cycles to force the + * entries into the desired order in the hash bucket. + * Recall that entries are moved to the head of the + * hash bucket list on lookup. + */ + + for ( i = 24; i >= 0; i -= 8 ) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); + } + } + + if ( pass ) { + + /* scan the hash bucket to verify that the expected entries appear + * in the expected order. + */ + scan_ptr = cache_ptr->index[expected_hash_bucket]; + + i = 0; + + while ( ( pass ) && ( i <= 24 ) ) + { + entry_ptr = &(base_addr[i]); + + if ( scan_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "premature end of hash bucket list?!?!"; + + } else if ( ( scan_ptr == NULL ) || + ( scan_ptr != &(entry_ptr->header) ) ) { + + pass = FALSE; + failure_mssg = "bad test hash bucket setup?!?!"; + } + + if ( pass ) { + + scan_ptr = scan_ptr->ht_next; + i += 8; + } + } + } + + + /* test setup complete -- flush the cache to run and end the test. */ + + if ( pass ) { + + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); + + if ( result < 0 ) { + + pass = FALSE; + failure_mssg = "Cache flush invalidate failed after flush op eviction test"; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected cache len/size after cleanup of flush op eviction test"; + + } + } + +#if H5C_COLLECT_CACHE_STATS + /* If we are collecting stats, check to see if we get the expected + * values. + */ + + if ( pass ) { + + if ( ( cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 2 ) || + ( cache_ptr->evictions[MONSTER_ENTRY_TYPE] != 5 ) || + ( cache_ptr->take_ownerships[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pins[MONSTER_ENTRY_TYPE] != 1 ) || + ( cache_ptr->unpins[MONSTER_ENTRY_TYPE] != 1 ) || + ( cache_ptr->dirty_pins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_flushes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_increases[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_decreases[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected monster entry stats in cedds__H5C_flush_invalidate_cache__bucket_scan()."; + } + } + + if ( pass ) { + + if ( ( cache_ptr->slist_scan_restarts != 0 ) || + ( cache_ptr->LRU_scan_restarts != 0 ) || + ( cache_ptr->hash_bucket_scan_restarts != 1 ) ) { + + pass = FALSE; + failure_mssg = "unexpected scan restart stats in cedds__H5C_flush_invalidate_cache__bucket_scan()."; + } + } +#endif /* H5C_COLLECT_CACHE_STATS */ + + if ( pass ) { + + reset_entries(); + } + + if ( pass ) { + + /* reset cache min clean size to its expected value */ + cache_ptr->min_clean_size = (1 * 1024 * 1024); + } + + return; + +} /* cedds__H5C_flush_invalidate_cache__bucket_scan() */ + + +/*------------------------------------------------------------------------- + * Function: check_stats() + * + * Purpose: If stats are enabled, conduct tests to verify correct + * functioning of the cache statistics collection code. + * + * Skip the test if stats are not enabled. + * + * At present this test is a shell -- fill it out at time + * permits. + * + * Return: void + * + * Programmer: John Mainzer + * 4/12/15 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ + +static unsigned +check_stats(void) +{ + +#if H5C_COLLECT_CACHE_STATS + + H5F_t * file_ptr = NULL; + +#endif /* H5C_COLLECT_CACHE_STATS */ + + TESTING("metadata cache statistics collection"); + +#if H5C_COLLECT_CACHE_STATS + + pass = TRUE; + + reset_entries(); + + file_ptr = setup_cache((size_t)(2 * 1024 * 1024), + (size_t)(1 * 1024 * 1024)); + + if ( pass ) { + + check_stats__smoke_check_1(file_ptr); + } + + + + if ( pass ) { + + takedown_cache(file_ptr, FALSE, FALSE); + } + + if ( pass ) { PASSED(); } else { H5_FAILED(); } + + if ( ! pass ) { + + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", + FUNC, failure_mssg); + } + +#else /* H5C_COLLECT_CACHE_STATS */ + + SKIPPED(); + + HDfprintf(stdout, " Statistics collection disabled.\n"); + +#endif /* H5C_COLLECT_CACHE_STATS */ + + return (unsigned)!pass; + +} /* check_stats() */ + + +/*------------------------------------------------------------------------- + * Function: check_stats__smoke_check_1() + * + * Purpose: Test to see if the statistics collection code is working + * more or less as expected. Do this by performing a number + * of operations in the cache, and checking to verify that + * they result in the expected statistics. + * + * Note that this function is not intended to be a full test + * of the statistics collection facility -- only a cursory + * check that will serve as a place holder until more complete + * tests are implemented. + * + * Do nothing if pass is FALSE on entry. + * + * Return: void + * + * Programmer: John Mainzer + * 4/22/15 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ +#if H5C_COLLECT_CACHE_STATS +static void +check_stats__smoke_check_1(H5F_t * file_ptr) +{ + H5C_t * cache_ptr = file_ptr->shared->cache; + int i; + herr_t result; + + if ( pass ) { + + if ( cache_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "cache_ptr NULL on entry to check_stats__smoke_check_1()."; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + failure_mssg = "cache not empty on entry to check_stats__smoke_check_1()."; + } + else if ( ( cache_ptr->max_cache_size != (2 * 1024 * 1024 ) ) || + ( cache_ptr->min_clean_size != (1 * 1024 * 1024 ) ) ) { + + pass = FALSE; + failure_mssg = + "unexpected cache config at start of check_stats__smoke_check_1()."; + + } else { + + /* set min clean size to zero for this test as it simplifies + * computing the expected cache size after each operation. + */ + + cache_ptr->min_clean_size = 0; + } + } + + if ( pass ) { + + /* first fill the cache with monster entryies via insertion */ + + for ( i = 0; i < 32; i++ ) + + insert_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); + } + + if ( pass ) { + + if ( ( cache_ptr->hits[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->misses[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->write_protects[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->read_protects[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->max_read_protects[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 32 ) || + ( cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->evictions[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->take_ownerships[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->unpins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->dirty_pins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_flushes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_increases[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_decreases[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected monster size entry stats in check_stats__smoke_check_1(1)."; + } + } + + if ( pass ) { + + if ( ( cache_ptr->total_ht_insertions != 32 ) || + ( cache_ptr->total_ht_deletions != 0 ) || + ( cache_ptr->successful_ht_searches != 0 ) || + ( cache_ptr->total_successful_ht_search_depth != 0 ) || + ( cache_ptr->failed_ht_searches != 32 ) || + ( cache_ptr->total_failed_ht_search_depth != 48 ) || + ( cache_ptr->max_index_len != 32 ) || + ( cache_ptr->max_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_clean_index_size != 0 ) || + ( cache_ptr->max_dirty_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_slist_len != 32 ) || + ( cache_ptr->max_slist_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_pl_len != 0 ) || + ( cache_ptr->max_pl_size != 0 ) || + ( cache_ptr->max_pel_len != 0 ) || + ( cache_ptr->max_pel_size != 0 ) || + ( cache_ptr->calls_to_msic != 0 ) || + ( cache_ptr->total_entries_skipped_in_msic != 0 ) || + ( cache_ptr->total_entries_scanned_in_msic != 0 ) || + ( cache_ptr->max_entries_skipped_in_msic != 0 ) || + ( cache_ptr->max_entries_scanned_in_msic != 0 ) || + ( cache_ptr->entries_scanned_to_make_space != 0 ) || + ( cache_ptr->slist_scan_restarts != 0 ) || + ( cache_ptr->LRU_scan_restarts != 0 ) || + ( cache_ptr->hash_bucket_scan_restarts != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected cache stats in check_stats__smoke_check_1(1)."; + } + } + +#if H5C_COLLECT_CACHE_ENTRY_STATS + if ( pass ) { + + /* Note that most entry level stats are only updated on entry eviction */ + + if ( ( cache_ptr->max_accesses[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->min_accesses[MONSTER_ENTRY_TYPE] != 1000000 ) || /* initial value */ + ( cache_ptr->max_clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->max_flushes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->max_size[MONSTER_ENTRY_TYPE] != 64 * 1024 ) || + ( cache_ptr->max_pins[MONSTER_ENTRY_TYPE] != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected monster entry level stats in check_stats__smoke_check_1(1)."; + } + } +#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ + + if ( pass ) { + + /* protect and unprotect each entry once. Note + * that all entries are already dirty, as they + * entered the cache via insertion + */ + + for ( i = 0; i < 32; i++ ) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); + } + } + + if ( pass ) { + + if ( ( cache_ptr->hits[MONSTER_ENTRY_TYPE] != 32 ) || + ( cache_ptr->misses[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->write_protects[MONSTER_ENTRY_TYPE] != 32 ) || + ( cache_ptr->read_protects[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->max_read_protects[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 32 ) || + ( cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->evictions[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->take_ownerships[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->unpins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->dirty_pins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_flushes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_increases[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_decreases[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected monster size entry stats in check_stats__smoke_check_1(2)."; + } + } + + if ( pass ) { + + if ( ( cache_ptr->total_ht_insertions != 32 ) || + ( cache_ptr->total_ht_deletions != 0 ) || + ( cache_ptr->successful_ht_searches != 32 ) || + ( cache_ptr->total_successful_ht_search_depth != 96 ) || + ( cache_ptr->failed_ht_searches != 32 ) || + ( cache_ptr->total_failed_ht_search_depth != 48 ) || + ( cache_ptr->max_index_len != 32 ) || + ( cache_ptr->max_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_clean_index_size != 0 ) || + ( cache_ptr->max_dirty_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_slist_len != 32 ) || + ( cache_ptr->max_slist_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_pl_len != 1 ) || + ( cache_ptr->max_pl_size != 64 * 1024 ) || + ( cache_ptr->max_pel_len != 0 ) || + ( cache_ptr->max_pel_size != 0 ) || + ( cache_ptr->calls_to_msic != 0 ) || + ( cache_ptr->total_entries_skipped_in_msic != 0 ) || + ( cache_ptr->total_entries_scanned_in_msic != 0 ) || + ( cache_ptr->max_entries_skipped_in_msic != 0 ) || + ( cache_ptr->max_entries_scanned_in_msic != 0 ) || + ( cache_ptr->entries_scanned_to_make_space != 0 ) || + ( cache_ptr->slist_scan_restarts != 0 ) || + ( cache_ptr->LRU_scan_restarts != 0 ) || + ( cache_ptr->hash_bucket_scan_restarts != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected cache stats in check_stats__smoke_check_1(2)."; + } + } + +#if H5C_COLLECT_CACHE_ENTRY_STATS + if ( pass ) { + + /* Note that most entry level stats are only updated on entry eviction */ + + if ( ( cache_ptr->max_accesses[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->min_accesses[MONSTER_ENTRY_TYPE] != 1000000 ) || /* initial value */ + ( cache_ptr->max_clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->max_flushes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->max_size[MONSTER_ENTRY_TYPE] != 64 * 1024 ) || + ( cache_ptr->max_pins[MONSTER_ENTRY_TYPE] != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected monster entry level stats in check_stats__smoke_check_1(2)."; + } + } +#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ + + if ( pass ) { + + /* protect and unprotect an entry that is not currently + * in the cache. Since the cache is full and all entries + * are dirty, this will force a flush of each entry, and + * the eviction of (MET, 0). + */ + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 32); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 32, H5C__DIRTIED_FLAG); + } + + if ( pass ) { + + if ( ( cache_ptr->hits[MONSTER_ENTRY_TYPE] != 32 ) || + ( cache_ptr->misses[MONSTER_ENTRY_TYPE] != 1 ) || + ( cache_ptr->write_protects[MONSTER_ENTRY_TYPE] != 33 ) || + ( cache_ptr->read_protects[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->max_read_protects[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 32 ) || + ( cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 32 ) || + ( cache_ptr->evictions[MONSTER_ENTRY_TYPE] != 1 ) || + ( cache_ptr->take_ownerships[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->unpins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->dirty_pins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_flushes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_increases[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_decreases[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected monster size entry stats in check_stats__smoke_check_1(3)."; + } + } + + if ( pass ) { + + if ( ( cache_ptr->total_ht_insertions != 33 ) || + ( cache_ptr->total_ht_deletions != 1 ) || + ( cache_ptr->successful_ht_searches != 65 ) || + ( cache_ptr->total_successful_ht_search_depth != 195 ) || + ( cache_ptr->failed_ht_searches != 33 ) || + ( cache_ptr->total_failed_ht_search_depth != 52 ) || + ( cache_ptr->max_index_len != 32 ) || + ( cache_ptr->max_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_clean_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_dirty_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_slist_len != 32 ) || + ( cache_ptr->max_slist_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_pl_len != 1 ) || + ( cache_ptr->max_pl_size != 64 * 1024 ) || + ( cache_ptr->max_pel_len != 0 ) || + ( cache_ptr->max_pel_size != 0 ) || + ( cache_ptr->calls_to_msic != 1 ) || + ( cache_ptr->total_entries_skipped_in_msic != 0 ) || + ( cache_ptr->total_entries_scanned_in_msic != 33 ) || + ( cache_ptr->max_entries_skipped_in_msic != 0 ) || + ( cache_ptr->max_entries_scanned_in_msic != 33 ) || + ( cache_ptr->entries_scanned_to_make_space != 33 ) || + ( cache_ptr->slist_scan_restarts != 0 ) || + ( cache_ptr->LRU_scan_restarts != 0 ) || + ( cache_ptr->hash_bucket_scan_restarts != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected cache stats in check_stats__smoke_check_1(3)."; + } + } + +#if H5C_COLLECT_CACHE_ENTRY_STATS + if ( pass ) { + + /* Note that most entry level stats are only updated on entry eviction */ + + if ( ( cache_ptr->max_accesses[MONSTER_ENTRY_TYPE] != 1 ) || + ( cache_ptr->min_accesses[MONSTER_ENTRY_TYPE] != 1 ) || + ( cache_ptr->max_clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->max_flushes[MONSTER_ENTRY_TYPE] != 1 ) || + ( cache_ptr->max_size[MONSTER_ENTRY_TYPE] != 64 * 1024 ) || + ( cache_ptr->max_pins[MONSTER_ENTRY_TYPE] != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected monster entry level stats in check_stats__smoke_check_1(3)."; + } + } +#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ + + if ( pass ) { + + /* protect and unprotect dirty (MET, 1), and then flush destroy + * the cache. + */ + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 1); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG); + } + + /* flush the cache to end the test and collect all entry stats */ + + if ( pass ) { + + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); + + if ( result < 0 ) { + + pass = FALSE; + failure_mssg = "Cache flush invalidate failed in check_stats__smoke_check_1()"; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected cache len/size after check_stats__smoke_check_1()"; + + } + } + + if ( pass ) { + + if ( ( cache_ptr->hits[MONSTER_ENTRY_TYPE] != 33 ) || + ( cache_ptr->misses[MONSTER_ENTRY_TYPE] != 1 ) || + ( cache_ptr->write_protects[MONSTER_ENTRY_TYPE] != 34 ) || + ( cache_ptr->read_protects[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->max_read_protects[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 32 ) || + ( cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 34 ) || + ( cache_ptr->evictions[MONSTER_ENTRY_TYPE] != 33 ) || + ( cache_ptr->take_ownerships[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_moves[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->unpins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->dirty_pins[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_flushes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->pinned_clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_increases[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->size_decreases[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->entry_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->cache_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected monster size entry stats in check_stats__smoke_check_1(4)."; + } + } + + if ( pass ) { + + if ( ( cache_ptr->total_ht_insertions != 33 ) || + ( cache_ptr->total_ht_deletions != 33 ) || + ( cache_ptr->successful_ht_searches != 98 ) || + ( cache_ptr->total_successful_ht_search_depth != 198 ) || + ( cache_ptr->failed_ht_searches != 33 ) || + ( cache_ptr->total_failed_ht_search_depth != 52 ) || + ( cache_ptr->max_index_len != 32 ) || + ( cache_ptr->max_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_clean_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_dirty_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_slist_len != 32 ) || + ( cache_ptr->max_slist_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_pl_len != 1 ) || + ( cache_ptr->max_pl_size != 64 * 1024 ) || + ( cache_ptr->max_pel_len != 0 ) || + ( cache_ptr->max_pel_size != 0 ) || + ( cache_ptr->calls_to_msic != 1 ) || + ( cache_ptr->total_entries_skipped_in_msic != 0 ) || + ( cache_ptr->total_entries_scanned_in_msic != 33 ) || + ( cache_ptr->max_entries_skipped_in_msic != 0 ) || + ( cache_ptr->max_entries_scanned_in_msic != 33 ) || + ( cache_ptr->entries_scanned_to_make_space != 33 ) || + ( cache_ptr->slist_scan_restarts != 0 ) || + ( cache_ptr->LRU_scan_restarts != 0 ) || + ( cache_ptr->hash_bucket_scan_restarts != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected cache stats in check_stats__smoke_check_1(4)."; + } + } + +#if H5C_COLLECT_CACHE_ENTRY_STATS + if ( pass ) { + + /* Note that most entry level stats are only updated on entry eviction */ + + if ( ( cache_ptr->max_accesses[MONSTER_ENTRY_TYPE] != 2 ) || + ( cache_ptr->min_accesses[MONSTER_ENTRY_TYPE] != 1 ) || + ( cache_ptr->max_clears[MONSTER_ENTRY_TYPE] != 0 ) || + ( cache_ptr->max_flushes[MONSTER_ENTRY_TYPE] != 2 ) || + ( cache_ptr->max_size[MONSTER_ENTRY_TYPE] != 64 * 1024 ) || + ( cache_ptr->max_pins[MONSTER_ENTRY_TYPE] != 0 ) ) { + + pass = FALSE; + failure_mssg = "Unexpected monster entry level stats in check_stats__smoke_check_1(4)."; + } + } +#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ + + if ( pass ) { + + reset_entries(); + } + + if ( pass ) { + + /* reset cache min clean size to its expected value */ + cache_ptr->min_clean_size = (1 * 1024 * 1024); + } + + return; + +} /* check_stats__smoke_check_1() */ + +#endif /* H5C_COLLECT_CACHE_STATS */ + + +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: Run tests on the cache code contained in H5C.c + * + * Return: Success: + * + * Failure: + * + * Programmer: John Mainzer + * 6/24/04 * * Modifications: * @@ -32999,29 +35075,30 @@ int main(void) { unsigned nerrs = 0; + int express_test; H5open(); - skip_long_tests = FALSE; - -#ifdef NDEBUG - run_full_test = TRUE; -#else /* NDEBUG */ - run_full_test = FALSE; -#endif /* NDEBUG */ - - nerrs += smoke_check_1(); - nerrs += smoke_check_2(); - nerrs += smoke_check_3(); - nerrs += smoke_check_4(); - nerrs += smoke_check_5(); - nerrs += smoke_check_6(); - nerrs += smoke_check_7(); - nerrs += smoke_check_8(); - nerrs += smoke_check_9(); - nerrs += smoke_check_10(); - - nerrs += write_permitted_check(); + express_test = GetTestExpress(); + + printf("=========================================\n"); + printf("Internal cache tests\n"); + printf(" express_test = %d\n", express_test); + printf("=========================================\n"); + + nerrs += smoke_check_1(express_test); + nerrs += smoke_check_2(express_test); + nerrs += smoke_check_3(express_test); + nerrs += smoke_check_4(express_test); + nerrs += smoke_check_5(express_test); + nerrs += smoke_check_6(express_test); + nerrs += smoke_check_7(express_test); + nerrs += smoke_check_8(express_test); + nerrs += smoke_check_9(express_test); + nerrs += smoke_check_10(express_test); + + nerrs += write_permitted_check(express_test); + nerrs += check_insert_entry(); nerrs += check_flush_cache(); nerrs += check_get_entry_status(); @@ -33058,6 +35135,8 @@ main(void) nerrs += check_flush_deps_err(); nerrs += check_flush_deps_order(); nerrs += check_notify_cb(); + nerrs += check_entry_deletions_during_scans(); + nerrs += check_stats(); return(nerrs > 0); } /* main() */ diff --git a/test/cache_api.c b/test/cache_api.c index 6953d17..1697884 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -25,6 +25,9 @@ #include "H5ACprivate.h" #include "cache_common.h" +/* extern declarations */ + +extern const char *FILENAME[]; /* global variable declarations: */ diff --git a/test/cache_common.c b/test/cache_common.c index 60ab827..8ccd7e3 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -23,6 +23,7 @@ #include "H5Cprivate.h" #include "H5Iprivate.h" #include "H5MFprivate.h" +#include "H5MMprivate.h" #include "cache_common.h" @@ -57,8 +58,6 @@ haddr_t saved_actual_base_addr = HADDR_UNDEF; /* Store the address of the hbool_t write_permitted = TRUE; hbool_t pass = TRUE; /* set to false on error */ -hbool_t skip_long_tests = TRUE; -hbool_t run_full_test = TRUE; hbool_t try_core_file_driver = FALSE; hbool_t core_file_driver_failed = FALSE; const char *failure_mssg = NULL; @@ -77,79 +76,156 @@ static test_entry_t notify_entries[NUM_NOTIFY_ENTRIES], orig_notify_entries[NUM_ hbool_t orig_entry_arrays_init = FALSE; -static herr_t pico_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t nano_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t micro_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t tiny_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t small_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t medium_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t large_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t huge_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t monster_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t variable_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t notify_clear(H5F_t * f, void * thing, hbool_t dest); - -static herr_t pico_dest(H5F_t * f, void * thing); -static herr_t nano_dest(H5F_t * f, void * thing); -static herr_t micro_dest(H5F_t * f, void * thing); -static herr_t tiny_dest(H5F_t * f, void * thing); -static herr_t small_dest(H5F_t * f, void * thing); -static herr_t medium_dest(H5F_t * f, void * thing); -static herr_t large_dest(H5F_t * f, void * thing); -static herr_t huge_dest(H5F_t * f, void * thing); -static herr_t monster_dest(H5F_t * f, void * thing); -static herr_t variable_dest(H5F_t * f, void * thing); -static herr_t notify_dest(H5F_t * f, void * thing); - -static herr_t pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t notify_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); - -static void * pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * notify_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); - -static herr_t pico_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t nano_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t micro_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t tiny_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t small_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t medium_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t large_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t huge_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t monster_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t variable_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t notify_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t pico_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t nano_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t micro_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t tiny_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t small_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t medium_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t large_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t huge_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t monster_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t variable_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t notify_get_load_size(const void *udata_ptr, size_t *image_len_ptr); + +static void *pico_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *nano_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *micro_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *tiny_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *small_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *medium_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *large_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *huge_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *monster_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *variable_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *notify_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); + +static herr_t pico_image_len(void *thing, size_t *image_len_ptr, + hbool_t *compressed_ptr, size_t * compressed_len_ptr); +static herr_t nano_image_len(void *thing, size_t *image_len_ptr, + hbool_t *compressed_ptr, size_t * compressed_len_ptr); +static herr_t micro_image_len(void *thing, size_t *image_len_ptr, + hbool_t *compressed_ptr, size_t * compressed_len_ptr); +static herr_t tiny_image_len(void *thing, size_t *image_len_ptr, + hbool_t *compressed_ptr, size_t * compressed_len_ptr); +static herr_t small_image_len(void *thing, size_t *image_len_ptr, + hbool_t *compressed_ptr, size_t * compressed_len_ptr); +static herr_t medium_image_len(void *thing, size_t *image_len_ptr, + hbool_t *compressed_ptr, size_t * compressed_len_ptr); +static herr_t large_image_len(void *thing, size_t *image_len_ptr, + hbool_t *compressed_ptr, size_t * compressed_len_ptr); +static herr_t huge_image_len(void *thing, size_t *image_len_ptr, + hbool_t *compressed_ptr, size_t * compressed_len_ptr); +static herr_t monster_image_len(void *thing, size_t *image_len_ptr, + hbool_t *compressed_ptr, size_t * compressed_len_ptr); +static herr_t variable_image_len(void *thing, size_t *image_len_ptr, + hbool_t *compressed_ptr, size_t * compressed_len_ptr); +static herr_t notify_image_len(void *thing, size_t *image_len_ptr, + hbool_t *compressed_ptr, size_t * compressed_len_ptr); + +static herr_t pico_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing, + haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr, + size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr); +static herr_t nano_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing, + haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr, + size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr); +static herr_t micro_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing, + haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr, + size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr); +static herr_t tiny_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing, + haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr, + size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr); +static herr_t small_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing, + haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr, + size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr); +static herr_t medium_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing, + haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr, + size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr); +static herr_t large_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing, + haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr, + size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr); +static herr_t huge_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing, + haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr, + size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr); +static herr_t monster_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing, + haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr, + size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr); +static herr_t variable_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing, + haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr, + size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr); +static herr_t notify_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing, + haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr, + size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr); + +static herr_t pico_serialize(const H5F_t *f, void *image_ptr, + size_t len, void *thing); +static herr_t nano_serialize(const H5F_t *f, void *image_ptr, + size_t len, void *thing); +static herr_t micro_serialize(const H5F_t *f, void *image_ptr, + size_t len, void *thing); +static herr_t tiny_serialize(const H5F_t *f, void *image_ptr, + size_t len, void *thing); +static herr_t small_serialize(const H5F_t *f, void *image_ptr, + size_t len, void *thing); +static herr_t medium_serialize(const H5F_t *f, void *image_ptr, + size_t len, void *thing); +static herr_t large_serialize(const H5F_t *f, void *image_ptr, + size_t len, void *thing); +static herr_t huge_serialize(const H5F_t *f, void *image_ptr, + size_t len, void *thing); +static herr_t monster_serialize(const H5F_t *f, void *image_ptr, + size_t len, void *thing); +static herr_t variable_serialize(const H5F_t *f, void *image_ptr, + size_t len, void *thing); +static herr_t notify_serialize(const H5F_t *f, void *image_ptr, + size_t len, void *thing); + +static herr_t pico_free_icr(void *thing); +static herr_t nano_free_icr(void *thing); +static herr_t micro_free_icr(void *thing); +static herr_t tiny_free_icr(void *thing); +static herr_t small_free_icr(void *thing); +static herr_t medium_free_icr(void *thing); +static herr_t large_free_icr(void *thing); +static herr_t huge_free_icr(void *thing); +static herr_t monster_free_icr(void *thing); +static herr_t variable_free_icr(void *thing); +static herr_t notify_free_icr(void *thing); + static herr_t notify_notify(H5C_notify_action_t action, void *thing); +/* Generic callback routines */ +static herr_t get_load_size(const void *udata_ptr, size_t *image_len_ptr, + int32_t entry_type); +static void *deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr, int32_t entry_type); +static herr_t image_len(void *thing, size_t *image_len_ptr, int32_t entry_type); +static herr_t pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, + unsigned *flags_ptr); +static herr_t serialize(const H5F_t *f, void *image_ptr, size_t len, + void *thing); +static herr_t notify(H5C_notify_action_t action, void *thing, int32_t + entry_type); +static herr_t free_icr(test_entry_t *entry, int32_t entry_type); + +/* Local routines */ +static void execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, + struct flush_op *op_ptr, unsigned *flags_ptr); + + test_entry_t *entries[NUMBER_OF_ENTRY_TYPES] = { pico_entries, @@ -262,118 +338,171 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = { { PICO_ENTRY_TYPE, - (H5C_load_func_t)pico_load, - (H5C_flush_func_t)pico_flush, - (H5C_dest_func_t)pico_dest, - (H5C_clear_func_t)pico_clear, + "pico_entry", + H5FD_MEM_DEFAULT, + H5C__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)pico_get_load_size, + (H5C_deserialize_func_t)pico_deserialize, + (H5C_image_len_func_t)pico_image_len, + (H5AC_pre_serialize_func_t)pico_pre_serialize, + (H5C_serialize_func_t)pico_serialize, (H5C_notify_func_t)NULL, - (H5C_size_func_t)pico_size + (H5C_free_icr_func_t)pico_free_icr, + (H5C_clear_func_t)NULL, + (H5C_get_fsf_size_t)NULL, }, { NANO_ENTRY_TYPE, - (H5C_load_func_t)nano_load, - (H5C_flush_func_t)nano_flush, - (H5C_dest_func_t)nano_dest, - (H5C_clear_func_t)nano_clear, + "nano_entry", + H5FD_MEM_DEFAULT, + H5C__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)nano_get_load_size, + (H5C_deserialize_func_t)nano_deserialize, + (H5C_image_len_func_t)nano_image_len, + (H5AC_pre_serialize_func_t)nano_pre_serialize, + (H5C_serialize_func_t)nano_serialize, (H5C_notify_func_t)NULL, - (H5C_size_func_t)nano_size + (H5C_free_icr_func_t)nano_free_icr, + (H5C_clear_func_t)NULL, + (H5C_get_fsf_size_t)NULL, }, { MICRO_ENTRY_TYPE, - (H5C_load_func_t)micro_load, - (H5C_flush_func_t)micro_flush, - (H5C_dest_func_t)micro_dest, - (H5C_clear_func_t)micro_clear, + "micro_entry", + H5FD_MEM_DEFAULT, + H5C__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)micro_get_load_size, + (H5C_deserialize_func_t)micro_deserialize, + (H5C_image_len_func_t)micro_image_len, + (H5AC_pre_serialize_func_t)micro_pre_serialize, + (H5C_serialize_func_t)micro_serialize, (H5C_notify_func_t)NULL, - (H5C_size_func_t)micro_size + (H5C_free_icr_func_t)micro_free_icr, + (H5C_clear_func_t)NULL, + (H5C_get_fsf_size_t)NULL, }, { TINY_ENTRY_TYPE, - (H5C_load_func_t)tiny_load, - (H5C_flush_func_t)tiny_flush, - (H5C_dest_func_t)tiny_dest, - (H5C_clear_func_t)tiny_clear, + "tiny_entry", + H5FD_MEM_DEFAULT, + H5C__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)tiny_get_load_size, + (H5C_deserialize_func_t)tiny_deserialize, + (H5C_image_len_func_t)tiny_image_len, + (H5AC_pre_serialize_func_t)tiny_pre_serialize, + (H5C_serialize_func_t)tiny_serialize, (H5C_notify_func_t)NULL, - (H5C_size_func_t)tiny_size + (H5C_free_icr_func_t)tiny_free_icr, + (H5C_clear_func_t)NULL, + (H5C_get_fsf_size_t)NULL, }, { SMALL_ENTRY_TYPE, - (H5C_load_func_t)small_load, - (H5C_flush_func_t)small_flush, - (H5C_dest_func_t)small_dest, - (H5C_clear_func_t)small_clear, + "small_entry", + H5FD_MEM_DEFAULT, + H5C__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)small_get_load_size, + (H5C_deserialize_func_t)small_deserialize, + (H5C_image_len_func_t)small_image_len, + (H5AC_pre_serialize_func_t)small_pre_serialize, + (H5C_serialize_func_t)small_serialize, (H5C_notify_func_t)NULL, - (H5C_size_func_t)small_size + (H5C_free_icr_func_t)small_free_icr, + (H5C_clear_func_t)NULL, + (H5C_get_fsf_size_t)NULL, }, { MEDIUM_ENTRY_TYPE, - (H5C_load_func_t)medium_load, - (H5C_flush_func_t)medium_flush, - (H5C_dest_func_t)medium_dest, - (H5C_clear_func_t)medium_clear, + "medium_entry", + H5FD_MEM_DEFAULT, + H5C__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)medium_get_load_size, + (H5C_deserialize_func_t)medium_deserialize, + (H5C_image_len_func_t)medium_image_len, + (H5AC_pre_serialize_func_t)medium_pre_serialize, + (H5C_serialize_func_t)medium_serialize, (H5C_notify_func_t)NULL, - (H5C_size_func_t)medium_size + (H5C_free_icr_func_t)medium_free_icr, + (H5C_clear_func_t)NULL, + (H5C_get_fsf_size_t)NULL, }, { LARGE_ENTRY_TYPE, - (H5C_load_func_t)large_load, - (H5C_flush_func_t)large_flush, - (H5C_dest_func_t)large_dest, - (H5C_clear_func_t)large_clear, + "large_entry", + H5FD_MEM_DEFAULT, + H5C__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)large_get_load_size, + (H5C_deserialize_func_t)large_deserialize, + (H5C_image_len_func_t)large_image_len, + (H5AC_pre_serialize_func_t)large_pre_serialize, + (H5C_serialize_func_t)large_serialize, (H5C_notify_func_t)NULL, - (H5C_size_func_t)large_size + (H5C_free_icr_func_t)large_free_icr, + (H5C_clear_func_t)NULL, + (H5C_get_fsf_size_t)NULL, }, { HUGE_ENTRY_TYPE, - (H5C_load_func_t)huge_load, - (H5C_flush_func_t)huge_flush, - (H5C_dest_func_t)huge_dest, - (H5C_clear_func_t)huge_clear, + "huge_entry", + H5FD_MEM_DEFAULT, + H5C__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)huge_get_load_size, + (H5C_deserialize_func_t)huge_deserialize, + (H5C_image_len_func_t)huge_image_len, + (H5AC_pre_serialize_func_t)huge_pre_serialize, + (H5C_serialize_func_t)huge_serialize, (H5C_notify_func_t)NULL, - (H5C_size_func_t)huge_size + (H5C_free_icr_func_t)huge_free_icr, + (H5C_clear_func_t)NULL, + (H5C_get_fsf_size_t)NULL, }, { MONSTER_ENTRY_TYPE, - (H5C_load_func_t)monster_load, - (H5C_flush_func_t)monster_flush, - (H5C_dest_func_t)monster_dest, - (H5C_clear_func_t)monster_clear, + "monster_entry", + H5FD_MEM_DEFAULT, + H5C__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)monster_get_load_size, + (H5C_deserialize_func_t)monster_deserialize, + (H5C_image_len_func_t)monster_image_len, + (H5AC_pre_serialize_func_t)monster_pre_serialize, + (H5C_serialize_func_t)monster_serialize, (H5C_notify_func_t)NULL, - (H5C_size_func_t)monster_size + (H5C_free_icr_func_t)monster_free_icr, + (H5C_clear_func_t)NULL, + (H5C_get_fsf_size_t)NULL, }, { VARIABLE_ENTRY_TYPE, - (H5C_load_func_t)variable_load, - (H5C_flush_func_t)variable_flush, - (H5C_dest_func_t)variable_dest, - (H5C_clear_func_t)variable_clear, + "variable_entry", + H5FD_MEM_DEFAULT, + H5C__CLASS_SPECULATIVE_LOAD_FLAG, + (H5C_get_load_size_func_t)variable_get_load_size, + (H5C_deserialize_func_t)variable_deserialize, + (H5C_image_len_func_t)variable_image_len, + (H5AC_pre_serialize_func_t)variable_pre_serialize, + (H5C_serialize_func_t)variable_serialize, (H5C_notify_func_t)NULL, - (H5C_size_func_t)variable_size + (H5C_free_icr_func_t)variable_free_icr, + (H5C_clear_func_t)NULL, + (H5C_get_fsf_size_t)NULL, }, { NOTIFY_ENTRY_TYPE, - (H5C_load_func_t)notify_load, - (H5C_flush_func_t)notify_flush, - (H5C_dest_func_t)notify_dest, - (H5C_clear_func_t)notify_clear, + "notify_entry", + H5FD_MEM_DEFAULT, + H5C__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)notify_get_load_size, + (H5C_deserialize_func_t)notify_deserialize, + (H5C_image_len_func_t)notify_image_len, + (H5AC_pre_serialize_func_t)notify_pre_serialize, + (H5C_serialize_func_t)notify_serialize, (H5C_notify_func_t)notify_notify, - (H5C_size_func_t)notify_size + (H5C_free_icr_func_t)notify_free_icr, + (H5C_clear_func_t)NULL, + (H5C_get_fsf_size_t)NULL, } }; -static herr_t clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t destroy(H5F_t * f, void * thing); -static herr_t flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned H5_ATTR_UNUSED * flags_ptr); -static void * load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t notify(H5C_notify_action_t action, void *thing); -static void execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, - struct flush_op *op_ptr, unsigned *flags_ptr); - - - - /* address translation functions: */ @@ -478,7 +607,7 @@ addr_to_type_and_index(haddr_t addr, 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; @@ -487,721 +616,834 @@ check_write_permitted(const H5F_t H5_ATTR_UNUSED *f, hbool_t *write_permitted_pt /*------------------------------------------------------------------------- - * Function: clear & friends + * Function: get_load_size & friends * - * Purpose: clear the entry. The helper functions verify that the - * correct version of clear is being called, and then call - * clear proper. + * Purpose: Query the image size for loading an entry. The helper + * functions funnel into get_load_size proper. * * Return: SUCCEED * - * Programmer: John Mainzer - * 6/10/04 + * Programmer: Quincey Koziol + * 5/18/10 * *------------------------------------------------------------------------- */ - -herr_t -clear(H5F_t * f, - void * thing, - hbool_t dest) +static herr_t +get_load_size(const void *udata, size_t *image_length, int32_t entry_type) { - test_entry_t * entry_ptr; - test_entry_t * base_addr; - - HDassert( thing ); - - entry_ptr = (test_entry_t *)thing; - base_addr = entries[entry_ptr->type]; - - HDassert( entry_ptr->index >= 0 ); - HDassert( entry_ptr->index <= max_indices[entry_ptr->type] ); - HDassert( entry_ptr == &(base_addr[entry_ptr->index]) ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->header.addr == entry_ptr->addr ); - HDassert( entry_ptr->header.size == entry_ptr->size ); - HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || - ( entry_ptr->size == entry_sizes[entry_ptr->type] ) ); - - entry_ptr->header.is_dirty = FALSE; - entry_ptr->is_dirty = FALSE; + test_entry_t *entry; + test_entry_t *base_addr; + haddr_t addr = *(const haddr_t *)udata; + int32_t type; + int32_t idx; - entry_ptr->cleared = TRUE; + addr_to_type_and_index(addr, &type, &idx); - if ( dest ) { + base_addr = entries[type]; + entry = &(base_addr[idx]); - destroy(f, thing); + HDassert(entry->type >= 0); + HDassert(entry->type == type); + HDassert(entry->type == entry_type); + HDassert(entry->type < NUMBER_OF_ENTRY_TYPES); + HDassert(entry->index == idx); + HDassert(entry->index >= 0); + HDassert(entry->index <= max_indices[type]); + HDassert(entry == entry->self); + HDassert(entry->addr == addr); - } + *image_length = entry->size; return(SUCCEED); +} /* get_load_size() */ -} /* clear() */ - -herr_t -pico_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +pico_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, PICO_ENTRY_TYPE); } -herr_t -nano_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +nano_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, NANO_ENTRY_TYPE); } -herr_t -micro_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +micro_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, MICRO_ENTRY_TYPE); } -herr_t -tiny_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +tiny_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, TINY_ENTRY_TYPE); } -herr_t -small_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +small_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, SMALL_ENTRY_TYPE); } -herr_t -medium_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +medium_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, MEDIUM_ENTRY_TYPE); } -herr_t -large_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +large_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, LARGE_ENTRY_TYPE); } -herr_t -huge_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +huge_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, HUGE_ENTRY_TYPE); } -herr_t -monster_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +monster_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, MONSTER_ENTRY_TYPE); } -herr_t -variable_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +variable_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == VARIABLE_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, VARIABLE_ENTRY_TYPE); } -herr_t -notify_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +notify_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == NOTIFY_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, NOTIFY_ENTRY_TYPE); } - /*------------------------------------------------------------------------- - * Function: dest & friends + * Function: deserialize & friends * - * Purpose: Destroy the entry. The helper functions verify that the - * correct version of dest is being called, and then call - * dest proper. + * Purpose: deserialize the entry. The helper functions verify that the + * correct version of deserialize is being called, and then call + * deserialize proper. * - * Return: SUCCEED + * Return: void * (pointer to the in core representation of the entry) * * Programmer: John Mainzer - * 6/10/04 + * 9/20/07 * *------------------------------------------------------------------------- */ - -herr_t -destroy(H5F_t H5_ATTR_UNUSED * f, - void * thing) +static void * +deserialize(const void *image, size_t len, void *udata, hbool_t *dirty, + int32_t entry_type) { - int i; - test_entry_t * entry_ptr; - test_entry_t * base_addr; - test_entry_t * pinned_entry_ptr; - test_entry_t * pinned_base_addr; - - HDassert( thing ); - - entry_ptr = (test_entry_t *)thing; - base_addr = entries[entry_ptr->type]; - - HDassert( entry_ptr->index >= 0 ); - HDassert( entry_ptr->index <= max_indices[entry_ptr->type] ); - HDassert( entry_ptr == &(base_addr[entry_ptr->index]) ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->cache_ptr != NULL ); - HDassert( entry_ptr->cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( ( entry_ptr->header.destroy_in_progress ) || - ( entry_ptr->header.addr == entry_ptr->addr ) ); - HDassert( entry_ptr->header.size == entry_ptr->size ); - HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || - ( entry_ptr->size == entry_sizes[entry_ptr->type] ) ); - - HDassert( !(entry_ptr->is_dirty) ); - HDassert( !(entry_ptr->header.is_dirty) ); - - if ( entry_ptr->num_pins > 0 ) { - - for ( i = 0; i < entry_ptr->num_pins; i++ ) - { - pinned_base_addr = entries[entry_ptr->pin_type[i]]; - pinned_entry_ptr = &(pinned_base_addr[entry_ptr->pin_idx[i]]); - - HDassert( 0 <= pinned_entry_ptr->type ); - HDassert( pinned_entry_ptr->type < NUMBER_OF_ENTRY_TYPES ); - HDassert( pinned_entry_ptr->type == entry_ptr->pin_type[i] ); - HDassert( pinned_entry_ptr->index >= 0 ); - HDassert( pinned_entry_ptr->index <= - max_indices[pinned_entry_ptr->type] ); - HDassert( pinned_entry_ptr->index == entry_ptr->pin_idx[i] ); - HDassert( pinned_entry_ptr == pinned_entry_ptr->self ); - HDassert( pinned_entry_ptr->header.is_pinned ); - HDassert( pinned_entry_ptr->is_pinned ); - HDassert( pinned_entry_ptr->pinning_ref_count > 0 ); - - pinned_entry_ptr->pinning_ref_count--; - - if ( pinned_entry_ptr->pinning_ref_count <= 0 ) { - - unpin_entry(pinned_entry_ptr->type, - pinned_entry_ptr->index); - } + test_entry_t *entry; + test_entry_t *base_addr; + haddr_t addr = *(haddr_t *)udata; + int32_t type; + int32_t idx; - entry_ptr->pin_type[i] = -1; - entry_ptr->pin_idx[i] = -1; - } - entry_ptr->num_pins = 0; - } + addr_to_type_and_index(addr, &type, &idx); - entry_ptr->destroyed = TRUE; - entry_ptr->cache_ptr = NULL; + base_addr = entries[type]; + entry = &(base_addr[idx]); + + HDassert(entry->type >= 0); + HDassert(entry->type == type); + HDassert(entry->type == entry_type); + HDassert(entry->type < NUMBER_OF_ENTRY_TYPES); + HDassert(entry->index == idx); + HDassert(entry->index >= 0); + HDassert(entry->index <= max_indices[type]); + HDassert(entry == entry->self); + HDassert(entry->addr == addr); + HDassert(entry->size == len); + HDassert((entry->type == VARIABLE_ENTRY_TYPE) || (entry->size == entry_sizes[type])); + HDassert(dirty != NULL); + + /* for now *dirty will always be FALSE */ + *dirty = FALSE; + + /* verify that the image contains the expected data. */ + HDassert(image != NULL); + if((entry->at_main_addr && entry->written_to_main_addr) || + (!entry->at_main_addr && entry->written_to_alt_addr)) { + if((type == PICO_ENTRY_TYPE) || (type == VARIABLE_ENTRY_TYPE) || + (type == NOTIFY_ENTRY_TYPE)) { + if((*((const char *)image)) != (char)(idx & 0xFF)) { + HDfprintf(stdout, "type = %d, idx = %d, addr = 0x%lx.\n", + type, idx, (long)addr); + HDfprintf(stdout, "*image = 0x%x\n", + (int)(*((const char *)image))); + HDfprintf(stdout, "expected *image = 0x%x\n", + (int)(idx & 0xFF)); + } /* end if */ + HDassert((*((const char *)image)) == (char)(idx & 0xFF)); + } /* end if */ + else { + if((*(((const char *)image) + 2)) != (char)(idx & 0xFF)) { + HDfprintf(stdout, "type = %d, idx = %d, addr = 0x%lx.\n", + type, idx, (long)addr); + HDfprintf(stdout, "*image = 0x%x 0x%x 0x%x\n", + (int)(*((const char *)image)), + (int)(*(((const char *)image) + 1)), + (int)(*(((const char *)image) + 2))); + HDfprintf(stdout, "expected *image = 0x%x\n", + (int)(idx & 0xFF), + (int)((idx & 0xFF00) >> 8)); + } /* end if */ + HDassert((*((const char *)image)) == (char)(type & 0xFF)); + HDassert((*(((const char *)image) + 1)) == (char)((idx & 0xFF00) >> 8)); + HDassert((*(((const char *)image) + 2)) == (char)(idx & 0xFF)); + } /* end else */ + } /* end if */ - return(SUCCEED); + entry->deserialized = TRUE; + entry->header.is_dirty = FALSE; + entry->is_dirty = FALSE; + (entry->deserializes)++; -} /* dest() */ + return((void *)entry); +} /* deserialize() */ -herr_t -pico_dest(H5F_t * f, void * thing) +void * +pico_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, PICO_ENTRY_TYPE); } -herr_t -nano_dest(H5F_t * f, void * thing) +void * +nano_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, NANO_ENTRY_TYPE); } -herr_t -micro_dest(H5F_t * f, void * thing) +void * +micro_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, MICRO_ENTRY_TYPE); } -herr_t -tiny_dest(H5F_t * f, void * thing) +void * +tiny_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, TINY_ENTRY_TYPE); } -herr_t -small_dest(H5F_t * f, void * thing) +void * +small_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, SMALL_ENTRY_TYPE); } -herr_t -medium_dest(H5F_t * f, void * thing) +void * +medium_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, MEDIUM_ENTRY_TYPE); } -herr_t -large_dest(H5F_t * f, void * thing) +void * +large_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, LARGE_ENTRY_TYPE); } -herr_t -huge_dest(H5F_t * f, void * thing) +void * +huge_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, HUGE_ENTRY_TYPE); } -herr_t -monster_dest(H5F_t * f, void * thing) +void * +monster_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, MONSTER_ENTRY_TYPE); } -herr_t -variable_dest(H5F_t * f, void * thing) +void * +variable_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == VARIABLE_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, VARIABLE_ENTRY_TYPE); } -herr_t -notify_dest(H5F_t * f, void * thing) +void * +notify_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == NOTIFY_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, NOTIFY_ENTRY_TYPE); } /*------------------------------------------------------------------------- - * Function: flush & friends + * Function: image_len & friends * - * Purpose: flush the entry and mark it as clean. The helper functions - * verify that the correct version of flush is being called, - * and then call flush proper. + * Purpose: Return the real (and possibly reduced) length of the image. + * The helper functions verify that the correct version of + * deserialize is being called, and then call deserialize + * proper. * * Return: SUCCEED * * Programmer: John Mainzer - * 6/10/04 + * 9/19/07 * *------------------------------------------------------------------------- */ herr_t -flush(H5F_t *f, - hid_t H5_ATTR_UNUSED dxpl_id, - hbool_t dest, - haddr_t -#ifdef NDEBUG - H5_ATTR_UNUSED -#endif /* NDEBUG */ - addr, - void *thing, - unsigned * flags_ptr) +image_len(void *thing, size_t *image_length, int32_t entry_type) { - int i; - test_entry_t * entry_ptr; - test_entry_t * base_addr; - - HDassert( thing ); - - entry_ptr = (test_entry_t *)thing; - base_addr = entries[entry_ptr->type]; - - HDassert( entry_ptr->index >= 0 ); - HDassert( entry_ptr->index <= max_indices[entry_ptr->type] ); - HDassert( entry_ptr == &(base_addr[entry_ptr->index]) ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->header.addr == entry_ptr->addr ); - HDassert( entry_ptr->addr == addr ); - HDassert( entry_ptr->header.size == entry_ptr->size ); - HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || - ( entry_ptr->size == entry_sizes[entry_ptr->type] ) ); - HDassert( entry_ptr->header.is_dirty == entry_ptr->is_dirty ); - HDassert( entry_ptr->cache_ptr != NULL ); - HDassert( entry_ptr->cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( entry_ptr->num_flush_ops >= 0 ); - HDassert( entry_ptr->num_flush_ops < MAX_FLUSH_OPS ); - - if ( entry_ptr->num_flush_ops > 0 ) { - - for ( i = 0; i < entry_ptr->num_flush_ops; i++ ) - { - execute_flush_op(f, - entry_ptr, - &((entry_ptr->flush_ops)[i]), - flags_ptr); - } - entry_ptr->num_flush_ops = 0; - entry_ptr->flush_op_self_resize_in_progress = FALSE; - } + test_entry_t *entry; + test_entry_t *base_addr; + int32_t type; + int32_t idx; - entry_ptr->flushed = TRUE; + HDassert(thing); + HDassert(image_length); - if ( ( ! write_permitted ) && ( entry_ptr->is_dirty ) ) { + entry = (test_entry_t *)thing; - pass = FALSE; - failure_mssg = "called flush when write_permitted is FALSE."; - } + HDassert(entry->self == entry); - if ( entry_ptr->is_dirty ) { + type = entry->type; + idx = entry->index; - (entry_ptr->writes)++; - entry_ptr->is_dirty = FALSE; - entry_ptr->header.is_dirty = FALSE; - } + HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); + HDassert(type == entry_type); + HDassert((idx >= 0) && (idx <= max_indices[type])); - if ( dest ) { + base_addr = entries[type]; + HDassert(entry == &(base_addr[idx])); - destroy(f, thing); + if(type != VARIABLE_ENTRY_TYPE) + HDassert(entry->size == entry_sizes[type]); + else { + HDassert(entry->size <= entry_sizes[type]); + HDassert(entry->size > 0); + } /* end else */ - } + *image_length = entry->size; return(SUCCEED); -} /* flush() */ +} /* image_len() */ herr_t -pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +pico_image_len(void *thing, size_t *image_length, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr) { - HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, PICO_ENTRY_TYPE); } herr_t -nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +nano_image_len(void *thing, size_t *image_length, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr) { - HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, NANO_ENTRY_TYPE); } herr_t -micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +micro_image_len(void *thing, size_t *image_length, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr) { - HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, MICRO_ENTRY_TYPE); } herr_t -tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +tiny_image_len(void *thing, size_t *image_length, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr) { - HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, TINY_ENTRY_TYPE); } herr_t -small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +small_image_len(void *thing, size_t *image_length, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr) { - HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, SMALL_ENTRY_TYPE); } herr_t -medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +medium_image_len(void *thing, size_t *image_length, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr) { - HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, MEDIUM_ENTRY_TYPE); } herr_t -large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +large_image_len(void *thing, size_t *image_length, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr) { - HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, LARGE_ENTRY_TYPE); } herr_t -huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +huge_image_len(void *thing, size_t *image_length, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr) { - HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, HUGE_ENTRY_TYPE); } herr_t -monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +monster_image_len(void *thing, size_t *image_length, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr) { - HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, MONSTER_ENTRY_TYPE); } herr_t -variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +variable_image_len(void *thing, size_t *image_length, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr) { - HDassert ( ((test_entry_t *)thing)->type == VARIABLE_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, VARIABLE_ENTRY_TYPE); } herr_t -notify_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +notify_image_len(void *thing, size_t *image_length, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr) { - HDassert ( ((test_entry_t *)thing)->type == NOTIFY_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, NOTIFY_ENTRY_TYPE); } /*------------------------------------------------------------------------- - * Function: load & friends + * Function: pre_serialize & friends * - * Purpose: "load" the requested entry and mark it as clean. The - * helper functions verify that the correct version of load - * is being called, and then call load proper. + * Purpose: Pre_serialize the supplied entry. For now this consistes of + * executing any flush operations and loading the appropriate + * values into *new_addr_ptr, *new_len_ptr, and *flags_ptr. * - * Return: SUCCEED + * The helper functions verify that the correct version of + * serialize is being called, and then call serialize + * proper. + * + * Return: SUCCEED if successful, FAIL otherwise. * * Programmer: John Mainzer - * 6/10/04 + * 8/07/14 * *------------------------------------------------------------------------- */ - -void * -load(H5F_t H5_ATTR_UNUSED *f, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t addr, - void H5_ATTR_UNUSED *udata) +herr_t +pre_serialize(const H5F_t *f, + hid_t H5_ATTR_UNUSED dxpl_id, + void *thing, + haddr_t addr, + size_t len, + haddr_t *new_addr_ptr, + size_t *new_len_ptr, + unsigned *flags_ptr) { + test_entry_t *entry; + test_entry_t *base_addr; int32_t type; int32_t idx; - test_entry_t * entry_ptr; - test_entry_t * base_addr; + int32_t i; - addr_to_type_and_index(addr, &type, &idx); + HDassert(f); + HDassert(thing); + HDassert(flags_ptr); + + *flags_ptr = H5C__SERIALIZE_NO_FLAGS_SET; + + HDassert(new_addr_ptr); + HDassert(new_len_ptr); + + entry = (test_entry_t *)thing; + + HDassert(entry->self == entry); + HDassert(entry->addr == addr); + HDassert(entry->size == len); + + /* shouldn't serialize the entry unless it is dirty */ + HDassert(entry->is_dirty); + + type = entry->type; + idx = entry->index; + + HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); + HDassert((idx >= 0) && (idx <= max_indices[type])); base_addr = entries[type]; - entry_ptr = &(base_addr[idx]); - HDassert( entry_ptr->type == type ); - HDassert( entry_ptr->type >= 0 ); - HDassert( entry_ptr->type < NUMBER_OF_ENTRY_TYPES ); - HDassert( entry_ptr->index == idx ); - HDassert( entry_ptr->index >= 0 ); - HDassert( entry_ptr->index <= max_indices[type] ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->addr == addr ); -#if 1 /* JRM */ - if ( ! ( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || - ( entry_ptr->size == entry_sizes[type] ) ) ) { - - HDfprintf(stdout, "entry type/index/size = %d/%d/%ld\n", - (int)(entry_ptr->type), - (int)(entry_ptr->index), - (long)(entry_ptr->size)); - } -#endif /* JRM */ - HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || - ( entry_ptr->size == entry_sizes[type] ) ); + HDassert(entry == &(base_addr[idx])); + HDassert(entry->num_flush_ops >= 0); + HDassert(entry->num_flush_ops < MAX_FLUSH_OPS); - entry_ptr->loaded = TRUE; + if(entry->num_flush_ops > 0) { + for(i = 0; i < entry->num_flush_ops; i++ ) { + HDassert(entry->file_ptr); - entry_ptr->header.is_dirty = FALSE; - entry_ptr->is_dirty = FALSE; + execute_flush_op(entry->file_ptr, entry, + &((entry->flush_ops)[i]), flags_ptr); + } /* end for */ + entry->num_flush_ops = 0; + entry->flush_op_self_resize_in_progress = FALSE; - (entry_ptr->reads)++; + /* This looks wrong, but it isn't -- *flags_ptr will be modified + * by execute_flush_op() only if the target is this entry -- + * and the flags set will accumulate over the set of calls in + * the for loop. + */ + if(pass && (((*flags_ptr) & H5C__SERIALIZE_RESIZED_FLAG) != 0)) { - return(entry_ptr); + /* set *new_len_ptr to the new length. */ -} /* load() */ + HDassert(entry->type == VARIABLE_ENTRY_TYPE); + HDassert(entry->size > 0); + HDassert(entry->size <= VARIABLE_ENTRY_SIZE); -void * -pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) + *new_len_ptr = entry->size; + } /* end if */ + + if(((*flags_ptr) & H5C__SERIALIZE_MOVED_FLAG) != 0) { + + HDassert(((*flags_ptr) | H5C__SERIALIZE_RESIZED_FLAG) != 0); + + /* place the new address in *new_addr */ + *new_addr_ptr = entry->addr; + } /* end if */ + } /* end if */ + + return(SUCCEED); + +} /* pre_serialize() */ + +herr_t +pico_pre_serialize(const H5F_t *f, + hid_t dxpl_id, + void *thing, + haddr_t addr, + size_t len, + size_t H5_ATTR_UNUSED compressed_len, + haddr_t *new_addr_ptr, + size_t *new_len_ptr, + size_t H5_ATTR_UNUSED *new_compressed_len_ptr, + unsigned *flags_ptr) { - return(load(f, dxpl_id, addr, udata)); + return pre_serialize(f, dxpl_id, thing, addr, len, + new_addr_ptr, new_len_ptr, flags_ptr); } -void * -nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +nano_pre_serialize(const H5F_t *f, + hid_t dxpl_id, + void *thing, + haddr_t addr, + size_t len, + size_t H5_ATTR_UNUSED compressed_len, + haddr_t *new_addr_ptr, + size_t *new_len_ptr, + size_t H5_ATTR_UNUSED *new_compressed_len_ptr, + unsigned *flags_ptr) { - return(load(f, dxpl_id, addr, udata)); + return pre_serialize(f, dxpl_id, thing, addr, len, + new_addr_ptr, new_len_ptr, flags_ptr); } -void * -micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +micro_pre_serialize(const H5F_t *f, + hid_t dxpl_id, + void *thing, + haddr_t addr, + size_t len, + size_t H5_ATTR_UNUSED compressed_len, + haddr_t *new_addr_ptr, + size_t *new_len_ptr, + size_t H5_ATTR_UNUSED *new_compressed_len_ptr, + unsigned *flags_ptr) { - return(load(f, dxpl_id, addr, udata)); + return pre_serialize(f, dxpl_id, thing, addr, len, + new_addr_ptr, new_len_ptr, flags_ptr); } -void * -tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +tiny_pre_serialize(const H5F_t *f, + hid_t dxpl_id, + void *thing, + haddr_t addr, + size_t len, + size_t H5_ATTR_UNUSED compressed_len, + haddr_t *new_addr_ptr, + size_t *new_len_ptr, + size_t H5_ATTR_UNUSED *new_compressed_len_ptr, + unsigned *flags_ptr) { - return(load(f, dxpl_id, addr, udata)); + return pre_serialize(f, dxpl_id, thing, addr, len, + new_addr_ptr, new_len_ptr, flags_ptr); } -void * -small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +small_pre_serialize(const H5F_t *f, + hid_t dxpl_id, + void *thing, + haddr_t addr, + size_t len, + size_t H5_ATTR_UNUSED compressed_len, + haddr_t *new_addr_ptr, + size_t *new_len_ptr, + size_t H5_ATTR_UNUSED *new_compressed_len_ptr, + unsigned *flags_ptr) { - return(load(f, dxpl_id, addr, udata)); + return pre_serialize(f, dxpl_id, thing, addr, len, + new_addr_ptr, new_len_ptr, flags_ptr); } -void * -medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +medium_pre_serialize(const H5F_t *f, + hid_t dxpl_id, + void *thing, + haddr_t addr, + size_t len, + size_t H5_ATTR_UNUSED compressed_len, + haddr_t *new_addr_ptr, + size_t *new_len_ptr, + size_t H5_ATTR_UNUSED *new_compressed_len_ptr, + unsigned *flags_ptr) { - return(load(f, dxpl_id, addr, udata)); + return pre_serialize(f, dxpl_id, thing, addr, len, + new_addr_ptr, new_len_ptr, flags_ptr); } -void * -large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +large_pre_serialize(const H5F_t *f, + hid_t dxpl_id, + void *thing, + haddr_t addr, + size_t len, + size_t H5_ATTR_UNUSED compressed_len, + haddr_t *new_addr_ptr, + size_t *new_len_ptr, + size_t H5_ATTR_UNUSED *new_compressed_len_ptr, + unsigned *flags_ptr) { - return(load(f, dxpl_id, addr, udata)); + return pre_serialize(f, dxpl_id, thing, addr, len, + new_addr_ptr, new_len_ptr, flags_ptr); } -void * -huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +huge_pre_serialize(const H5F_t *f, + hid_t dxpl_id, + void *thing, + haddr_t addr, + size_t len, + size_t H5_ATTR_UNUSED compressed_len, + haddr_t *new_addr_ptr, + size_t *new_len_ptr, + size_t H5_ATTR_UNUSED *new_compressed_len_ptr, + unsigned *flags_ptr) { - return(load(f, dxpl_id, addr, udata)); + return pre_serialize(f, dxpl_id, thing, addr, len, + new_addr_ptr, new_len_ptr, flags_ptr); } -void * -monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +monster_pre_serialize(const H5F_t *f, + hid_t dxpl_id, + void *thing, + haddr_t addr, + size_t len, + size_t H5_ATTR_UNUSED compressed_len, + haddr_t *new_addr_ptr, + size_t *new_len_ptr, + size_t H5_ATTR_UNUSED *new_compressed_len_ptr, + unsigned *flags_ptr) { - return(load(f, dxpl_id, addr, udata)); + return pre_serialize(f, dxpl_id, thing, addr, len, + new_addr_ptr, new_len_ptr, flags_ptr); } -void * -variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +variable_pre_serialize(const H5F_t *f, + hid_t dxpl_id, + void *thing, + haddr_t addr, + size_t len, + size_t H5_ATTR_UNUSED compressed_len, + haddr_t *new_addr_ptr, + size_t *new_len_ptr, + size_t H5_ATTR_UNUSED *new_compressed_len_ptr, + unsigned *flags_ptr) { - return(load(f, dxpl_id, addr, udata)); + return pre_serialize(f, dxpl_id, thing, addr, len, + new_addr_ptr, new_len_ptr, flags_ptr); } -void * -notify_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +notify_pre_serialize(const H5F_t *f, + hid_t dxpl_id, + void *thing, + haddr_t addr, + size_t len, + size_t H5_ATTR_UNUSED compressed_len, + haddr_t *new_addr_ptr, + size_t *new_len_ptr, + size_t H5_ATTR_UNUSED *new_compressed_len_ptr, + unsigned *flags_ptr) { - return(load(f, dxpl_id, addr, udata)); + return pre_serialize(f, dxpl_id, thing, addr, len, + new_addr_ptr, new_len_ptr, flags_ptr); } + /*------------------------------------------------------------------------- - * Function: size & friends + * Function: serialize & friends * - * Purpose: Get the size of the specified entry. The helper functions - * verify that the correct version of size is being called, - * and then call size proper. + * Purpose: Serialize the supplied entry. For now this consistes of + * loading the type and index of the entry into the first + * three bytes of the image (if it is long enough -- if not + * just load the low order byte of the index into the first + * byte of the image). * - * Return: SUCCEED + * The helper functions verify that the correct version of + * serialize is being called, and then call serialize + * proper. + * + * Return: SUCCEED if successful, FAIL otherwise. * * Programmer: John Mainzer - * 6/10/04 + * 9/19/07 * *------------------------------------------------------------------------- */ herr_t -size(H5F_t H5_ATTR_UNUSED * f, - void * thing, - size_t * size_ptr) +serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing) { - test_entry_t * entry_ptr; - test_entry_t * base_addr; + test_entry_t *entry; + test_entry_t *base_addr; + int32_t type; + int32_t idx; - HDassert( size_ptr ); - HDassert( thing ); + HDassert(image_ptr); + HDassert(thing); - entry_ptr = (test_entry_t *)thing; - base_addr = entries[entry_ptr->type]; + entry = (test_entry_t *)thing; - HDassert( entry_ptr->index >= 0 ); - HDassert( entry_ptr->index <= max_indices[entry_ptr->type] ); - HDassert( entry_ptr == &(base_addr[entry_ptr->index]) ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->header.addr == entry_ptr->addr ); - HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || \ - ( entry_ptr->size == entry_sizes[entry_ptr->type] ) ); + HDassert(entry->self == entry); + HDassert(entry->size == len); + + /* shouldn't serialize the entry unless it is dirty */ + HDassert(entry->is_dirty); + + type = entry->type; + idx = entry->index; + + HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); + HDassert((idx >= 0) && (idx <= max_indices[type])); - *size_ptr = entry_ptr->size; + base_addr = entries[type]; + + HDassert(entry == &(base_addr[idx])); + HDassert(entry->num_flush_ops >= 0); + HDassert(entry->num_flush_ops < MAX_FLUSH_OPS); + + /* null out the image to avoid spurious failures */ + HDmemset(image_ptr, 0, len); + + if((type == PICO_ENTRY_TYPE) || (type == VARIABLE_ENTRY_TYPE) || + (type == NOTIFY_ENTRY_TYPE )) { + HDassert(entry->size >= PICO_ENTRY_SIZE); + *((char *)image_ptr) = (char)((entry->index) & 0xFF); + } /* end if */ + else { + HDassert(entry->size >= NANO_ENTRY_SIZE); + *((char *)image_ptr) = (char)((entry->type) & 0xFF); + *(((char *)image_ptr) + 1) = (char)(((entry->index) & 0xFF00) >> 8); + *(((char *)image_ptr) + 2) = (char)((entry->index) & 0xFF); + } /* end else */ + + /* We no longer do the actual write through an callback -- this is + * as close to that callback as we will get. Hence mark the entry + * clean here. If all goes well, it will be flushed shortly. + */ + entry->is_dirty = FALSE; + + /* since the entry is about to be written to disk, we can mark it + * as initialized. + */ + if(entry->at_main_addr) + entry->written_to_main_addr = TRUE; + else + entry->written_to_alt_addr = TRUE; + + /* do book keeping */ + (entry->serializes)++; + entry->serialized = TRUE; return(SUCCEED); -} /* size() */ +} /* serialize() */ herr_t -pico_size(H5F_t * f, void * thing, size_t * size_ptr) +pico_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing) { - HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return serialize(f, image_ptr, len, thing); } herr_t -nano_size(H5F_t * f, void * thing, size_t * size_ptr) +nano_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing) { - HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return serialize(f, image_ptr, len, thing); } herr_t -micro_size(H5F_t * f, void * thing, size_t * size_ptr) +micro_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing) { - HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return serialize(f, image_ptr, len, thing); } herr_t -tiny_size(H5F_t * f, void * thing, size_t * size_ptr) +tiny_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing) { - HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return serialize(f, image_ptr, len, thing); } herr_t -small_size(H5F_t * f, void * thing, size_t * size_ptr) +small_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing) { - HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return serialize(f, image_ptr, len, thing); } herr_t -medium_size(H5F_t * f, void * thing, size_t * size_ptr) +medium_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, + void *thing) { - HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return serialize(f, image_ptr, len, thing); } herr_t -large_size(H5F_t * f, void * thing, size_t * size_ptr) +large_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing) { - HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return serialize(f, image_ptr, len, thing); } herr_t -huge_size(H5F_t * f, void * thing, size_t * size_ptr) +huge_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing) { - HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return serialize(f, image_ptr, len, thing); } herr_t -monster_size(H5F_t * f, void * thing, size_t * size_ptr) +monster_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, + void *thing) { - HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return serialize(f, image_ptr, len, thing); } herr_t -variable_size(H5F_t * f, void * thing, size_t * size_ptr) +variable_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, + void *thing) { - HDassert ( ((test_entry_t *)thing)->type == VARIABLE_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return serialize(f, image_ptr, len, thing); } herr_t -notify_size(H5F_t * f, void * thing, size_t * size_ptr) +notify_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, + void *thing) { - HDassert ( ((test_entry_t *)thing)->type == NOTIFY_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return serialize(f, image_ptr, len, thing); } @@ -1220,32 +1462,39 @@ notify_size(H5F_t * f, void * thing, size_t * size_ptr) *------------------------------------------------------------------------- */ static herr_t -notify(H5C_notify_action_t action, void *thing) +notify(H5C_notify_action_t action, void *thing, int32_t entry_type) { - test_entry_t * entry_ptr; + test_entry_t *entry; test_entry_t *base_addr; HDassert(thing); - entry_ptr = (test_entry_t *)thing; - base_addr = entries[entry_ptr->type]; + entry = (test_entry_t *)thing; + base_addr = entries[entry->type]; - HDassert( entry_ptr->index >= 0 ); - HDassert( entry_ptr->index <= max_indices[entry_ptr->type] ); - HDassert( entry_ptr == &(base_addr[entry_ptr->index]) ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->header.addr == entry_ptr->addr ); - HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || \ - ( entry_ptr->size == entry_sizes[entry_ptr->type] ) ); + HDassert(entry->index >= 0); + HDassert(entry->index <= max_indices[entry->type]); + HDassert((entry->type >= 0) && (entry->type < NUMBER_OF_ENTRY_TYPES)); + HDassert(entry->type == entry_type); + HDassert(entry == &(base_addr[entry->index])); + HDassert(entry == entry->self); + HDassert(entry->header.addr == entry->addr); + HDassert((entry->type == VARIABLE_ENTRY_TYPE) || \ + (entry->size == entry_sizes[entry->type])); /* Increment count for appropriate action */ switch(action) { - case H5C_NOTIFY_ACTION_AFTER_INSERT: /* Entry has been added to the cache */ - entry_ptr->notify_after_insert_count++; + case H5C_NOTIFY_ACTION_AFTER_INSERT: /* Entry has been added */ + case H5C_NOTIFY_ACTION_AFTER_LOAD: /* to the cache. */ + entry->notify_after_insert_count++; break; + case H5C_NOTIFY_ACTION_AFTER_FLUSH: + /* do nothing */ + break; + case H5C_NOTIFY_ACTION_BEFORE_EVICT: /* Entry is about to be evicted from cache */ - entry_ptr->notify_before_evict_count++; + entry->notify_before_evict_count++; break; default: @@ -1258,11 +1507,160 @@ notify(H5C_notify_action_t action, void *thing) herr_t notify_notify(H5C_notify_action_t action, void *thing) { - HDassert ( ((test_entry_t *)thing)->type == NOTIFY_ENTRY_TYPE ); - return(notify(action, thing)); + return(notify(action, thing, NOTIFY_ENTRY_TYPE)); +} + + +/*------------------------------------------------------------------------- + * Function: free_icr & friends + * + * Purpose: Nominally, this callback is supposed to free the + * in core representation of the entry. + * + * In the context of this test bed, we use it to do + * do all the processing we used to do on a destroy. + * In particular, we use it to release all the pins + * that this entry may have on other entries. + * + * The helper functions verify that the correct version of + * serialize is being called, and then call free_icr + * proper. + * + * Return: SUCCEED + * + * Programmer: John Mainzer + * 9/19/07 + * + *------------------------------------------------------------------------- + */ +herr_t +free_icr(test_entry_t *entry, int32_t entry_type) +{ + test_entry_t *base_addr; + + HDassert(entry); + + base_addr = entries[entry->type]; + + HDassert(entry->type == entry_type); + HDassert(entry->index >= 0); + HDassert(entry->index <= max_indices[entry->type]); + HDassert(entry == &(base_addr[entry->index])); + HDassert(entry == entry->self); + HDassert(entry->cache_ptr != NULL); + HDassert(entry->cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert((entry->header.destroy_in_progress) || + (entry->header.addr == entry->addr)); + HDassert(entry->header.size == entry->size); + HDassert((entry->type == VARIABLE_ENTRY_TYPE) || + (entry->size == entry_sizes[entry->type])); + + if(entry->num_pins > 0) { + int i; + + for(i = 0; i < entry->num_pins; i++) { + test_entry_t *pinned_entry; + test_entry_t *pinned_base_addr; + + pinned_base_addr = entries[entry->pin_type[i]]; + pinned_entry = &(pinned_base_addr[entry->pin_idx[i]]); + + HDassert(0 <= pinned_entry->type); + HDassert(pinned_entry->type < NUMBER_OF_ENTRY_TYPES); + HDassert(pinned_entry->type == entry->pin_type[i]); + HDassert(pinned_entry->index >= 0); + HDassert(pinned_entry->index <= max_indices[pinned_entry->type]); + HDassert(pinned_entry->index == entry->pin_idx[i]); + HDassert(pinned_entry == pinned_entry->self); + HDassert(pinned_entry->header.is_pinned); + HDassert(pinned_entry->is_pinned); + HDassert(pinned_entry->pinning_ref_count > 0); + + pinned_entry->pinning_ref_count--; + + if(pinned_entry->pinning_ref_count <= 0) { + HDassert(pinned_entry->file_ptr); + + unpin_entry(pinned_entry->type, pinned_entry->index); + } /* end if */ + + entry->pin_type[i] = -1; + entry->pin_idx[i] = -1; + } /* end if */ + entry->num_pins = 0; + } /* end if */ + + entry->destroyed = TRUE; + entry->cache_ptr = NULL; + + return(SUCCEED); +} /* free_icr() */ + +herr_t +pico_free_icr(void *thing) +{ + return free_icr((test_entry_t *)thing, PICO_ENTRY_TYPE); +} + +herr_t +nano_free_icr(void *thing) +{ + return free_icr((test_entry_t *)thing, NANO_ENTRY_TYPE); +} + +herr_t +micro_free_icr(void *thing) +{ + return free_icr((test_entry_t *)thing, MICRO_ENTRY_TYPE); +} + +herr_t +tiny_free_icr(void *thing) +{ + return free_icr((test_entry_t *)thing, TINY_ENTRY_TYPE); +} + +herr_t +small_free_icr(void *thing) +{ + return free_icr((test_entry_t *)thing, SMALL_ENTRY_TYPE); +} + +herr_t +medium_free_icr(void *thing) +{ + return free_icr((test_entry_t *)thing, MEDIUM_ENTRY_TYPE); } +herr_t +large_free_icr(void *thing) +{ + return free_icr((test_entry_t *)thing, LARGE_ENTRY_TYPE); +} +herr_t +huge_free_icr(void *thing) +{ + return free_icr((test_entry_t *)thing, HUGE_ENTRY_TYPE); +} + +herr_t +monster_free_icr(void *thing) +{ + return free_icr((test_entry_t *)thing, MONSTER_ENTRY_TYPE); +} + +herr_t +variable_free_icr(void *thing) +{ + return free_icr((test_entry_t *)thing, VARIABLE_ENTRY_TYPE); +} + +herr_t +notify_free_icr(void *thing) +{ + return free_icr((test_entry_t *)thing, NOTIFY_ENTRY_TYPE); +} /**************************************************************************/ @@ -1565,17 +1963,10 @@ execute_flush_op(H5F_t * file_ptr, HDassert( op_ptr->size <= VARIABLE_ENTRY_SIZE ); entry_ptr->size = op_ptr->size; - (*flags_ptr) |= H5C_CALLBACK__SIZE_CHANGED_FLAG; - entry_ptr->flush_op_self_resize_in_progress = TRUE; - /* if the entry is in the process of being destroyed, - * set the header size to match the entry size so as - * to avoid a spurious failure in the destroy callback. - */ - if ( entry_ptr->header.destroy_in_progress ) { + (*flags_ptr) |= H5C__SERIALIZE_RESIZED_FLAG; - entry_ptr->header.size = entry_ptr->size; - } + entry_ptr->flush_op_self_resize_in_progress = TRUE; } else { @@ -1587,7 +1978,29 @@ execute_flush_op(H5F_t * file_ptr, break; case FLUSH_OP__MOVE: - move_entry(cache_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag); + if((entry_ptr->type == op_ptr->type) && + (entry_ptr->index == op_ptr->idx)) { + + /* the flush operation is acting on the entry to + * which it is attached. Handle this here: + */ + + HDassert(((*flags_ptr) & H5C__SERIALIZE_RESIZED_FLAG) != 0); + (*flags_ptr) |= H5C__SERIALIZE_MOVED_FLAG; + + if(op_ptr->flag) { + HDassert(entry_ptr->addr == entry_ptr->alt_addr); + entry_ptr->addr = entry_ptr->main_addr; + entry_ptr->at_main_addr = TRUE; + } /* end if */ + else { + HDassert(entry_ptr->addr == entry_ptr->main_addr); + entry_ptr->addr = entry_ptr->alt_addr; + entry_ptr->at_main_addr = FALSE; + } /* end else */ + } /* end if */ + else + move_entry(cache_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag); break; case FLUSH_OP__ORDER: @@ -1596,6 +2009,33 @@ execute_flush_op(H5F_t * file_ptr, (*op_ptr->order_ptr)++; break; + case FLUSH_OP__EXPUNGE: + /* the expunge flush op exists to allow us to simulate the + * case in which an entry is removed from the cashe as the + * the result of the flush of a second entry. At present, + * this can only happen via the take ownership flag, but + * we will make this test feature more general to as to make + * tests easier to write. + * + * When this operation is executed, the target entry is + * removed from the cache without being flushed if dirty + * via the expunge_entry() test function (which calls + * H5C_expunge_entry()). Note that this flush operation + * must always be executed on an entry other than the + * entry being flushed. + */ + HDassert( ( entry_ptr->type != op_ptr->type ) || + ( entry_ptr->index != op_ptr->idx ) ); + expunge_entry(file_ptr, op_ptr->type, op_ptr->idx); + break; + + case FLUSH_OP__DEST_FLUSH_DEP: + HDassert( ( entry_ptr->type != op_ptr->type ) || + ( entry_ptr->index != op_ptr->idx ) ); + destroy_flush_dependency(op_ptr->type, op_ptr->idx, + entry_ptr->type, entry_ptr->index); + break; + default: pass = FALSE; failure_mssg = "Undefined flush op code."; @@ -1721,6 +2161,8 @@ reset_entries(void) base_addr[j].self = &(base_addr[j]); base_addr[j].cache_ptr = NULL; + base_addr[j].written_to_main_addr = FALSE; + base_addr[j].written_to_alt_addr = FALSE; base_addr[j].addr = addr; base_addr[j].at_main_addr = TRUE; base_addr[j].main_addr = addr; @@ -1728,8 +2170,8 @@ reset_entries(void) base_addr[j].size = entry_size; base_addr[j].type = i; base_addr[j].index = j; - base_addr[j].reads = 0; - base_addr[j].writes = 0; + base_addr[j].serializes = 0; + base_addr[j].deserializes = 0; base_addr[j].is_dirty = FALSE; base_addr[j].is_protected = FALSE; base_addr[j].is_read_only = FALSE; @@ -1755,10 +2197,10 @@ reset_entries(void) } base_addr[j].flush_op_self_resize_in_progress = FALSE; - base_addr[j].loaded = FALSE; - base_addr[j].cleared = FALSE; - base_addr[j].flushed = FALSE; + base_addr[j].deserialized = FALSE; + base_addr[j].serialized = FALSE; base_addr[j].destroyed = FALSE; + base_addr[j].expunged = FALSE; base_addr[j].flush_dep_par_type = -1; base_addr[j].flush_dep_par_idx = -1; @@ -1987,15 +2429,24 @@ verify_entry_status(H5C_t * cache_ptr, unsigned u; /* Local index variable */ if ( ( ! expected[i].in_cache ) && - ( ( expected[i].is_dirty ) || - ( expected[i].is_protected ) || - ( expected[i].is_pinned ) ) ) { + ( ( expected[i].is_protected ) || ( expected[i].is_pinned ) ) ) { pass = FALSE; sprintf(msg, "%d: Contradictory data in expected[%d].\n", tag, i); failure_mssg = msg; } + if ( ( ! expected[i].in_cache ) && + ( expected[i].is_dirty ) && + ( ! entry_ptr->expunged ) ) { + + pass = FALSE; + sprintf(msg, + "%d: expected[%d] specs non-expunged, dirty, non-resident.\n", + tag, i); + failure_mssg = msg; + } + if ( pass ) { in_cache = entry_in_cache(cache_ptr, expected[i].entry_type, @@ -2161,23 +2612,20 @@ verify_entry_status(H5C_t * cache_ptr, if ( pass ) { - if ( ( entry_ptr->loaded != expected[i].loaded ) || - ( entry_ptr->cleared != expected[i].cleared ) || - ( entry_ptr->flushed != expected[i].flushed ) || + if ( ( entry_ptr->deserialized != expected[i].deserialized ) || + ( entry_ptr->serialized != expected[i].serialized ) || ( entry_ptr->destroyed != expected[i].destroyed ) ) { pass = FALSE; sprintf(msg, - "%d entry (%d,%d) loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", + "%d entry (%d,%d) deserialized = %d(%d), serialized = %d(%d), dest = %d(%d)\n", tag, (int)expected[i].entry_type, (int)expected[i].entry_index, - (int)(entry_ptr->loaded), - (int)(expected[i].loaded), - (int)(entry_ptr->cleared), - (int)(expected[i].cleared), - (int)(entry_ptr->flushed), - (int)(expected[i].flushed), + (int)(entry_ptr->deserialized), + (int)(expected[i].deserialized), + (int)(entry_ptr->serialized), + (int)(expected[i].serialized), (int)(entry_ptr->destroyed), (int)(expected[i].destroyed)); failure_mssg = msg; @@ -2372,20 +2820,37 @@ verify_unprotected(void) } /* verify_unprotected() */ -/*------------------------------------------------------------------------- - * Function: setup_cache() +/***************************************************************************** * - * Purpose: Allocate a cache of the desired size and configure it for - * use in the test bed. Return a pointer to the new cache - * structure. + * Function: setup_cache() * - * Return: Pointer to new cache, or NULL on failure. + * Purpose: Open an HDF file. This will allocate an instance and + * initialize an associated instance of H5C_t. However, + * we want to test an instance of H5C_t, so allocate and + * initialize one with the file ID returned by the call to + * H5Fcreate(). Return a pointer to this instance of H5C_t. * - * Programmer: John Mainzer - * 6/11/04 + * Observe that we open a HDF file because the cache now + * writes directly to file, and we need the file I/O facilities + * associated with the file. * - *------------------------------------------------------------------------- - */ + * To avoid tripping on error check code, must allocate enough + * space in the file to hold all the test entries and their + * alternates. This is a little sticky, as the addresses of + * all the test entries are determined at compile time. + * + * Deal with this by choosing BASE_ADDR large enough that + * the base address of the allocate space will be less than + * or equal to BASE_ADDR, and then requesting an extra BASE_ADDR + * bytes, so we don't have to wory about exceeding the allocation. + * + * Return: Success: Ptr to H5C_t + * + * Failure: NULL + * + * Programmer: JRM -- 9/13/07 + * + *****************************************************************************/ H5F_t * setup_cache(size_t max_cache_size, @@ -2650,8 +3115,11 @@ setup_cache(size_t max_cache_size, /*------------------------------------------------------------------------- * Function: takedown_cache() * - * Purpose: Flush the specified cache and disable it. If requested, - * dump stats first. If pass is FALSE, do nothing. + * Purpose: Flush the specified cache and destroy it. If requested, + * dump stats first. Then close and delete the associate + * file. + * + * If pass is FALSE, do nothing. * * Return: void * @@ -2678,7 +3146,7 @@ takedown_cache(H5F_t * file_ptr, flush_cache(file_ptr, TRUE, FALSE, FALSE); - H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT); + H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT); if ( saved_cache != NULL ) { @@ -2753,6 +3221,11 @@ takedown_cache(H5F_t * file_ptr, * Programmer: John Mainzer * 7/6/06 * + * Changes: Added code to set entry_ptr->expunged to TRUE if + * H5C_expunge_entry() returns without error. + * + * JRM -- 8/21/14 + * *------------------------------------------------------------------------- */ @@ -2787,7 +3260,7 @@ expunge_entry(H5F_t * file_ptr, HDassert( ! ( entry_ptr->header.is_pinned ) ); HDassert( ! ( entry_ptr->is_pinned ) ); - result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, + result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types[type]), entry_ptr->addr, H5C__NO_FLAGS_SET); if ( result < 0 ) { @@ -2795,6 +3268,9 @@ expunge_entry(H5F_t * file_ptr, pass = FALSE; failure_mssg = "error in H5C_expunge_entry()."; + } else { + + entry_ptr->expunged = TRUE; } } @@ -2837,11 +3313,11 @@ flush_cache(H5F_t * file_ptr, if(destroy_entries) result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, - H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); + H5C__FLUSH_INVALIDATE_FLAG); else result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, - H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); + H5C__NO_FLAGS_SET); if(dump_stats) H5C_stats(cache_ptr, "test cache", dump_detailed_stats); @@ -2921,8 +3397,8 @@ insert_entry(H5F_t * file_ptr, entry_ptr->is_dirty = TRUE; - result = H5C_insert_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[type]), entry_ptr->addr, (void *)entry_ptr, flags); + result = H5C_insert_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[type]), entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || ( entry_ptr->header.is_protected ) || @@ -2951,6 +3427,7 @@ insert_entry(H5F_t * file_ptr, } HDassert(entry_ptr->cache_ptr == NULL); + entry_ptr->file_ptr = file_ptr; entry_ptr->cache_ptr = cache_ptr; if(insert_pinned) @@ -3174,8 +3651,8 @@ protect_entry(H5F_t * file_ptr, HDassert( entry_ptr == entry_ptr->self ); HDassert( !(entry_ptr->is_protected) ); - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[type]), entry_ptr->addr, NULL, H5C__NO_FLAGS_SET); + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[type]), entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); if ( ( cache_entry_ptr != (void *)entry_ptr ) || ( !(entry_ptr->header.is_protected) ) || @@ -3214,6 +3691,7 @@ protect_entry(H5F_t * file_ptr, ( entry_ptr->cache_ptr == cache_ptr ) ); entry_ptr->cache_ptr = cache_ptr; + entry_ptr->file_ptr = file_ptr; entry_ptr->is_protected = TRUE; } @@ -3270,8 +3748,8 @@ protect_entry_ro(H5F_t * file_ptr, ( ( entry_ptr->is_read_only ) && ( entry_ptr->ro_ref_count > 0 ) ) ); - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[type]), entry_ptr->addr, NULL, H5C__READ_ONLY_FLAG); + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[type]), entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); if ( ( cache_entry_ptr != (void *)entry_ptr ) || ( !(entry_ptr->header.is_protected) ) || @@ -3290,6 +3768,7 @@ protect_entry_ro(H5F_t * file_ptr, ( entry_ptr->cache_ptr == cache_ptr ) ); entry_ptr->cache_ptr = cache_ptr; + entry_ptr->file_ptr = file_ptr; entry_ptr->is_protected = TRUE; entry_ptr->is_read_only = TRUE; entry_ptr->ro_ref_count++; @@ -3479,7 +3958,7 @@ unprotect_entry(H5F_t * file_ptr, if(flags & H5C__DIRTIED_FLAG) entry_ptr->is_dirty = TRUE; - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types[type]), entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || @@ -3563,6 +4042,7 @@ unprotect_entry(H5F_t * file_ptr, void row_major_scan_forward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -3579,6 +4059,7 @@ row_major_scan_forward(H5F_t * file_ptr, H5C_t * cache_ptr = NULL; int32_t type = 0; int32_t idx; + int32_t local_max_index; if ( verbose ) HDfprintf(stdout, "%s(): entering.\n", FUNC); @@ -3601,208 +4082,283 @@ row_major_scan_forward(H5F_t * file_ptr, { idx = -lag; - while ( ( pass ) && ( idx <= (max_indices[type] + lag) ) ) + local_max_index = MIN(max_index, max_indices[type]); + + while ( ( pass ) && ( idx <= (local_max_index + lag) ) ) { + int32_t tmp_idx; + if ( verbose ) { HDfprintf(stdout, "%d:%d: ", type, idx); } - if ( ( pass ) && ( do_inserts ) && ( (idx + lag) >= 0 ) && - ( (idx + lag) <= max_indices[type] ) && - ( ((idx + lag) % 2) == 0 ) && - ( ! entry_in_cache(cache_ptr, type, (idx + lag)) ) ) { + tmp_idx = idx + lag; + if ( ( pass ) && ( do_inserts ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( (tmp_idx % 2) == 0 ) && + ( ! entry_in_cache(cache_ptr, type, tmp_idx) ) ) { if ( verbose ) - HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag)); + HDfprintf(stdout, "1(i, %d, %d) ", type, tmp_idx); - insert_entry(file_ptr, type, (idx + lag), H5C__NO_FLAGS_SET); - } + insert_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + } - if ( ( pass ) && ( (idx + lag - 1) >= 0 ) && - ( (idx + lag - 1) <= max_indices[type] ) && - ( ( (idx + lag - 1) % 3 ) == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 3 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p, %d, %d) ", type, (idx + lag - 1)); + HDfprintf(stdout, "2(p, %d, %d) ", type, tmp_idx); + + protect_entry(file_ptr, type, tmp_idx); - protect_entry(file_ptr, type, (idx + lag - 1)); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } - if ( ( pass ) && ( (idx + lag - 2) >= 0 ) && - ( (idx + lag - 2) <= max_indices[type] ) && - ( ( (idx + lag - 2) % 3 ) == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 3 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 2)); + HDfprintf(stdout, "3(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx+lag-2, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); + + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } + /* (don't decrement tmp_idx) */ + if ( ( pass ) && ( do_moves ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 3 ) == 0 ) ) { - if ( ( pass ) && ( do_moves ) && ( (idx + lag - 2) >= 0 ) && - ( (idx + lag - 2) <= max_indices[type] ) && - ( ( (idx + lag - 2) % 3 ) == 0 ) ) { + if ( verbose ) + HDfprintf(stdout, "4(r, %d, %d, %d) ", + type, tmp_idx, (int)move_to_main_addr); - move_entry(cache_ptr, type, (idx + lag - 2), - move_to_main_addr); - } + move_entry(cache_ptr, type, tmp_idx, move_to_main_addr); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + } - if ( ( pass ) && ( (idx + lag - 3) >= 0 ) && - ( (idx + lag - 3) <= max_indices[type] ) && - ( ( (idx + lag - 3) % 5 ) == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 5 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p, %d, %d) ", type, (idx + lag - 3)); + HDfprintf(stdout, "5(p, %d, %d) ", type, tmp_idx); + + protect_entry(file_ptr, type, tmp_idx); - protect_entry(file_ptr, type, (idx + lag - 3)); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } - if ( ( pass ) && ( (idx + lag - 5) >= 0 ) && - ( (idx + lag - 5) <= max_indices[type] ) && - ( ( (idx + lag - 5) % 5 ) == 0 ) ) { + tmp_idx -= 2; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 5 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 5)); + HDfprintf(stdout, "6(u, %d, %d) ", type, tmp_idx); + + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - unprotect_entry(file_ptr, type, idx+lag-5, H5C__NO_FLAGS_SET); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } if ( do_mult_ro_protects ) { - if ( ( pass ) && ( (idx + lag - 5) >= 0 ) && - ( (idx + lag - 5) < max_indices[type] ) && - ( (idx + lag - 5) % 9 == 0 ) ) { + /* (don't decrement tmp_idx) */ + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 9 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p-ro, %d, %d) ", type, - (idx + lag - 5)); + HDfprintf(stdout, "7(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, (idx + lag - 5)); + protect_entry_ro(file_ptr, type, tmp_idx); + + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } - if ( ( pass ) && ( (idx + lag - 6) >= 0 ) && - ( (idx + lag - 6) < max_indices[type] ) && - ( (idx + lag - 6) % 11 == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 11 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p-ro, %d, %d) ", type, - (idx + lag - 6)); + HDfprintf(stdout, "8(p-ro, %d, %d) ", type, tmp_idx); + + protect_entry_ro(file_ptr, type, tmp_idx); - protect_entry_ro(file_ptr, type, (idx + lag - 6)); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } - if ( ( pass ) && ( (idx + lag - 7) >= 0 ) && - ( (idx + lag - 7) < max_indices[type] ) && - ( (idx + lag - 7) % 13 == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 13 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p-ro, %d, %d) ", type, - (idx + lag - 7)); + HDfprintf(stdout, "9(p-ro, %d, %d) ", type, tmp_idx); + + protect_entry_ro(file_ptr, type, tmp_idx); - protect_entry_ro(file_ptr, type, (idx + lag - 7)); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } - if ( ( pass ) && ( (idx + lag - 7) >= 0 ) && - ( (idx + lag - 7) < max_indices[type] ) && - ( (idx + lag - 7) % 9 == 0 ) ) { + /* (don't decrement tmp_idx) */ + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 9 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u-ro, %d, %d) ", type, - (idx + lag - 7)); + HDfprintf(stdout, "10(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, (idx + lag - 7), H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); + + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } - if ( ( pass ) && ( (idx + lag - 8) >= 0 ) && - ( (idx + lag - 8) < max_indices[type] ) && - ( (idx + lag - 8) % 11 == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 11 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u-ro, %d, %d) ", type, - (idx + lag - 8)); + HDfprintf(stdout, "11(u-ro, %d, %d) ", type, tmp_idx); + + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - unprotect_entry(file_ptr, type, (idx + lag - 8), H5C__NO_FLAGS_SET); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } - if ( ( pass ) && ( (idx + lag - 9) >= 0 ) && - ( (idx + lag - 9) < max_indices[type] ) && - ( (idx + lag - 9) % 13 == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 13 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u-ro, %d, %d) ", type, - (idx + lag - 9)); + HDfprintf(stdout, "12(u-ro, %d, %d) ", type, tmp_idx); + + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - unprotect_entry(file_ptr, type, (idx + lag - 9), H5C__NO_FLAGS_SET); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } } /* if ( do_mult_ro_protects ) */ - if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { + if ( ( pass ) && ( idx >= 0 ) && ( idx <= local_max_index ) ) { if ( verbose ) - HDfprintf(stdout, "(p, %d, %d) ", type, idx); + HDfprintf(stdout, "13(p, %d, %d) ", type, idx); protect_entry(file_ptr, type, idx); + + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } - if ( ( pass ) && ( (idx - lag + 2) >= 0 ) && - ( (idx - lag + 2) <= max_indices[type] ) && - ( ( (idx - lag + 2) % 7 ) == 0 ) ) { + tmp_idx = idx - lag + 2; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 7 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 2)); + HDfprintf(stdout, "14(u, %d, %d) ", type, tmp_idx); + + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - unprotect_entry(file_ptr, type, idx-lag+2, H5C__NO_FLAGS_SET); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } - if ( ( pass ) && ( (idx - lag + 1) >= 0 ) && - ( (idx - lag + 1) <= max_indices[type] ) && - ( ( (idx - lag + 1) % 7 ) == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 7 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p, %d, %d) ", type, (idx - lag + 1)); + HDfprintf(stdout, "15(p, %d, %d) ", type, tmp_idx); - protect_entry(file_ptr, type, (idx - lag + 1)); + protect_entry(file_ptr, type, tmp_idx); + + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } if ( do_destroys ) { - if ( ( pass ) && ( (idx - lag) >= 0 ) && - ( ( idx - lag) <= max_indices[type] ) ) { + tmp_idx = idx - lag; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) ) { - switch ( (idx - lag) %4 ) { + switch ( tmp_idx %4 ) { case 0: /* we just did an insert */ - unprotect_entry(file_ptr, type, idx - lag, H5C__NO_FLAGS_SET); + + if ( verbose ) + HDfprintf(stdout, "16(u, %d, %d) ", type, tmp_idx); + + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); + + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); break; case 1: - if ( (entries[type])[idx-lag].is_dirty ) { + if ( (entries[type])[tmp_idx].is_dirty ) { + + if ( verbose ) + HDfprintf(stdout, "17(u, %d, %d) ", type, tmp_idx); + + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - unprotect_entry(file_ptr, type, idx - lag, H5C__NO_FLAGS_SET); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } else { - unprotect_entry(file_ptr, type, idx - lag, + if ( verbose ) + HDfprintf(stdout, "18(u, %d, %d) ", type, tmp_idx); + + unprotect_entry(file_ptr, type, tmp_idx, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); + + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } break; - case 2: /* we just did an insrt */ - unprotect_entry(file_ptr, type, idx - lag, H5C__DELETED_FLAG); + case 2: /* we just did an insert */ + + if ( verbose ) + HDfprintf(stdout, "19(u-del, %d, %d) ", type, tmp_idx); + + unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG); + + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); break; case 3: - if ( (entries[type])[idx-lag].is_dirty ) { + if ( (entries[type])[tmp_idx].is_dirty ) { + + if ( verbose ) + HDfprintf(stdout, "20(u-del, %d, %d) ", type, tmp_idx); + + unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG); - unprotect_entry(file_ptr, type, idx - lag, H5C__DELETED_FLAG); + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } else { - unprotect_entry(file_ptr, type, idx - lag, + if ( verbose ) + HDfprintf(stdout, "21(u-del, %d, %d) ", type, tmp_idx); + + unprotect_entry(file_ptr, type, tmp_idx, (dirty_destroys ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) | H5C__DELETED_FLAG); + + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } break; @@ -3814,14 +4370,17 @@ row_major_scan_forward(H5F_t * file_ptr, } else { - if ( ( pass ) && ( (idx - lag) >= 0 ) && - ( ( idx - lag) <= max_indices[type] ) ) { + tmp_idx = idx - lag; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); + HDfprintf(stdout, "22(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx - lag, + unprotect_entry(file_ptr, type, tmp_idx, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); + + HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); } } @@ -3965,6 +4524,7 @@ hl_row_major_scan_forward(H5F_t * file_ptr, void row_major_scan_backward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -3981,6 +4541,7 @@ row_major_scan_backward(H5F_t * file_ptr, H5C_t * cache_ptr = NULL; int32_t type = NUMBER_OF_ENTRY_TYPES - 1; int32_t idx; + int32_t local_max_index; if ( verbose ) HDfprintf(stdout, "%s(): Entering.\n", FUNC); @@ -4000,142 +4561,152 @@ row_major_scan_backward(H5F_t * file_ptr, while ( ( pass ) && ( type >= 0 ) ) { - idx = max_indices[type] + lag; + local_max_index = MIN(max_index, max_indices[type]); + + idx = local_max_index + lag; while ( ( pass ) && ( idx >= -lag ) ) { - if ( ( pass ) && ( do_inserts ) && ( (idx - lag) >= 0 ) && - ( (idx - lag) <= max_indices[type] ) && - ( ((idx - lag) % 2) == 1 ) && - ( ! entry_in_cache(cache_ptr, type, (idx - lag)) ) ) { + int32_t tmp_idx; + + tmp_idx = idx - lag; + if ( ( pass ) && ( do_inserts ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( (tmp_idx % 2) == 1 ) && + ( ! entry_in_cache(cache_ptr, type, tmp_idx) ) ) { if ( verbose ) - HDfprintf(stdout, "(i, %d, %d) ", type, (idx - lag)); + HDfprintf(stdout, "(i, %d, %d) ", type, tmp_idx); - insert_entry(file_ptr, type, (idx - lag), H5C__NO_FLAGS_SET); + insert_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } - - if ( ( pass ) && ( (idx - lag + 1) >= 0 ) && - ( (idx - lag + 1) <= max_indices[type] ) && - ( ( (idx - lag + 1) % 3 ) == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 3 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p, %d, %d) ", type, (idx - lag + 1)); + HDfprintf(stdout, "(p, %d, %d) ", type, tmp_idx); - protect_entry(file_ptr, type, (idx - lag + 1)); + protect_entry(file_ptr, type, tmp_idx); } - if ( ( pass ) && ( (idx - lag + 2) >= 0 ) && - ( (idx - lag + 2) <= max_indices[type] ) && - ( ( (idx - lag + 2) % 3 ) == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 3 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 2)); + HDfprintf(stdout, "(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx-lag+2, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } + /* (don't increment tmp_idx) */ + if ( ( pass ) && ( do_moves ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 3 ) == 0 ) ) { - if ( ( pass ) && ( do_moves ) && ( (idx - lag + 2) >= 0 ) && - ( (idx - lag + 2) <= max_indices[type] ) && - ( ( (idx - lag + 2) % 3 ) == 0 ) ) { + if ( verbose ) + HDfprintf(stdout, "(r, %d, %d, %d) ", + type, tmp_idx, (int)move_to_main_addr); - move_entry(cache_ptr, type, (idx - lag + 2), - move_to_main_addr); + move_entry(cache_ptr, type, tmp_idx, move_to_main_addr); } - - if ( ( pass ) && ( (idx - lag + 3) >= 0 ) && - ( (idx - lag + 3) <= max_indices[type] ) && - ( ( (idx - lag + 3) % 5 ) == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 5 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p, %d, %d) ", type, (idx - lag + 3)); + HDfprintf(stdout, "(p, %d, %d) ", type, tmp_idx); protect_entry(file_ptr, type, (idx - lag + 3)); } - if ( ( pass ) && ( (idx - lag + 5) >= 0 ) && - ( (idx - lag + 5) <= max_indices[type] ) && - ( ( (idx - lag + 5) % 5 ) == 0 ) ) { + tmp_idx += 2; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 5 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 5)); + HDfprintf(stdout, "(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx-lag+5, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } + /* (don't increment tmp_idx) */ if ( do_mult_ro_protects ) { - if ( ( pass ) && ( (idx - lag + 5) >= 0 ) && - ( (idx - lag + 5) < max_indices[type] ) && - ( (idx - lag + 5) % 9 == 0 ) ) { + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 9 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p-ro, %d, %d) ", type, - (idx - lag + 5)); + HDfprintf(stdout, "(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, (idx - lag + 5)); + protect_entry_ro(file_ptr, type, tmp_idx); } - if ( ( pass ) && ( (idx - lag + 6) >= 0 ) && - ( (idx - lag + 6) < max_indices[type] ) && - ( (idx - lag + 6) % 11 == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 11 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p-ro, %d, %d) ", type, - (idx - lag + 6)); + HDfprintf(stdout, "(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, (idx - lag + 6)); + protect_entry_ro(file_ptr, type, tmp_idx); } - if ( ( pass ) && ( (idx - lag + 7) >= 0 ) && - ( (idx - lag + 7) < max_indices[type] ) && - ( (idx - lag + 7) % 13 == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 13 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p-ro, %d, %d) ", type, - (idx - lag + 7)); + HDfprintf(stdout, "(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, (idx - lag + 7)); + protect_entry_ro(file_ptr, type, tmp_idx); } - if ( ( pass ) && ( (idx - lag + 7) >= 0 ) && - ( (idx - lag + 7) < max_indices[type] ) && - ( (idx - lag + 7) % 9 == 0 ) ) { + /* (don't increment tmp_idx) */ + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 9 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u-ro, %d, %d) ", type, - (idx - lag + 7)); + HDfprintf(stdout, "(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, (idx - lag + 7), H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } - if ( ( pass ) && ( (idx - lag + 8) >= 0 ) && - ( (idx - lag + 8) < max_indices[type] ) && - ( (idx - lag + 8) % 11 == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 11 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u-ro, %d, %d) ", type, - (idx - lag + 8)); + HDfprintf(stdout, "(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, (idx - lag + 8), H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } - if ( ( pass ) && ( (idx - lag + 9) >= 0 ) && - ( (idx - lag + 9) < max_indices[type] ) && - ( (idx - lag + 9) % 13 == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 13 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u-ro, %d, %d) ", type, - (idx - lag + 9)); + HDfprintf(stdout, "(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, (idx - lag + 9), H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } } /* if ( do_mult_ro_protects ) */ - if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { + if ( ( pass ) && ( idx >= 0 ) && ( idx <= local_max_index ) ) { if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, idx); @@ -4143,32 +4714,33 @@ row_major_scan_backward(H5F_t * file_ptr, protect_entry(file_ptr, type, idx); } - - if ( ( pass ) && ( (idx + lag - 2) >= 0 ) && - ( (idx + lag - 2) <= max_indices[type] ) && - ( ( (idx + lag - 2) % 7 ) == 0 ) ) { + tmp_idx = idx + lag - 2; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 7 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 2)); + HDfprintf(stdout, "(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx+lag-2, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } - if ( ( pass ) && ( (idx + lag - 1) >= 0 ) && - ( (idx + lag - 1) <= max_indices[type] ) && - ( ( (idx + lag - 1) % 7 ) == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 7 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p, %d, %d) ", type, (idx + lag - 1)); + HDfprintf(stdout, "(p, %d, %d) ", type, tmp_idx); - protect_entry(file_ptr, type, (idx + lag - 1)); + protect_entry(file_ptr, type, tmp_idx); } if ( do_destroys ) { if ( ( pass ) && ( (idx + lag) >= 0 ) && - ( ( idx + lag) <= max_indices[type] ) ) { + ( ( idx + lag) <= local_max_index ) ) { switch ( (idx + lag) % 4 ) { @@ -4211,7 +4783,7 @@ row_major_scan_backward(H5F_t * file_ptr, } else { if ( ( pass ) && ( (idx + lag) >= 0 ) && - ( ( idx + lag) <= max_indices[type] ) ) { + ( ( idx + lag) <= local_max_index ) ) { if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag)); @@ -4361,6 +4933,7 @@ hl_row_major_scan_backward(H5F_t * file_ptr, void col_major_scan_forward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -4372,14 +4945,19 @@ col_major_scan_forward(H5F_t * file_ptr, H5C_t * cache_ptr = NULL; int32_t type = 0; int32_t idx; + int32_t local_max_index[NUMBER_OF_ENTRY_TYPES]; if ( verbose ) HDfprintf(stdout, "%s: entering.\n", FUNC); if ( pass ) { + int i; cache_ptr = file_ptr->shared->cache; + for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ ) + local_max_index[i] = MIN(max_index, max_indices[i]); + HDassert( lag > 5 ); if ( reset_stats ) { @@ -4397,7 +4975,7 @@ col_major_scan_forward(H5F_t * file_ptr, while ( ( pass ) && ( type < NUMBER_OF_ENTRY_TYPES ) ) { if ( ( pass ) && ( do_inserts ) && ( (idx + lag) >= 0 ) && - ( (idx + lag) <= max_indices[type] ) && + ( (idx + lag) <= local_max_index[type] ) && ( ((idx + lag) % 3) == 0 ) && ( ! entry_in_cache(cache_ptr, type, (idx + lag)) ) ) { @@ -4407,7 +4985,9 @@ col_major_scan_forward(H5F_t * file_ptr, insert_entry(file_ptr, type, (idx + lag), H5C__NO_FLAGS_SET); } - if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { + if ( ( pass ) && + ( idx >= 0 ) && + ( idx <= local_max_index[type] ) ) { if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, idx); @@ -4416,7 +4996,7 @@ col_major_scan_forward(H5F_t * file_ptr, } if ( ( pass ) && ( (idx - lag) >= 0 ) && - ( (idx - lag) <= max_indices[type] ) ) { + ( (idx - lag) <= local_max_index[type] ) ) { if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); @@ -4529,7 +5109,7 @@ hl_col_major_scan_forward(H5F_t * file_ptr, } if ( ( pass ) && ( i >= 0 ) && - ( i <= max_indices[type] ) ) { + ( i <= local_max_index ) ) { if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, i); @@ -4577,6 +5157,7 @@ hl_col_major_scan_forward(H5F_t * file_ptr, void col_major_scan_backward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -4589,16 +5170,21 @@ col_major_scan_backward(H5F_t * file_ptr, int mile_stone = 1; int32_t type; int32_t idx; + int32_t local_max_index[NUMBER_OF_ENTRY_TYPES]; if ( verbose ) HDfprintf(stdout, "%s: entering.\n", FUNC); if ( pass ) { + int i; cache_ptr = file_ptr->shared->cache; HDassert( cache_ptr != NULL ); + for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ ) + local_max_index[i] = MIN(max_index, max_indices[i]); + HDassert( lag > 5 ); if ( reset_stats ) { @@ -4607,7 +5193,7 @@ col_major_scan_backward(H5F_t * file_ptr, } } - idx = MAX_ENTRIES + lag; + idx = local_max_index[NUMBER_OF_ENTRY_TYPES - 1] + lag; if ( verbose ) /* 1 */ HDfprintf(stdout, "%s: point %d.\n", FUNC, mile_stone++); @@ -4620,7 +5206,7 @@ col_major_scan_backward(H5F_t * file_ptr, while ( ( pass ) && ( type >= 0 ) ) { if ( ( pass ) && ( do_inserts) && ( (idx - lag) >= 0 ) && - ( (idx - lag) <= max_indices[type] ) && + ( (idx - lag) <= local_max_index[type] ) && ( ((idx - lag) % 3) == 0 ) && ( ! entry_in_cache(cache_ptr, type, (idx - lag)) ) ) { @@ -4630,7 +5216,9 @@ col_major_scan_backward(H5F_t * file_ptr, insert_entry(file_ptr, type, (idx - lag), H5C__NO_FLAGS_SET); } - if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { + if ( ( pass ) && + ( idx >= 0 ) && + ( idx <= local_max_index[type] ) ) { if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, idx); @@ -4639,7 +5227,7 @@ col_major_scan_backward(H5F_t * file_ptr, } if ( ( pass ) && ( (idx + lag) >= 0 ) && - ( (idx + lag) <= max_indices[type] ) ) { + ( (idx + lag) <= local_max_index[type] ) ) { if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag)); @@ -5445,3 +6033,73 @@ validate_mdc_config(hid_t file_id, } /* validate_mdc_config() */ + +#if 0 /* debugging functions -- normally commented out */ +/*------------------------------------------------------------------------- + * Function: dump_LRU + * + * Purpose: Display a summarize list of the contents of the LRU + * from head to tail. + * + * Return: void + * + * Programmer: John Mainzer + * 2/16/15 + * + *------------------------------------------------------------------------- + */ +void +dump_LRU(H5F_t * file_ptr) +{ + const char * hdr_0 = + " Entry Entry Entry Entry Entry \n"; + const char * hdr_1 = + " Num: Dirty: Size: Addr: Type: \n"; + const char * hdr_2 = + "==============================================================\n"; + int i = 0; + H5C_cache_entry_t * entry_ptr = NULL; + H5C_t *cache_ptr = file_ptr->shared->cache; + + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + + entry_ptr = cache_ptr->LRU_head_ptr; + + HDfprintf(stdout, + "\n\nIndex len/size/clean size/dirty size = %d/%lld/%lld/%lld\n", + cache_ptr->index_len, (long long)(cache_ptr->index_size), + (long long)(cache_ptr->clean_index_size), + (long long)(cache_ptr->dirty_index_size)); + HDfprintf(stdout, "\nLRU len/size = %d/%lld.\n\n", + cache_ptr->LRU_list_len, (long long)(cache_ptr->LRU_list_size)); + + if ( entry_ptr != NULL ) + { + HDfprintf(stdout, "%s%s%s", hdr_0, hdr_1, hdr_2); + } + + while ( entry_ptr != NULL ) + { + HDfprintf(stdout, + " %3d %d %10lld 0x%010llx %s(%d)\n", + i, + (int)(entry_ptr->is_dirty), + (long long)(entry_ptr->size), + (long long)(entry_ptr->addr), + entry_ptr->type->name, + entry_ptr->type->id); + i++; + entry_ptr = entry_ptr->next; + } + + if ( cache_ptr->LRU_list_len > 0 ) + { + HDfprintf(stdout, "%s\n", hdr_2); + } + + return; + +} /* dump_LRU() */ + +#endif /* debugging functions -- normally commented out */ diff --git a/test/cache_common.h b/test/cache_common.h index 48b95d8..737c53f 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -138,12 +138,14 @@ * directly pinned by a single entry. */ -#define FLUSH_OP__NO_OP 0 -#define FLUSH_OP__DIRTY 1 -#define FLUSH_OP__RESIZE 2 -#define FLUSH_OP__MOVE 3 -#define FLUSH_OP__ORDER 4 -#define FLUSH_OP__MAX_OP 4 +#define FLUSH_OP__NO_OP 0 +#define FLUSH_OP__DIRTY 1 +#define FLUSH_OP__RESIZE 2 +#define FLUSH_OP__MOVE 3 +#define FLUSH_OP__ORDER 4 +#define FLUSH_OP__EXPUNGE 5 +#define FLUSH_OP__DEST_FLUSH_DEP 6 +#define FLUSH_OP__MAX_OP 6 #define MAX_FLUSH_OPS 10 /* Maximum number of flush operations * that can be associated with a @@ -214,10 +216,32 @@ typedef struct test_entry_t struct test_entry_t * self; /* pointer to this entry -- used for * sanity checking. */ + H5F_t * file_ptr; /* pointer to the file in which the + * entry resides, or NULL if the entry + * is not in a file. + */ H5C_t * cache_ptr; /* pointer to the cache in which * the entry resides, or NULL if the * entry is not in cache. */ + hbool_t written_to_main_addr; + /* Flag indicating whether an image + * of the entry has been written to + * its main address. Since we no + * longer have a flush callback, we + * set this field to true whenever the + * entry is serialized while at its + * main address. + */ + hbool_t written_to_alt_addr; + /* Flag indicating whether an image + * of the entry has been written to + * its alternate address. Since we no + * longer have a flush callback, we + * set this field to true whenever the + * entry is serialized while at its + * alternate address. + */ haddr_t addr; /* where the cache thinks this entry * is located */ @@ -239,11 +263,11 @@ typedef struct test_entry_t */ int32_t index; /* index in its entry array */ - int32_t reads; /* number of times this entry has - * been loaded. + int32_t serializes; /* number of times this entry has + * been serialized. */ - int32_t writes; /* number of times this entry has - * been written + int32_t deserializes; /* number of times this entry has + * been deserialized */ hbool_t is_dirty; /* entry has been modified since * last write @@ -302,16 +326,16 @@ typedef struct test_entry_t * checking code that would otherwise * cause a false test failure. */ - hbool_t loaded; /* entry has been loaded since the - * last time it was reset. + hbool_t deserialized; /* entry has been deserialized since + * the last time it was reset. */ - hbool_t cleared; /* entry has been cleared since the + hbool_t serialized; /* entry has been serialized since the * last time it was reset. */ - hbool_t flushed; /* entry has been flushed since the + hbool_t destroyed; /* entry has been destroyed since the * last time it was reset. */ - hbool_t destroyed; /* entry has been destroyed since the + hbool_t expunged; /* entry has been expunged since the * last time it was reset. */ int flush_dep_par_type; /* Entry type of flush dependency parent */ @@ -471,9 +495,6 @@ if ( ( (cache_ptr) == NULL ) || \ (i).flash_threshold = (e).flash_threshold; \ (i).decr_mode = (e).decr_mode; \ (i).upper_hr_threshold = (e).upper_hr_threshold; \ - (i).flash_incr_mode = (e).flash_incr_mode; \ - (i).flash_multiple = (e).flash_multiple; \ - (i).flash_threshold = (e).flash_threshold; \ (i).decrement = (e).decrement; \ (i).apply_max_decrement = (e).apply_max_decrement; \ (i).max_decrement = (e).max_decrement; \ @@ -490,15 +511,14 @@ struct expected_entry_status int entry_type; int entry_index; size_t size; - unsigned char in_cache; - unsigned char at_main_addr; - unsigned char is_dirty; - unsigned char is_protected; - unsigned char is_pinned; - unsigned char loaded; - unsigned char cleared; - unsigned char flushed; - unsigned char destroyed; + hbool_t in_cache; + hbool_t at_main_addr; + hbool_t is_dirty; + hbool_t is_protected; + hbool_t is_pinned; + hbool_t deserialized; + hbool_t serialized; + hbool_t destroyed; int flush_dep_par_type; /* Entry type of flush dependency parent */ int flush_dep_par_idx; /* Index of flush dependency parent */ uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS]; @@ -514,12 +534,9 @@ struct expected_entry_status /* global variable externs: */ -extern const char *FILENAME[3]; - +extern haddr_t saved_actual_base_addr; extern hbool_t write_permitted; extern hbool_t pass; /* set to false on error */ -extern hbool_t skip_long_tests; -extern hbool_t run_full_test; extern const char *failure_mssg; extern test_entry_t * entries[NUMBER_OF_ENTRY_TYPES]; @@ -609,6 +626,7 @@ void resize_entry(H5F_t * file_ptr, H5F_t *setup_cache(size_t max_cache_size, size_t min_clean_size); void row_major_scan_forward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -631,6 +649,7 @@ void hl_row_major_scan_forward(H5F_t * file_ptr, hbool_t do_inserts); void row_major_scan_backward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -653,6 +672,7 @@ void hl_row_major_scan_backward(H5F_t * file_ptr, hbool_t do_inserts); void col_major_scan_forward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -671,6 +691,7 @@ void hl_col_major_scan_forward(H5F_t * file_ptr, int dirty_unprotects); void col_major_scan_backward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -747,5 +768,10 @@ void validate_mdc_config(hid_t file_id, hbool_t compare_init, int test_num); +/** Debugging functions -- normally commented out ***/ +#if 0 +void dump_LRU(H5F_t * file_ptr); +#endif + #endif /* _CACHE_COMMON_H */ diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 9209f6d..84c9b34 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -457,7 +457,7 @@ static int evict_entries(hid_t fid) /* Evict all we can from the cache to examine full tag creation tree */ /* This function will likely return failure since the root group * is still protected. Thus, don't check its return value. */ - H5C_flush_cache(f, H5P_DEFAULT, H5P_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); + H5C_flush_cache(f, H5P_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); return 0; @@ -3866,13 +3866,13 @@ check_invalid_tag_application(void) /* Call H5HL_protect to protect the local heap created above. */ /* This should fail as no tag is set up during the protect call */ - if (( lheap = H5HL_protect(f, H5AC_ind_dxpl_id, addr, H5AC_WRITE)) != NULL ) TEST_ERROR; + if (( lheap = H5HL_protect(f, H5AC_ind_dxpl_id, addr, H5AC__NO_FLAGS_SET)) != NULL ) TEST_ERROR; /* Again, set up a valid tag in the DXPL */ if ( H5AC_tag(H5AC_ind_dxpl_id, (haddr_t)25, NULL) < 0) TEST_ERROR; /* Call H5HL_protect again to protect the local heap. This should succeed. */ - if (( lheap = H5HL_protect(f, H5AC_ind_dxpl_id, addr, H5AC_WRITE)) == NULL ) TEST_ERROR; + if (( lheap = H5HL_protect(f, H5AC_ind_dxpl_id, addr, H5AC__NO_FLAGS_SET)) == NULL ) TEST_ERROR; /* Now unprotect the heap, as we're done with the test. */ if ( H5HL_unprotect(lheap) < 0 ) TEST_ERROR; diff --git a/test/earray.c b/test/earray.c index 8a355c8..feaa15e 100644 --- a/test/earray.c +++ b/test/earray.c @@ -160,11 +160,26 @@ typedef struct earray_test_t { /* Local prototypes */ /* Metadata cache (H5AC) callbacks */ -static earray_test_t *earray_cache_test_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata, void *udata2); -static herr_t earray_cache_test_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, earray_test_t *test, unsigned * flags_ptr); -static herr_t earray_cache_test_clear(H5F_t *f, earray_test_t *test, hbool_t destroy); -static herr_t earray_cache_test_size(const H5F_t *f, const earray_test_t *test, size_t *size_ptr); -static herr_t earray_cache_test_dest(H5F_t *f, earray_test_t *test); + +static herr_t earray_cache_test_get_load_size(const void *udata_ptr, + size_t *image_len_ptr); + +static void *earray_cache_test_deserialize(const void *image_ptr, + size_t len, + void *udata_ptr, + hbool_t *dirty_ptr); + +static herr_t earray_cache_test_image_len(const void *thing, + size_t *image_len_ptr, + hbool_t *compressed_ptr, + size_t * compressed_len_ptr); + +static herr_t earray_cache_test_serialize(const H5F_t *f, + void *image_ptr, + size_t len, + void *thing); + +static herr_t earray_cache_test_free_icr(void *thing); /* Local variables */ @@ -181,13 +196,19 @@ h5_stat_size_t empty_size_g; /* H5EA test object inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_EARRAY_TEST[1] = {{ - H5AC_TEST_ID, - (H5AC_load_func_t)earray_cache_test_load, - (H5AC_flush_func_t)earray_cache_test_flush, - (H5AC_dest_func_t)earray_cache_test_dest, - (H5AC_clear_func_t)earray_cache_test_clear, - (H5AC_notify_func_t)NULL, - (H5AC_size_func_t)earray_cache_test_size, + /* id */ H5AC_TEST_ID, + /* name */ "earray test", + /* mem_type */ H5FD_MEM_DEFAULT, + /* flags */ H5AC__CLASS_NO_IO_FLAG, + /* get_load_size */ (H5AC_get_load_size_func_t)earray_cache_test_get_load_size, + /* deserialize */ (H5AC_deserialize_func_t)earray_cache_test_deserialize, + /* image_len */ (H5AC_image_len_func_t)earray_cache_test_image_len, + /* pre_serialize */ (H5AC_pre_serialize_func_t)NULL, + /* serialize */ (H5AC_serialize_func_t)earray_cache_test_serialize, + /* notify */ (H5AC_notify_func_t)NULL, + /* free_icr */ (H5AC_free_icr_func_t)earray_cache_test_free_icr, + /* clear */ NULL, + /* fsf_size */ NULL, }}; @@ -610,196 +631,244 @@ error: /*------------------------------------------------------------------------- - * Function: earray_cache_test_load + * Function: earray_cache_test_get_load_size() * - * Purpose: Loads an extensible array test object from the disk. + * Purpose: place holder function -- should never be called * - * Return: Success: Pointer to a new extensible array test object - * Failure: NULL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * May 26 2009 + * A generic discussion of metadata cache callbacks of this type + * may be found in H5Cprivate.h: + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 8/2/14 * *------------------------------------------------------------------------- */ -static earray_test_t * -earray_cache_test_load(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr, const void H5_ATTR_UNUSED *udata1, void H5_ATTR_UNUSED *udata2) +static herr_t +earray_cache_test_get_load_size(const void *udata_ptr, size_t *image_len_ptr) { - /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(udata_ptr); + HDassert(image_len_ptr); /* Should never be called */ HDassert(0 && "Can't be called!"); - return(NULL); -} /* end earray_cache_test_load() */ + *image_len_ptr = 0; + + return(SUCCEED); + +} /* end earray_cache_test_get_load_size() */ /*------------------------------------------------------------------------- - * Function: earray_cache_test_flush + * Function: earray_cache_test_deserialize * - * Purpose: Flushes a dirty extensible array test object to disk. + * Purpose: place holder function -- should never be called. * - * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * May 26 2009 + * A generic discussion of metadata cache callbacks of this type + * may be found in H5Cprivate.h: + * + * Return: Success: Pointer to in core representation + * Failure: NULL + * + * Programmer: John Mainzer + * 8/2/14 * *------------------------------------------------------------------------- */ -static herr_t -earray_cache_test_flush(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t destroy, haddr_t H5_ATTR_UNUSED addr, earray_test_t *test, unsigned H5_ATTR_UNUSED * flags_ptr) +static void * +earray_cache_test_deserialize(const void *image_ptr, + size_t len, + void *udata_ptr, + hbool_t *dirty_ptr) { - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(test); - - if(test->cache_info.is_dirty) { - /* Check for out of order flush */ - if(test->fd_info->base_obj) - TEST_ERROR - - /* Check which index this entry corresponds to */ - if((uint64_t)0 == test->idx) { - /* Check for out of order flush */ - if(test->fd_info->idx0_obj || test->fd_info->idx0_elem) - TEST_ERROR + HDassert(image_ptr); + HDassert(len > 0 ); + HDassert(udata_ptr); + HDassert(dirty_ptr); - /* Set flag for object flush */ - test->fd_info->idx0_obj = TRUE; - } /* end if */ - else if((uint64_t)1 == test->idx) { - /* Check for out of order flush */ - if(test->fd_info->idx1_obj || test->fd_info->idx1_elem) - TEST_ERROR - /* Set flag for object flush */ - test->fd_info->idx1_obj = TRUE; - } /* end if */ - else if((uint64_t)10000 == test->idx) { - /* Check for out of order flush */ - if(test->fd_info->idx10000_obj || test->fd_info->idx10000_elem) - TEST_ERROR - - /* Set flag for object flush */ - test->fd_info->idx10000_obj = TRUE; - } /* end if */ - else if((uint64_t)-1 == test->idx) { - /* Set flag for object flush */ - test->fd_info->base_obj = TRUE; - } /* end if */ - - /* Mark the entry as clean */ - test->cache_info.is_dirty = FALSE; - } /* end if */ - - if(destroy) - if(earray_cache_test_dest(f, test) < 0) - TEST_ERROR + /* Should never be called */ + HDassert(0 && "Can't be called!"); - return(SUCCEED); + return(NULL); -error: - return(FAIL); -} /* earray_cache_test_flush() */ +} /* end earray_cache_test_deserialize() */ /*------------------------------------------------------------------------- - * Function: earray_cache_test_dest + * Function: earray_cache_test_image_len * - * Purpose: Destroys an extensible array test object in memory. + * Purpose: test code place holder function -- just set *image_len_ptr to + * one. * - * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * May 26 2009 + * A generic discussion of metadata cache callbacks of this type + * may be found in H5Cprivate.h: + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 8/2/14 * *------------------------------------------------------------------------- */ -herr_t -earray_cache_test_dest(H5F_t H5_ATTR_UNUSED *f, earray_test_t *test) +static herr_t +earray_cache_test_image_len(const void *thing, size_t *image_len_ptr, + hbool_t H5_ATTR_UNUSED * compressed_ptr, size_t H5_ATTR_UNUSED * compressed_len_ptr) { - /* - * Check arguments. - */ - HDassert(test); - /* Free the shared info itself */ - HDfree(test); + HDassert(thing); + HDassert(image_len_ptr); + + /* Set size value */ + /* (hard-code to 1) */ + *image_len_ptr = 1; return(SUCCEED); -} /* end earray_cache_test_dest() */ + +} /* end earray_cache_test_image_len() */ + + +/********************************/ +/* no H5O_cache_pre_serialize() */ +/********************************/ /*------------------------------------------------------------------------- - * Function: earray_cache_test_clear + * Function: earray_cache_test_serialize * - * Purpose: Mark an extensible array test object in memory as non-dirty. + * Purpose: Validate the contents of the instance of earray_test_t. * - * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * May 26 2009 + * A generic discussion of metadata cache callbacks of this type + * may be found in H5Cprivate.h: + * + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 8/2/14 * *------------------------------------------------------------------------- */ static herr_t -earray_cache_test_clear(H5F_t *f, earray_test_t *test, hbool_t destroy) +earray_cache_test_serialize(const H5F_t *f, + void *image_ptr, + H5_ATTR_UNUSED size_t len, + void *thing) { - /* - * Check arguments. - */ + earray_test_t *test = NULL; + + HDassert(f); + HDassert(image_ptr); + HDassert(thing); + + test = (earray_test_t *)thing; + HDassert(test); + HDassert(test->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert((const H5AC_class_t *)(test->cache_info.type) == + &(H5AC_EARRAY_TEST[0])); - /* Reset the dirty flag. */ - test->cache_info.is_dirty = FALSE; + /* Check for out of order flush */ + if(test->fd_info->base_obj) + TEST_ERROR - if(destroy) - if(earray_cache_test_dest(f, test) < 0) + /* Check which index this entry corresponds to */ + if((uint64_t)0 == test->idx) { + /* Check for out of order flush */ + if(test->fd_info->idx0_obj || test->fd_info->idx0_elem) TEST_ERROR + /* Set flag for object flush */ + test->fd_info->idx0_obj = TRUE; + } /* end if */ + else if((uint64_t)1 == test->idx) { + /* Check for out of order flush */ + if(test->fd_info->idx1_obj || test->fd_info->idx1_elem) + TEST_ERROR + + /* Set flag for object flush */ + test->fd_info->idx1_obj = TRUE; + } /* end if */ + else if((uint64_t)10000 == test->idx) { + /* Check for out of order flush */ + if(test->fd_info->idx10000_obj || test->fd_info->idx10000_elem) + TEST_ERROR + + /* Set flag for object flush */ + test->fd_info->idx10000_obj = TRUE; + } /* end if */ + else if((uint64_t)-1 == test->idx) { + /* Set flag for object flush */ + test->fd_info->base_obj = TRUE; + } /* end if */ + return(SUCCEED); error: + return(FAIL); -} /* end earray_cache_test_clear() */ + +} /* end earray_cache_test_serialize() */ + + +/******************************************/ +/* no earray_cache_test_notify() function */ +/******************************************/ /*------------------------------------------------------------------------- - * Function: earray_cache_test_size + * Function: earray_cache_test_free_icr * - * Purpose: Compute the size in bytes of an extensible array test object - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Destroy an extensible array test object in memory. * - * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * May 26 2009 + * A generic discussion of metadata cache callbacks of this type + * may be found in H5Cprivate.h: + * + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 8/2/14 * *------------------------------------------------------------------------- */ static herr_t -earray_cache_test_size(const H5F_t H5_ATTR_UNUSED *f, const earray_test_t H5_ATTR_UNUSED *test, size_t *size_ptr) +earray_cache_test_free_icr(void *thing) { - /* check arguments */ - HDassert(f); + earray_test_t *test = NULL; + + HDassert(thing); + + test = (earray_test_t *)thing; + HDassert(test); - HDassert(size_ptr); - /* Set size value */ - /* (hard-code to 1) */ - *size_ptr = 1; + /* the metadata cache sets cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling the + * free_icr routine. Hence the following assert: + */ + + HDassert(test->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert((const H5AC_class_t *)(test->cache_info.type) == + &(H5AC_EARRAY_TEST[0])); + + /* Free the shared info itself */ + HDfree(test); return(SUCCEED); -} /* earray_cache_test_size() */ + +} /* end earray_cache_test_free_icr() */ /*------------------------------------------------------------------------- @@ -1541,7 +1610,7 @@ test_flush_depend(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR TEST_ERROR /* Protect the base entry */ - if(NULL == (base_entry = (earray_test_t *)H5AC_protect(f, H5P_DATASET_XFER_DEFAULT, H5AC_EARRAY_TEST, base_addr, NULL, H5AC_WRITE))) + if(NULL == (base_entry = (earray_test_t *)H5AC_protect(f, H5P_DATASET_XFER_DEFAULT, H5AC_EARRAY_TEST, base_addr, NULL, H5AC__NO_FLAGS_SET))) TEST_ERROR /* Unprotect & unpin the base entry */ @@ -1553,7 +1622,7 @@ test_flush_depend(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR TEST_ERROR /* Protect the test entry */ - if(NULL == (entry1 = (earray_test_t *)H5AC_protect(f, H5P_DATASET_XFER_DEFAULT, H5AC_EARRAY_TEST, addr1, NULL, H5AC_WRITE))) + if(NULL == (entry1 = (earray_test_t *)H5AC_protect(f, H5P_DATASET_XFER_DEFAULT, H5AC_EARRAY_TEST, addr1, NULL, H5AC__NO_FLAGS_SET))) TEST_ERROR /* Unprotect & unpin the test entry */ @@ -1565,7 +1634,7 @@ test_flush_depend(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR TEST_ERROR /* Protect the test entry */ - if(NULL == (entry2 = (earray_test_t *)H5AC_protect(f, H5P_DATASET_XFER_DEFAULT, H5AC_EARRAY_TEST, addr2, NULL, H5AC_WRITE))) + if(NULL == (entry2 = (earray_test_t *)H5AC_protect(f, H5P_DATASET_XFER_DEFAULT, H5AC_EARRAY_TEST, addr2, NULL, H5AC__NO_FLAGS_SET))) TEST_ERROR /* Unprotect & unpin the test entry */ @@ -1577,7 +1646,7 @@ test_flush_depend(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR TEST_ERROR /* Protect the test entry */ - if(NULL == (entry3 = (earray_test_t *)H5AC_protect(f, H5P_DATASET_XFER_DEFAULT, H5AC_EARRAY_TEST, addr3, NULL, H5AC_WRITE))) + if(NULL == (entry3 = (earray_test_t *)H5AC_protect(f, H5P_DATASET_XFER_DEFAULT, H5AC_EARRAY_TEST, addr3, NULL, H5AC__NO_FLAGS_SET))) TEST_ERROR /* Unprotect & unpin the test entry */ diff --git a/test/lheap.c b/test/lheap.c index 51ae25b..bdb6360 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -94,7 +94,7 @@ main(void) H5Eprint2(H5E_DEFAULT, stdout); goto error; } - if (NULL == (heap = H5HL_protect(f, H5P_DATASET_XFER_DEFAULT, heap_addr, H5AC_WRITE))) { + if (NULL == (heap = H5HL_protect(f, H5P_DATASET_XFER_DEFAULT, heap_addr, H5AC__NO_FLAGS_SET))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; @@ -144,7 +144,7 @@ main(void) if(j > 4) buf[j] = '\0'; - if (NULL == (heap = H5HL_protect(f, H5P_DATASET_XFER_DEFAULT, heap_addr, H5AC_READ))) { + if (NULL == (heap = H5HL_protect(f, H5P_DATASET_XFER_DEFAULT, heap_addr, H5AC__READ_ONLY_FLAG))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; diff --git a/test/ohdr.c b/test/ohdr.c index 0ed3d97..1ba2b10 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -210,7 +210,7 @@ test_ohdr_cache(char *filename, hid_t fapl) FAIL_STACK_ERROR /* Protect local heap (which actually pins it in the cache) */ - if(NULL == (lheap = H5HL_protect(f, my_dxpl, lheap_addr, H5AC_READ))) + if(NULL == (lheap = H5HL_protect(f, my_dxpl, lheap_addr, H5AC__READ_ONLY_FLAG))) FAIL_STACK_ERROR /* Create an object header */ @@ -230,7 +230,7 @@ test_ohdr_cache(char *filename, hid_t fapl) FAIL_STACK_ERROR /* Protect local heap (which actually pins it in the cache) */ - if(NULL == (lheap2 = H5HL_protect(f, my_dxpl, lheap_addr2, H5AC_READ))) + if(NULL == (lheap2 = H5HL_protect(f, my_dxpl, lheap_addr2, H5AC__READ_ONLY_FLAG))) FAIL_STACK_ERROR /* Unprotect local heap (which actually unpins it from the cache) */ @@ -247,7 +247,7 @@ test_ohdr_cache(char *filename, hid_t fapl) FAIL_STACK_ERROR /* Protect local heap (which actually pins it in the cache) */ - if(NULL == (lheap3 = H5HL_protect(f, my_dxpl, lheap_addr3, H5AC_READ))) + if(NULL == (lheap3 = H5HL_protect(f, my_dxpl, lheap_addr3, H5AC__READ_ONLY_FLAG))) FAIL_STACK_ERROR /* Unprotect local heap (which actually unpins it from the cache) */ diff --git a/testpar/t_cache.c b/testpar/t_cache.c index b6c7870..18140ad 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -29,9 +29,10 @@ #include "H5Cpkg.h" #include "H5Fpkg.h" #include "H5Iprivate.h" +#include "H5MFprivate.h" -#define BASE_ADDR (haddr_t)512 +#define BASE_ADDR (haddr_t)1024 int nerrors = 0; @@ -46,6 +47,14 @@ const char *FILENAME[NFILENAME]={"CacheTestDummy", NULL}; #endif /* !PATH_MAX */ char filenames[NFILENAME][PATH_MAX]; hid_t fapl; /* file access property list */ +haddr_t max_addr = 0; /* used to store the end of + * the address space used by + * the data array (see below). + */ +hbool_t callbacks_verbose = FALSE; /* flag used to control whether + * the callback functions are in + * verbose mode. + */ int world_mpi_size = -1; @@ -129,11 +138,11 @@ int total_writes = 0; * processes, and thus cannot be marked as dirty unless they * happen to overlap some collective operation. * - * cleared: Boolean flag that is set to true whenever the entry is - * dirty, and is cleared via a call to clear_datum(). + * cleared: Boolean flag that is set to true whenever the entry is + * dirty, and is cleared via a call to datum_clear(). * - * flushed: Boolean flag that is set to true whenever the entry is - * dirty, and is flushed via a call to flush_datum(). + * flushed: Boolean flag that is set to true whenever the entry is + * dirty, and is flushed by the metadata cache. * * reads: Integer field used to maintain a count of the number of * times this entry has been read from the server since @@ -146,6 +155,12 @@ int total_writes = 0; * index: Index of this instance of datum in the data_index[] array * discussed below. * + * aux_ptr: Pointer to the instance of H5AC_aux_t associated with the + * instance of the metadata cache within which this entry + * resides. This field was added to allow us to pass this + * value to the notify callback from the serialize callback. + * It should be NULL when not in use. + * *****************************************************************************/ struct datum @@ -165,6 +180,7 @@ struct datum int reads; int writes; int index; + struct H5AC_aux_t * aux_ptr; }; /***************************************************************************** @@ -373,28 +389,65 @@ static hbool_t serve_rw_count_reset_request(struct mssg_t * mssg_ptr); /* call back functions & related data structures */ -static herr_t clear_datum(H5F_t * f, void * thing, hbool_t dest); -static herr_t destroy_datum(H5F_t H5_ATTR_UNUSED * f, void * thing); -static herr_t flush_datum(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t dest, haddr_t addr, - void *thing); -static void * load_datum(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, - void H5_ATTR_UNUSED *udata); -static herr_t size_datum(H5F_t H5_ATTR_UNUSED * f, void * thing, size_t * size_ptr); +static herr_t datum_get_load_size(const void * udata_ptr, + size_t *image_len_ptr); + +static void * datum_deserialize(const void * image_ptr, + size_t len, + void * udata_ptr, + hbool_t * dirty_ptr); + +static herr_t datum_image_len(void *thing, + size_t *image_len_ptr, + hbool_t *compressed_ptr, + size_t *compressed_len_ptr); + +static herr_t datum_serialize(const H5F_t *f, + void *image_ptr, + size_t len, + void *thing_ptr); + +static herr_t datum_notify(H5C_notify_action_t action, void *thing); + +static herr_t datum_free_icr(void * thing); + +static herr_t datum_clear(H5F_t * f, void * thing, hbool_t about_to_destroy); #define DATUM_ENTRY_TYPE H5AC_TEST_ID #define NUMBER_OF_ENTRY_TYPES 1 + +/* Note the use of the H5AC__CLASS_SKIP_READS and H5AC__CLASS_SKIP_WRITES + * flags. As a result of these flags, the metadata cache does no file I/O + * on metadata of the datum type. + * + * Instead, this test uses a server process to keep track of who has + * written and read what, and to verify that there are no messages from + * the past / future. + * + * In the callbacks for the version 2 cache, this activity was hidden in + * the load and flush callbacks. However, now we handle this function in + * notify callbacks for the after load and after flush events. + * + * JRM -- 1/13/15 + */ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = { { - DATUM_ENTRY_TYPE, - (H5C_load_func_t)load_datum, - (H5C_flush_func_t)flush_datum, - (H5C_dest_func_t)destroy_datum, - (H5C_clear_func_t)clear_datum, - (H5C_notify_func_t)NULL, - (H5C_size_func_t)size_datum + /* id */ DATUM_ENTRY_TYPE, + /* name */ "datum", + /* mem_type */ H5FD_MEM_DEFAULT, + /* flags */ H5AC__CLASS_SKIP_READS | H5AC__CLASS_SKIP_WRITES, + /* get_load_size */ (H5AC_get_load_size_func_t)datum_get_load_size, + /* deserialize */ (H5AC_deserialize_func_t)datum_deserialize, + /* image_len */ (H5AC_image_len_func_t)datum_image_len, + /* pre_serialize */ (H5AC_pre_serialize_func_t)NULL, + /* serialize */ (H5AC_serialize_func_t)datum_serialize, + /* notify */ (H5AC_notify_func_t)datum_notify, + /* free_icr */ (H5AC_free_icr_func_t)datum_free_icr, + /* clear */ (H5AC_clear_func_t)datum_clear, + /* fsf_size */ (H5AC_get_fsf_size_t)NULL, } }; @@ -787,6 +840,7 @@ init_data(void) data[i].reads = 0; data[i].writes = 0; data[i].index = i; + data[i].aux_ptr = NULL; data_index[i] = i; @@ -796,6 +850,9 @@ init_data(void) j = (j + 1) % num_addr_offsets; } + /* save the end of the address space used by the data array */ + max_addr = addr; + return; } /* init_data() */ @@ -2264,92 +2321,140 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr) /*------------------------------------------------------------------------- - * Function: clear_datum + * Function: datum_get_load_size * - * Purpose: Mark the datum as clean and destroy it if requested. - * Do not write it to the server, or increment the version. + * Purpose: Query the image size for an entry before deserializing it * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: John Mainzer - * 12/29/05 + * Programmer: Quincey Koziol + * 5/18/10 * *------------------------------------------------------------------------- */ static herr_t -clear_datum(H5F_t * f, - void * thing, - hbool_t dest) +datum_get_load_size(const void * udata_ptr, + size_t *image_len_ptr) { + haddr_t addr = *(haddr_t *)udata_ptr; int idx; struct datum * entry_ptr; - HDassert( thing ); + HDassert( udata_ptr ); + HDassert( image_len_ptr ); - entry_ptr = (struct datum *)thing; - - idx = addr_to_datum_index(entry_ptr->base_addr); + idx = addr_to_datum_index(addr); HDassert( idx >= 0 ); HDassert( idx < NUM_DATA_ENTRIES ); HDassert( idx < virt_num_data_entries ); - HDassert( &(data[idx]) == entry_ptr ); - HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); - HDassert( ( entry_ptr->header.size == entry_ptr->len ) || - ( entry_ptr->header.size == entry_ptr->local_len ) ); + entry_ptr = &(data[idx]); - HDassert( entry_ptr->header.is_dirty == entry_ptr->dirty ); + HDassert( addr == entry_ptr->base_addr ); + HDassert( ! entry_ptr->global_pinned ); + HDassert( ! entry_ptr->local_pinned ); - if ( entry_ptr->header.is_dirty ) { + if ( callbacks_verbose ) { - entry_ptr->cleared = TRUE; + HDfprintf(stdout, + "%d: get_load_size() idx = %d, addr = %ld, len = %d.\n", + world_mpi_rank, idx, (long)addr, (int)entry_ptr->local_len); + fflush(stdout); } - entry_ptr->header.is_dirty = FALSE; - entry_ptr->dirty = FALSE; + /* Set image length size */ + *image_len_ptr = entry_ptr->local_len; - if ( dest ) { + return(SUCCEED); +} /* get_load_size() */ - destroy_datum(f, thing); + +/*------------------------------------------------------------------------- + * Function: datum_deserialize + * + * Purpose: deserialize the entry. + * + * Return: void * (pointer to the in core representation of the entry) + * + * Programmer: John Mainzer + * 9/20/07 + * + *------------------------------------------------------------------------- + */ +static void * +datum_deserialize(const void * image_ptr, + H5_ATTR_UNUSED size_t len, + void * udata_ptr, + hbool_t * dirty_ptr) +{ + haddr_t addr = *(haddr_t *)udata_ptr; + hbool_t success = TRUE; + int idx; + struct datum * entry_ptr = NULL; + + HDassert( image_ptr != NULL ); + idx = addr_to_datum_index(addr); + + HDassert( idx >= 0 ); + HDassert( idx < NUM_DATA_ENTRIES ); + HDassert( idx < virt_num_data_entries ); + + entry_ptr = &(data[idx]); + + HDassert( addr == entry_ptr->base_addr ); + HDassert( ! entry_ptr->global_pinned ); + HDassert( ! entry_ptr->local_pinned ); + + HDassert( dirty_ptr ); + + if ( callbacks_verbose ) { + + HDfprintf(stdout, + "%d: deserialize() idx = %d, addr = %ld, len = %d, is_dirty = %d.\n", + world_mpi_rank, idx, (long)addr, (int)len, + (int)(entry_ptr->header.is_dirty)); + fflush(stdout); } - datum_clears++; + *dirty_ptr = FALSE; - if ( entry_ptr->header.is_pinned ) { + if ( ! success ) { + + entry_ptr = NULL; - datum_pinned_clears++; - HDassert( entry_ptr->global_pinned || entry_ptr->local_pinned ); } - return(SUCCEED); + return(entry_ptr); -} /* clear_datum() */ +} /* deserialize() */ /*------------------------------------------------------------------------- - * Function: destroy_datum() + * Function: datum_image_len * - * Purpose: Destroy the entry. At present, this means do nothing other - * than verify that the entry is clean. In particular, do not - * write it to the server process. + * Purpose: Return the real (and possibly reduced) length of the image. + * The helper functions verify that the correct version of + * deserialize is being called, and then call deserialize + * proper. * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: John Mainzer - * 12/29/05 + * Programmer: John Mainzer + * 9/19/07 * *------------------------------------------------------------------------- */ static herr_t -destroy_datum(H5F_t H5_ATTR_UNUSED * f, - void * thing) +datum_image_len(void *thing, size_t *image_len, + hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr) { int idx; struct datum * entry_ptr; HDassert( thing ); + HDassert( image_len ); entry_ptr = (struct datum *)thing; @@ -2359,55 +2464,53 @@ destroy_datum(H5F_t H5_ATTR_UNUSED * f, HDassert( idx < NUM_DATA_ENTRIES ); HDassert( idx < virt_num_data_entries ); HDassert( &(data[idx]) == entry_ptr ); + HDassert( entry_ptr->local_len > 0 ); + HDassert( entry_ptr->local_len <= entry_ptr->len ); - HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); - HDassert( ( entry_ptr->header.size == entry_ptr->len ) || - ( entry_ptr->header.size == entry_ptr->local_len ) ); + if(callbacks_verbose) { + HDfprintf(stdout, + "%d: image_len() idx = %d, addr = %ld, len = %d.\n", + world_mpi_rank, idx, (long)(entry_ptr->base_addr), + (int)(entry_ptr->local_len)); + fflush(stdout); + } - HDassert( !(entry_ptr->dirty) ); - HDassert( !(entry_ptr->header.is_dirty) ); - HDassert( !(entry_ptr->global_pinned) ); - HDassert( !(entry_ptr->local_pinned) ); - HDassert( !(entry_ptr->header.is_pinned) ); + HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); - datum_destroys++; + *image_len = entry_ptr->local_len; return(SUCCEED); - -} /* destroy_datum() */ +} /* datum_image_len() */ /*------------------------------------------------------------------------- - * Function: flush_datum + * Function: datum_serialize * - * Purpose: Flush the entry to the server process and mark it as clean. - * Then destroy the entry if requested. + * Purpose: Serialize the supplied entry. * - * Return: SUCCEED if successful, and FAIL otherwise. + * Return: SUCCEED if successful, FAIL otherwise. * - * Programmer: John Mainzer - * 12/29/05 + * Programmer: John Mainzer + * 10/30/07 * *------------------------------------------------------------------------- */ static herr_t -flush_datum(H5F_t *f, - hid_t H5_ATTR_UNUSED dxpl_id, - hbool_t dest, - haddr_t H5_ATTR_UNUSED addr, - void *thing) +datum_serialize(const H5F_t *f, + void *image_ptr, + size_t len, + void *thing_ptr) { - hbool_t was_dirty = FALSE; herr_t ret_value = SUCCEED; int idx; struct datum * entry_ptr; - struct mssg_t mssg; H5C_t * cache_ptr; struct H5AC_aux_t * aux_ptr; - HDassert( thing ); + HDassert( thing_ptr ); + HDassert( image_ptr ); - entry_ptr = (struct datum *)thing; + entry_ptr = (struct datum *)thing_ptr; HDassert( f ); HDassert( f->shared ); @@ -2420,7 +2523,11 @@ flush_datum(H5F_t *f, aux_ptr = (H5AC_aux_t *)(f->shared->cache->aux_ptr); + HDassert( aux_ptr ); HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); + HDassert( entry_ptr->aux_ptr == NULL ); + + entry_ptr->aux_ptr = aux_ptr; idx = addr_to_datum_index(entry_ptr->base_addr); @@ -2429,96 +2536,19 @@ flush_datum(H5F_t *f, HDassert( idx < virt_num_data_entries ); HDassert( &(data[idx]) == entry_ptr ); - HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); - HDassert( ( entry_ptr->header.size == entry_ptr->len ) || - ( entry_ptr->header.size == entry_ptr->local_len ) ); - - HDassert( entry_ptr->header.is_dirty == entry_ptr->dirty ); - - if ( ( file_mpi_rank != 0 ) && - ( entry_ptr->dirty ) && - ( aux_ptr->metadata_write_strategy == - H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY ) ) { + if ( callbacks_verbose ) { - ret_value = FAIL; HDfprintf(stdout, - "%d:%s: Flushed dirty entry from non-zero file process.", - world_mpi_rank, FUNC); + "%d: serialize() idx = %d, addr = %ld, len = %d.\n", + world_mpi_rank, idx, (long)entry_ptr->header.addr, (int)len); + fflush(stdout); } - if ( ret_value == SUCCEED ) { - - if ( entry_ptr->header.is_dirty ) { - - was_dirty = TRUE; /* so we will receive the ack if requested */ - - /* compose the message */ - mssg.req = WRITE_REQ_CODE; - mssg.src = world_mpi_rank; - mssg.dest = world_server_mpi_rank; - mssg.mssg_num = -1; /* set by send function */ - mssg.base_addr = entry_ptr->base_addr; - mssg.len = entry_ptr->len; - mssg.ver = entry_ptr->ver; - mssg.count = 0; - mssg.magic = MSSG_MAGIC; - - if ( ! send_mssg(&mssg, FALSE) ) { - - nerrors++; - ret_value = FAIL; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", - world_mpi_rank, FUNC); - } - } - else - { - entry_ptr->header.is_dirty = FALSE; - entry_ptr->dirty = FALSE; - entry_ptr->flushed = TRUE; - } - } - } - -#if DO_WRITE_REQ_ACK - - if ( ( ret_value == SUCCEED ) && ( was_dirty ) ) { - - if ( ! recv_mssg(&mssg, WRITE_REQ_ACK_CODE) ) { - - nerrors++; - ret_value = FAIL; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", - world_mpi_rank, FUNC); - } - } else if ( ( mssg.req != WRITE_REQ_ACK_CODE ) || - ( mssg.src != world_server_mpi_rank ) || - ( mssg.dest != world_mpi_rank ) || - ( mssg.base_addr != entry_ptr->base_addr ) || - ( mssg.len != entry_ptr->len ) || - ( mssg.ver != entry_ptr->ver ) || - ( mssg.magic != MSSG_MAGIC ) ) { - - nerrors++; - ret_value = FAIL; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: Bad data in write req ack.\n", - world_mpi_rank, FUNC); - } - } - } - -#endif /* DO_WRITE_REQ_ACK */ - - if ( ret_value == SUCCEED ) { - - if ( dest ) { + HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); + HDassert( ( entry_ptr->header.size == entry_ptr->len ) || + ( entry_ptr->header.size == entry_ptr->local_len ) ); - ret_value = destroy_datum(f, thing); - } - } + HDassert( entry_ptr->header.is_dirty == entry_ptr->dirty ); datum_flushes++; @@ -2530,97 +2560,130 @@ flush_datum(H5F_t *f, return(ret_value); -} /* flush_datum() */ +} /* datum_serialize() */ + /*------------------------------------------------------------------------- - * Function: load_datum + * Function: datum_notify * - * Purpose: Read the requested entry from the server and mark it as - * clean. + * Purpose: Do the communication with the server we used to do in the + * flush and load callbacks in the version 2 cache. * - * Return: SUCCEED if successful, FAIL otherwise. + * Return: SUCCEED * - * Programmer: John Mainzer - * 12/29/05 - * - * Modifications: + * Programmer: John Mainzer + * 1/12/15 * *------------------------------------------------------------------------- */ - -static void * -load_datum(H5F_t H5_ATTR_UNUSED *f, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t addr, - void H5_ATTR_UNUSED *udata) +static herr_t +datum_notify(H5C_notify_action_t action, void *thing) { - hbool_t success = TRUE; - int idx; - struct datum * entry_ptr = NULL; + hbool_t was_dirty = FALSE; + herr_t ret_value = SUCCEED; + struct datum * entry_ptr; + struct H5AC_aux_t * aux_ptr; struct mssg_t mssg; + int idx; - idx = addr_to_datum_index(addr); + HDassert( thing ); + + entry_ptr = (struct datum *)thing; + + idx = addr_to_datum_index(entry_ptr->base_addr); HDassert( idx >= 0 ); HDassert( idx < NUM_DATA_ENTRIES ); HDassert( idx < virt_num_data_entries ); + HDassert( &(data[idx]) == entry_ptr ); - entry_ptr = &(data[idx]); + if ( callbacks_verbose ) { - HDassert( addr == entry_ptr->base_addr ); - HDassert( ! entry_ptr->global_pinned ); - HDassert( ! entry_ptr->local_pinned ); + HDfprintf(stdout, + "%d: notify() action = %d, idx = %d, addr = %ld.\n", + world_mpi_rank, (int) action, idx, + (long)entry_ptr->header.addr); + fflush(stdout); + } - /* compose the read message */ - mssg.req = READ_REQ_CODE; - mssg.src = world_mpi_rank; - mssg.dest = world_server_mpi_rank; - mssg.mssg_num = -1; /* set by send function */ - mssg.base_addr = entry_ptr->base_addr; - mssg.len = entry_ptr->len; - mssg.ver = 0; /* bogus -- should be corrected by server */ - mssg.count = 0; /* not used */ - mssg.magic = MSSG_MAGIC; + HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); + HDassert( ( entry_ptr->header.size == entry_ptr->len ) || + ( entry_ptr->header.size == entry_ptr->local_len ) ); - if ( ! send_mssg(&mssg, FALSE) ) { + switch ( action ) + { + case H5AC_NOTIFY_ACTION_AFTER_INSERT: + if ( callbacks_verbose ) { - nerrors++; - success = FALSE; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", - world_mpi_rank, FUNC); - } - } + HDfprintf(stdout, + "%d: notify() action = insert, idx = %d, addr = %ld.\n", + world_mpi_rank, idx, (long)entry_ptr->header.addr); + fflush(stdout); + } + /* do nothing */ + break; - if ( success ) { + case H5AC_NOTIFY_ACTION_AFTER_LOAD: + if ( callbacks_verbose ) { + + HDfprintf(stdout, + "%d: notify() action = load, idx = %d, addr = %ld.\n", + world_mpi_rank, idx, (long)entry_ptr->header.addr); + fflush(stdout); + } - if ( ! recv_mssg(&mssg, READ_REQ_REPLY_CODE) ) { + /* compose the read message */ + mssg.req = READ_REQ_CODE; + mssg.src = world_mpi_rank; + mssg.dest = world_server_mpi_rank; + mssg.mssg_num = -1; /* set by send function */ + mssg.base_addr = entry_ptr->base_addr; + mssg.len = entry_ptr->len; + mssg.ver = 0; /* bogus -- should be corrected by server */ + mssg.count = 0; /* not used */ + mssg.magic = MSSG_MAGIC; - nerrors++; - success = FALSE; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", - world_mpi_rank, FUNC); + if ( ! send_mssg(&mssg, FALSE) ) { + + nerrors++; + ret_value = FAIL; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", + world_mpi_rank, FUNC); + } } - } - } - if ( success ) { + if ( ret_value == SUCCEED ) { - if ( ( mssg.req != READ_REQ_REPLY_CODE ) || - ( mssg.src != world_server_mpi_rank ) || - ( mssg.dest != world_mpi_rank ) || - ( mssg.base_addr != entry_ptr->base_addr ) || - ( mssg.len != entry_ptr->len ) || - ( mssg.ver < entry_ptr->ver ) || - ( mssg.magic != MSSG_MAGIC ) ) { + if ( ! recv_mssg(&mssg, READ_REQ_REPLY_CODE) ) { - nerrors++; - success = FALSE; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: Bad data in read req reply.\n", - world_mpi_rank, FUNC); + nerrors++; + ret_value = FAIL; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", + world_mpi_rank, FUNC); + } + } } + + if ( ret_value == SUCCEED ) { + + if ( ( mssg.req != READ_REQ_REPLY_CODE ) || + ( mssg.src != world_server_mpi_rank ) || + ( mssg.dest != world_mpi_rank ) || + ( mssg.base_addr != entry_ptr->base_addr ) || + ( mssg.len != entry_ptr->len ) || + ( mssg.ver < entry_ptr->ver ) || + ( mssg.magic != MSSG_MAGIC ) ) { + + nerrors++; + ret_value = FAIL; + if ( verbose ) { + HDfprintf(stdout, + "%d:%s: Bad data in read req reply.\n", + world_mpi_rank, FUNC); + } + #if 0 /* This has been useful debugging code -- keep it for now. */ if ( mssg.req != READ_REQ_REPLY_CODE ) { @@ -2683,58 +2746,223 @@ load_datum(H5F_t H5_ATTR_UNUSED *f, } else { - entry_ptr->ver = mssg.ver; - entry_ptr->header.is_dirty = FALSE; - entry_ptr->dirty = FALSE; - } + entry_ptr->ver = mssg.ver; + entry_ptr->dirty = FALSE; + datum_loads++; + } + } + break; + + case H5C_NOTIFY_ACTION_AFTER_FLUSH: + if ( callbacks_verbose ) { + + HDfprintf(stdout, + "%d: notify() action = flush, idx = %d, addr = %ld.\n", + world_mpi_rank, idx, (long)entry_ptr->header.addr); + fflush(stdout); + } + + HDassert( entry_ptr->aux_ptr ); + HDassert( entry_ptr->aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); + aux_ptr = entry_ptr->aux_ptr; + entry_ptr->aux_ptr = NULL; + + HDassert(entry_ptr->header.is_dirty); /* JRM */ + + if ( ( file_mpi_rank != 0 ) && + ( entry_ptr->dirty ) && + ( aux_ptr->metadata_write_strategy == + H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY ) ) { + + ret_value = FAIL; + HDfprintf(stdout, + "%d:%s: Flushed dirty entry from non-zero file process.", + world_mpi_rank, FUNC); + } + + if ( ret_value == SUCCEED ) { + + if ( entry_ptr->header.is_dirty ) { + + was_dirty = TRUE; /* so we will receive the ack + * if requested + */ + + /* compose the message */ + mssg.req = WRITE_REQ_CODE; + mssg.src = world_mpi_rank; + mssg.dest = world_server_mpi_rank; + mssg.mssg_num = -1; /* set by send function */ + mssg.base_addr = entry_ptr->base_addr; + mssg.len = entry_ptr->len; + mssg.ver = entry_ptr->ver; + mssg.count = 0; + mssg.magic = MSSG_MAGIC; + + if ( ! send_mssg(&mssg, FALSE) ) { + + nerrors++; + ret_value = FAIL; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", + world_mpi_rank, FUNC); + } + } + else + { + entry_ptr->dirty = FALSE; + entry_ptr->flushed = TRUE; + } + } + } + +#if DO_WRITE_REQ_ACK + + if ( ( ret_value == SUCCEED ) && ( was_dirty ) ) { + + if ( ! recv_mssg(&mssg, WRITE_REQ_ACK_CODE) ) { + + nerrors++; + ret_value = FAIL; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", + world_mpi_rank, FUNC); + } + } else if ( ( mssg.req != WRITE_REQ_ACK_CODE ) || + ( mssg.src != world_server_mpi_rank ) || + ( mssg.dest != world_mpi_rank ) || + ( mssg.base_addr != entry_ptr->base_addr ) || + ( mssg.len != entry_ptr->len ) || + ( mssg.ver != entry_ptr->ver ) || + ( mssg.magic != MSSG_MAGIC ) ) { + + nerrors++; + ret_value = FAIL; + if ( verbose ) { + HDfprintf(stdout, + "%d:%s: Bad data in write req ack.\n", + world_mpi_rank, FUNC); + } + } + } + +#endif /* DO_WRITE_REQ_ACK */ + + datum_flushes++; + + if ( entry_ptr->header.is_pinned ) { + + datum_pinned_flushes++; + HDassert(entry_ptr->global_pinned || entry_ptr->local_pinned); + } + break; + + case H5AC_NOTIFY_ACTION_BEFORE_EVICT: + if ( callbacks_verbose ) { + + HDfprintf(stdout, + "%d: notify() action = evict, idx = %d, addr = %ld.\n", + world_mpi_rank, idx, (long)entry_ptr->header.addr); + fflush(stdout); + } + + /* do nothing */ + break; + + default: + nerrors++; + ret_value = FAIL; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: Unknown notify action.\n", + world_mpi_rank, FUNC); + } + break; } - if ( ! success ) { + return(ret_value); - entry_ptr = NULL; +} /* datum_notify() */ + + +/*------------------------------------------------------------------------- + * Function: datum_free_icr + * + * Purpose: Nominally, this callback is supposed to free the + * in core representation of the entry. + * + * In the context of this test bed, we use it to do + * do all the processing we used to do on a destroy. + * + * Return: SUCCEED + * + * Programmer: John Mainzer + * 9/19/07 + * + *------------------------------------------------------------------------- + */ +static herr_t +datum_free_icr(void * thing) +{ + int idx; + struct datum * entry_ptr; + + HDassert( thing ); + + entry_ptr = (struct datum *)thing; + + idx = addr_to_datum_index(entry_ptr->base_addr); + HDassert( idx >= 0 ); + HDassert( idx < NUM_DATA_ENTRIES ); + HDassert( idx < virt_num_data_entries ); + HDassert( &(data[idx]) == entry_ptr ); + + if ( callbacks_verbose ) { + + HDfprintf(stdout, + "%d: free_icr() idx = %d, dirty = %d.\n", + world_mpi_rank, idx, (int)(entry_ptr->dirty)); + fflush(stdout); } - datum_loads++; + HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); + HDassert( ( entry_ptr->header.size == entry_ptr->len ) || + ( entry_ptr->header.size == entry_ptr->local_len ) ); - return(entry_ptr); + HDassert( !(entry_ptr->header.is_dirty) ); + HDassert( !(entry_ptr->global_pinned) ); + HDassert( !(entry_ptr->local_pinned) ); + HDassert( !(entry_ptr->header.is_pinned) ); + + datum_destroys++; -} /* load_datum() */ + return(SUCCEED); +} /* datum_free_icr() */ + /*------------------------------------------------------------------------- - * Function: size_datum + * Function: datum_clear * - * Purpose: Get the size of the specified entry. Just look at the - * local copy, as size can't change. + * Purpose: Mark the datum as clean. + * + * Do not write it to the server, or increment the version. * * Return: SUCCEED * * Programmer: John Mainzer - * 6/10/04 - * - * Modifications: - * - * JRM -- 7/11/06 - * Modified function to return the local_len field instead - * of the len field. These two fields usually contain the - * same value, but if the size of an entry is changed, we - * store the altered size in local_len without changing - * len. Note that local_len must be positive, and may - * not exceed len. + * 12/29/05 * *------------------------------------------------------------------------- */ - static herr_t -size_datum(H5F_t H5_ATTR_UNUSED * f, - void * thing, - size_t * size_ptr) +datum_clear(H5F_t H5_ATTR_UNUSED * f, + void * thing, + hbool_t H5_ATTR_UNUSED about_to_destroy) { int idx; struct datum * entry_ptr; HDassert( thing ); - HDassert( size_ptr ); entry_ptr = (struct datum *)thing; @@ -2744,16 +2972,28 @@ size_datum(H5F_t H5_ATTR_UNUSED * f, HDassert( idx < NUM_DATA_ENTRIES ); HDassert( idx < virt_num_data_entries ); HDassert( &(data[idx]) == entry_ptr ); - HDassert( entry_ptr->local_len > 0 ); - HDassert( entry_ptr->local_len <= entry_ptr->len ); HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); + HDassert( ( entry_ptr->header.size == entry_ptr->len ) || + ( entry_ptr->header.size == entry_ptr->local_len ) ); - *size_ptr = entry_ptr->local_len; + HDassert( ( entry_ptr->dirty ) || + ( entry_ptr->header.is_dirty == entry_ptr->dirty ) ); + + entry_ptr->cleared = TRUE; + entry_ptr->dirty = FALSE; + + datum_clears++; + + if ( entry_ptr->header.is_pinned ) { + + datum_pinned_clears++; + HDassert( entry_ptr->global_pinned || entry_ptr->local_pinned ); + } return(SUCCEED); -} /* size_datum() */ +} /* datum_clear() */ /*****************************************************************************/ @@ -2792,6 +3032,8 @@ expunge_entry(H5F_t * file_ptr, HDassert( !(entry_ptr->global_pinned) ); HDassert( !(entry_ptr->local_pinned) ); + entry_ptr->dirty = FALSE; + if ( nerrors == 0 ) { result = H5AC_expunge_entry(file_ptr, (hid_t)-1, &(types[0]), @@ -3280,8 +3522,10 @@ lock_entry(H5F_t * file_ptr, HDassert( ! (entry_ptr->locked) ); cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr, - H5P_DATASET_XFER_DEFAULT, &(types[0]), entry_ptr->base_addr, - NULL, H5AC_WRITE); + H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->base_addr, + &entry_ptr->base_addr, + H5AC__NO_FLAGS_SET); if ( ( cache_entry_ptr != (void *)(&(entry_ptr->header)) ) || ( entry_ptr->header.type != &(types[0]) ) || @@ -3801,6 +4045,7 @@ setup_cache_for_test(hid_t * fid_ptr, H5AC_cache_config_t test_config; H5F_t * file_ptr = NULL; H5C_t * cache_ptr = NULL; + haddr_t actual_base_addr; HDassert ( fid_ptr != NULL ); HDassert ( file_ptr_ptr != NULL ); @@ -3950,6 +4195,54 @@ setup_cache_for_test(hid_t * fid_ptr, } } + /* allocate space for test entries -- do this before we set the + * sync point done callback as it will dirty the superblock, requiring + * another flush. If the sync point done callback is set, this will + * cause a spurious failure. + */ + if ( success ) { /* allocate space for test entries */ + + actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, H5P_DEFAULT, + (hsize_t)(max_addr + BASE_ADDR)); + + if ( actual_base_addr == HADDR_UNDEF ) { + + success = FALSE; + nerrors++; + + if ( verbose ) { + HDfprintf(stdout, "%d:%s: H5MF_alloc() failed.\n", + world_mpi_rank, FUNC); + } + + } else if ( actual_base_addr > BASE_ADDR ) { + + /* If this happens, must increase BASE_ADDR so that the + * actual_base_addr is <= BASE_ADDR. This should only happen + * if the size of the superblock is increase. + */ + success = FALSE; + nerrors++; + + if ( verbose ) { + HDfprintf(stdout, "%d:%s: actual_base_addr > BASE_ADDR.\n", + world_mpi_rank, FUNC); + } + } + } + + + /* flush the file again -- space allocation dirtied superblock */ + if ( success ) { + + if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { + nerrors++; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: second H5Fflush() failed.\n", + world_mpi_rank, FUNC); + } + } + } #if DO_SYNC_AFTER_WRITE @@ -4138,7 +4431,7 @@ setup_rand(void) { hbool_t use_predefined_seeds = FALSE; int num_predefined_seeds = 3; - unsigned predefined_seeds[3] = {33402, 33505, 33422}; + unsigned predefined_seeds[3] = {18669, 89925, 12577}; unsigned seed; struct timeval tv; @@ -6472,27 +6765,27 @@ trace_file_check(int metadata_write_strategy) { "### HDF5 metadata cache trace file version 1 ###\n", "H5AC_set_cache_auto_resize_config 1 0 1 0 \"t_cache_trace.txt\" 1 0 2097152 0.300000 33554432 1048576 50000 1 0.900000 2.000000 1 1.000000 0.250000 1 4194304 3 0.999000 0.900000 1 1048576 3 1 0.100000 262144 0 0\n", - "H5AC_insert_entry 0x200 25 0x0 2 0\n", - "H5AC_insert_entry 0x202 25 0x0 2 0\n", - "H5AC_insert_entry 0x204 25 0x0 4 0\n", - "H5AC_insert_entry 0x208 25 0x0 6 0\n", - "H5AC_protect 0x200 25 H5AC_WRITE 2 1\n", - "H5AC_mark_entry_dirty 0x200 0\n", - "H5AC_unprotect 0x200 25 0 0 0\n", - "H5AC_protect 0x202 25 H5AC_WRITE 2 1\n", - "H5AC_pin_protected_entry 0x202 0\n", - "H5AC_unprotect 0x202 25 0 0 0\n", - "H5AC_unpin_entry 0x202 0\n", - "H5AC_expunge_entry 0x202 25 0\n", - "H5AC_protect 0x204 25 H5AC_WRITE 4 1\n", - "H5AC_pin_protected_entry 0x204 0\n", - "H5AC_unprotect 0x204 25 0 0 0\n", - "H5AC_mark_entry_dirty 0x204 0 0 0\n", - "H5AC_resize_entry 0x204 2 0\n", - "H5AC_resize_entry 0x204 4 0\n", - "H5AC_unpin_entry 0x204 0\n", - "H5AC_move_entry 0x200 0x8c65 25 0\n", - "H5AC_move_entry 0x8c65 0x200 25 0\n", + "H5AC_insert_entry 0x400 27 0x0 2 0\n", + "H5AC_insert_entry 0x402 27 0x0 2 0\n", + "H5AC_insert_entry 0x404 27 0x0 4 0\n", + "H5AC_insert_entry 0x408 27 0x0 6 0\n", + "H5AC_protect 0x400 27 0x0 2 1\n", + "H5AC_mark_entry_dirty 0x400 0\n", + "H5AC_unprotect 0x400 27 0x0 0\n", + "H5AC_protect 0x402 27 0x0 2 1\n", + "H5AC_pin_protected_entry 0x402 0\n", + "H5AC_unprotect 0x402 27 0x0 0\n", + "H5AC_unpin_entry 0x402 0\n", + "H5AC_expunge_entry 0x402 27 0\n", + "H5AC_protect 0x404 27 0x0 4 1\n", + "H5AC_pin_protected_entry 0x404 0\n", + "H5AC_unprotect 0x404 27 0x0 0\n", + "H5AC_mark_entry_dirty 0x404 0\n", + "H5AC_resize_entry 0x404 2 0\n", + "H5AC_resize_entry 0x404 4 0\n", + "H5AC_unpin_entry 0x404 0\n", + "H5AC_move_entry 0x400 0x8e65 27 0\n", + "H5AC_move_entry 0x8e65 0x400 27 0\n", "H5AC_flush 0\n", NULL }; @@ -6500,27 +6793,27 @@ trace_file_check(int metadata_write_strategy) { "### HDF5 metadata cache trace file version 1 ###\n", "H5AC_set_cache_auto_resize_config 1 0 1 0 \"t_cache_trace.txt\" 1 0 2097152 0.300000 33554432 1048576 50000 1 0.900000 2.000000 1 1.000000 0.250000 1 4194304 3 0.999000 0.900000 1 1048576 3 1 0.100000 262144 1 0\n", - "H5AC_insert_entry 0x200 25 0x0 2 0\n", - "H5AC_insert_entry 0x202 25 0x0 2 0\n", - "H5AC_insert_entry 0x204 25 0x0 4 0\n", - "H5AC_insert_entry 0x208 25 0x0 6 0\n", - "H5AC_protect 0x200 25 H5AC_WRITE 2 1\n", - "H5AC_mark_entry_dirty 0x200 0\n", - "H5AC_unprotect 0x200 25 0 0 0\n", - "H5AC_protect 0x202 25 H5AC_WRITE 2 1\n", - "H5AC_pin_protected_entry 0x202 0\n", - "H5AC_unprotect 0x202 25 0 0 0\n", - "H5AC_unpin_entry 0x202 0\n", - "H5AC_expunge_entry 0x202 25 0\n", - "H5AC_protect 0x204 25 H5AC_WRITE 4 1\n", - "H5AC_pin_protected_entry 0x204 0\n", - "H5AC_unprotect 0x204 25 0 0 0\n", - "H5AC_mark_entry_dirty 0x204 0 0 0\n", - "H5AC_resize_pinned_entry 0x204 2 0\n", - "H5AC_resize_pinned_entry 0x204 4 0\n", - "H5AC_unpin_entry 0x204 0\n", - "H5AC_move_entry 0x200 0x8c65 25 0\n", - "H5AC_move_entry 0x8c65 0x200 25 0\n", + "H5AC_insert_entry 0x400 27 0x0 2 0\n", + "H5AC_insert_entry 0x402 27 0x0 2 0\n", + "H5AC_insert_entry 0x404 27 0x0 4 0\n", + "H5AC_insert_entry 0x408 27 0x0 6 0\n", + "H5AC_protect 0x400 27 0x0 2 1\n", + "H5AC_mark_entry_dirty 0x400 0\n", + "H5AC_unprotect 0x400 27 0x0 0\n", + "H5AC_protect 0x402 27 0x0 2 1\n", + "H5AC_pin_protected_entry 0x402 0\n", + "H5AC_unprotect 0x402 27 0x0 0\n", + "H5AC_unpin_entry 0x402 0\n", + "H5AC_expunge_entry 0x402 27 0\n", + "H5AC_protect 0x404 27 0x0 4 1\n", + "H5AC_pin_protected_entry 0x404 0\n", + "H5AC_unprotect 0x404 27 0x0 0\n", + "H5AC_mark_entry_dirty 0x404 0\n", + "H5AC_resize_entry 0x404 2 0\n", + "H5AC_resize_entry 0x404 4 0\n", + "H5AC_unpin_entry 0x404 0\n", + "H5AC_move_entry 0x400 0x8e65 27 0\n", + "H5AC_move_entry 0x8e65 0x400 27 0\n", "H5AC_flush 0\n", NULL }; -- cgit v0.12 From cf7c5123cbd23a4c1d13dccd02fc2c632210d939 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 18 Jun 2015 08:52:35 -0500 Subject: [svn-r27238] Add function prototype for local function --- tools/lib/h5tools_str.c | 59 +++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 2603984..b945847 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -48,6 +48,7 @@ static char *h5tools_escape(char *s, size_t size); static hbool_t h5tools_str_is_zero(const void *_mem, size_t size); static void h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch); +void h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, h5tools_context_t *ctx); /*------------------------------------------------------------------------- * Function: h5tools_str_close @@ -144,16 +145,16 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) nchars = HDvsnprintf(str->s + str->len, avail, fmt, ap); HDva_end(ap); - /* Note: HDvsnprintf() behaves differently on Windows as Unix, when - * buffer is smaller than source string. On Unix, this function - * returns length of the source string and copy string upto the - * buffer size with NULL at the end of the buffer. However on - * Windows with the same condition, this function returns -1 and + /* Note: HDvsnprintf() behaves differently on Windows as Unix, when + * buffer is smaller than source string. On Unix, this function + * returns length of the source string and copy string upto the + * buffer size with NULL at the end of the buffer. However on + * Windows with the same condition, this function returns -1 and * doesn't add NULL at the end of the buffer. * Because of this different return results, the strlen of the new string * is used to handle when HDvsnprintf() returns -1 on Windows due * to lack of buffer size, so try one more time after realloc more - * buffer size before return NULL. + * buffer size before return NULL. */ if (nchars < 0) { /* failure, such as bad format */ @@ -277,7 +278,7 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt) if (HDstrchr(fmt, '%')) { size_t n = sizeof(_temp); if (str->len - start + 1 > n) { - n = str->len - start + 1; + n = str->len - start + 1; temp = (char*)HDmalloc(n); HDassert(temp); } @@ -665,12 +666,12 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, * * PVN, 28 March 2006 * added H5T_NATIVE_LDOUBLE case - * + * * Raymond Lu, 2011-09-01 * CLANG compiler complained about the line (about 800): * tempint = (tempint >> packed_data_offset) & packed_data_mask; - * The right shift may cause undefined behavior if PACKED_DATA_OFFSET is - * 32-bit or more. For every kind of native integers, I changed the code + * The right shift may cause undefined behavior if PACKED_DATA_OFFSET is + * 32-bit or more. For every kind of native integers, I changed the code * to make it zero if PACKED_DATA_OFFSET is greater than or equal to the * size of integer. *------------------------------------------------------------------------- @@ -1371,37 +1372,37 @@ h5tools_str_is_zero(const void *_mem, size_t size) * * Purpose: replace all occurrences of substring. * - * Return: char * + * Return: char * * * Programmer: Peter Cao * March 8, 2012 * * Notes: - * Applications need to call free() to free the memoery allocated for - * the return string + * Applications need to call free() to free the memoery allocated for + * the return string * *------------------------------------------------------------------------- */ char * h5tools_str_replace ( const char *string, const char *substr, const char *replacement ) { - char *tok = NULL; - char *newstr = NULL; - char *oldstr = NULL; - char *head = NULL; - - if ( substr == NULL || replacement == NULL ) - return HDstrdup (string); - - newstr = HDstrdup (string); - head = newstr; - while ( (tok = HDstrstr ( head, substr ))){ - oldstr = newstr; - newstr = HDmalloc ( HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) + 1 ); + char *tok = NULL; + char *newstr = NULL; + char *oldstr = NULL; + char *head = NULL; + + if ( substr == NULL || replacement == NULL ) + return HDstrdup (string); + + newstr = HDstrdup (string); + head = newstr; + while ( (tok = HDstrstr ( head, substr ))){ + oldstr = newstr; + newstr = HDmalloc ( HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) + 1 ); if ( newstr == NULL ){ - HDfree (oldstr); - return NULL; + HDfree (oldstr); + return NULL; } HDmemcpy ( newstr, oldstr, tok - oldstr ); HDmemcpy ( newstr + (tok - oldstr), replacement, HDstrlen ( replacement ) ); @@ -1411,6 +1412,6 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac head = newstr + (tok - oldstr) + HDstrlen( replacement ); HDfree (oldstr); } - + return newstr; } -- cgit v0.12 From c614e178e32188bde97f1cf692bb2c15d97135df Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Thu, 18 Jun 2015 15:36:19 -0500 Subject: [svn-r27243] fix problem with encoding/decoding external fapl for lapls. --- src/H5Plapl.c | 50 ++++++++++++++++++++++++------------- test/gen_plist.c | 16 ++++++------ test/testfiles/plist_files/dxpl_be | Bin 229 -> 229 bytes test/testfiles/plist_files/dxpl_le | Bin 229 -> 229 bytes test/testfiles/plist_files/fapl_be | Bin 1462 -> 1462 bytes test/testfiles/plist_files/fapl_le | Bin 1462 -> 1462 bytes test/testfiles/plist_files/lapl_be | Bin 1562 -> 1565 bytes test/testfiles/plist_files/lapl_le | Bin 1562 -> 1565 bytes 8 files changed, 41 insertions(+), 25 deletions(-) diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 87b96b6..e3b3c4f 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -237,7 +237,7 @@ H5P_lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) uint8_t **pp = (uint8_t **)_pp; H5P_genplist_t *fapl_plist; /* Pointer to property list */ hbool_t non_default_fapl = FALSE; /* Whether the FAPL is non-default */ - size_t enc_size = 0; /* FAPL's encoded size */ + size_t fapl_size = 0; /* FAPL's encoded size */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -257,13 +257,30 @@ H5P_lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) /* Encode the property list, if non-default */ /* (if *pp == NULL, will only compute the size) */ if(non_default_fapl) { - if(H5P__encode(fapl_plist, TRUE, *pp, &enc_size) < 0) + if(H5P__encode(fapl_plist, TRUE, NULL, &fapl_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "can't encode property list") - if(*pp) - *pp += enc_size; + + if(*pp) { + uint64_t enc_value; + unsigned enc_size; + + /* encode the length of the plist */ + enc_value = (uint64_t)fapl_size; + enc_size = H5VM_limit_enc_size(enc_value); + HDassert(enc_size < 256); + *(*pp)++ = (uint8_t)enc_size; + UINT64ENCODE_VAR(*pp, enc_value, enc_size); + + /* encode the plist */ + if(H5P__encode(fapl_plist, TRUE, *pp, &fapl_size) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "can't encode property list") + + *pp += fapl_size; + } + fapl_size += (1 + H5VM_limit_enc_size((uint64_t)fapl_size)); } /* end if */ - *size += (1 + enc_size); /* Non-default flag, plus encoded property list size */ + *size += (1 + fapl_size); /* Non-default flag, plus encoded property list size */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -304,22 +321,21 @@ H5P_lacc_elink_fapl_dec(const void **_pp, void *_value) non_default_fapl = (hbool_t)*(*pp)++; if(non_default_fapl) { - H5P_genplist_t *fapl_plist; /* Pointer to property list */ - size_t enc_size = 0; /* Encoded size of property list */ + size_t fapl_size = 0; /* Encoded size of property list */ + unsigned enc_size; + uint64_t enc_value; + + /* Decode the plist length */ + enc_size = *(*pp)++; + HDassert(enc_size < 256); + UINT64DECODE_VAR(*pp, enc_value, enc_size); + fapl_size = (size_t)enc_value; /* Decode the property list */ if((*elink_fapl = H5P__decode(*pp)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTDECODE, FAIL, "can't decode property") - /* Get the property list object */ - if(NULL == (fapl_plist = (H5P_genplist_t *)H5P_object_verify(*elink_fapl, H5P_FILE_ACCESS))) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property list") - - /* Compute the encoded size of the property list */ - if(H5P__encode(fapl_plist, TRUE, NULL, &enc_size) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "can't compute encoded property list size") - - *pp += enc_size; + *pp += fapl_size; } /* end if */ else *elink_fapl = H5P_DEFAULT; @@ -578,7 +594,7 @@ H5P_lacc_elink_pref_dec(const void **_pp, void *_value) /* Decode the value */ UINT64DECODE_VAR(*pp, enc_value, enc_size); - len = enc_value; + len = (size_t)enc_value; if(0 != len) { /* Make a copy of the user's prefix string */ diff --git a/test/gen_plist.c b/test/gen_plist.c index e77af73..cd3748b 100644 --- a/test/gen_plist.c +++ b/test/gen_plist.c @@ -63,26 +63,26 @@ main(void) 1 /*TRUE*/, 0 /*FALSE*/, ( 2 * 2048 * 1024), - 0.3f, + 0.3, (64 * 1024 * 1024), (4 * 1024 * 1024), 60000, H5C_incr__threshold, - 0.8f, - 3.0f, + 0.8, + 3.0, 1 /*TRUE*/, (8 * 1024 * 1024), H5C_flash_incr__add_space, - 2.0f, - 0.25f, + 2.0, + 0.25, H5C_decr__age_out_with_threshold, - 0.997f, - 0.8f, + 0.997, + 0.8, 1 /*TRUE*/, (3 * 1024 * 1024), 3, 0 /*FALSE*/, - 0.2f, + 0.2, (256 * 2048), H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY}; diff --git a/test/testfiles/plist_files/dxpl_be b/test/testfiles/plist_files/dxpl_be index 5ff2ea0..b5194c8 100644 Binary files a/test/testfiles/plist_files/dxpl_be and b/test/testfiles/plist_files/dxpl_be differ diff --git a/test/testfiles/plist_files/dxpl_le b/test/testfiles/plist_files/dxpl_le index 5ff2ea0..b5194c8 100644 Binary files a/test/testfiles/plist_files/dxpl_le and b/test/testfiles/plist_files/dxpl_le differ diff --git a/test/testfiles/plist_files/fapl_be b/test/testfiles/plist_files/fapl_be index 0b050d0..65e2070 100644 Binary files a/test/testfiles/plist_files/fapl_be and b/test/testfiles/plist_files/fapl_be differ diff --git a/test/testfiles/plist_files/fapl_le b/test/testfiles/plist_files/fapl_le index 0b050d0..65e2070 100644 Binary files a/test/testfiles/plist_files/fapl_le and b/test/testfiles/plist_files/fapl_le differ diff --git a/test/testfiles/plist_files/lapl_be b/test/testfiles/plist_files/lapl_be index e58bfb4..385cfc5 100644 Binary files a/test/testfiles/plist_files/lapl_be and b/test/testfiles/plist_files/lapl_be differ diff --git a/test/testfiles/plist_files/lapl_le b/test/testfiles/plist_files/lapl_le index e58bfb4..385cfc5 100644 Binary files a/test/testfiles/plist_files/lapl_le and b/test/testfiles/plist_files/lapl_le differ -- cgit v0.12 From 48e1bbb0f87c6712189f82a7c5d8835a87d21ee2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 19 Jun 2015 10:57:38 -0500 Subject: [svn-r27252] Fix whitespace --- tools/lib/h5tools_str.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index b945847..470620f 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -1386,23 +1386,23 @@ h5tools_str_is_zero(const void *_mem, size_t size) char * h5tools_str_replace ( const char *string, const char *substr, const char *replacement ) { - char *tok = NULL; - char *newstr = NULL; - char *oldstr = NULL; - char *head = NULL; - - if ( substr == NULL || replacement == NULL ) - return HDstrdup (string); - - newstr = HDstrdup (string); - head = newstr; - while ( (tok = HDstrstr ( head, substr ))){ - oldstr = newstr; - newstr = HDmalloc ( HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) + 1 ); + char *tok = NULL; + char *newstr = NULL; + char *oldstr = NULL; + char *head = NULL; + + if ( substr == NULL || replacement == NULL ) + return HDstrdup (string); + + newstr = HDstrdup (string); + head = newstr; + while ( (tok = HDstrstr ( head, substr ))){ + oldstr = newstr; + newstr = HDmalloc ( HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) + 1 ); if ( newstr == NULL ){ - HDfree (oldstr); - return NULL; + HDfree (oldstr); + return NULL; } HDmemcpy ( newstr, oldstr, tok - oldstr ); HDmemcpy ( newstr + (tok - oldstr), replacement, HDstrlen ( replacement ) ); -- cgit v0.12